dracut/0014-Revert-chore-remove-unused-function.patch
Pavel Valena e68b4f0939 Upgrade to dracut 107
From-source-git-commit: e0d1d0707c4694219b6d44d417c4c4e6a0fdc94c

Resolves: RHEL-97473
2025-07-21 15:52:08 +02:00

50 lines
1.8 KiB
Diff

From 0baf5e0b6c1370b51a20327bd67e0260fc9f8f2e Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 10 Jul 2025 10:33:21 -0700
Subject: [PATCH 14/15] Revert "chore: remove unused function"
This reverts commit 81ddde54051351ea17dbb84ef6232820f96740af.
dracut itself may not use inst_library, but external modules do,
at least anaconda's does.
(cherry picked from commit da64b204418753abce4090892831429c03239fa7)
Related: RHEL-97473
---
dracut-init.sh | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/dracut-init.sh b/dracut-init.sh
index 9be00c56..749801fc 100755
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -350,6 +350,25 @@ dracut_instmods() {
fi
}
+# this is not used within dracut itself, but external modules use it,
+# do not remove it!
+inst_library() {
+ local _ret _hostonly_install
+ if [[ $1 == "-H" ]]; then
+ _hostonly_install="-H"
+ shift
+ fi
+ [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
+ [[ -e $1 ]] || return 1 # no source
+ if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
+ return 0
+ else
+ _ret=$?
+ derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
+ return $_ret
+ fi
+}
+
inst_binary() {
local _ret
if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
--
2.50.1