fix(image): finally have working mount of encrypted volumes!
This commit is contained in:
parent
adb2e90c13
commit
10090a75b0
3 changed files with 30 additions and 23 deletions
pkgs/rootfs
|
@ -16,6 +16,29 @@ echo patos > ./etc/hostname
|
|||
|
||||
ln -sf /etc/os-release ./etc/initrd-release
|
||||
|
||||
# set default target to initrd inside initrd
|
||||
ln -sf initrd.target ./usr/lib/systemd/system/default.target
|
||||
|
||||
mkdir ./usr/lib/systemd/system/systemd-repart.service.d
|
||||
cat <<EOF > ./usr/lib/systemd/system/systemd-repart.service.d/override.conf
|
||||
[Service]
|
||||
ExecStart=systemd-repart --dry-run=no --generate-crypttab=/run/crypttab --generate-fstab=/run/fstab
|
||||
EOF
|
||||
|
||||
cat <<EOF > ./usr/lib/systemd/system/sysroot-run.mount
|
||||
[Unit]
|
||||
Before=initrd-fs.target
|
||||
DefaultDependencies=false
|
||||
|
||||
[Mount]
|
||||
Options=bind
|
||||
What=/run
|
||||
Where=/sysroot/run
|
||||
EOF
|
||||
# bind mount /run to /sysroot/run
|
||||
mkdir ./usr/lib/systemd/system/initrd-fs.target.requires/
|
||||
ln -sf ../sysroot-run.mount ./usr/lib/systemd/system/initrd-fs.target.requires/sysroot-run.mount
|
||||
|
||||
# gen initrd
|
||||
find . -print0 | cpio --null --owner=root:root -o --format=newc | xz -9 --check=crc32 > ../initrd.xz
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue