From 68403ffbfac7b5c439b516cf70fbb6d602b8006a Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Sat, 20 Jul 2024 11:55:40 +0200 Subject: [PATCH] fix overlay - only create the @root volume if it doesn't exist yet - mount snaps into the overlay /var --- mkosi.extra/usr/bin/_kdeos-overlay | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mkosi.extra/usr/bin/_kdeos-overlay b/mkosi.extra/usr/bin/_kdeos-overlay index b8293cd..5970790 100755 --- a/mkosi.extra/usr/bin/_kdeos-overlay +++ b/mkosi.extra/usr/bin/_kdeos-overlay @@ -27,7 +27,7 @@ mount -v \ # Make sure our subvolumes exist! In particular if we introduce subvolumes after installation. # FIXME This is a bit garbage. It'd be much tidier if we could tell repart to do this for us. But in some sort of # safe mode so it doesn't twiddle the partition table. -btrfs subvolume create "${sysroot}/system/@root" +[ -d "${sysroot}/system/@root" ] || btrfs subvolume create "${sysroot}/system/@root" mount -v \ -o rw,subvol=@home \ @@ -38,9 +38,6 @@ mount -v \ mount -v \ -o rw,subvol=@locale \ "$rootdisk" "${sysroot}/usr/lib/locale" -mount -v \ - -o rw,subvol=@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" \ @@ -49,5 +46,8 @@ mount -v \ -t overlay \ -o "rw,lowerdir=${sysroot}/var,upperdir=${sysroot}/system/@var-overlay/upper,workdir=${sysroot}/system/@var-overlay/work,index=off,metacopy=off" \ overlay "${sysroot}/var" +mount -v \ + -o rw,subvol=@snap \ + "$rootdisk" "${sysroot}/var/lib/snapd/snap" # TODO: should we maybe also mount /etc into the initrd /etc so we have early access to fstab and the like