Skip to content

Commit dfbed2e

Browse files
Fix #10
1 parent af6ea19 commit dfbed2e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

initrd-sysroot-mount.service

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool
2+
3+
# Ensure /sysroot mount before switch root.
4+
# See issue #10.
5+
# See https://www.freedesktop.org/software/systemd/man/bootup.html
6+
7+
[Unit]
8+
Description=Initrd SysRoot Mount
9+
Documentation=https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/README.md
10+
ConditionPathExists=/etc/initrd-release
11+
ConditionPathExists=/dev/mapper/root
12+
ConditionPathExists=/sysroot
13+
ConditionPathIsMountPoint=!/sysroot
14+
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
19+
20+
[Service]
21+
Type=oneshot
22+
RemainAfterExit=true
23+
ExecStart=/bin/mount /dev/mapper/root /sysroot
24+
25+
[Install]
26+
WantedBy=initrd-switch-root.service
27+
WantedBy=initrd-switch-root.target
28+
29+
[X-SystemdTool]
30+
31+
# enable service
32+
InitrdService=enable

0 commit comments

Comments
 (0)