1
0
mirror of https://github.com/systemd/systemd synced 2024-07-03 08:29:25 +00:00

test: add fstab file support for fstab-generator tests

This commit is contained in:
Lily Foster 2023-01-25 18:52:30 -05:00
parent 905dd992f8
commit ef0c7ab6ac
No known key found for this signature in database
GPG Key ID: 49340081E484C893
11 changed files with 63 additions and 1 deletions

View File

@ -26,7 +26,11 @@ for f in "$src"/test-*.input; do
trap "rm -rf '$out'" EXIT INT QUIT PIPE
# shellcheck disable=SC2046
SYSTEMD_LOG_LEVEL=debug SYSTEMD_IN_INITRD=yes SYSTEMD_PROC_CMDLINE="fstab=no $(cat "$f")" $generator "$out" "$out" "$out"
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"
fi
if [[ -f "$out"/systemd-fsck-root.service ]]; then
# For split-usr system

View File

@ -0,0 +1,5 @@
# Automatically generated by systemd-fstab-generator
[Unit]
Requires=dev-sdx1.device
After=dev-sdx1.device

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,2 @@
/dev/sdx1 /sysroot auto defaults 0 1
/dev/sdx2 /sysroot/usr auto defaults 0 0