aboutsummaryrefslogtreecommitdiffstats
path: root/stage1
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-06-26 15:55:25 +0200
committerSven Gothel <[email protected]>2021-06-26 15:55:25 +0200
commit785f9054390a077ee28829cbe919a5c237e03c53 (patch)
treedb683c89d52fccab2426036fe88d297fa4639860 /stage1
parent5d85fc5ed790e9a2761815c1606232493f776b18 (diff)
ro: Inject overlayfs, using DATADEV '/data' partition as 'upper'; Disable rootfs resize @ init (1st boot)
/etc/fstab didn't work to mount the overlayfs (boot freeze due to some dependencies). Hence we use our own 'overlay_mount.service' Before 'local_fs.target', which mounts '/data' and its overlays. We also disable rootfs resize @ init (1st boot), since the rootfs is immutable from here on.
Diffstat (limited to 'stage1')
-rwxr-xr-xstage1/01-sys-tweaks/00-run.sh10
-rw-r--r--stage1/01-sys-tweaks/files/fstab13
2 files changed, 21 insertions, 2 deletions
diff --git a/stage1/01-sys-tweaks/00-run.sh b/stage1/01-sys-tweaks/00-run.sh
index 9c380ec..41985f4 100755
--- a/stage1/01-sys-tweaks/00-run.sh
+++ b/stage1/01-sys-tweaks/00-run.sh
@@ -5,6 +5,16 @@ install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/[email protected]
install -v -m 644 files/fstab "${ROOTFS_DIR}/etc/fstab"
on_chroot << EOF
+mkdir -p /data/etc/upper
+mkdir -p /data/etc/work
+mkdir -p /data/home/upper
+mkdir -p /data/home/work
+mkdir -p /data/srv/upper
+mkdir -p /data/srv/work
+mkdir -p /data/tmp/upper
+mkdir -p /data/tmp/work
+mkdir -p /data/var/upper
+mkdir -p /data/var/work
if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then
adduser --disabled-password --gecos "" ${FIRST_USER_NAME}
fi
diff --git a/stage1/01-sys-tweaks/files/fstab b/stage1/01-sys-tweaks/files/fstab
index 4ad89ff..bea1fe3 100644
--- a/stage1/01-sys-tweaks/files/fstab
+++ b/stage1/01-sys-tweaks/files/fstab
@@ -1,4 +1,13 @@
proc /proc proc defaults 0 0
BOOTDEV /boot vfat defaults 0 2
-DATADEV /data ext4 defaults,noatime 0 1
-ROOTDEV / ext4 defaults,noatime,ro,errors=remount-ro 0 1
+DATADEV /data ext4 defaults,noatime,noauto 0 1
+ROOTDEV / ext4 defaults,noatime,ro,errors=remount-ro 0 0
+
+# defaults = rw, suid, dev, exec, auto, nouser, and async
+# we replace auto -> noauto,x-systemd.automount
+#overlay /etc overlay noauto,x-systemd.automount,rw,suid,dev,exec,nouser,async,noatime,lowerdir=/etc,upperdir=/data/etc/upper,workdir=/data/etc/work 0 0
+#overlay /home overlay noauto,x-systemd.automount,rw,suid,dev,exec,nouser,async,noatime,lowerdir=/home,upperdir=/data/home/upper,workdir=/data/home/work 0 0
+#overlay /srv overlay noauto,x-systemd.automount,rw,suid,dev,exec,nouser,async,noatime,lowerdir=/srv,upperdir=/data/srv/upper,workdir=/data/srv/work 0 0
+#overlay /tmp overlay noauto,x-systemd.automount,rw,suid,dev,exec,nouser,async,noatime,lowerdir=/tmp,upperdir=/data/tmp/upper,workdir=/data/tmp/work 0 0
+#overlay /var overlay noauto,x-systemd.automount,rw,suid,dev,exec,nouser,async,noatime,lowerdir=/var,upperdir=/data/var/upper,workdir=/data/var/work 0 0
+