fix: mount race condition of patos-state
This commit is contained in:
parent
a3aab1ea5c
commit
ca54cefe36
3 changed files with 17 additions and 9 deletions
|
@ -12,7 +12,7 @@ find rootfs/ -type d -exec chmod 755 {} \;
|
|||
# set default target to multi-user
|
||||
ln -sf multi-user.target rootfs/usr/lib/systemd/system/default.target
|
||||
|
||||
# mount patos state
|
||||
# mount /etc overlay and patos state
|
||||
ln -sf ../etc.mount rootfs/usr/lib/systemd/system/local-fs.target.wants/etc.mount
|
||||
ln -sf ../var.mount rootfs/usr/lib/systemd/system/sysinit.target.wants/var.mount
|
||||
|
||||
|
@ -20,10 +20,12 @@ ln -sf ../var.mount rootfs/usr/lib/systemd/system/sysinit.target.wants/var.mount
|
|||
ln -sf ../dbus.service rootfs/usr/lib/systemd/system/multi-user.target.wants/dbus.service
|
||||
ln -sf ../dbus.socket rootfs/usr/lib/systemd/system/sockets.target.wants/dbus.socket
|
||||
|
||||
# enable systemd-networkd
|
||||
# enable network services
|
||||
ln -sf ../systemd-networkd.service rootfs/usr/lib/systemd/system/sysinit.target.wants/systemd-networkd.service
|
||||
ln -sf ../systemd-resolved.service rootfs/usr/lib/systemd/system/sysinit.target.wants/systemd-resolved.service
|
||||
ln -sf ../systemd-timesyncd.service rootfs/usr/lib/systemd/system/multi-user.target.wants/systemd-timesyncd.service
|
||||
|
||||
# generate a temporary machine id
|
||||
# generate a temporary machine id (replace with overlay later)
|
||||
$systemd/usr/bin/systemd-machine-id-setup --root=rootfs/
|
||||
|
||||
$systemd/usr/bin/ukify build \
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
set -ex -o pipefail
|
||||
|
||||
mkdir -p $out
|
||||
mkdir -p $out/etc/repart.d $out/dev $out/proc $out/sys $out/tmp $out/root $out/run $out/boot $out/mnt $out/home $out/srv
|
||||
ln -sf ../usr/bin $out/bin
|
||||
ln -sf ../usr/bin $out/sbin
|
||||
ln -sf ../usr/lib $out/lib
|
||||
ln -sf ../usr/lib $out/lib64
|
||||
mkdir -p $out/etc/repart.d $out/dev $out/proc $out/sys $out/tmp $out/root $out/run $out/boot $out/mnt $out/home $out/srv $out/var/tmp
|
||||
ln -sf /usr/bin $out/bin
|
||||
ln -sf /usr/bin $out/sbin
|
||||
ln -sf /usr/lib $out/lib
|
||||
ln -sf /usr/lib $out/lib64
|
||||
ln -sf ../proc/self/mounts $out/etc/mtab
|
||||
|
||||
### install systemd
|
||||
|
@ -29,6 +29,11 @@ VERSION_ID={version}
|
|||
BUILD_ID={version}
|
||||
EOF
|
||||
|
||||
cat <<EOF > $out/etc/issue
|
||||
<<< Welcome to PatOS v${version} (Pre-Alpha) (\m) - \l >>>
|
||||
|
||||
EOF
|
||||
|
||||
# replace agetty with busybox getty
|
||||
sed -i 's#ExecStart=.*#ExecStart=-/sbin/getty -L %I 115200 vt100#' $out/usr/lib/systemd/system/serial-getty@.service
|
||||
|
||||
|
@ -60,6 +65,7 @@ cat <<EOF > $out/usr/lib/systemd/system/var.mount
|
|||
[Unit]
|
||||
Description=Mount for /var
|
||||
Before=local-fs.target
|
||||
After=systemd-repart.service
|
||||
|
||||
[Mount]
|
||||
What=/dev/disk/by-label/patos-state
|
||||
|
|
|
@ -305,7 +305,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
(lib.mesonBool "utmp" true)
|
||||
(lib.mesonBool "log-trace" true)
|
||||
|
||||
(lib.mesonBool "kernel-install" true)
|
||||
(lib.mesonBool "kernel-install" false)
|
||||
(lib.mesonBool "quotacheck" false)
|
||||
(lib.mesonBool "ldconfig" false)
|
||||
(lib.mesonBool "install-sysconfdir" true)
|
||||
|
|
Loading…
Add table
Reference in a new issue