dracut - 055-1
- version 055 - install the missing fsck utils
This commit is contained in:
parent
9f8738445a
commit
bf5f951f08
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,3 +38,4 @@
|
|||||||
/dracut-051.tar.xz
|
/dracut-051.tar.xz
|
||||||
/dracut-053.tar.xz
|
/dracut-053.tar.xz
|
||||||
/dracut-054.tar.xz
|
/dracut-054.tar.xz
|
||||||
|
/dracut-055.tar.xz
|
||||||
|
23
0001.patch
23
0001.patch
@ -1,23 +0,0 @@
|
|||||||
From f634448b293ed232009b25c824f6dcd66961426f Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
|
|
||||||
Date: Fri, 14 May 2021 13:46:23 +0000
|
|
||||||
Subject: [PATCH] fix(packit): downstream has renamed the master branch to main
|
|
||||||
|
|
||||||
---
|
|
||||||
.packit.yml | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/.packit.yml b/.packit.yml
|
|
||||||
index 8a995efe..482b4c4d 100644
|
|
||||||
--- a/.packit.yml
|
|
||||||
+++ b/.packit.yml
|
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|
||||||
- job: propose_downstream
|
|
||||||
trigger: release
|
|
||||||
metadata:
|
|
||||||
- dist_git_branches: master
|
|
||||||
+ dist_git_branches: main
|
|
||||||
|
|
||||||
- job: tests
|
|
||||||
trigger: pull_request
|
|
||||||
|
|
24
0002.patch
24
0002.patch
@ -1,24 +0,0 @@
|
|||||||
From b9b6f0ee5b859a562e46a8c4e0dee0261fabf74d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Lars Wendler <polynomial-c@gentoo.org>
|
|
||||||
Date: Fri, 14 May 2021 16:00:27 +0200
|
|
||||||
Subject: [PATCH] fix(dracut-util): print error message with trailing newline
|
|
||||||
|
|
||||||
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
|
|
||||||
---
|
|
||||||
src/util/util.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/util/util.c b/src/util/util.c
|
|
||||||
index 8ae06d6c..b3498df6 100644
|
|
||||||
--- a/src/util/util.c
|
|
||||||
+++ b/src/util/util.c
|
|
||||||
@@ -123,7 +123,7 @@ static void usage(enum EXEC_MODE enumExecMode, int ret, char *msg)
|
|
||||||
{
|
|
||||||
switch (enumExecMode) {
|
|
||||||
case UNDEFINED:
|
|
||||||
- fprintf(stderr, "ERROR: 'dracut-util' has to be called via a symlink to the tool name.");
|
|
||||||
+ fprintf(stderr, "ERROR: 'dracut-util' has to be called via a symlink to the tool name.\n");
|
|
||||||
break;
|
|
||||||
case GETARG:
|
|
||||||
fprintf(stderr, "ERROR: %s\nUsage: dracut-getarg <KEY>[=[<VALUE>]]\n", msg);
|
|
||||||
|
|
555
0003.patch
555
0003.patch
@ -1,555 +0,0 @@
|
|||||||
From c08bc8109d4c43beacfa4bcdc20a356102da6d02 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Harald Hoyer <harald@redhat.com>
|
|
||||||
Date: Mon, 17 May 2021 11:00:22 +0200
|
|
||||||
Subject: [PATCH] fix(base): split out `dracut-dev-lib.sh`
|
|
||||||
|
|
||||||
To share the `wait_for_dev` function and use it without side effects on
|
|
||||||
install time, split out the needed functions in an extra library.
|
|
||||||
---
|
|
||||||
modules.d/99base/dracut-dev-lib.sh | 119 +++++++++++++++++++++++++++++++++++++
|
|
||||||
modules.d/99base/dracut-lib.sh | 115 +----------------------------------
|
|
||||||
modules.d/99base/module-setup.sh | 9 ++-
|
|
||||||
test/TEST-01-BASIC/test.sh | 1 +
|
|
||||||
test/TEST-02-SYSTEMD/test.sh | 1 +
|
|
||||||
test/TEST-03-USR-MOUNT/test.sh | 1 +
|
|
||||||
test/TEST-04-FULL-SYSTEMD/test.sh | 1 +
|
|
||||||
test/TEST-10-RAID/test.sh | 1 +
|
|
||||||
test/TEST-11-LVM/test.sh | 1 +
|
|
||||||
test/TEST-12-RAID-DEG/test.sh | 1 +
|
|
||||||
test/TEST-13-ENC-RAID-LVM/test.sh | 1 +
|
|
||||||
test/TEST-14-IMSM/test.sh | 1 +
|
|
||||||
test/TEST-15-BTRFSRAID/test.sh | 1 +
|
|
||||||
test/TEST-16-DMSQUASH/test.sh | 1 +
|
|
||||||
test/TEST-17-LVM-THIN/test.sh | 1 +
|
|
||||||
test/TEST-20-NFS/test.sh | 1 +
|
|
||||||
test/TEST-30-ISCSI/test.sh | 1 +
|
|
||||||
test/TEST-35-ISCSI-MULTI/test.sh | 1 +
|
|
||||||
test/TEST-40-NBD/test.sh | 2 +
|
|
||||||
test/TEST-50-MULTINIC/test.sh | 1 +
|
|
||||||
test/TEST-98-GETARG/test.sh | 2 +
|
|
||||||
21 files changed, 145 insertions(+), 118 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/modules.d/99base/dracut-dev-lib.sh b/modules.d/99base/dracut-dev-lib.sh
|
|
||||||
new file mode 100755
|
|
||||||
index 00000000..5083f4f2
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/modules.d/99base/dracut-dev-lib.sh
|
|
||||||
@@ -0,0 +1,119 @@
|
|
||||||
+#!/bin/sh
|
|
||||||
+
|
|
||||||
+# get a systemd-compatible unit name from a path
|
|
||||||
+# (mimicks unit_name_from_path_instance())
|
|
||||||
+dev_unit_name() {
|
|
||||||
+ local dev="$1"
|
|
||||||
+
|
|
||||||
+ if command -v systemd-escape > /dev/null; then
|
|
||||||
+ systemd-escape -p -- "$dev"
|
|
||||||
+ return $?
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ if [ "$dev" = "/" -o -z "$dev" ]; then
|
|
||||||
+ printf -- "-"
|
|
||||||
+ return 0
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ dev="${1%%/}"
|
|
||||||
+ dev="${dev##/}"
|
|
||||||
+ # shellcheck disable=SC1003
|
|
||||||
+ dev="$(str_replace "$dev" '\' '\x5c')"
|
|
||||||
+ dev="$(str_replace "$dev" '-' '\x2d')"
|
|
||||||
+ if [ "${dev##.}" != "$dev" ]; then
|
|
||||||
+ dev="\x2e${dev##.}"
|
|
||||||
+ fi
|
|
||||||
+ dev="$(str_replace "$dev" '/' '-')"
|
|
||||||
+
|
|
||||||
+ printf -- "%s" "$dev"
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+# set_systemd_timeout_for_dev [-n] <dev> [<timeout>]
|
|
||||||
+# Set 'rd.timeout' as the systemd timeout for <dev>
|
|
||||||
+set_systemd_timeout_for_dev() {
|
|
||||||
+ local _name
|
|
||||||
+ local _needreload
|
|
||||||
+ local _noreload
|
|
||||||
+ local _timeout
|
|
||||||
+
|
|
||||||
+ [ -z "$DRACUT_SYSTEMD" ] && return 0
|
|
||||||
+
|
|
||||||
+ if [ "$1" = "-n" ]; then
|
|
||||||
+ _noreload=1
|
|
||||||
+ shift
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ if [ -n "$2" ]; then
|
|
||||||
+ _timeout="$2"
|
|
||||||
+ else
|
|
||||||
+ _timeout=$(getarg rd.timeout)
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ _timeout=${_timeout:-0}
|
|
||||||
+
|
|
||||||
+ _name=$(dev_unit_name "$1")
|
|
||||||
+ if ! [ -L "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ]; then
|
|
||||||
+ [ -d "${PREFIX}"/etc/systemd/system/initrd.target.wants ] || mkdir -p "${PREFIX}"/etc/systemd/system/initrd.target.wants
|
|
||||||
+ ln -s ../"${_name}".device "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device"
|
|
||||||
+ type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_name}".device
|
|
||||||
+ _needreload=1
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ if ! [ -f "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ]; then
|
|
||||||
+ mkdir -p "${PREFIX}/etc/systemd/system/${_name}.device.d"
|
|
||||||
+ {
|
|
||||||
+ echo "[Unit]"
|
|
||||||
+ echo "JobTimeoutSec=$_timeout"
|
|
||||||
+ echo "JobRunningTimeoutSec=$_timeout"
|
|
||||||
+ } > "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf"
|
|
||||||
+ type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf
|
|
||||||
+ _needreload=1
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then
|
|
||||||
+ /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload
|
|
||||||
+ fi
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+# wait_for_dev <dev> [<timeout>]
|
|
||||||
+#
|
|
||||||
+# Installs a initqueue-finished script,
|
|
||||||
+# which will cause the main loop only to exit,
|
|
||||||
+# if the device <dev> is recognized by the system.
|
|
||||||
+wait_for_dev() {
|
|
||||||
+ local _name
|
|
||||||
+ local _noreload
|
|
||||||
+
|
|
||||||
+ if [ "$1" = "-n" ]; then
|
|
||||||
+ _noreload=-n
|
|
||||||
+ shift
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ _name="$(str_replace "$1" '/' '\x2f')"
|
|
||||||
+
|
|
||||||
+ type mark_hostonly > /dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh"
|
|
||||||
+
|
|
||||||
+ [ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
|
|
||||||
+
|
|
||||||
+ printf '[ -e "%s" ]\n' "$1" \
|
|
||||||
+ >> "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh"
|
|
||||||
+ {
|
|
||||||
+ printf '[ -e "%s" ] || ' "$1"
|
|
||||||
+ printf 'warn "\"%s\" does not exist"\n' "$1"
|
|
||||||
+ } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh"
|
|
||||||
+
|
|
||||||
+ set_systemd_timeout_for_dev $_noreload "$@"
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+cancel_wait_for_dev() {
|
|
||||||
+ local _name
|
|
||||||
+ _name="$(str_replace "$1" '/' '\x2f')"
|
|
||||||
+ rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh"
|
|
||||||
+ rm -f -- "$hookdir/emergency/80-${_name}.sh"
|
|
||||||
+ if [ -n "$DRACUT_SYSTEMD" ]; then
|
|
||||||
+ _name=$(dev_unit_name "$1")
|
|
||||||
+ rm -f -- "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device"
|
|
||||||
+ rm -f -- "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf"
|
|
||||||
+ /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload
|
|
||||||
+ fi
|
|
||||||
+}
|
|
||||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
|
|
||||||
index c35658fa..dc94e93f 100755
|
|
||||||
--- a/modules.d/99base/dracut-lib.sh
|
|
||||||
+++ b/modules.d/99base/dracut-lib.sh
|
|
||||||
@@ -1,5 +1,7 @@
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
+type wait_for_dev > /dev/null 2>&1 || . /lib/dracut-dev-lib.sh
|
|
||||||
+
|
|
||||||
export DRACUT_SYSTEMD
|
|
||||||
export NEWROOT
|
|
||||||
if [ -n "$NEWROOT" ]; then
|
|
||||||
@@ -838,119 +840,6 @@ wait_for_mount() {
|
|
||||||
} >> "$hookdir/emergency/90-${_name}.sh"
|
|
||||||
}
|
|
||||||
|
|
||||||
-# get a systemd-compatible unit name from a path
|
|
||||||
-# (mimicks unit_name_from_path_instance())
|
|
||||||
-dev_unit_name() {
|
|
||||||
- local dev="$1"
|
|
||||||
-
|
|
||||||
- if command -v systemd-escape > /dev/null; then
|
|
||||||
- systemd-escape -p -- "$dev"
|
|
||||||
- return
|
|
||||||
- fi
|
|
||||||
-
|
|
||||||
- if [ "$dev" = "/" -o -z "$dev" ]; then
|
|
||||||
- printf -- "-"
|
|
||||||
- exit 0
|
|
||||||
- fi
|
|
||||||
-
|
|
||||||
- dev="${1%%/}"
|
|
||||||
- dev="${dev##/}"
|
|
||||||
- # shellcheck disable=SC1003
|
|
||||||
- dev="$(str_replace "$dev" '\' '\x5c')"
|
|
||||||
- dev="$(str_replace "$dev" '-' '\x2d')"
|
|
||||||
- if [ "${dev##.}" != "$dev" ]; then
|
|
||||||
- dev="\x2e${dev##.}"
|
|
||||||
- fi
|
|
||||||
- dev="$(str_replace "$dev" '/' '-')"
|
|
||||||
-
|
|
||||||
- printf -- "%s" "$dev"
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-# set_systemd_timeout_for_dev <dev>
|
|
||||||
-# Set 'rd.timeout' as the systemd timeout for <dev>
|
|
||||||
-
|
|
||||||
-set_systemd_timeout_for_dev() {
|
|
||||||
- local _name
|
|
||||||
- local _needreload
|
|
||||||
- local _noreload
|
|
||||||
- local _timeout
|
|
||||||
-
|
|
||||||
- if [ "$1" = "-n" ]; then
|
|
||||||
- _noreload=1
|
|
||||||
- shift
|
|
||||||
- fi
|
|
||||||
-
|
|
||||||
- _timeout=$(getarg rd.timeout)
|
|
||||||
- _timeout=${_timeout:-0}
|
|
||||||
-
|
|
||||||
- if [ -n "$DRACUT_SYSTEMD" ]; then
|
|
||||||
- _name=$(dev_unit_name "$1")
|
|
||||||
- if ! [ -L "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ]; then
|
|
||||||
- [ -d "${PREFIX}"/etc/systemd/system/initrd.target.wants ] || mkdir -p "${PREFIX}"/etc/systemd/system/initrd.target.wants
|
|
||||||
- ln -s ../"${_name}".device "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device"
|
|
||||||
- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_name}".device
|
|
||||||
- _needreload=1
|
|
||||||
- fi
|
|
||||||
-
|
|
||||||
- if ! [ -f "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ]; then
|
|
||||||
- mkdir -p "${PREFIX}/etc/systemd/system/${_name}.device.d"
|
|
||||||
- {
|
|
||||||
- echo "[Unit]"
|
|
||||||
- echo "JobTimeoutSec=$_timeout"
|
|
||||||
- echo "JobRunningTimeoutSec=$_timeout"
|
|
||||||
- } > "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf"
|
|
||||||
- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf
|
|
||||||
- _needreload=1
|
|
||||||
- fi
|
|
||||||
-
|
|
||||||
- if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then
|
|
||||||
- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload
|
|
||||||
- fi
|
|
||||||
- fi
|
|
||||||
-}
|
|
||||||
-# wait_for_dev <dev>
|
|
||||||
-#
|
|
||||||
-# Installs a initqueue-finished script,
|
|
||||||
-# which will cause the main loop only to exit,
|
|
||||||
-# if the device <dev> is recognized by the system.
|
|
||||||
-wait_for_dev() {
|
|
||||||
- local _name
|
|
||||||
- local _noreload
|
|
||||||
-
|
|
||||||
- if [ "$1" = "-n" ]; then
|
|
||||||
- _noreload=-n
|
|
||||||
- shift
|
|
||||||
- fi
|
|
||||||
-
|
|
||||||
- _name="$(str_replace "$1" '/' '\x2f')"
|
|
||||||
-
|
|
||||||
- type mark_hostonly > /dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh"
|
|
||||||
-
|
|
||||||
- [ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
|
|
||||||
-
|
|
||||||
- printf '[ -e "%s" ]\n' "$1" \
|
|
||||||
- >> "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh"
|
|
||||||
- {
|
|
||||||
- printf '[ -e "%s" ] || ' "$1"
|
|
||||||
- printf 'warn "\"%s\" does not exist"\n' "$1"
|
|
||||||
- } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh"
|
|
||||||
-
|
|
||||||
- set_systemd_timeout_for_dev $_noreload "$1"
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-cancel_wait_for_dev() {
|
|
||||||
- local _name
|
|
||||||
- _name="$(str_replace "$1" '/' '\x2f')"
|
|
||||||
- rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh"
|
|
||||||
- rm -f -- "$hookdir/emergency/80-${_name}.sh"
|
|
||||||
- if [ -n "$DRACUT_SYSTEMD" ]; then
|
|
||||||
- _name=$(dev_unit_name "$1")
|
|
||||||
- rm -f -- "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device"
|
|
||||||
- rm -f -- "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf"
|
|
||||||
- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload
|
|
||||||
- fi
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
killproc() {
|
|
||||||
debug_off
|
|
||||||
local _exe
|
|
||||||
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
|
|
||||||
index a52c643e..7eb0a277 100755
|
|
||||||
--- a/modules.d/99base/module-setup.sh
|
|
||||||
+++ b/modules.d/99base/module-setup.sh
|
|
||||||
@@ -50,6 +50,7 @@ install() {
|
|
||||||
mkdir -p "${initdir}"/tmp
|
|
||||||
|
|
||||||
inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "$moddir/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
mkdir -p "${initdir}"/var
|
|
||||||
|
|
||||||
if ! dracut_module_included "systemd"; then
|
|
||||||
@@ -117,10 +118,8 @@ install() {
|
|
||||||
fi
|
|
||||||
export PREFIX="$initdir"
|
|
||||||
|
|
||||||
- # suppress getarg for `rd.memdebug`
|
|
||||||
- export DEBUG_MEM_LEVEL=0
|
|
||||||
- # shellcheck source=dracut-lib.sh
|
|
||||||
- . "$moddir/dracut-lib.sh"
|
|
||||||
+ # shellcheck source=dracut-dev-lib.sh
|
|
||||||
+ . "$moddir/dracut-dev-lib.sh"
|
|
||||||
|
|
||||||
for _dev in "${host_devs[@]}"; do
|
|
||||||
for _dev2 in "${root_devs[@]}"; do
|
|
||||||
@@ -137,7 +136,7 @@ install() {
|
|
||||||
_pdev=$(get_persistent_dev "$_dev")
|
|
||||||
|
|
||||||
case "$_pdev" in
|
|
||||||
- /dev/?*) wait_for_dev "$_pdev" ;;
|
|
||||||
+ /dev/?*) wait_for_dev "$_pdev" 0 ;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
|
|
||||||
index 7ac2a8b9..012f2e5a 100755
|
|
||||||
--- a/test/TEST-01-BASIC/test.sh
|
|
||||||
+++ b/test/TEST-01-BASIC/test.sh
|
|
||||||
@@ -49,6 +49,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh
|
|
||||||
index a8185b09..8b6b5930 100755
|
|
||||||
--- a/test/TEST-02-SYSTEMD/test.sh
|
|
||||||
+++ b/test/TEST-02-SYSTEMD/test.sh
|
|
||||||
@@ -48,6 +48,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh
|
|
||||||
index 13361173..3bb7fab7 100755
|
|
||||||
--- a/test/TEST-03-USR-MOUNT/test.sh
|
|
||||||
+++ b/test/TEST-03-USR-MOUNT/test.sh
|
|
||||||
@@ -69,6 +69,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
|
|
||||||
index 9b8fab24..38cb1464 100755
|
|
||||||
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
|
|
||||||
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
|
|
||||||
@@ -93,6 +93,7 @@ test_setup() {
|
|
||||||
inst_multiple -o {,/usr}/lib/systemd/system/"dracut*"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
|
|
||||||
index f03d2952..918d2a71 100755
|
|
||||||
--- a/test/TEST-10-RAID/test.sh
|
|
||||||
+++ b/test/TEST-10-RAID/test.sh
|
|
||||||
@@ -46,6 +46,7 @@ test_setup() {
|
|
||||||
inst_multiple -o ${_terminfodir}/l/linux
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh
|
|
||||||
index e44b21ff..12384c09 100755
|
|
||||||
--- a/test/TEST-11-LVM/test.sh
|
|
||||||
+++ b/test/TEST-11-LVM/test.sh
|
|
||||||
@@ -50,6 +50,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh
|
|
||||||
index 8d56f658..beb81381 100755
|
|
||||||
--- a/test/TEST-12-RAID-DEG/test.sh
|
|
||||||
+++ b/test/TEST-12-RAID-DEG/test.sh
|
|
||||||
@@ -80,6 +80,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh
|
|
||||||
index 2d76c982..968eafe7 100755
|
|
||||||
--- a/test/TEST-13-ENC-RAID-LVM/test.sh
|
|
||||||
+++ b/test/TEST-13-ENC-RAID-LVM/test.sh
|
|
||||||
@@ -78,6 +78,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh
|
|
||||||
index ab4f8119..78b087f5 100755
|
|
||||||
--- a/test/TEST-14-IMSM/test.sh
|
|
||||||
+++ b/test/TEST-14-IMSM/test.sh
|
|
||||||
@@ -75,6 +75,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh
|
|
||||||
index 75e97703..47edac81 100755
|
|
||||||
--- a/test/TEST-15-BTRFSRAID/test.sh
|
|
||||||
+++ b/test/TEST-15-BTRFSRAID/test.sh
|
|
||||||
@@ -53,6 +53,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
|
|
||||||
index 73c4c7f1..2a68f305 100755
|
|
||||||
--- a/test/TEST-16-DMSQUASH/test.sh
|
|
||||||
+++ b/test/TEST-16-DMSQUASH/test.sh
|
|
||||||
@@ -88,6 +88,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh
|
|
||||||
index 6f6886ec..7dbcca51 100755
|
|
||||||
--- a/test/TEST-17-LVM-THIN/test.sh
|
|
||||||
+++ b/test/TEST-17-LVM-THIN/test.sh
|
|
||||||
@@ -48,6 +48,7 @@ test_setup() {
|
|
||||||
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
|
|
||||||
index dc9fa0b0..0be60a80 100755
|
|
||||||
--- a/test/TEST-20-NFS/test.sh
|
|
||||||
+++ b/test/TEST-20-NFS/test.sh
|
|
||||||
@@ -320,6 +320,7 @@ test_setup() {
|
|
||||||
done
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
|
|
||||||
index e1d10265..5f0063f8 100755
|
|
||||||
--- a/test/TEST-30-ISCSI/test.sh
|
|
||||||
+++ b/test/TEST-30-ISCSI/test.sh
|
|
||||||
@@ -162,6 +162,7 @@ test_setup() {
|
|
||||||
inst_simple /etc/os-release
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh
|
|
||||||
index 09b939ab..628131e0 100755
|
|
||||||
--- a/test/TEST-35-ISCSI-MULTI/test.sh
|
|
||||||
+++ b/test/TEST-35-ISCSI-MULTI/test.sh
|
|
||||||
@@ -174,6 +174,7 @@ test_setup() {
|
|
||||||
inst_simple /etc/os-release
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
|
|
||||||
index df1bcb2f..178dff40 100755
|
|
||||||
--- a/test/TEST-40-NBD/test.sh
|
|
||||||
+++ b/test/TEST-40-NBD/test.sh
|
|
||||||
@@ -219,6 +219,7 @@ make_encrypted_root() {
|
|
||||||
inst_multiple -o ${_terminfodir}/l/linux
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
@@ -299,6 +300,7 @@ make_client_root() {
|
|
||||||
inst_multiple -o ${_terminfodir}/l/linux
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
|
|
||||||
index e96cef7c..81b1f685 100755
|
|
||||||
--- a/test/TEST-50-MULTINIC/test.sh
|
|
||||||
+++ b/test/TEST-50-MULTINIC/test.sh
|
|
||||||
@@ -270,6 +270,7 @@ test_setup() {
|
|
||||||
done
|
|
||||||
|
|
||||||
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
|
|
||||||
+ inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
|
|
||||||
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
|
|
||||||
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
|
|
||||||
diff --git a/test/TEST-98-GETARG/test.sh b/test/TEST-98-GETARG/test.sh
|
|
||||||
index 9a00470b..012396ba 100755
|
|
||||||
--- a/test/TEST-98-GETARG/test.sh
|
|
||||||
+++ b/test/TEST-98-GETARG/test.sh
|
|
||||||
@@ -15,6 +15,7 @@ test_setup() {
|
|
||||||
ln -sfnr "$basedir"/dracut-util "$TESTDIR"/dracut-getarg
|
|
||||||
ln -sfnr "$basedir"/dracut-util "$TESTDIR"/dracut-getargs
|
|
||||||
ln -sfnr "$basedir"/modules.d/99base/dracut-lib.sh "$TESTDIR"/dracut-lib.sh
|
|
||||||
+ ln -sfnr "$basedir"/modules.d/99base/dracut-dev-lib.sh "$TESTDIR"/dracut-dev-lib.sh
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -85,6 +86,7 @@ test_run() {
|
|
||||||
|
|
||||||
export PATH=".:$PATH"
|
|
||||||
|
|
||||||
+ . dracut-dev-lib.sh
|
|
||||||
. dracut-lib.sh
|
|
||||||
|
|
||||||
debug_off() {
|
|
||||||
|
|
39
0004.patch
39
0004.patch
@ -1,39 +0,0 @@
|
|||||||
From 7275c6f6a0f6808cd939ea5bdf1244c7bd13ba44 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Harald Hoyer <harald@redhat.com>
|
|
||||||
Date: Mon, 17 May 2021 14:22:10 +0200
|
|
||||||
Subject: [PATCH] feat(dracut.sh): detect running in a container
|
|
||||||
|
|
||||||
Don't try to `mknod` by setting DRACUT_NO_MKNOD.
|
|
||||||
Don't try to `cp` extended attributrs by setting DRACUT_NO_XATTR.
|
|
||||||
---
|
|
||||||
dracut.sh | 9 ++++++++-
|
|
||||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/dracut.sh b/dracut.sh
|
|
||||||
index bfb7a1ac..24e1c2e7 100755
|
|
||||||
--- a/dracut.sh
|
|
||||||
+++ b/dracut.sh
|
|
||||||
@@ -1171,6 +1171,13 @@ if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
|
||||||
. "$dracutbasedir"/dracut-version.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
+if systemd-detect-virt -c &> /dev/null; then
|
|
||||||
+ export DRACUT_NO_MKNOD=1 DRACUT_NO_XATTR=1
|
|
||||||
+ if [[ $hostonly ]]; then
|
|
||||||
+ printf "%s\n" "dracut: WARNING: running in hostonly mode in a container!!"
|
|
||||||
+ fi
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
if [[ -f $dracutbasedir/dracut-init.sh ]]; then
|
|
||||||
# shellcheck source=./dracut-init.sh
|
|
||||||
. "$dracutbasedir"/dracut-init.sh
|
|
||||||
@@ -1888,7 +1895,7 @@ if [[ $kernel_only != yes ]]; then
|
|
||||||
# shellcheck disable=SC2174
|
|
||||||
mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d"
|
|
||||||
done
|
|
||||||
- if [[ $EUID == "0" ]]; then
|
|
||||||
+ if [[ $EUID == "0" ]] && ! [[ $DRACUT_NO_MKNOD ]]; then
|
|
||||||
[[ -c ${initdir}/dev/null ]] || mknod "${initdir}"/dev/null c 1 3
|
|
||||||
[[ -c ${initdir}/dev/kmsg ]] || mknod "${initdir}"/dev/kmsg c 1 11
|
|
||||||
[[ -c ${initdir}/dev/console ]] || mknod "${initdir}"/dev/console c 5 1
|
|
||||||
|
|
58
0005.patch
58
0005.patch
@ -1,58 +0,0 @@
|
|||||||
From 148e420be5b5809aa8d5033f47477573bbbf3e60 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Harald Hoyer <harald@redhat.com>
|
|
||||||
Date: Tue, 18 May 2021 10:13:56 +0200
|
|
||||||
Subject: [PATCH] fix(base): add missing `str_replace` to `dracut-dev-lib.sh`
|
|
||||||
|
|
||||||
```
|
|
||||||
dracut-dev-lib.sh: line 92: str_replace: command not found
|
|
||||||
dracut-dev-lib.sh: line 98: /var/tmp/dracut.sabKZg/initramfs/initqueue/finished/devexists-.sh: No such file or directory
|
|
||||||
dracut-dev-lib.sh: line 83: /var/tmp/dracut.sabKZg/initramfs/emergency/80-.sh: No such file or directory
|
|
||||||
```
|
|
||||||
---
|
|
||||||
modules.d/99base/dracut-dev-lib.sh | 20 ++++++++++++++++++++
|
|
||||||
modules.d/99base/module-setup.sh | 1 +
|
|
||||||
2 files changed, 21 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/modules.d/99base/dracut-dev-lib.sh b/modules.d/99base/dracut-dev-lib.sh
|
|
||||||
index 5083f4f2..0df22b82 100755
|
|
||||||
--- a/modules.d/99base/dracut-dev-lib.sh
|
|
||||||
+++ b/modules.d/99base/dracut-dev-lib.sh
|
|
||||||
@@ -1,5 +1,25 @@
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
+# replaces all occurrences of 'search' in 'str' with 'replacement'
|
|
||||||
+#
|
|
||||||
+# str_replace str search replacement
|
|
||||||
+#
|
|
||||||
+# example:
|
|
||||||
+# str_replace ' one two three ' ' ' '_'
|
|
||||||
+str_replace() {
|
|
||||||
+ local in="$1"
|
|
||||||
+ local s="$2"
|
|
||||||
+ local r="$3"
|
|
||||||
+ local out=''
|
|
||||||
+
|
|
||||||
+ while [ "${in##*"$s"*}" != "$in" ]; do
|
|
||||||
+ chop="${in%%"$s"*}"
|
|
||||||
+ out="${out}${chop}$r"
|
|
||||||
+ in="${in#*"$s"}"
|
|
||||||
+ done
|
|
||||||
+ echo "${out}${in}"
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
# get a systemd-compatible unit name from a path
|
|
||||||
# (mimicks unit_name_from_path_instance())
|
|
||||||
dev_unit_name() {
|
|
||||||
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
|
|
||||||
index 7eb0a277..07c33eef 100755
|
|
||||||
--- a/modules.d/99base/module-setup.sh
|
|
||||||
+++ b/modules.d/99base/module-setup.sh
|
|
||||||
@@ -117,6 +117,7 @@ install() {
|
|
||||||
export DRACUT_SYSTEMD=1
|
|
||||||
fi
|
|
||||||
export PREFIX="$initdir"
|
|
||||||
+ export hookdir=/lib/dracut/hooks
|
|
||||||
|
|
||||||
# shellcheck source=dracut-dev-lib.sh
|
|
||||||
. "$moddir/dracut-dev-lib.sh"
|
|
||||||
|
|
61
0006.patch
61
0006.patch
@ -1,61 +0,0 @@
|
|||||||
From fa63c9be13660ae5223f9c3e87234ab281b97a95 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Harald Hoyer <harald@redhat.com>
|
|
||||||
Date: Mon, 17 May 2021 13:07:09 +0200
|
|
||||||
Subject: [PATCH] ci: add shfmt to Fedora containers
|
|
||||||
|
|
||||||
---
|
|
||||||
test/container/Dockerfile-Fedora-33 | 1 +
|
|
||||||
test/container/Dockerfile-Fedora-34 | 1 +
|
|
||||||
test/container/Dockerfile-Fedora-latest | 1 +
|
|
||||||
test/container/Dockerfile-Fedora-rawhide | 1 +
|
|
||||||
4 files changed, 4 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/test/container/Dockerfile-Fedora-33 b/test/container/Dockerfile-Fedora-33
|
|
||||||
index 51ca39f4..8e09cf5e 100644
|
|
||||||
--- a/test/container/Dockerfile-Fedora-33
|
|
||||||
+++ b/test/container/Dockerfile-Fedora-33
|
|
||||||
@@ -48,6 +48,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
|
|
||||||
python3-imgcreate \
|
|
||||||
which \
|
|
||||||
ShellCheck \
|
|
||||||
+ shfmt \
|
|
||||||
&& dnf -y update && dnf clean all
|
|
||||||
|
|
||||||
# Set default command
|
|
||||||
diff --git a/test/container/Dockerfile-Fedora-34 b/test/container/Dockerfile-Fedora-34
|
|
||||||
index 7e295e9a..b9701f6d 100644
|
|
||||||
--- a/test/container/Dockerfile-Fedora-34
|
|
||||||
+++ b/test/container/Dockerfile-Fedora-34
|
|
||||||
@@ -48,6 +48,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
|
|
||||||
python3-imgcreate \
|
|
||||||
which \
|
|
||||||
ShellCheck \
|
|
||||||
+ shfmt \
|
|
||||||
&& dnf -y update && dnf clean all
|
|
||||||
|
|
||||||
# Set default command
|
|
||||||
diff --git a/test/container/Dockerfile-Fedora-latest b/test/container/Dockerfile-Fedora-latest
|
|
||||||
index 81d5b9b9..3fc4a370 100644
|
|
||||||
--- a/test/container/Dockerfile-Fedora-latest
|
|
||||||
+++ b/test/container/Dockerfile-Fedora-latest
|
|
||||||
@@ -48,6 +48,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
|
|
||||||
python3-imgcreate \
|
|
||||||
which \
|
|
||||||
ShellCheck \
|
|
||||||
+ shfmt \
|
|
||||||
&& dnf -y update && dnf clean all
|
|
||||||
|
|
||||||
# Set default command
|
|
||||||
diff --git a/test/container/Dockerfile-Fedora-rawhide b/test/container/Dockerfile-Fedora-rawhide
|
|
||||||
index bd75e611..2d5653a7 100644
|
|
||||||
--- a/test/container/Dockerfile-Fedora-rawhide
|
|
||||||
+++ b/test/container/Dockerfile-Fedora-rawhide
|
|
||||||
@@ -48,6 +48,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
|
|
||||||
python3-imgcreate \
|
|
||||||
which \
|
|
||||||
ShellCheck \
|
|
||||||
+ shfmt \
|
|
||||||
&& dnf -y update && dnf clean all
|
|
||||||
|
|
||||||
# Set default command
|
|
||||||
|
|
61
0007.patch
61
0007.patch
@ -1,61 +0,0 @@
|
|||||||
From 636d6df3134dde1dac72241937724bc59deb9303 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kairui Song <kasong@redhat.com>
|
|
||||||
Date: Wed, 7 Apr 2021 02:11:41 +0800
|
|
||||||
Subject: [PATCH] fix(squash): don't mount the mount points if already mounted
|
|
||||||
|
|
||||||
It is possible that user setup some early mount in the rootfs even
|
|
||||||
earlier, so just be more robust and cover that case too.
|
|
||||||
|
|
||||||
Signed-off-by: Kairui Song <kasong@redhat.com>
|
|
||||||
---
|
|
||||||
modules.d/99squash/init-squash.sh | 17 +++++++++++------
|
|
||||||
modules.d/99squash/module-setup.sh | 4 ++--
|
|
||||||
2 files changed, 13 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash/init-squash.sh
|
|
||||||
index 3de6f819..59769f62 100755
|
|
||||||
--- a/modules.d/99squash/init-squash.sh
|
|
||||||
+++ b/modules.d/99squash/init-squash.sh
|
|
||||||
@@ -1,12 +1,17 @@
|
|
||||||
#!/bin/sh
|
|
||||||
PATH=/bin:/sbin
|
|
||||||
|
|
||||||
-# Basic mounts for mounting a squash image
|
|
||||||
-mkdir /proc /sys /dev /run
|
|
||||||
-mount -t proc -o nosuid,noexec,nodev proc /proc
|
|
||||||
-mount -t sysfs -o nosuid,noexec,nodev sysfs /sys
|
|
||||||
-mount -t devtmpfs -o mode=755,noexec,nosuid,strictatime devtmpfs /dev
|
|
||||||
-mount -t tmpfs -o mode=755,nodev,nosuid,strictatime tmpfs /run
|
|
||||||
+[ -e /proc/self/mounts ] \
|
|
||||||
+ || (mkdir -p /proc && mount -t proc -o nosuid,noexec,nodev proc /proc)
|
|
||||||
+
|
|
||||||
+grep -q '^sysfs /sys sysfs' /proc/self/mounts \
|
|
||||||
+ || (mkdir -p /sys && mount -t sysfs -o nosuid,noexec,nodev sysfs /sys)
|
|
||||||
+
|
|
||||||
+grep -q '^devtmpfs /dev devtmpfs' /proc/self/mounts \
|
|
||||||
+ || (mkdir -p /dev && mount -t devtmpfs -o mode=755,noexec,nosuid,strictatime devtmpfs /dev)
|
|
||||||
+
|
|
||||||
+grep -q '^tmpfs /run tmpfs' /proc/self/mounts \
|
|
||||||
+ || (mkdir -p /run && mount -t tmpfs -o mode=755,noexec,nosuid,strictatime tmpfs /run)
|
|
||||||
|
|
||||||
# Load required modules
|
|
||||||
modprobe loop
|
|
||||||
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
|
|
||||||
index 77520027..e3196213 100644
|
|
||||||
--- a/modules.d/99squash/module-setup.sh
|
|
||||||
+++ b/modules.d/99squash/module-setup.sh
|
|
||||||
@@ -42,11 +42,11 @@ installpost() {
|
|
||||||
# Install required modules and binaries for the squash image init script.
|
|
||||||
if [[ $_busybox ]]; then
|
|
||||||
inst "$_busybox" /usr/bin/busybox
|
|
||||||
- for _i in sh echo mount modprobe mkdir switch_root; do
|
|
||||||
+ for _i in sh echo mount modprobe mkdir switch_root grep; do
|
|
||||||
ln_r /usr/bin/busybox /usr/bin/$_i
|
|
||||||
done
|
|
||||||
else
|
|
||||||
- DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root
|
|
||||||
+ DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep
|
|
||||||
fi
|
|
||||||
|
|
||||||
hostonly="" instmods "loop" "squashfs" "overlay"
|
|
||||||
|
|
59
0008.patch
59
0008.patch
@ -1,59 +0,0 @@
|
|||||||
From 9355cb8ea5024533210067373657dc337d63ecb9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
|
|
||||||
Date: Tue, 18 May 2021 12:39:34 +0000
|
|
||||||
Subject: [PATCH] fix(bash): minor cleanups
|
|
||||||
|
|
||||||
- Remove hard coded path to binary
|
|
||||||
- Add missing license header
|
|
||||||
- Document sections
|
|
||||||
- refactor install section
|
|
||||||
---
|
|
||||||
modules.d/00bash/module-setup.sh | 28 ++++++++++++++++++++--------
|
|
||||||
1 file changed, 20 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/modules.d/00bash/module-setup.sh b/modules.d/00bash/module-setup.sh
|
|
||||||
index f72c297b..89ef6541 100755
|
|
||||||
--- a/modules.d/00bash/module-setup.sh
|
|
||||||
+++ b/modules.d/00bash/module-setup.sh
|
|
||||||
@@ -1,20 +1,32 @@
|
|
||||||
#!/bin/bash
|
|
||||||
+# This file is part of dracut.
|
|
||||||
+# SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
-# called by dracut
|
|
||||||
+# Prerequisite check(s) for module.
|
|
||||||
check() {
|
|
||||||
- require_binaries /bin/bash
|
|
||||||
+
|
|
||||||
+ # If the binary(s) requirements are not fulfilled the module can't be installed.
|
|
||||||
+ require_binaries bash || return 1
|
|
||||||
+
|
|
||||||
+ # Return 255 to only include the module, if another module requires it.
|
|
||||||
+ return 255
|
|
||||||
+
|
|
||||||
}
|
|
||||||
|
|
||||||
-# called by dracut
|
|
||||||
+# Module dependency requirements.
|
|
||||||
depends() {
|
|
||||||
+
|
|
||||||
+ # Return 0 to include the dependent module(s) in the initramfs.
|
|
||||||
return 0
|
|
||||||
+
|
|
||||||
}
|
|
||||||
|
|
||||||
-# called by dracut
|
|
||||||
+# Install the required file(s) and directories for the module in the initramfs.
|
|
||||||
install() {
|
|
||||||
- # If another shell is already installed, do not use bash
|
|
||||||
- [[ -x $initdir/bin/sh ]] && return
|
|
||||||
|
|
||||||
- # Prefer bash as /bin/sh if it is available.
|
|
||||||
- inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
|
|
||||||
+ inst /bin/bash
|
|
||||||
+
|
|
||||||
+ # Prefer bash as default shell if no other shell is preferred.
|
|
||||||
+ [[ -L $initdir/bin/sh ]] || ln -sf bash "${initdir}/bin/sh"
|
|
||||||
+
|
|
||||||
}
|
|
||||||
|
|
29
0009.patch
29
0009.patch
@ -1,29 +0,0 @@
|
|||||||
From c1ab36139d416e580e768c29f2addf7ccbc2c612 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marcos Mello <marcosfrm@gmail.com>
|
|
||||||
Date: Thu, 20 May 2021 15:41:26 -0300
|
|
||||||
Subject: [PATCH] fix(install): sane default --kerneldir
|
|
||||||
|
|
||||||
If --kerneldir is not specified, use /lib/modules/$(uname -r).
|
|
||||||
|
|
||||||
Fixes #1505
|
|
||||||
---
|
|
||||||
src/install/dracut-install.c | 5 ++++-
|
|
||||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
|
|
||||||
index 9f044ae0..3fd70fc8 100644
|
|
||||||
--- a/src/install/dracut-install.c
|
|
||||||
+++ b/src/install/dracut-install.c
|
|
||||||
@@ -1167,7 +1167,10 @@ static int parse_argv(int argc, char *argv[])
|
|
||||||
if (!kerneldir) {
|
|
||||||
struct utsname buf;
|
|
||||||
uname(&buf);
|
|
||||||
- kerneldir = strdup(buf.version);
|
|
||||||
+ if (asprintf(&kerneldir, "%s%s", "/lib/modules/", buf.release) < 0) {
|
|
||||||
+ log_error("Out of memory!");
|
|
||||||
+ exit(EXIT_FAILURE);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg_modalias) {
|
|
||||||
|
|
33
0010.patch
33
0010.patch
@ -1,33 +0,0 @@
|
|||||||
From 0a6007bf4f472565d2c0c205a56edea7ba3e3bc3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Harald Hoyer <harald@redhat.com>
|
|
||||||
Date: Fri, 21 May 2021 11:30:47 +0200
|
|
||||||
Subject: [PATCH] fix(dracut): pipe hardlink output to `dinfo`
|
|
||||||
|
|
||||||
Otherwise the output is cluttered with:
|
|
||||||
```
|
|
||||||
Mode: real
|
|
||||||
Files: 1364
|
|
||||||
Linked: 5 files
|
|
||||||
Compared: 0 xattrs
|
|
||||||
Compared: 384 files
|
|
||||||
Saved: 12.84 KiB
|
|
||||||
Duration: 0.052674 seconds
|
|
||||||
```
|
|
||||||
---
|
|
||||||
dracut.sh | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/dracut.sh b/dracut.sh
|
|
||||||
index 24e1c2e7..60ac46f4 100755
|
|
||||||
--- a/dracut.sh
|
|
||||||
+++ b/dracut.sh
|
|
||||||
@@ -2092,7 +2092,7 @@ done
|
|
||||||
|
|
||||||
if [[ $do_hardlink == yes ]] && command -v hardlink > /dev/null; then
|
|
||||||
dinfo "*** Hardlinking files ***"
|
|
||||||
- hardlink "$initdir" 2>&1
|
|
||||||
+ hardlink "$initdir" 2>&1 | dinfo
|
|
||||||
dinfo "*** Hardlinking files done ***"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
43
0011.patch
43
0011.patch
@ -1,43 +0,0 @@
|
|||||||
From a277a5fc7acc0a9e8d853f09671495f9d27645c1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Harald Hoyer <harald@redhat.com>
|
|
||||||
Date: Fri, 21 May 2021 12:19:32 +0200
|
|
||||||
Subject: [PATCH] fix(dracut-functions): get_maj_min without
|
|
||||||
get_maj_min_cache_file set
|
|
||||||
|
|
||||||
If `get_maj_min_cache_file` is unset `get_maj_min()` would error out.
|
|
||||||
|
|
||||||
Fix it to work without a cache file set.
|
|
||||||
---
|
|
||||||
dracut-functions.sh | 17 ++++++++++++-----
|
|
||||||
1 file changed, 12 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
|
||||||
index 1991c62e..5206bd21 100755
|
|
||||||
--- a/dracut-functions.sh
|
|
||||||
+++ b/dracut-functions.sh
|
|
||||||
@@ -234,13 +234,20 @@ get_fs_env() {
|
|
||||||
# 8:2
|
|
||||||
get_maj_min() {
|
|
||||||
local _majmin
|
|
||||||
- out="$(grep -m1 -oP "^$1 \K\S+$" "${get_maj_min_cache_file:?}")"
|
|
||||||
- if [ -z "$out" ]; then
|
|
||||||
+ local _out
|
|
||||||
+
|
|
||||||
+ if [[ $get_maj_min_cache_file ]]; then
|
|
||||||
+ _out="$(grep -m1 -oP "^$1 \K\S+$" "$get_maj_min_cache_file")"
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ if ! [[ "$_out" ]]; then
|
|
||||||
_majmin="$(stat -L -c '%t:%T' "$1" 2> /dev/null)"
|
|
||||||
- out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")"
|
|
||||||
- echo "$1 $out" >> "${get_maj_min_cache_file:?}"
|
|
||||||
+ _out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")"
|
|
||||||
+ if [[ $get_maj_min_cache_file ]]; then
|
|
||||||
+ echo "$1 $_out" >> "$get_maj_min_cache_file"
|
|
||||||
+ fi
|
|
||||||
fi
|
|
||||||
- echo -n "$out"
|
|
||||||
+ echo -n "$_out"
|
|
||||||
}
|
|
||||||
|
|
||||||
# get_devpath_block <device>
|
|
19
dracut.spec
19
dracut.spec
@ -5,10 +5,10 @@
|
|||||||
# strip the automatically generated dep here and instead co-own the
|
# strip the automatically generated dep here and instead co-own the
|
||||||
# directory.
|
# directory.
|
||||||
%global __requires_exclude pkg-config
|
%global __requires_exclude pkg-config
|
||||||
%define dist_free_release 12.git20210521
|
%define dist_free_release 1
|
||||||
|
|
||||||
Name: dracut
|
Name: dracut
|
||||||
Version: 054
|
Version: 055
|
||||||
Release: %{dist_free_release}%{?dist}
|
Release: %{dist_free_release}%{?dist}
|
||||||
|
|
||||||
Summary: Initramfs generator using udev
|
Summary: Initramfs generator using udev
|
||||||
@ -29,17 +29,6 @@ URL: https://dracut.wiki.kernel.org/
|
|||||||
# Source can be generated by
|
# Source can be generated by
|
||||||
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz
|
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz
|
||||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
|
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
|
||||||
Patch1: 0001.patch
|
|
||||||
Patch2: 0002.patch
|
|
||||||
Patch3: 0003.patch
|
|
||||||
Patch4: 0004.patch
|
|
||||||
Patch5: 0005.patch
|
|
||||||
Patch6: 0006.patch
|
|
||||||
Patch7: 0007.patch
|
|
||||||
Patch8: 0008.patch
|
|
||||||
Patch9: 0009.patch
|
|
||||||
Patch10: 0010.patch
|
|
||||||
Patch11: 0011.patch
|
|
||||||
|
|
||||||
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||||
|
|
||||||
@ -495,6 +484,10 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
|
|||||||
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
|
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu May 27 2021 Harald Hoyer <harald@redhat.com> - 055-1
|
||||||
|
- version 055
|
||||||
|
- install the missing fsck utils
|
||||||
|
|
||||||
* Fri May 21 2021 Harald Hoyer <harald@redhat.com> - 054-12.git20210521
|
* Fri May 21 2021 Harald Hoyer <harald@redhat.com> - 054-12.git20210521
|
||||||
- fix `get_maj_min` for kdump
|
- fix `get_maj_min` for kdump
|
||||||
- suppress hardlink output
|
- suppress hardlink output
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (dracut-054.tar.xz) = 7cff87b9cc6c7323044610c4ddda9685a8eba4ebd320fa39071707d6c324ed69da722ecb0257be9bbf2bb8bc11fed6a3dc7c34c5d8229e00b6f261835a33503b
|
SHA512 (dracut-055.tar.xz) = 2d2ea2889d9013bc94245bd7d1a2154f24d02bd9c2f7dbb28e5968e17d918e6598c68d85b0f551f968218980a80b19361ca0c9e8e94997ba54f4c09afcd6d866
|
||||||
|
Loading…
Reference in New Issue
Block a user