Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > by-pkgid > f297d8fa9658e342f58b232ff920f605 > files > 8

lvm1-1.0.8-3.1.100mdk.src.rpm

--- lvm10-1.0.4.orig/1.0.4/tools/man8/lvmcreate_initrd.8
+++ lvm10-1.0.4/1.0.4/tools/man8/lvmcreate_initrd.8
@@ -115,6 +115,11 @@
 .BR vgextend (8)
 to add them to e.g.
 .IR YourVG .
+.SH ENVIRONMENT VARIABLES
+lvmcreate_initrd honours the TMPDIR environment variable when creating the
+temporary filesystem. By default this will be in /tmp but you may need to
+override this using TMPDIR if your /tmp is on a filesystem that does not allow
+loopback mounts (eg tmpfs).
 .SH DIAGNOSTICS
 .B lvcmcreate_initrd
 returns 0 for success.  1 is returned in all other cases.
--- lvm10-1.0.4.orig/1.0.4/tools/lvmcreate_initrd
+++ lvm10-1.0.4/1.0.4/tools/lvmcreate_initrd
@@ -50,8 +50,12 @@
 
 cmd=`basename $0`
 
-TMPMNT=/tmp/mnt.$$
-TMPLIB=/tmp/lib.$$
+if [ -z "$TMPDIR" ]; then
+  TMPDIR=/tmp
+fi
+
+TMPMNT=$TMPDIR/mnt.$$
+TMPLIB=$TMPDIR/lib.$$
 USEMOD=1
 
 PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
@@ -138,7 +142,7 @@
 
 INITRD=${INITRD:-"/boot/initrd-lvm-$VERSION.gz"}
 MODULES=/lib/modules/$VERSION
-DEVRAM=/tmp/initrd.$$
+DEVRAM=$TMPDIR/initrd.$$
 DEV=${DEV-"/dev"}
 
 echo "$cmd -- make LVM initial ram disk $INITRD"
@@ -153,7 +157,7 @@
 
 # The size of the ramdisk is automatically calculated unless this is set
 #INITRDSIZE=
-INITRDFILES="/sbin/vgchange /sbin/vgscan /bin/bash /bin/mount /bin/umount /bin/sh /bin/rm"
+INITRDFILES="/sbin/vgchange /sbin/vgscan /lib/lvm-10/vgchange /lib/lvm-10/vgscan /bin/bash /bin/mount /bin/umount /bin/sh /bin/rm"
 
 if [ "$USEMOD" ]; then
    # Check for an LVM module, otherwise it must be compiled into the kernel
@@ -191,11 +195,11 @@
    # Use the IOP version, if specified.  Otherwise, if we are building for
    # the current kernel or there is only one IOP version installed, use it.
    if [ "$IOP" ]; then
-      IOP="/lib/lvm-iop$IOP"
+      IOP="/lib/lvm-$IOP"
    elif [ "$VERSION" = "`uname -r`" ]; then
-      IOP="/lib/lvm-iop`lvmiopversion`"
-   elif [ `ls -d /lib/lvm-iop* | wc -w` -eq 1 ]; then
-      IOP="`ls -d /lib/lvm-iop*`"
+      IOP="/lib/lvm-`lvmiopversion`"
+   elif [ `ls -d /lib/lvm-* | wc -w` -eq 1 ]; then
+      IOP="`ls -d /lib/lvm-*`"
    fi
    for FILE in $INITRDFILES; do
    case $FILE in
@@ -206,7 +210,7 @@
             echo "$cmd -- need to set LVM IOP for kernel $VERSION with '-i'."
             cleanup 1
          fi
-         NEWFILE="$IOP/`basename $FILE`"
+         NEWFILE="/lib/lvm-$IOP/`basename $FILE`"
 	 if [ -x $NEWFILE ]; then
 	    INITRDFILES="$INITRDFILES $NEWFILE"
          else
@@ -233,6 +237,10 @@
 # run out of room on the ramdisk while stripping the libraries.
 echo "$cmd -- stripping shared libraries"
 mkdir $TMPLIB
+if [ $? -ne 0 ]; then
+   echo "$cmd -- ERROR making $TMPLIB"
+   cleanup 1
+fi
 for LIB in $SHLIBS; do
    verbose "copy $LIB to $TMPLIB$LIB"
    mkdir -p `dirname $TMPLIB$LIB`