summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--functions10
-rwxr-xr-xmkinitcpio18
2 files changed, 4 insertions, 24 deletions
diff --git a/functions b/functions
index 1aea1a7..136b281 100644
--- a/functions
+++ b/functions
@@ -204,10 +204,6 @@ add_module() {
esac
}
-_ldd() {
- LD_TRACE_LOADED_OBJECTS=1 "$LD_SO" "$@"
-}
-
_add_file() {
# add a file to $BUILDROOT
# $1: pathname on initcpio
@@ -264,10 +260,10 @@ add_binary() {
# always add the binary itself
_add_file "${dest#$BASEDIR}" "$binary" "$mode"
- $LD_SO --verify "$binary" &>/dev/null || return # not a binary!
+ lddout=$(ldd "$binary" 2>/dev/null) || return 1 # not a binary!
# resolve sodeps
- regex='^[[:space:]]*[^/].+ => (.*) \(.*\)'
+ regex='(/.+) \(0x[a-fA-F0-9]+\)'
while read line; do
[[ "$line" =~ $regex ]] && sodep=${BASH_REMATCH[1]} || continue
@@ -282,7 +278,7 @@ add_binary() {
_add_file "${resolved#$BASEDIR}" "$resolved" 755
fi
fi
- done < <(_ldd "$binary")
+ done <<< "$lddout"
return 0
}
diff --git a/mkinitcpio b/mkinitcpio
index 459c828..71d3e0d 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -22,7 +22,7 @@ INSTDIR=install
PRESETDIR=mkinitcpio.d
COMPRESSION=gzip
-declare TMPDIR BASEDIR MODULE_FILE GENIMG PRESET COMPRESSION_OPTIONS BUILDROOT LD_SO
+declare TMPDIR BASEDIR MODULE_FILE GENIMG PRESET COMPRESSION_OPTIONS BUILDROOT
declare NC= BOLD= BLUE= GREEN= RED= YELLOW=
declare -i QUIET=1 SHOW_AUTOMODS=0 SAVELIST=0 COLOR=1
declare -a SKIPHOOKS ADDED_MODULES
@@ -294,22 +294,6 @@ trap '[[ $FUNCNAME = parse_hook ]] && (( ++builderrors ))' ERR
#parse 'global' hook, as defined in ${CONFIG}
parse_hook
-# resolve the linker and add it
-case $CARCH in
- i686) LD_SO=("$BASEDIR"/lib/ld-linux.so.?*) ;;
- x86_64) LD_SO=("$BASEDIR"/lib/ld-linux-${CARCH//_/-}.so.?*) ;;
- *) die "unknown architecture: $CARCH" ;;
-esac
-
-if (( ${#LD_SO[*]} != 1 )); then # uh oh...
- die "failed to resolve the location of /lib/ld.so. Please report this bug."
-fi
-
-resolved=$(readlink -e "$LD_SO")
-_add_file "${resolved#$BASEDIR}" "$resolved" 755
-_add_symlink "${LD_SO#$BASEDIR}" "$resolved"
-unset resolved
-
for hook in ${HOOKS}; do
in_array "$hook" "${SKIPHOOKS[@]}" && continue
unset MODULES BINARIES FILES SCRIPT