Skip to content

Commit ce1d6d1

Browse files
Resolve #10 #12: Ensure /sysroot mount before switch root.
1 parent 69e8db9 commit ce1d6d1

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

initrd-sysroot-mount.service

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
# This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool
22

3-
# Ensure /sysroot mount before switch root.
4-
# See issue #10.
3+
# Ensure /sysroot mount before switch root.
4+
# Provides unit dependency: sysroot.mount -> initrd-root-fs.target
5+
# See https://github.com/systemd/systemd/issues/3551
6+
# See https://github.com/random-archer/mkinitcpio-systemd-tool/issues/10
7+
# See https://github.com/random-archer/mkinitcpio-systemd-tool/issues/12
58
# See https://www.freedesktop.org/software/systemd/man/bootup.html
9+
# See https://github.com/systemd/systemd/blob/master/src/fstab-generator/fstab-generator.c
610

711
[Unit]
8-
Description=Initrd SysRoot Mount
12+
Description=Initrd /sysroot binder
913
Documentation=https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/README.md
1014
ConditionPathExists=/etc/initrd-release
11-
ConditionPathExists=/dev/mapper/root
12-
ConditionPathExists=/sysroot
13-
ConditionPathIsMountPoint=!/sysroot
1415
DefaultDependencies=no
15-
After=initrd-cleanup.service
16-
After=initrd-root-fs.target initrd-fs.target initrd.target
17-
Before=initrd-switch-root.service
18-
Before=initrd-switch-root.target
16+
After=sysroot.mount
17+
BindsTo=sysroot.mount
1918

2019
[Service]
2120
Type=oneshot
2221
RemainAfterExit=true
23-
ExecStart=/bin/mount /dev/mapper/root /sysroot
22+
ExecStart=/bin/true
2423

2524
[Install]
26-
WantedBy=initrd-switch-root.service
27-
WantedBy=initrd-switch-root.target
25+
WantedBy=initrd-root-fs.target
2826

2927
[X-SystemdTool]
30-
31-
# enable service
3228
InitrdService=enable

0 commit comments

Comments
 (0)