linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Update to lvm2create_initrd
@ 2006-11-11 11:18 Douglas Mayle
  2006-11-14 17:02 ` Alasdair G Kergon
  0 siblings, 1 reply; 7+ messages in thread
From: Douglas Mayle @ 2006-11-11 11:18 UTC (permalink / raw)
  To: LVM

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

I've made an update to the lvm2create_initrd script that fixes some  
problems with ldd output that were never addressed in the first  
version (e.g. libraries linked with a static path).

I also check for binaries in the path, rather than hardcoding their  
location, and I've added support for the Gentoo style of MAKEDEV.


[-- Attachment #2: lvm2create_initrd.patch --]
[-- Type: application/octet-stream, Size: 1292 bytes --]

--- lvm2create_initrd.orig	2006-11-10 21:32:53.000000000 +0100
+++ lvm2create_initrd	2006-11-10 21:35:42.000000000 +0100
@@ -52,7 +52,7 @@
 DEVRAM=/tmp/initrd.$$
 
 # set defaults
-BINFILES=${BINFILES:-"/lib/lvm-200/lvm /bin/bash /bin/busybox /sbin/pivot_root"}
+BINFILES=${BINFILES:-"`which lvm` `which bash` `which busybox` `which pivot_root`"}
 BASICDEVICES=${BASICDEVICES:-"std consoleonly fd"}
 BLOCKDEVICES=${BLOCKDEVICES:-"md hda hdb hdc hdd sda sdb sdc sdd"}
 MAKEDEV=${MAKEDEV:-"debian"}
@@ -269,7 +269,7 @@
 # Figure out which shared libraries we actually need in our initrd
 echo "$cmd -- finding required shared libraries"
 verbose "BINFILES: `echo $BINFILES`"
-LIBFILES=`ldd $BINFILES 2>/dev/null | awk '{if (/=>/) { print $3 }}' | sort -u`
+LIBFILES=`ldd $BINFILES 2>/dev/null |grep -v linux-gate |grep -v : | awk '{if (/=>/) { print $3 } else if (/\//) { print $1 }}' | sort -u`
 if [ $? -ne 0 ]; then
    echo "$cmd -- ERROR figuring out needed shared libraries"
    exit 1
@@ -356,6 +356,10 @@
     (cd $TMPMNT/dev; /dev/MAKEDEV $OPT_Q -d $TMPMNT/dev -m 2)
     RETCODE=$?
     ;;
+gentoo)
+    (cd $TMPMNT/dev; /usr/sbin/MAKEDEV $OPT_Q $BASICDEVICES $BLOCKDEVICES)
+    RETCODE=$?
+    ;;
 *)
     echo "$cmd -- ERROR: $MAKEDEV is not a known MAKEDEV style."
     RETCODE=1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-11-26 15:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-11 11:18 [linux-lvm] Update to lvm2create_initrd Douglas Mayle
2006-11-14 17:02 ` Alasdair G Kergon
2006-11-14 17:49   ` Douglas Mayle
2006-11-20 19:37     ` Douglas Mayle
2006-11-21 22:39       ` Alasdair G Kergon
2006-11-21 22:44         ` Alasdair G Kergon
2006-11-26 15:11           ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).