summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-05-02 15:15:38 +0100
committerLyndon Brown <jnqnfe@gmail.com>2020-05-02 17:07:32 +0100
commit55e17b1e256a4295c67f44e633adaa07f850d4fb (patch)
tree3afd08b7de78e215136c3f478d581b31fdf7bd4e
parentb2b260242974a3a9ff479f7b597af96b8ea13d0d (diff)
downloadvyos-live-build-55e17b1e256a4295c67f44e633adaa07f850d4fb.tar.gz
vyos-live-build-55e17b1e256a4295c67f44e633adaa07f850d4fb.zip
config: refactor basic package list construction
Gbp-Dch: Ignore
-rwxr-xr-xscripts/build/config43
1 files changed, 17 insertions, 26 deletions
diff --git a/scripts/build/config b/scripts/build/config
index 3a79c9f88..7f19aaeb2 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -1345,33 +1345,24 @@ do
fi
done
-if [ ! -e config/package-lists/live.list.chroot ]
-then
- case "${LB_INITRAMFS}" in
- live-boot)
- echo "live-boot" > config/package-lists/live.list.chroot
- echo "live-config" >> config/package-lists/live.list.chroot
-
- case "${LB_INITSYSTEM}" in
- none)
- # do nothing
- ;;
-
- systemd)
- echo "live-config-systemd" >> config/package-lists/live.list.chroot
- ;;
-
- sysvinit)
- echo "live-config-${LB_INITSYSTEM}" >> config/package-lists/live.list.chroot
- echo "sysvinit-core" >> config/package-lists/live.list.chroot
- ;;
- esac
- ;;
-
- *)
- ;;
-esac
+LIVE_PKG_LIST="config/package-lists/live.list.chroot"
+if [ ! -e "${LIVE_PKG_LIST}" ]; then
+ NEEDED_PACKAGES=""
+ if [ "${LB_INITRAMFS}" = "live-boot" ]; then
+ NEEDED_PACKAGES="live-boot live-config"
+ case "${LB_INITSYSTEM}" in
+ systemd)
+ NEEDED_PACKAGES="${NEEDED_PACKAGES} live-config-systemd"
+ ;;
+ sysvinit)
+ NEEDED_PACKAGES="${NEEDED_PACKAGES} live-config-sysvinit sysvinit-core"
+ ;;
+ esac
+ fi
+ for PKG in $NEEDED_PACKAGES; do
+ echo "${PKG}" >> "${LIVE_PKG_LIST}"
+ done
fi
# Remove empty directories (if user has requested via --clean)