Add explicit support for firmware packages

These are treated like "extra" packages during image creation, but are
also copied into /firmware in the cdroot. That's where d-i will look
for them on firmware-included images.
This commit is contained in:
Steve McIntyre 2017-06-19 01:32:30 +01:00 committed by Jeff Epler
parent 7a3f88f82b
commit e190d99990
2 changed files with 27 additions and 1 deletions

View file

@ -17,7 +17,13 @@ cat /etc/resolv.conf > ${rootdir}/etc/resolv.conf
prepare_apt_source "${LWR_MIRROR}" "${LWR_DISTRIBUTION}"
chroot ${rootdir} apt-get -y install initramfs-tools live-boot live-config ${LWR_TASK_PACKAGES} ${LWR_EXTRA_PACKAGES} task-laptop task-english libnss-myhostname
${LWR_EXTRA_PACKAGES} task-laptop task-english libnss-myhostname
for PKG in ${FIRMWARE_PKGS}; do
echo "$PKG $PKG/license/accepted boolean true" | \
chroot ${rootdir} debconf-set-selections
done
chroot ${rootdir} apt-get -q -y install initramfs-tools live-boot live-config ${LWR_TASK_PACKAGES} ${LWR_EXTRA_PACKAGES} ${LWR_FIRMWARE_PACKAGES} task-laptop task-english libnss-myhostname >> vmdebootstrap.log 2>&1
# Temporary fix for #843983
chroot ${rootdir} chmod 755 /

View file

@ -82,6 +82,10 @@ class LiveWrapper(cliapp.Application):
['e', 'extra'], 'Extra packages to install',
metavar='"PKG1 PKG2 ..."',
group='Packages')
self.settings.string(
['f', 'firmware'], 'Firmware packages to install',
metavar='"PKG1 PKG2 ..."',
group='Packages')
self.settings.boolean(
['isolinux'], 'Add isolinux bootloader to the image '
'(default: %default)', default=True, group="Bootloaders")
@ -205,6 +209,7 @@ class LiveWrapper(cliapp.Application):
os.environ['LWR_DISTRIBUTION'] = self.settings['distribution']
os.environ['LWR_TASK_PACKAGES'] = self.settings['tasks']
os.environ['LWR_EXTRA_PACKAGES'] = self.settings['extra']
os.environ['LWR_FIRMWARE_PACKAGES'] = self.settings['firmware']
for envvar in os.environ.keys():
if envvar.startswith('LWR_'):
@ -263,6 +268,21 @@ class LiveWrapper(cliapp.Application):
print("... completed udeb downloads")
logging.info("... completed udeb downloads")
# Download the firmware debs if desired
if len(self.settings['firmware']) > 0:
logging.info("Downloading firmware debs...")
# FIXME: may need a change to the download location
fw_root = self.cdroot['firmware'].path
handler = get_apt_handler(fw_root,
self.settings['mirror'],
self.settings['distribution'],
self.settings['architecture'])
for pkg in self.settings['firmware'].split(' '):
filename = handler.download_package(pkg, fw_root)
handler.clean_up_apt()
logging.info("... firmware deb downloads")
# Generate boot config
bootconfig = BootloaderConfig(self.cdroot.path)