]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test: remove dracut-lib.sh dependency from real rootfs
authorJo Zzsi <jozzsicsataban@gmail.com>
Tue, 10 Sep 2024 02:42:07 +0000 (22:42 -0400)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Thu, 19 Sep 2024 18:46:14 +0000 (14:46 -0400)
modules.d/80test-root/test-init.sh
test/TEST-20-NFS/client-init.sh
test/TEST-30-ISCSI/client-init.sh
test/TEST-30-ISCSI/test.sh
test/TEST-35-ISCSI-MULTI/client-init.sh
test/TEST-35-ISCSI-MULTI/test.sh
test/TEST-40-NBD/client-init.sh
test/TEST-40-NBD/test.sh
test/TEST-50-MULTINIC/client-init.sh
test/TEST-50-MULTINIC/test.sh

index 49116fa867461a5f7b185e40675e58cba6542b55..c7ab6f63af1a4fc1451f2c7f172c407f38c5ea73 100755 (executable)
@@ -27,20 +27,6 @@ else
     echo "All OK"
 fi
 
-export TERM=linux
-export PS1='initramfs-test:\w\$ '
-stty sane
 echo "made it to the rootfs!"
-
-. /lib/dracut-lib.sh
-
-if getargbool 0 rd.shell; then
-    strstr "$(setsid --help)" "control" && CTTY="-c"
-    setsid ${CTTY:+"${CTTY}"} sh -i
-fi
-
 echo "Powering down."
-if [ -d /run/initramfs/etc ]; then
-    echo " rd.debug=0 " >> /run/initramfs/etc/cmdline
-fi
 poweroff -f
index f50d0e2db60974aa5638e891c41241f2c3f4d6af..988890ca683fd357b168cad9d24f74eef8a6efd4 100755 (executable)
@@ -7,15 +7,6 @@ export PATH=/usr/sbin:/usr/bin:/sbin:/bin
 command -v plymouth > /dev/null 2>&1 && plymouth --quit
 exec > /dev/console 2>&1
 
-export TERM=linux
-export PS1='initramfs-test:\w\$ '
-stty sane
-if getargbool 0 rd.shell; then
-    [ -c /dev/watchdog ] && printf 'V' > /dev/watchdog
-    strstr "$(setsid --help)" "control" && CTTY="-c"
-    setsid ${CTTY:+"${CTTY}"} sh -i
-fi
-
 echo "made it to the rootfs! Powering down."
 
 while read -r dev _ fstype opts rest || [ -n "$dev" ]; do
index ab70d17d8b9c069a8f7ef3c3195147135fbbbf9b..1062323b11e9360e28590605651b0464a1a8bd54 100755 (executable)
@@ -1,13 +1,9 @@
 #!/bin/sh
-. /lib/dracut-lib.sh
 
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
 command -v plymouth > /dev/null 2>&1 && plymouth --quit
 exec > /dev/console 2>&1
 
-export TERM=linux
-export PS1='initramfs-test:\w\$ '
-stty sane
 echo "made it to the rootfs! Powering down."
 while read -r dev _ fstype opts rest || [ -n "$dev" ]; do
     [ "$fstype" != "ext4" ] && continue
@@ -15,10 +11,5 @@ while read -r dev _ fstype opts rest || [ -n "$dev" ]; do
     break
 done < /proc/mounts
 
-if getargbool 0 rd.shell; then
-    strstr "$(setsid --help)" "control" && CTTY="-c"
-    setsid ${CTTY:+"${CTTY}"} sh -i
-fi
-
 sync
 poweroff -f
