mirror of
https://github.com/systemd/systemd.git
synced 2025-08-31 09:49:54 +03:00
test: add fstab file support for fstab-generator tests
This commit is contained in:
@ -26,7 +26,11 @@ for f in "$src"/test-*.input; do
|
|||||||
trap "rm -rf '$out'" EXIT INT QUIT PIPE
|
trap "rm -rf '$out'" EXIT INT QUIT PIPE
|
||||||
|
|
||||||
# shellcheck disable=SC2046
|
# shellcheck disable=SC2046
|
||||||
|
if [[ "$f" == *.fstab.input ]]; then
|
||||||
|
SYSTEMD_LOG_LEVEL=debug SYSTEMD_IN_INITRD=yes SYSTEMD_SYSFS_CHECK=no SYSTEMD_PROC_CMDLINE="fstab=yes root=fstab" SYSTEMD_FSTAB="$f" SYSTEMD_SYSROOT_FSTAB="/dev/null" $generator "$out" "$out" "$out"
|
||||||
|
else
|
||||||
SYSTEMD_LOG_LEVEL=debug SYSTEMD_IN_INITRD=yes SYSTEMD_PROC_CMDLINE="fstab=no $(cat "$f")" $generator "$out" "$out" "$out"
|
SYSTEMD_LOG_LEVEL=debug SYSTEMD_IN_INITRD=yes SYSTEMD_PROC_CMDLINE="fstab=no $(cat "$f")" $generator "$out" "$out" "$out"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -f "$out"/systemd-fsck-root.service ]]; then
|
if [[ -f "$out"/systemd-fsck-root.service ]]; then
|
||||||
# For split-usr system
|
# For split-usr system
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
# Automatically generated by systemd-fstab-generator
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Requires=dev-sdx1.device
|
||||||
|
After=dev-sdx1.device
|
@ -0,0 +1,11 @@
|
|||||||
|
# Automatically generated by systemd-fstab-generator
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
|
||||||
|
SourcePath=/etc/fstab
|
||||||
|
Before=initrd-fs.target
|
||||||
|
|
||||||
|
[Mount]
|
||||||
|
What=/sysusr/usr
|
||||||
|
Where=/sysroot/usr
|
||||||
|
Options=bind
|
@ -0,0 +1,13 @@
|
|||||||
|
# Automatically generated by systemd-fstab-generator
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
|
||||||
|
SourcePath=/etc/fstab
|
||||||
|
Before=initrd-root-fs.target
|
||||||
|
Requires=systemd-fsck-root.service
|
||||||
|
After=systemd-fsck-root.service
|
||||||
|
After=blockdev@dev-sdx1.target
|
||||||
|
|
||||||
|
[Mount]
|
||||||
|
What=/dev/sdx1
|
||||||
|
Where=/sysroot
|
@ -0,0 +1,16 @@
|
|||||||
|
# Automatically generated by systemd-fstab-generator
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=File System Check on /dev/sdx1
|
||||||
|
Documentation=man:systemd-fsck-root.service(8)
|
||||||
|
DefaultDependencies=no
|
||||||
|
BindsTo=dev-sdx1.device
|
||||||
|
Conflicts=shutdown.target
|
||||||
|
After=initrd-root-device.target local-fs-pre.target dev-sdx1.device
|
||||||
|
Before=shutdown.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
|
||||||
|
TimeoutSec=0
|
@ -0,0 +1,11 @@
|
|||||||
|
# Automatically generated by systemd-fstab-generator
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
|
||||||
|
SourcePath=/etc/fstab
|
||||||
|
Before=initrd-usr-fs.target
|
||||||
|
After=blockdev@dev-sdx2.target
|
||||||
|
|
||||||
|
[Mount]
|
||||||
|
What=/dev/sdx2
|
||||||
|
Where=/sysusr/usr
|
@ -0,0 +1,2 @@
|
|||||||
|
/dev/sdx1 /sysroot auto defaults 0 1
|
||||||
|
/dev/sdx2 /sysroot/usr auto defaults 0 0
|
Reference in New Issue
Block a user