summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-04-26 22:27:56 +0200
committerDaniel Baumann <daniel@debian.org>2012-04-26 22:39:36 +0200
commitb8bf4da08f99216fee0e1004aae82ed1f8f582cb (patch)
treeb15708f3dc7d51b409e7726e114ee9fb83d89e8a /scripts
parentadd95845d9cea2ffa55e7d84af504450b3bc65eb (diff)
downloadvyos-live-build-b8bf4da08f99216fee0e1004aae82ed1f8f582cb.tar.gz
vyos-live-build-b8bf4da08f99216fee0e1004aae82ed1f8f582cb.zip
Adding support for including firmware packages automatically within the live system.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/lb_chroot_linux-image41
-rwxr-xr-xscripts/build/lb_config12
2 files changed, 52 insertions, 1 deletions
diff --git a/scripts/build/lb_chroot_linux-image b/scripts/build/lb_chroot_linux-image
index 806719116..344dfbbde 100755
--- a/scripts/build/lb_chroot_linux-image
+++ b/scripts/build/lb_chroot_linux-image
@@ -53,6 +53,47 @@ then
done
done
+ if [ "${LB_FIRMWARE_CHROOT}" = "true" ]
+ then
+ # Assumption: firmware packages install files into /lib/firmware
+
+ # Get all firmware packages names
+ FIRMWARE_PACKAGES="$(wget ${WGET_OPTIONS} ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c | awk '/^lib\/firmware/ { print $2 }' | sort -u)"
+
+ if [ "${LB_DERIVATIVE}" = "true" ]
+ then
+ FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(wget ${WGET_OPTIONS} ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c | awk '/^lib\/firmware/ { print $2 }' | sort -u)"
+ fi
+
+ # Filter out contrib packages if contrib is not enabled
+ if ! echo ${LB_ARCHIVE_AREAS} | grep -qs contrib
+ then
+ for _PACKAGE in ${FIRMWARE_PACKAGES}
+ do
+ _FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | grep -v '^contrib/')"
+ done
+
+ FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES}"
+ fi
+
+ # Filter out non-free packages if non-free is not enabled
+ if ! echo ${LB_ARCHIVE_AREAS} | grep -qs non-free
+ then
+ for _PACKAGE in ${FIRMWARE_PACKAGES}
+ do
+ _FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | grep -v '^non-free/')"
+ done
+
+ FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES}"
+ fi
+
+ # Drop section and keep package names only
+ for _PACKAGE in ${FIRMWARE_PACKAGES}
+ do
+ echo $(echo ${_PACKAGE} | awk -F/ '{ print $NF }') >> chroot/root/packages.chroot
+ done
+ fi
+
# Creating stage file
Create_stagefile .stage/chroot_linux-image
fi
diff --git a/scripts/build/lb_config b/scripts/build/lb_config
index 81c2db2f0..26f34cc9e 100755
--- a/scripts/build/lb_config
+++ b/scripts/build/lb_config
@@ -136,6 +136,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--source true|false]\n\
\t [-s|--source-images iso|net|tar|hdd]\n\
\t [--firmware-binary true|false]\n\
+\t [--firmware-chroot true|false]\n\
\t [--swap-file-path PATH]\n\
\t [--swap-file-size MB]\n\
\t [--syslinux-theme THEME_SUFFIX]\n\
@@ -170,7 +171,7 @@ Local_arguments ()
grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,iso-application:,iso-preparer:,iso-publisher:,
iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,
net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
- net-cow-server:,net-tarball:,firmware-binary:,swap-file-path:,swap-file-size:,syslinux-theme:,
+ net-cow-server:,net-tarball:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:,syslinux-theme:,
win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force,
help,ignore-system-defaults,quiet,usage,verbose,version,bootstrap-qemu-static:,bootstrap-qemu-arch:,
bootstrap-qemu-exclude:"
@@ -754,6 +755,11 @@ Local_arguments ()
shift 2
;;
+ --firmware-chroot)
+ LB_FIRMWARE_CHROOT="${2}"
+ shift 2
+ ;;
+
--swap-file-path)
LB_SWAP_FILE_PATH="${2}"
shift 2
@@ -1403,6 +1409,10 @@ LB_NET_TARBALL="${LB_NET_TARBALL}"
# (Default: ${LB_FIRMWARE_BINARY})
LB_FIRMWARE_BINARY="${LB_FIRMWARE_BINARY}"
+# \$LB_FIRMWARE_CHROOT: include firmware packages in debian-installer
+# (Default: ${LB_FIRMWARE_CHROOT})
+LB_FIRMWARE_CHROOT="${LB_FIRMWARE_CHROOT}"
+
# \$LB_SWAP_FILE_PATH: set swap file path
# (Default: ${LB_SWAP_FILE_PATH})
LB_SWAP_FILE_PATH="${LB_SWAP_FILE_PATH}"