]>
Commit | Line | Data |
---|---|---|
7294632c FS |
1 | #!/usr/bin/env bash |
2 | # SPDX-License-Identifier: LGPL-2.1-or-later | |
3 | set -eux | |
4 | set -o pipefail | |
5 | ||
6 | if systemd-detect-virt -qc; then | |
7 | echo >&2 "This test can't run in a container" | |
8 | exit 1 | |
9 | fi | |
10 | ||
57d61ff3 FS |
11 | # This test requires systemd to run in the initrd as well, which is not the case |
12 | # for mkinitrd-based initrd (Ubuntu/Debian) | |
13 | if [[ "$(systemctl show -P InitRDTimestampMonotonic)" -eq 0 ]]; then | |
14 | echo "systemd didn't run in the initrd, skipping the test" | |
15 | touch /skipped | |
16 | exit 0 | |
17 | fi | |
18 | ||
7294632c FS |
19 | # We should've created a mount under /run in initrd (see the other half of the test) |
20 | # that should've survived the transition from initrd to the real system | |
21 | test -d /run/initrd-mount-target | |
22 | mountpoint /run/initrd-mount-target | |
23 | [[ -e /run/initrd-mount-target/hello-world ]] | |
24 | ||
25 | # Copy the prepared shutdown initrd to its intended location. Check the respective | |
26 | # test.sh file for details | |
27 | mkdir -p /run/initramfs | |
28 | cp -r /shutdown-initrd/* /run/initramfs/ | |
29 | ||
30 | touch /testok |