fix overlay

- only create the @root volume if it doesn't exist yet
- mount snaps into the overlay /var
This commit is contained in:
Harald Sitter
2024-07-20 11:55:40 +02:00
parent 2162a453af
commit 68403ffbfa

View File

@@ -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