index 675c12f1599cc12141d8ddd48d4a3c7b8830ba43..72c2241fd08aa12549620f33935edfc1ae3720ba 100755 (executable)
@@ -137,8 +137,6 @@ test_setup() {
     "$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
         -m "test-root" \
         -I "ip grep setsid" \
-        -i "${PKGLIBDIR}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-        -i "${PKGLIBDIR}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
         -f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
     mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
 
@@ -175,8 +173,6 @@ test_setup() {
     "$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
         -m "test-root network-legacy" \
         -d "iscsi_tcp crc32c ipv6" \
-        -i "${PKGLIBDIR}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-        -i "${PKGLIBDIR}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
         -I "modprobe chmod ip tcpdump 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" \
         -i "./dhcpd.conf" "/etc/dhcpd.conf" \
index ab70d17d8b9c069a8f7ef3c3195147135fbbbf9b..1062323b11e9360e28590605651b0464a1a8bd54 100755 (executable)
@@ -1,13 +1,9 @@
 #!/bin/sh
-. /lib/dracut-lib.sh
 
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
 command -v plymouth > /dev/null 2>&1 && plymouth --quit
 exec > /dev/console 2>&1
 
-export TERM=linux
-export PS1='initramfs-test:\w\$ '
-stty sane
 echo "made it to the rootfs! Powering down."
 while read -r dev _ fstype opts rest || [ -n "$dev" ]; do
     [ "$fstype" != "ext4" ] && continue
@@ -15,10 +11,5 @@ while read -r dev _ fstype opts rest || [ -n "$dev" ]; do
     break
 done < /proc/mounts
 
-if getargbool 0 rd.shell; then
-    strstr "$(setsid --help)" "control" && CTTY="-c"
-    setsid ${CTTY:+"${CTTY}"} sh -i
-fi
-
 sync
 poweroff -f
index 1b00b9aea7f7069f29feaf06f0272285c33ded4b..eae8478d897dec736a5f2738318adec9f975e69c 100755 (executable)
@@ -150,8 +150,6 @@ test_setup() {
     "$DRACUT" -l --keep --tmpdir "$TESTDIR" \
         -m "test-root" \
         -I "ip grep setsid" \
-        -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-        -i "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
         --no-hostonly --no-hostonly-cmdline --nohardlink \
         -f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
     mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
@@ -190,8 +188,6 @@ test_setup() {
         -m "test-root network-legacy iscsi" \
         -d "iscsi_tcp crc32c ipv6 af_packet" \
         -I "ip grep sleep setsid chmod modprobe pidof tgtd tgtadm" \
-        -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-        -i "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
         --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 \
         -i "./dhcpd.conf" "/etc/dhcpd.conf" \
index b8637f00df2867be543b4d1043d9f191076c5954..b86dd94c0736f1fd2f9b81c164979c2fd80750a5 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/sh
 : > /dev/watchdog
-. /lib/dracut-lib.sh
 
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
 command -v plymouth > /dev/null 2>&1 && plymouth --quit
@@ -13,16 +12,8 @@ while read -r dev fs fstype opts rest || [ -n "$dev" ]; do
     echo "nbd-OK $fstype $opts"
     break
 done < /proc/mounts
-export TERM=linux
-export PS1='nbdclient-test:\w\$ '
-stty sane
 echo "made it to the rootfs! Powering down."
 
-if getargbool 0 rd.shell; then
-    strstr "$(setsid --help)" "control" && CTTY="-c"
-    setsid ${CTTY:+"${CTTY}"} sh -i
-fi
-
 mount -n -o remount,ro /
 
 sync
index 9fceab59939dd466aa7299dd1b37600ad34fa928..4a168a51dcad5337d936ec64e85f57eba741b9cb 100755 (executable)
@@ -192,8 +192,6 @@ make_encrypted_root() {
     "$DRACUT" -l --keep --tmpdir "$TESTDIR" \
         -m "test-root" \
         -I "ip grep" \
-        -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-        -i "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
         --no-hostonly --no-hostonly-cmdline --nohardlink \
         -f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
     mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
@@ -230,8 +228,6 @@ make_client_root() {
     "$DRACUT" -l --keep --tmpdir "$TESTDIR" \
         -m "test-root" \
         -I "ip" \
-        -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-        -i "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
         --no-hostonly --no-hostonly-cmdline --nohardlink \
         -f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
     mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
@@ -280,8 +276,6 @@ EOF
     "$DRACUT" -l --keep --tmpdir "$TESTDIR" \
         -m "test-root network-legacy" \
         -I "ip grep sleep nbd-server chmod modprobe vi pidof" \
-        -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-        -i "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
         --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 \
         -i "./dhcpd.conf" "/etc/dhcpd.conf" \
index 09db5b3851c17b925e188211424d99f469099a87..2ef664eae2c532439ec52f9ac7f93e43347d9b2d 100755 (executable)
@@ -1,13 +1,9 @@
 #!/bin/sh
-. /lib/dracut-lib.sh
 
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
 command -v plymouth > /dev/null 2>&1 && plymouth --quit
 exec > /dev/console 2>&1
 
-export TERM=linux
-export PS1='initramfs-test:\w\$ '
-stty sane
 echo "made it to the rootfs! Powering down."
 
 set -x
@@ -34,7 +30,5 @@ done
     echo "$IFACES"
 } | dd oflag=direct,dsync of=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_marker status=none
 
-getargbool 0 rd.shell && sh -i
-
 sync
 poweroff -f
index 0ac65da7256e42e128e33cc76d86d37aa32d3a2f..940a2cafd9f9fafd608c901b39d411b63fce8dfc 100755 (executable)
@@ -257,12 +257,6 @@ test_setup() {
             fi
         done
 
-        inst_simple "${PKGLIBDIR}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
-        inst_simple "${PKGLIBDIR}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
-        inst_binary "${PKGLIBDIR}/dracut-util" "/usr/bin/dracut-util"
-        ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
-        ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
-
         inst ./client-init.sh /sbin/init
         inst_simple /etc/os-release
         inst_multiple -o {,/usr}/etc/nsswitch.conf