Blame SOURCES/0258-splitup-dracut-init.sh-from-dracut-functions.sh.patch

64b87c
From 1211a10b959fea039f4c8718c3901ad63e4816d3 Mon Sep 17 00:00:00 2001
64b87c
From: Harald Hoyer <harald@redhat.com>
64b87c
Date: Thu, 2 Jul 2015 15:40:13 +0200
64b87c
Subject: [PATCH] splitup dracut-init.sh from dracut-functions.sh
64b87c
64b87c
other tools want to source dracut-functions.sh without any mkdir side
64b87c
effects.
64b87c
64b87c
(cherry picked from commit 777f2db0373ccbc1a44fc2d960ecefbe50195055)
64b87c
---
64b87c
 Makefile                          |  1 +
64b87c
 dracut-functions.sh               |  9 ++-------
64b87c
 dracut-init.sh                    | 34 ++++++++++++++++++++++++++++++++++
64b87c
 dracut.sh                         |  8 ++++----
64b87c
 dracut.spec                       |  1 +
64b87c
 test/TEST-01-BASIC/test.sh        |  6 +++---
64b87c
 test/TEST-02-SYSTEMD/test.sh      |  6 +++---
64b87c
 test/TEST-03-USR-MOUNT/test.sh    |  6 +++---
64b87c
 test/TEST-04-FULL-SYSTEMD/test.sh |  6 +++---
64b87c
 test/TEST-10-RAID/test.sh         |  6 +++---
64b87c
 test/TEST-11-LVM/test.sh          |  6 +++---
64b87c
 test/TEST-12-RAID-DEG/test.sh     |  6 +++---
64b87c
 test/TEST-13-ENC-RAID-LVM/test.sh |  6 +++---
64b87c
 test/TEST-14-IMSM/test.sh         |  6 +++---
64b87c
 test/TEST-15-BTRFSRAID/test.sh    |  6 +++---
64b87c
 test/TEST-16-DMSQUASH/test.sh     |  4 ++--
64b87c
 test/TEST-17-LVM-THIN/test.sh     |  6 +++---
64b87c
 test/TEST-20-NFS/test.sh          |  6 +++---
64b87c
 test/TEST-30-ISCSI/test.sh        |  8 ++++----
64b87c
 test/TEST-40-NBD/test.sh          | 10 +++++-----
64b87c
 test/TEST-50-MULTINIC/test.sh     |  6 +++---
64b87c
 21 files changed, 92 insertions(+), 61 deletions(-)
64b87c
 create mode 100644 dracut-init.sh
64b87c
64b87c
diff --git a/Makefile b/Makefile
64b87c
index 5441d8f..18f5a88 100644
64b87c
--- a/Makefile
64b87c
+++ b/Makefile
64b87c
@@ -106,6 +106,7 @@ install: dracut-version.sh
64b87c
 	install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
64b87c
 	mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
64b87c
 	mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
64b87c
+	install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh
64b87c
 	install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
64b87c
 	install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
64b87c
 	ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
64b87c
diff --git a/dracut-functions.sh b/dracut-functions.sh
64b87c
index 4ea3204..31586ca 100755
64b87c
--- a/dracut-functions.sh
64b87c
+++ b/dracut-functions.sh
64b87c
@@ -22,14 +22,9 @@
64b87c
 export LC_MESSAGES=C
64b87c
 
64b87c
 if [[ $DRACUT_KERNEL_LAZY ]] && ! [[ $DRACUT_KERNEL_LAZY_HASHDIR ]]; then
64b87c
-    if ! [[ -d "$initdir/.kernelmodseen" ]]; then
64b87c
-        mkdir -p "$initdir/.kernelmodseen"
64b87c
+    if [[ -d "$initdir/.kernelmodseen" ]]; then
64b87c
+        DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen"
64b87c
     fi
64b87c
-    DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen"
64b87c
-fi
64b87c
-
64b87c
-if [[ $initdir ]] && ! [[ -d $initdir ]]; then
64b87c
-    mkdir -p "$initdir"
64b87c
 fi
64b87c
 
64b87c
 # Generic substring function.  If $2 is in $1, return 0.
