From fe3cc25f6b005235ac82ce0d19ac30a5b89b4d51 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Tue, 14 Feb 2023 21:05:54 -0600 Subject: [PATCH] fstab: Only overlay /etc/ssh There's really no sense in creating a writable copy of the whole `/etc` hierarchy at `/run/etc/rw`. Instead, let's just mount overlays at the paths we want to make writable (which for now is only `/etc/ssh`). --- overlay/etc/fstab | 3 +-- overlay/usr/libexec/init-storage | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/overlay/etc/fstab b/overlay/etc/fstab index f00e1b5..001082f 100644 --- a/overlay/etc/fstab +++ b/overlay/etc/fstab @@ -1,4 +1,3 @@ PARTLABEL=dch-data /var btrfs subvol=var,nosuid,noexec,nodev 0 2 PARTLABEL=dch-data /run/etc btrfs subvol=etc,nosuid,noexec,nodev 0 0 -overlay /run/etc/rw overlay lowerdir=/etc,upperdir=/run/etc/rw,workdir=/run/etc/.work 0 0 -/run/etc/rw/ssh /etc/ssh none bind 0 0 +overlay /etc/ssh overlay lowerdir=/etc/ssh,upperdir=/run/etc/rw/ssh,workdir=/run/etc/.work,x-systemd.requires=run-etc.mount 0 0 diff --git a/overlay/usr/libexec/init-storage b/overlay/usr/libexec/init-storage index e819854..dd971e1 100755 --- a/overlay/usr/libexec/init-storage +++ b/overlay/usr/libexec/init-storage @@ -28,6 +28,7 @@ format_dev() { mount "${dev}" "${tmpdir}" || exit btrfs subvolume create "${tmpdir}"/etc || exit mkdir -p "${tmpdir}"/etc/.work "${tmpdir}"/etc/rw || exit + mkdir -p "${tmpdir}"/etc/rw/ssh btrfs subvolume create "${tmpdir}"/var || exit btrfs subvolume create "${tmpdir}"/var/log || exit umount "${dev}" || exit