move to /var/lib/snapd/snap

as it turns out the AUR build of snapd explicitly builds with a
different path for snaps. to make things work that way and match snapd
expectations we now mount the snap volume into /var/lib/snapd/snap
(which is created during rootfs creation).
we also symlink /snap there so to the user everything seems as though it
was under /snap

if that doesn't work out we might have to reconsider using the AUR
package :\
This commit is contained in:
Harald Sitter
2024-07-18 00:16:42 +02:00
parent 594d9b6c74
commit 24975796da
2 changed files with 3 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ mount -v \
"$rootdisk" "${sysroot}/usr/lib/locale"
mount -v \
-o rw,subvol=@snap \
"$rootdisk" "${sysroot}/snap"
"$rootdisk" "${sysroot}/var/lib/snapd/snap"
mount -v \
-t overlay \
-o "rw,lowerdir=${sysroot}/etc,upperdir=${sysroot}/system/@etc-overlay/upper,workdir=${sysroot}/system/@etc-overlay/work,index=off,metacopy=off" \

View File

@@ -7,7 +7,7 @@ set -ex
env
mkdir --mode 0700 /system # for the kdeos-overlay.service
mkdir /snap # for snapd
ln -s var/lib/snapd/snap /snap # for snapd
export SYSTEMD_ESP_PATH="$BOOT_MNT"
mkdir --mode 0700 "$SYSTEMD_ESP_PATH"
@@ -66,6 +66,7 @@ pacman --noconfirm --upgrade /home/builder/.cache/yay/snapd/*.pkg.tar.*
pacman --noconfirm --upgrade /home/builder/.cache/yay/steam-devices-git/*.pkg.tar.*
pacman --noconfirm --upgrade /home/builder/.cache/yay/systemd-bootchart/*.pkg.tar.*
touch /var/lib/snapd/apparmor/snap-confine/.keep # this has been gotten lost in the past for unknown reasons
mkdir /var/lib/snapd/snap/ # make sure the final snap location exists. we'll mount into it
userdel --remove builder
rm /etc/sudoers.d/builder
rm -rf /home/builder