64b87c
diff --git a/dracut-init.sh b/dracut-init.sh
64b87c
new file mode 100644
64b87c
index 0000000..469e42a
64b87c
--- /dev/null
64b87c
+++ b/dracut-init.sh
64b87c
@@ -0,0 +1,34 @@
64b87c
+#!/bin/bash
64b87c
+#
64b87c
+# functions used by dracut and other tools.
64b87c
+#
64b87c
+# Copyright 2005-2009 Red Hat, Inc.  All rights reserved.
64b87c
+#
64b87c
+# This program is free software; you can redistribute it and/or modify
64b87c
+# it under the terms of the GNU General Public License as published by
64b87c
+# the Free Software Foundation; either version 2 of the License, or
64b87c
+# (at your option) any later version.
64b87c
+#
64b87c
+# This program is distributed in the hope that it will be useful,
64b87c
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
64b87c
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
64b87c
+# GNU General Public License for more details.
64b87c
+#
64b87c
+# You should have received a copy of the GNU General Public License
64b87c
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
64b87c
+#
64b87c
+export LC_MESSAGES=C
64b87c
+
64b87c
+if [[ $DRACUT_KERNEL_LAZY ]] && ! [[ $DRACUT_KERNEL_LAZY_HASHDIR ]]; then
64b87c
+    if ! [[ -d "$initdir/.kernelmodseen" ]]; then
64b87c
+        mkdir -p "$initdir/.kernelmodseen"
64b87c
+    fi
64b87c
+    DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen"
64b87c
+fi
64b87c
+
64b87c
+if [[ $initdir ]] && ! [[ -d $initdir ]]; then
64b87c
+    mkdir -p "$initdir"
64b87c
+fi
64b87c
+
64b87c
+[[ $dracutbasedir ]] || export dracutbasedir=${BASH_SOURCE%/*}
64b87c
+. $dracutbasedir/dracut-functions.sh
64b87c
diff --git a/dracut.sh b/dracut.sh
64b87c
index cc22a14..a214f81 100755
64b87c
--- a/dracut.sh
64b87c
+++ b/dracut.sh
64b87c
@@ -519,7 +519,7 @@ while :; do
64b87c
         -q|--quiet)    ((verbosity_mod_l--));;
64b87c
         -l|--local)
64b87c
                        allowlocal="yes"
64b87c
-                       [[ -f "$(readlink -f "${0%/*}")/dracut-functions.sh" ]] \
64b87c
+                       [[ -f "$(readlink -f "${0%/*}")/dracut-init.sh" ]] \
64b87c
                            && dracutbasedir="$(readlink -f "${0%/*}")"
64b87c
                        ;;
64b87c
         -H|--hostonly|--host-only)
64b87c
@@ -841,10 +841,10 @@ if [[ $print_cmdline ]]; then
64b87c
     kmsgloglvl=0
64b87c
 fi
64b87c
 
64b87c
-if [[ -f $dracutbasedir/dracut-functions.sh ]]; then
64b87c
-    . $dracutbasedir/dracut-functions.sh
64b87c
+if [[ -f $dracutbasedir/dracut-init.sh ]]; then
64b87c
+    . $dracutbasedir/dracut-init.sh
64b87c
 else
64b87c
-    printf "%s\n" "dracut: Cannot find $dracutbasedir/dracut-functions.sh." >&2
64b87c
+    printf "%s\n" "dracut: Cannot find $dracutbasedir/dracut-init.sh." >&2
64b87c
     printf "%s\n" "dracut: Are you running from a git checkout?" >&2
64b87c
     printf "%s\n" "dracut: Try passing -l as an argument to $0" >&2
64b87c
     exit 1
64b87c
diff --git a/dracut.spec b/dracut.spec
64b87c
index 302cfc5..d22f586 100644
64b87c
--- a/dracut.spec
64b87c
+++ b/dracut.spec
64b87c
@@ -296,6 +296,7 @@ rm -rf -- $RPM_BUILD_ROOT
64b87c
 %endif
64b87c
 %dir %{dracutlibdir}
64b87c
 %dir %{dracutlibdir}/modules.d
64b87c
+%{dracutlibdir}/dracut-init.sh
64b87c
 %{dracutlibdir}/dracut-functions.sh
64b87c
 %{dracutlibdir}/dracut-functions
64b87c
 %{dracutlibdir}/dracut-version.sh
64b87c
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
64b87c
index 02ebc23..642b250 100755
64b87c
--- a/test/TEST-01-BASIC/test.sh
64b87c
+++ b/test/TEST-01-BASIC/test.sh
64b87c
@@ -29,7 +29,7 @@ test_setup() {
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
 	mkdir -p $initdir
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient \
64b87c
 	    umount strace less setsid
64b87c
@@ -51,7 +51,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mkfs.ext3 poweroff cp umount sync
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -80,7 +80,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh
64b87c
index 2a8ed6b..4ebff83 100755
64b87c
--- a/test/TEST-02-SYSTEMD/test.sh
64b87c
+++ b/test/TEST-02-SYSTEMD/test.sh
64b87c
@@ -25,7 +25,7 @@ test_setup() {
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
 	mkdir -p $initdir
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient \
64b87c
 	    umount strace less setsid
64b87c
@@ -47,7 +47,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mkfs.ext3 poweroff cp umount
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -76,7 +76,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh
64b87c
index b8231fe..e772352 100755
64b87c
--- a/test/TEST-03-USR-MOUNT/test.sh
64b87c
+++ b/test/TEST-03-USR-MOUNT/test.sh
64b87c
@@ -55,7 +55,7 @@ test_setup() {
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
 	mkdir -p $initdir
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient \
64b87c
 	    umount strace less setsid
64b87c
@@ -78,7 +78,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -114,7 +114,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
64b87c
index aa83122..3834238 100755
64b87c
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
64b87c
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
64b87c
@@ -57,7 +57,7 @@ test_setup() {
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
 	mkdir -p $initdir
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 
64b87c
         for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run; do
64b87c
             if [ -L "/$d" ]; then
64b87c
@@ -221,7 +221,7 @@ EOF
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -256,7 +256,7 @@ EOF
64b87c
 
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
64b87c
index d79d5cd..cf474df 100755
64b87c
--- a/test/TEST-10-RAID/test.sh
64b87c
+++ b/test/TEST-10-RAID/test.sh
64b87c
@@ -28,7 +28,7 @@ test_setup() {
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
 	(mkdir -p "$initdir"; cd "$initdir"; mkdir -p dev sys proc etc var/run tmp run)
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -49,7 +49,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mke2fs poweroff cp umount
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -77,7 +77,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst ./cryptroot-ask.sh /sbin/cryptroot-ask
64b87c
diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh
64b87c
index 732d0c8..c3c27bc 100755
64b87c
--- a/test/TEST-11-LVM/test.sh
64b87c
+++ b/test/TEST-11-LVM/test.sh
64b87c
@@ -24,7 +24,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -46,7 +46,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mke2fs poweroff cp umount
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -69,7 +69,7 @@ test_setup() {
64b87c
     grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh
64b87c
index 87fe542..11f66b2 100755
64b87c
--- a/test/TEST-12-RAID-DEG/test.sh
64b87c
+++ b/test/TEST-12-RAID-DEG/test.sh
64b87c
@@ -66,7 +66,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -87,7 +87,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mke2fs poweroff cp umount dd grep
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -120,7 +120,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh
64b87c
index 129620b..993f71d 100755
64b87c
--- a/test/TEST-13-ENC-RAID-LVM/test.sh
64b87c
+++ b/test/TEST-13-ENC-RAID-LVM/test.sh
64b87c
@@ -62,7 +62,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -83,7 +83,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mke2fs poweroff cp umount grep
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -113,7 +113,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh
64b87c
index ad0cf7b..9465965 100755
64b87c
--- a/test/TEST-14-IMSM/test.sh
64b87c
+++ b/test/TEST-14-IMSM/test.sh
64b87c
@@ -54,7 +54,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -76,7 +76,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mke2fs poweroff cp umount grep
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
@@ -104,7 +104,7 @@ test_setup() {
64b87c
     echo $MD_UUID > $TESTDIR/mduuid
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh
64b87c
index 71f5703..9b97136 100755
64b87c
--- a/test/TEST-15-BTRFSRAID/test.sh
64b87c
+++ b/test/TEST-15-BTRFSRAID/test.sh
64b87c
@@ -26,7 +26,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -47,7 +47,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mkfs.btrfs poweroff cp umount
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -77,7 +77,7 @@ test_setup() {
64b87c
 
64b87c
    (
64b87c
         export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
64b87c
index 252e845..c08a2a4 100755
64b87c
--- a/test/TEST-16-DMSQUASH/test.sh
64b87c
+++ b/test/TEST-16-DMSQUASH/test.sh
64b87c
@@ -30,7 +30,7 @@ test_setup() {
64b87c
     mkdir -p -- "$TESTDIR"/overlay
64b87c
     (
64b87c
 	export initdir="$TESTDIR"/overlay
64b87c
-	. "$basedir"/dracut-functions.sh
64b87c
+	. "$basedir"/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
@@ -48,7 +48,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
 	export initdir="$TESTDIR"/root-source
64b87c
-	. "$basedir"/dracut-functions.sh
64b87c
+	. "$basedir"/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient \
64b87c
 	    umount strace less
64b87c
diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh
64b87c
index 4c904b0..79e224e 100755
64b87c
--- a/test/TEST-17-LVM-THIN/test.sh
64b87c
+++ b/test/TEST-17-LVM-THIN/test.sh
64b87c
@@ -24,7 +24,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay/source
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip route \
64b87c
 	    mount dmesg ifconfig dhclient mkdir cp ping dhclient
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -46,7 +46,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple sfdisk mke2fs poweroff cp umount
64b87c
 	inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -69,7 +69,7 @@ test_setup() {
64b87c
     grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
64b87c
     (
64b87c
 	export initdir=$TESTDIR/overlay
64b87c
-	. $basedir/dracut-functions.sh
64b87c
+	. $basedir/dracut-init.sh
64b87c
 	inst_multiple poweroff shutdown
64b87c
 	inst_hook emergency 000 ./hard-off.sh
64b87c
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
64b87c
index 7b5e3c5..14350e9 100755
64b87c
--- a/test/TEST-20-NFS/test.sh
64b87c
+++ b/test/TEST-20-NFS/test.sh
64b87c
@@ -221,7 +221,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
         export initdir=$TESTDIR/mnt
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
 
64b87c
         for _f in modules.builtin.bin modules.builtin; do
64b87c
             [[ $srcmods/$_f ]] && break
64b87c
@@ -287,7 +287,7 @@ test_setup() {
64b87c
     # Make client root inside server root
64b87c
     (
64b87c
         export initdir=$TESTDIR/mnt/nfs/client
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
 
64b87c
         inst_multiple sh shutdown poweroff stty cat ps ln ip \
64b87c
             mount dmesg mkdir cp ping grep
64b87c
@@ -331,7 +331,7 @@ test_setup() {
64b87c
     # Make an overlay with needed tools for the test harness
64b87c
     (
64b87c
         export initdir=$TESTDIR/overlay
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         mkdir $TESTDIR/overlay
64b87c
         inst_multiple poweroff shutdown
64b87c
         inst_hook emergency 000 ./hard-off.sh
64b87c
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
64b87c
index f597783..a258c04 100755
64b87c
--- a/test/TEST-30-ISCSI/test.sh
64b87c
+++ b/test/TEST-30-ISCSI/test.sh
64b87c
@@ -104,7 +104,7 @@ test_setup() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
         export initdir=$TESTDIR/overlay/source
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         inst_multiple sh shutdown poweroff stty cat ps ln ip \
64b87c
             mount dmesg mkdir cp ping grep
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -121,7 +121,7 @@ test_setup() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
         export initdir=$TESTDIR/overlay
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         inst_multiple sfdisk mkfs.ext3 poweroff cp umount
64b87c
         inst_hook initqueue 01 ./create-root.sh
64b87c
         inst_hook initqueue/finished 01 ./finished-false.sh
64b87c
@@ -157,7 +157,7 @@ test_setup() {
64b87c
     rm -- $TESTDIR/client.img
64b87c
     (
64b87c
         export initdir=$TESTDIR/overlay
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         inst_multiple poweroff shutdown
64b87c
         inst_hook emergency 000 ./hard-off.sh
64b87c
         inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
@@ -177,7 +177,7 @@ test_setup() {
64b87c
     kernel=$KVERSION
64b87c
     (
64b87c
         export initdir=$TESTDIR/mnt
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         (
64b87c
             cd "$initdir";
64b87c
             mkdir -p dev sys proc etc var/run tmp var/lib/dhcpd /etc/iscsi
64b87c
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
64b87c
index 59494ed..abf1a4f 100755
64b87c
--- a/test/TEST-40-NBD/test.sh
64b87c
+++ b/test/TEST-40-NBD/test.sh
64b87c
@@ -195,7 +195,7 @@ make_encrypted_root() {
64b87c
     # Create what will eventually be our root filesystem onto an overlay
64b87c
     (
64b87c
         export initdir=$TESTDIR/overlay/source
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         mkdir -p "$initdir"
64b87c
         (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
64b87c
         inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
64b87c
@@ -214,7 +214,7 @@ make_encrypted_root() {
64b87c
     # second, install the files needed to make the root filesystem
64b87c
     (
64b87c
         export initdir=$TESTDIR/overlay
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         inst_multiple mke2fs poweroff cp umount tune2fs
64b87c
         inst_hook emergency 000 ./hard-off.sh
64b87c
         inst_hook initqueue 01 ./create-root.sh
64b87c
@@ -253,7 +253,7 @@ make_client_root() {
64b87c
     kernel=$KVERSION
64b87c
     (
64b87c
         export initdir=$TESTDIR/mnt
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         mkdir -p "$initdir"
64b87c
         (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
64b87c
         inst_multiple sh ls shutdown poweroff stty cat ps ln ip \
64b87c
@@ -288,7 +288,7 @@ make_server_root() {
64b87c
     kernel=$KVERSION
64b87c
     (
64b87c
         export initdir=$TESTDIR/mnt
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         mkdir -p "$initdir"
64b87c
         (
64b87c
             cd "$initdir";
64b87c
@@ -335,7 +335,7 @@ test_setup() {
64b87c
     # Make the test image
64b87c
     (
64b87c
         export initdir=$TESTDIR/overlay
64b87c
-        . $basedir/dracut-functions.sh
64b87c
+        . $basedir/dracut-init.sh
64b87c
         inst_multiple poweroff shutdown
64b87c
         inst_hook emergency 000 ./hard-off.sh
64b87c
         inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
64b87c
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
64b87c
index 3c6003b..4f73203 100755
64b87c
--- a/test/TEST-50-MULTINIC/test.sh
64b87c
+++ b/test/TEST-50-MULTINIC/test.sh
64b87c
@@ -150,7 +150,7 @@ test_setup() {
64b87c
 
64b87c
     (
64b87c
         export initdir="$TESTDIR"/mnt
64b87c
-        . "$basedir"/dracut-functions.sh
64b87c
+        . "$basedir"/dracut-init.sh
64b87c
 
64b87c
         (
64b87c
             cd "$initdir";
64b87c
@@ -216,7 +216,7 @@ test_setup() {
64b87c
     # Make client root inside server root
64b87c
     (
64b87c
         export initdir="$TESTDIR"/mnt/nfs/client
64b87c
-        . "$basedir"/dracut-functions.sh
64b87c
+        . "$basedir"/dracut-init.sh
64b87c
         inst_multiple sh shutdown poweroff stty cat ps ln ip \
64b87c
             mount dmesg mkdir cp ping grep ls
64b87c
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
64b87c
@@ -256,7 +256,7 @@ test_setup() {
64b87c
     # Make an overlay with needed tools for the test harness
64b87c
     (
64b87c
         export initdir="$TESTDIR"/overlay
64b87c
-        . "$basedir"/dracut-functions.sh
64b87c
+        . "$basedir"/dracut-init.sh
64b87c
         inst_multiple poweroff shutdown
64b87c
         inst_hook emergency 000 ./hard-off.sh
64b87c
         inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules