--- /dev/null
+../test/dracut.conf.d/test/
\ No newline at end of file
--- /dev/null
+../test/dracut.conf.d/test-makeroot/
\ No newline at end of file
--- /dev/null
+../test/dracut.conf.d/test-root
\ No newline at end of file
}
install() {
- # do not compress, do not strip
- export compress="cat"
- export do_strip="no"
- export do_hardlink="no"
- export early_microcode="no"
- export hostonly_cmdline="no"
-
inst_multiple poweroff cp umount sync dd mkfs.ext4
inst_hook initqueue/finished 01 "$moddir/finished-false.sh"
}
}
install() {
- # do not compress, do not strip
- export compress="cat"
- export do_strip="no"
- export do_hardlink="no"
- export early_microcode="no"
- export hostonly_cmdline="no"
-
inst_simple /etc/os-release
inst_multiple mkdir ln dd stty mount poweroff umount setsid sync cat grep
}
install() {
- # do not compress, do not strip
- export compress="cat"
- export do_strip="no"
- export do_hardlink="no"
- export early_microcode="no"
- export hostonly_cmdline="no"
-
inst poweroff
inst_hook shutdown-emergency 000 "$moddir/hard-off.sh"
inst_hook emergency 000 "$moddir/hard-off.sh"
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ --add-confdir test-makeroot \
-I "mkfs.${TEST_FSTYPE}" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ --add-confdir "test-makeroot" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
--nomdadmconf \
--no-hostonly-cmdline -N \
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-i ./fstab /etc/fstab \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ --add-confdir test-makeroot \
-I "mkfs.btrfs" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root systemd" \
+ --add-confdir test-root \
+ -a systemd \
-i "${PKGLIBDIR}/modules.d/80test-root/test-init.sh" "/sbin/test-init.sh" \
-i ./test-init.sh /sbin/test-init \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot btrfs crypt" \
+ --add-confdir test-makeroot \
+ -a "btrfs crypt" \
-I "mkfs.btrfs cryptsetup" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ --add-confdir test-makeroot \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
--nomdadmconf \
--no-hostonly-cmdline -N \
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot bash crypt lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "bash crypt lvm mdraid" \
-I "grep cryptsetup" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot bash lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "bash lvm mdraid" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
rm -rf -- "$TESTDIR"/overlay
test_setup() {
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot bash crypt lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "bash crypt lvm mdraid" \
-I "grep cryptsetup" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot bash crypt lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "bash crypt lvm mdraid" \
-I "grep cryptsetup" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot bash lvm mdraid dmraid" \
+ --add-confdir test-makeroot \
+ -a "bash lvm mdraid dmraid" \
-d "piix ide-gd_mod ata_piix ext4 sd_mod dm-multipath dm-crypt dm-round-robin faulty linear multipath raid0 raid10 raid1 raid456" \
-I "grep sfdisk realpath" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot bash btrfs" \
+ --add-confdir test-makeroot \
+ -a "bash btrfs" \
-d "piix ide-gd_mod ata_piix btrfs sd_mod" \
-I "mkfs.btrfs" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-i ./test-init.sh /sbin/init-persist \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- --module "test-makeroot" \
+ --add-confdir test-makeroot \
--install "sfdisk mkfs.ntfs mksquashfs mkfs.erofs" \
--drivers "ntfs3 erofs" \
--include ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot bash lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "bash lvm mdraid" \
-I "grep" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
test_setup() {
# Create what will eventually be our root filesystem
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
"$TESTDIR"/tmp-initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/dracut.*/initramfs/proc
test_setup() {
# Create what will eventually be the client root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-I "ip grep setsid" \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot crypt lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "crypt lvm mdraid" \
-I "setsid blockdev" \
-i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \
--no-hostonly-cmdline -N \
# Create what will eventually be the server root filesystem onto an overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root network-legacy" \
+ --add-confdir test-root \
+ -a network-legacy \
-d "iscsi_tcp crc32c ipv6" \
-I "modprobe chmod ip setsid pidof tgtd tgtadm /etc/passwd" \
--install-optional "/etc/netconfig dhcpd /etc/group /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/services /usr/etc/nsswitch.conf /usr/etc/rpc /usr/etc/protocols /usr/etc/services" \
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ --add-confdir test-makeroot \
-i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
rm -rf -- "$TESTDIR"/overlay
# Create what will eventually be our root filesystem onto an overlay
rm -rf -- "$TESTDIR"/overlay
"$DRACUT" -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-I "ip grep setsid" \
--no-hostonly --no-hostonly-cmdline --nohardlink \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot crypt lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "crypt lvm mdraid" \
-I "setsid blockdev" \
-i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \
--no-hostonly-cmdline -N \
rm -rf -- "$TESTDIR"/overlay
"$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
- -m "test-root network-legacy iscsi" \
+ --add-confdir test-root \
+ -a "network-legacy iscsi" \
-d "iscsi_tcp crc32c ipv6 af_packet" \
-I "ip grep sleep setsid chmod modprobe pidof tgtd tgtadm" \
--install-optional "/etc/netconfig dhcpd /etc/group /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/services /usr/etc/nsswitch.conf /usr/etc/rpc /usr/etc/protocols /usr/etc/services" \
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ --add-confdir test-makeroot \
-i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
rm -rf -- "$TESTDIR"/overlay
rm -fr "$TESTDIR"/overlay
# Create what will eventually be our root filesystem onto an overlay
"$DRACUT" -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-I "ip grep" \
--no-hostonly --no-hostonly-cmdline --nohardlink \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot crypt lvm mdraid" \
+ --add-confdir test-makeroot \
+ -a "crypt lvm mdraid" \
-I "cryptsetup" \
-i ./create-encrypted-root.sh /lib/dracut/hooks/initqueue/01-create-encrypted-root.sh \
--no-hostonly-cmdline -N \
make_client_root() {
rm -fr "$TESTDIR"/overlay
"$DRACUT" -l --keep --tmpdir "$TESTDIR" \
- -m "test-root" \
+ --add-confdir test-root \
-I "ip" \
--no-hostonly --no-hostonly-cmdline --nohardlink \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ --add-confdir test-makeroot \
-i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \
--nomdadmconf \
--no-hostonly-cmdline -N \
EOF
"$DRACUT" -l --keep --tmpdir "$TESTDIR" \
- -m "test-root network-legacy" \
+ --add-confdir test-root \
+ -a "network-legacy" \
-I "ip grep sleep nbd-server chmod modprobe vi pidof" \
--install-optional "/etc/netconfig dhcpd /etc/group /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/services /usr/etc/nsswitch.conf /usr/etc/rpc /usr/etc/protocols /usr/etc/services" \
-i /tmp/config /etc/nbd-server/config \
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot network-legacy" \
+ --add-confdir test-makeroot \
+ -a "network-legacy" \
-i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \
--nomdadmconf \
--no-hostonly-cmdline -N \
--- /dev/null
+dracutmodules+=" test-makeroot "
+# do not compress, do not strip
+compress="cat"
+do_strip="no"
+do_hardlink="no"
+early_microcode="no"
+hostonly_cmdline="no"
--- /dev/null
+dracutmodules+=" test-root "
+# do not compress, do not strip
+compress="cat"
+do_strip="no"
+do_hardlink="no"
+early_microcode="no"
+hostonly_cmdline="no"
--- /dev/null
+add_dracutmodules+=" test "
+# do not compress, do not strip
+compress="cat"
+do_strip="no"
+do_hardlink="no"
+early_microcode="no"
+hostonly_cmdline="no"
fi
# pick up configuration from /tmp/dracut.conf.d when running the tests
- TEST_DRACUT_ARGS+=" --local --confdir /tmp/dracut.conf.d --no-early-microcode --add test --force --kver $KVERSION"
+ TEST_DRACUT_ARGS+=" --local --confdir /tmp/dracut.conf.d --add-confdir test --no-early-microcode --force --kver $KVERSION"
# include $TESTDIR"/overlay if exists
if [ -d "$TESTDIR"/overlay ]; then