From b72a5397fbdbbae335476fb6e861b57447317bc9 Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Mon, 10 Apr 2023 14:59:21 -0600 Subject: [PATCH] scripts: update slimy to handle u-d-i If the target snap is ubuntu-desktop-installer, put subiquity changes in the appropriate location. --- scripts/slimy-update-snap.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/slimy-update-snap.sh b/scripts/slimy-update-snap.sh index 7e4aa3ef..e8c43bd3 100755 --- a/scripts/slimy-update-snap.sh +++ b/scripts/slimy-update-snap.sh @@ -35,7 +35,9 @@ add_overlay() { local upper="$(mktemp -dp "${tmpdir}")" fi chmod go+rx "${work}" "${upper}" - do_mount -t overlay overlay -o lowerdir="${lower}",upperdir="${upper}",workdir="${work}" "${mountpoint}" + do_mount -t overlay overlay \ + -o lowerdir="${lower}",upperdir="${upper}",workdir="${work}" \ + "${mountpoint}" } @@ -53,11 +55,22 @@ do_mount $old old add_overlay old new rm -rf new/lib/python3.10/site-packages/curtin -rm -rf new/lib/python3.10/site-packages/subiquity -rm -rf new/lib/python3.10/site-packages/subiquitycore + +if [ -d new/lib/python3.10/site-packages/subiquity ] ; then + subiquity_dest=new/lib/python3.10/site-packages +elif [ -d new/bin/subiquity/subiquity ] ; then + subiquity_dest=new/bin/subiquity +else + echo "unrecognized snap" >&2 + exit 1 +fi + +rm -rf "${subiquity_dest}/subiquity" +rm -rf "${subiquity_dest}/subiquitycore" (cd "${src}" && ./scripts/update-part.py curtin) -rsync -a --chown 0:0 $src/subiquity $src/subiquitycore $src/curtin/curtin new/lib/python3.10/site-packages +rsync -a --chown 0:0 $src/curtin/curtin new/lib/python3.10/site-packages +rsync -a --chown 0:0 $src/subiquity $src/subiquitycore $subiquity_dest snapcraft pack new --output $new