Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (4f08598685c5949cdf7017853ea11e272e3c8eb6)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (4f08598685c5949cdf7017853ea11e272e3c8eb6)
  • Date: Thu, 20 Mar 2008 09:28:55 -0500

GIT changes to master cauldron by Justin Boffemmyer <flux AT sourcemage.org>:

scripts/mkinitrd | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)

New commits:
commit 4f08598685c5949cdf7017853ea11e272e3c8eb6
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/mkinitrd: Fixed the libscan function/usage

Both the definition and usage of libscan were broken. The definition
failed to properly select all of the libs that would be returned by
ldd. The usage failed to take into account the fact that the results
returned via ldd would be a list, and therefore would need multiple
iterations to copy each one. This is now properly dealt with.

diff --git a/scripts/mkinitrd b/scripts/mkinitrd
index 25f24fc..85f051c 100755
--- a/scripts/mkinitrd
+++ b/scripts/mkinitrd
@@ -29,10 +29,20 @@ EXECDIRS=(bin sbin usr/bin usr/sbin)
#---------------------------------------------------------------------
# Used to implicitly install linked-against-libs to the initrd with a binary
function libscan() {
- chroot $CHROOT_DIR ldd "$1" 2> /dev/null |
- cut -d'>' -f2 |
- cut -d' ' -f2 |
- grep '^/'
+ chroot $CHROOT_DIR /usr/bin/ldd "$1" |
+ grep '/' |
+ cut -f 2 |
+ sed -e 's/.*=> //' |
+ sed -e 's/ (0x.*)$//' |
+ sed -e 's/^[/]//'
+}
+
+# This function gets the real library files from the symlinks returned
+# by running libscan (ldd returns symlinks if that's what the binary
+# links to). The leading '/' is removed for convenience.
+function reallib() {
+ chroot $CHROOT_DIR readlink -f $1 |
+ sed -e 's/^[/]//'
}

function my_which() {
@@ -53,13 +63,19 @@ function my_which() {
#---------------------------------------------------------------------
function install_prog() {
local prog progpath
+ local i
for prog in $* ;do
# find executable
progpath=$(my_which $prog) &&
# install executable (path will be relative to $CHROOT_DIR)
cp --parents -f $progpath $INITRDROOT &&
# install needed libs
- cp --parents -f $( libscan $progpath ) $INITRDROOT
+ for i in $(libscan $progpath) ; do
+ # Needed to copy both the lib and symlinks
+ # Some programs (like ldconfig) rely on the symlinks
+ cp --parents -f $(reallib $i) $INITRDROOT
+ cp -d --parents -f $i $INITRDROOT
+ done
done
}




  • [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (4f08598685c5949cdf7017853ea11e272e3c8eb6), Justin Boffemmyer, 03/20/2008

Archive powered by MHonArc 2.6.24.

Top of Page