| 1 |
#!/usr/bin/env bash |
| 2 |
set -e |
| 3 |
|
| 4 |
# We don't use mkosi.extra because /usr/sbin could be a symlink and cp doesn't handle that properly until |
| 5 |
# coreutils 9.5 or newer. |
| 6 |
mkdir -p "$BUILDROOT/sbin" |
| 7 |
rm -f "$BUILDROOT/sbin/init" |
| 8 |
cat >"$BUILDROOT/sbin/init" <<EOF |
| 9 |
#!/usr/bin/env bash |
| 10 |
echo "Hello from dummy init, beautiful day, innit?" |
| 11 |
ip link |
| 12 |
EOF |
| 13 |
chmod +x "$BUILDROOT/sbin/init" |
| 14 |
|
| 15 |
# Arch relies on tmpfiles.d/etc.conf but this image isn't booted |
| 16 |
if [ ! -e "$BUILDROOT/etc/os-release" ]; then |
| 17 |
ln -s ../usr/lib/os-release "$BUILDROOT/etc/os-release" |
| 18 |
fi |
| 19 |
|
| 20 |
# For use in the minimal containers, only needs libsystemd and libc |
| 21 |
if [[ -x "$BUILDDIR/test-fdstore" ]]; then |
| 22 |
cp "$BUILDDIR/test-fdstore" "$BUILDROOT/usr/bin/test-fdstore" |
| 23 |
fi |