aidecoe 14/07/21 19:13:50
Added:
038-0008-dracut-functions.sh-fix-inst-functions.patch
Log:
Fix in hostonly inst functions.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key
F0134531E1DBFAB5)
Revision Changes Path
1.1
sys-kernel/dracut/files/038-0008-dracut-functions.sh-fix-inst-functions.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/files/038-0008-dracut-functions.sh-fix-inst-functions.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/files/038-0008-dracut-functions.sh-fix-inst-functions.patch?rev=1.1&content-type=text/plain
Index: 038-0008-dracut-functions.sh-fix-inst-functions.patch
===================================================================
>From 0791f69f870f66dcbec30d64bca4c0cd9c70e7a8 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <[email protected]>
Date: Mon, 21 Jul 2014 16:58:15 +0200
Subject: [PATCH 8/8] dracut-functions.sh: fix inst*() functions for "-H"
handling
because some inst*() functions check the existance of the source files
and do not know about the "-H" option, some failed to install the
hostonly files.
---
dracut-functions.sh | 46 ++++++++++++++++++++++++++++++++--------------
1 file changed, 32 insertions(+), 14 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index aa0949d..f241016 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -765,33 +765,46 @@ inst_dir() {
}
inst() {
+ local _hostonly_install
+ if [[ "$1" == "-H" ]]; then
+ _hostonly_install="-H"
+ shift
+ fi
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
- #dinfo "$DRACUT_INSTALL -l $@"
- $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"}
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
+ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"}
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H}
"$@" || :
}
inst_simple() {
+ local _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
- $DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@" || :
+ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${_hostonly_install:+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"}
${_hostonly_install:+-H} "$@" || :
}
inst_symlink() {
+ local _hostonly_install
+ if [[ "$1" == "-H" ]]; then
+ _hostonly_install="-H"
+ shift
+ fi
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
[[ -L $1 ]] || return 1
- $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"}
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
+ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"}
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H}
"$@" || :
}
inst_multiple() {
- local ret
- #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
+ local _ret
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} "$@"
- ret=$?
- (($ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
- return $ret
+ _ret=$?
+ (($_ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H}
"$@" || :
+ return $_ret
}
dracut_install() {
@@ -799,10 +812,15 @@ dracut_install() {
}
inst_library() {
+ local _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
- $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"}
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
+ $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}
${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"}
${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H}
"$@" || :
}
inst_binary() {
--
2.0.2