|
|
ff210d |
From f31312257094b3336c38cc8bdce1ded9188d37c3 Mon Sep 17 00:00:00 2001
|
|
|
ff210d |
From: Ray Strode <rstrode@redhat.com>
|
|
|
ff210d |
Date: Mon, 15 Oct 2018 21:02:50 -0400
|
|
|
ff210d |
Subject: [PATCH 1/6] populate-initrd: drop unused local variable
|
|
|
ff210d |
|
|
|
ff210d |
the inst_library function declares a variable `_lib`
|
|
|
ff210d |
that's completely unused.
|
|
|
ff210d |
|
|
|
ff210d |
This commit removes the declaration.
|
|
|
ff210d |
---
|
|
|
ff210d |
scripts/plymouth-populate-initrd.in | 2 +-
|
|
|
ff210d |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
ff210d |
|
|
|
ff210d |
diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in
|
|
|
ff210d |
index e3326e9..5f3bb85 100755
|
|
|
ff210d |
--- a/scripts/plymouth-populate-initrd.in
|
|
|
ff210d |
+++ b/scripts/plymouth-populate-initrd.in
|
|
|
ff210d |
@@ -141,61 +141,61 @@ inst_simple() {
|
|
|
ff210d |
|
|
|
ff210d |
# find symlinks linked to given library file
|
|
|
ff210d |
# $1 = library file
|
|
|
ff210d |
# Function searches for symlinks by stripping version numbers appended to
|
|
|
ff210d |
# library filename, checks if it points to the same target and finally
|
|
|
ff210d |
# prints the list of symlinks to stdout.
|
|
|
ff210d |
#
|
|
|
ff210d |
# Example:
|
|
|
ff210d |
# rev_lib_symlinks libfoo.so.8.1
|
|
|
ff210d |
# output: libfoo.so.8 libfoo.so
|
|
|
ff210d |
# (Only if libfoo.so.8 and libfoo.so exists on host system.)
|
|
|
ff210d |
rev_lib_symlinks() {
|
|
|
ff210d |
[[ ! $1 ]] && return 0
|
|
|
ff210d |
|
|
|
ff210d |
local fn="$1" orig="$(readlink -f "$1")" links=''
|
|
|
ff210d |
|
|
|
ff210d |
[[ ${fn} =~ .*\.so\..* ]] || return 1
|
|
|
ff210d |
|
|
|
ff210d |
until [[ ${fn##*.} == so ]]; do
|
|
|
ff210d |
fn="${fn%.*}"
|
|
|
ff210d |
[[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}"
|
|
|
ff210d |
done
|
|
|
ff210d |
|
|
|
ff210d |
echo "${links}"
|
|
|
ff210d |
}
|
|
|
ff210d |
|
|
|
ff210d |
# Same as above, but specialized to handle dynamic libraries.
|
|
|
ff210d |
# It handles making symlinks according to how the original library
|
|
|
ff210d |
# is referenced.
|
|
|
ff210d |
inst_library() {
|
|
|
ff210d |
- local _src="$1" _dest=${2:-$1} _lib _reallib _symlink
|
|
|
ff210d |
+ local _src="$1" _dest=${2:-$1} _reallib _symlink
|
|
|
ff210d |
strstr "$1" "/" || return 1
|
|
|
ff210d |
[[ -e $initdir/$_dest ]] && return 0
|
|
|
ff210d |
if [[ -L $_src ]]; then
|
|
|
ff210d |
# install checksum files also
|
|
|
ff210d |
if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
|
|
|
ff210d |
inst "${_src%/*}/.${_src##*/}.hmac" "${_dest%/*}/.${_dest##*/}.hmac"
|
|
|
ff210d |
fi
|
|
|
ff210d |
_reallib=$(readlink -f "$_src")
|
|
|
ff210d |
inst_simple "$_reallib" "$_reallib"
|
|
|
ff210d |
inst_dir "${_dest%/*}"
|
|
|
ff210d |
[[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
|
|
|
ff210d |
ln -sfn $(convert_abs_rel "${_dest}" "${_reallib}") "${initdir}/${_dest}"
|
|
|
ff210d |
else
|
|
|
ff210d |
inst_simple "$_src" "$_dest"
|
|
|
ff210d |
fi
|
|
|
ff210d |
|
|
|
ff210d |
# Create additional symlinks. See rev_symlinks description.
|
|
|
ff210d |
for _symlink in $(rev_lib_symlinks $_src) $(rev_lib_symlinks $_reallib); do
|
|
|
ff210d |
[[ ! -e $initdir/$_symlink ]] && {
|
|
|
ff210d |
ddebug "Creating extra symlink: $_symlink"
|
|
|
ff210d |
inst_symlink $_symlink
|
|
|
ff210d |
}
|
|
|
ff210d |
done
|
|
|
ff210d |
}
|
|
|
ff210d |
|
|
|
ff210d |
# find a binary. If we were not passed the full path directly,
|
|
|
ff210d |
# search in the usual places to find the binary.
|
|
|
ff210d |
find_binary() {
|
|
|
ff210d |
if [[ -z ${1##/*} ]]; then
|
|
|
ff210d |
if [[ -x $1 ]] || { strstr "$1" ".so" && ldd $1 &>/dev/null; }; then
|
|
|
ff210d |
--
|
|
|
ff210d |
2.17.1
|
|
|
ff210d |
|