diff --git a/live-build/auto/build b/live-build/auto/build index 677de997..806d040c 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -375,7 +375,7 @@ EOF (cd chroot && find usr/share/doc -maxdepth 1 -type d | xargs du -s | sort -nr) echo END docdirs - /usr/share/livecd-rootfs/minimize-manual chroot + ${LIVECD_ROOTFS_ROOT}/minimize-manual chroot clean_debian_chroot fi diff --git a/live-build/auto/config b/live-build/auto/config index 25247be9..a1f6126f 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1,6 +1,8 @@ #!/bin/bash set -e +LIVECD_ROOTFS_ROOT=${LIVECD_ROOTFS_ROOT:-/usr/share/livecd-rootfs} + case $ARCH:$SUBARCH in amd64:|amd64:generic|amd64:intel-iot|\ arm64:|arm64:generic|arm64:raspi|arm64:snapdragon|arm64:nvidia|\ @@ -47,12 +49,12 @@ if [ -z "$MIRROR" ]; then fi mkdir -p config -cp -af /usr/share/livecd-rootfs/live-build/functions config/functions -cp -af /usr/share/livecd-rootfs/live-build/lb_*_layered config/ -cp -af /usr/share/livecd-rootfs/live-build/snap-seed-parse.py config/snap-seed-parse -cp -af /usr/share/livecd-rootfs/live-build/snap-seed-missing-providers.py config/snap-seed-missing-providers -cp -af /usr/share/livecd-rootfs/live-build/expand-task config/expand-task -cp -af /usr/share/livecd-rootfs/live-build/squashfs-exclude-files config/ +cp -af ${LIVECD_ROOTFS_ROOT}/live-build/functions config/functions +cp -af ${LIVECD_ROOTFS_ROOT}/live-build/lb_*_layered config/ +cp -af ${LIVECD_ROOTFS_ROOT}/live-build/snap-seed-parse.py config/snap-seed-parse +cp -af ${LIVECD_ROOTFS_ROOT}/live-build/snap-seed-missing-providers.py config/snap-seed-missing-providers +cp -af ${LIVECD_ROOTFS_ROOT}/live-build/expand-task config/expand-task +cp -af ${LIVECD_ROOTFS_ROOT}/live-build/squashfs-exclude-files config/ mkdir -p config/package-lists @@ -816,7 +818,7 @@ do_layered_desktop_image() { DEFAULT_KERNEL="linux-$KERNEL_FLAVOURS" if [ "$LOCALE_SUPPORT" != none ]; then - /usr/share/livecd-rootfs/checkout-translations-branch \ + ${LIVECD_ROOTFS_ROOT}/checkout-translations-branch \ https://git.launchpad.net/subiquity po \ config/catalog-translations fi @@ -1136,7 +1138,7 @@ case $PROJECT in NO_SQUASHFS_PASSES=ubuntu-server-minimal.ubuntu-server.installer.$flavor.netboot DEFAULT_KERNEL="$kernel_metapkg" - /usr/share/livecd-rootfs/checkout-translations-branch \ + ${LIVECD_ROOTFS_ROOT}/checkout-translations-branch \ https://git.launchpad.net/subiquity po config/catalog-translations ;; *) @@ -1154,7 +1156,7 @@ case $PROJECT in # created in ubuntu-core-installer/hooks/05-prepare-image.binary, which # subiquity knows how to install. if [ ${SUBPROJECT} == "desktop" ]; then - cp /usr/share/livecd-rootfs/live-build/${PROJECT}/ubuntu-core-desktop-24-amd64.model-assertion config/ + cp ${LIVECD_ROOTFS_ROOT}/live-build/${PROJECT}/ubuntu-core-desktop-24-amd64.model-assertion config/ fi OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" PASSES_TO_LAYERS=true @@ -1168,7 +1170,7 @@ case $PROJECT in USE_BRIDGE_KERNEL=false DEFAULT_KERNEL="snap:pc-kernel" - /usr/share/livecd-rootfs/checkout-translations-branch \ + ${LIVECD_ROOTFS_ROOT}/checkout-translations-branch \ https://git.launchpad.net/subiquity po config/catalog-translations ;; @@ -1308,7 +1310,7 @@ case $SUBPROJECT in # and a variety of things fail without it. add_package install tzdata - cp -af /usr/share/livecd-rootfs/live-build/make-lxd-metadata.py config/make-lxd-metadata + cp -af ${LIVECD_ROOTFS_ROOT}/live-build/make-lxd-metadata.py config/make-lxd-metadata ;; esac @@ -1433,6 +1435,7 @@ echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/chroot echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/chroot echo "IMAGEFORMAT=\"$IMAGEFORMAT\"" >> config/chroot +echo "LIVECD_ROOTFS_ROOT=\"$LIVECD_ROOTFS_ROOT\"" >> config/common if [ -n "$PASSES" ]; then echo "PASSES=\"$PASSES\"" >> config/common fi @@ -1566,7 +1569,7 @@ case $PROJECT:${SUBPROJECT:-} in ubuntustudio:*|edubuntu:*|ubuntu-budgie:*|ubuntucinnamon:*|xubuntu:*| \ ubuntukylin:*|ubuntu-mate:*|ubuntu-core-installer:*|lubuntu:*) # Ensure that most things e.g. includes.chroot are copied as is - for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do + for entry in ${LIVECD_ROOTFS_ROOT}/live-build/${PROJECT}/*; do case $entry in *hooks*) # But hooks are shared across the projects with symlinks @@ -1601,11 +1604,11 @@ esac case $PROJECT in ubuntu-oem|ubuntustudio|edubuntu|ubuntu-budgie|ubuntucinnamon| \ xubuntu|ubuntukylin|ubuntu-mate|lubuntu) - cp -af /usr/share/livecd-rootfs/live-build/ubuntu/includes.chroot \ + cp -af ${LIVECD_ROOTFS_ROOT}/live-build/ubuntu/includes.chroot \ config/includes.chroot LIVE_LAYER=${LIVE_PREFIX}live - cp -af /usr/share/livecd-rootfs/live-build/ubuntu/includes.chroot.minimal.standard.live \ + cp -af ${LIVECD_ROOTFS_ROOT}/live-build/ubuntu/includes.chroot.minimal.standard.live \ config/includes.chroot.$LIVE_LAYER if [ $PROJECT != ubuntu-oem ]; then @@ -1621,7 +1624,7 @@ esac case $SUBPROJECT in buildd) - cp -af /usr/share/livecd-rootfs/live-build/buildd/* config/ + cp -af ${LIVECD_ROOTFS_ROOT}/live-build/buildd/* config/ ;; esac @@ -1645,7 +1648,7 @@ if [ "$EXTRA_PPAS" ]; then extra_ppa=${extra_ppa%:*} ;; esac - extra_ppa_fingerprint="$(/usr/share/livecd-rootfs/get-ppa-fingerprint "$extra_ppa")" + extra_ppa_fingerprint="$(${LIVECD_ROOTFS_ROOT}/get-ppa-fingerprint "$extra_ppa")" cat >> config/archives/extra-ppas.list.chroot <>${mountpoint}/meta-data.sample < chroot.packages.${pass} diff --git a/live-build/ubuntu-core-installer/hooks/05-prepare-image.binary b/live-build/ubuntu-core-installer/hooks/05-prepare-image.binary index 05980c90..b140a979 100755 --- a/live-build/ubuntu-core-installer/hooks/05-prepare-image.binary +++ b/live-build/ubuntu-core-installer/hooks/05-prepare-image.binary @@ -11,6 +11,7 @@ case ${PASS:-} in esac . config/binary +. config/common . config/functions case ${SUBPROJECT} in @@ -56,4 +57,4 @@ PROJECT_FULL=$PROJECT${SUBARCH:+-$SUBARCH} usc_opts="--output livecd.${PROJECT_FULL}.install-sources.yaml \ --template config/edge.catalog-in.yaml \ --size 0" -/usr/share/livecd-rootfs/update-source-catalog source $usc_opts +${LIVECD_ROOTFS_ROOT}/update-source-catalog source $usc_opts diff --git a/minimize-manual b/minimize-manual index eac75e95..fcb490a1 100755 --- a/minimize-manual +++ b/minimize-manual @@ -7,10 +7,12 @@ set -e +. config/common + chroot_directory=$1 -auto_packages=$(/usr/share/livecd-rootfs/auto-markable-pkgs $chroot_directory) +auto_packages=$(${LIVECD_ROOTFS_ROOT}/auto-markable-pkgs $chroot_directory) if [ -n "$auto_packages" ]; then chroot $chroot_directory apt-mark auto $auto_packages fi -[ -z "$(/usr/share/livecd-rootfs/auto-markable-pkgs $chroot_directory 2> /dev/null)" ] +[ -z "$(${LIVECD_ROOTFS_ROOT}/auto-markable-pkgs $chroot_directory 2> /dev/null)" ]