feat(image): make /var stateful
This commit is contained in:
parent
e196cf729c
commit
e4ebf7ea7f
2 changed files with 44 additions and 2 deletions
image
|
@ -13,11 +13,28 @@ find rootfs/ -type d -exec chmod 755 {} \;
|
|||
mkdir rootfs/usr/lib/systemd/system/basic.target.wants
|
||||
ln -sf basic.target rootfs/usr/lib/systemd/system/default.target
|
||||
|
||||
# mount patos state
|
||||
cat <<EOF > rootfs/usr/lib/systemd/system/var.mount
|
||||
[Unit]
|
||||
Description=Mount for /var
|
||||
Before=local-fs.target
|
||||
|
||||
[Mount]
|
||||
What=/dev/disk/by-label/patos-state
|
||||
Where=/var
|
||||
Type=ext2
|
||||
Options=defaults
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
EOF
|
||||
ln -sf ../var.mount rootfs/usr/lib/systemd/system/basic.target.wants/var.mount
|
||||
|
||||
# enable dbus
|
||||
ln -sf ../dbus.service rootfs/usr/lib/systemd/system/basic.target.wants/dbus.service
|
||||
ln -sf ../dbus.socket rootfs/usr/lib/systemd/system/sockets.target.wants/dbus.socket
|
||||
|
||||
# generate machine-id
|
||||
# generate a temporary machine id
|
||||
$systemd/usr/bin/systemd-machine-id-setup --root=rootfs/
|
||||
|
||||
cat <<EOF > rootfs/etc/passwd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue