Skip to content

Commit

Permalink
fstab: make requied changes so that the /etc overlay get mounted eari…
Browse files Browse the repository at this point in the history
…er in the boot process

Having "noauto" among flags postpone the overlay mount to a moment where services are started already, making it impossible to disable/enable services.

Fix the above issue (and very probably more) by having the overlay mounted earlier in the boot sequence.

/sysroot is the directory systemd (in initramfs) mounts the new rootfs to (before performing the switch_root syscall to it) and raw fs arguments (unparsed by systemd) needs to specify that directory.
  • Loading branch information
NeroReflex committed Apr 15, 2024
1 parent 5019655 commit 59812b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ Subsystem sftp /usr/lib/ssh/sftp-server
" > /etc/ssh/sshd_config
echo "
LABEL=frzr_root /var btrfs defaults,subvolid=256,rw,noatime,nodatacow,nofail 0 0
LABEL=frzr_root /home btrfs defaults,subvolid=257,rw,noatime,nodatacow,nofail 0 0
LABEL=frzr_root /frzr_root btrfs defaults,subvolid=5,rw,noatime,nodatacow,x-initrd 0 2
overlay /etc overlay noauto,x-systemd.requires=/frzr_root,x-systemd.rw-only,lowerdir=/etc,upperdir=/frzr_root/etc,workdir=/frzr_root/.etc,index=off,metacopy=off,comment=etcoverlay 0 0
LABEL=frzr_root /var btrfs defaults,subvolid=256,rw,noatime,nodatacow,nofail 0 0
LABEL=frzr_root /home btrfs defaults,subvolid=257,rw,noatime,nodatacow,nofail 0 0
LABEL=frzr_root /frzr_root btrfs defaults,subvolid=5,rw,noatime,nodatacow,x-initrd 0 2
overlay /etc overlay defaults,x-systemd.requires=/frzr_root,x-systemd.rw-only,lowerdir=/sysroot/etc,upperdir=/sysroot/frzr_root/etc,workdir=/sysroot/frzr_root/.etc,index=off,metacopy=off,comment=etcoverlay 0 0
" > /etc/fstab
echo "
Expand Down

0 comments on commit 59812b3

Please sign in to comment.