Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > by-pkgid > 7f9e18511336b1bbbdf914d376d524ba > files > 25

mkinitrd-6.0.63-17.1mnb2.src.rpm

diff -p -up mkinitrd-6.0.63/functions.bootchart mkinitrd-6.0.63/functions
--- mkinitrd-6.0.63/functions.bootchart	2009-01-28 15:46:38.000000000 +0100
+++ mkinitrd-6.0.63/functions	2009-01-28 15:46:38.000000000 +0100
@@ -175,7 +175,9 @@ function inst() {
         inst "$interp" "$root"
         RET=$?
         IF_indent_chars=${old_indent_chars}
-        return $RET
+        if [ $RET -ne 0 ]; then
+            return $RET
+        fi
     fi
 
     if [ -e "$root$dest" ]; then
diff -p -up mkinitrd-6.0.63/mkinitrd.bootchart mkinitrd-6.0.63/mkinitrd
--- mkinitrd-6.0.63/mkinitrd.bootchart	2009-01-28 15:46:38.000000000 +0100
+++ mkinitrd-6.0.63/mkinitrd	2009-01-28 16:01:10.000000000 +0100
@@ -114,7 +114,7 @@ usage () {
     $cmd "       [--with=<module>] [--force-lvm-probe | --omit-lvm-modules]"
     $cmd "       [--builtin=<module>] [--omit-dmraid] [--net-dev=<interface>]"
     $cmd "       [--fstab=<fstab>] [--nocompress] <initrd-image> <kernel-version>"
-    $cmd "       [--dsdt[=<dsdt.aml>]]"
+    $cmd "       [--dsdt[=<dsdt.aml>] [--bootchart]]"
     $cmd ""
     $cmd "       (ex: `basename $0` /boot/initrd-$(uname -r).img $(uname -r))"
 
@@ -956,6 +956,9 @@ while [ $# -gt 0 ]; do
         --help)
             usage -n
             ;;
+        --bootchart)
+            BOOTCHART=1
+            ;;
         *)
             if [ -z "$target" ]; then
                 target=$1
@@ -1340,6 +1343,7 @@ mkdir -p $MNTIMAGE/sys
 mkdir -p $MNTIMAGE/sysroot
 ln -s bin $MNTIMAGE/sbin
 mkdir -p $MNTIMAGE/etc/blkid
+mkdir -p $MNTIMAGE/mnt
 
 vecho "Building initrd in $MNTIMAGE"
 inst /sbin/nash "$MNTIMAGE" /bin/nash
@@ -1817,6 +1821,29 @@ emit "loadpolicy"
 emit "plymouth --newroot=/sysroot"
 emit "echo Switching to new root and running init."
 emit "nash-if-splash splashy_update \"chroot /sysroot\""
+if [ ! -z "$BOOTCHART" ]; then
+    inst /sbin/bootchartd "$MNTIMAGE"
+    inst /etc/bootchartd.conf "$MNTIMAGE"
+    inst /bin/cat "$MNTIMAGE"
+    inst /sbin/accton "$MNTIMAGE" /sbin/accton
+    inst /usr/bin/killall "$MNTIMAGE" /bin/killall
+    inst /bin/mount "$MNTIMAGE"
+    inst /bin/umount "$MNTIMAGE"
+    inst /bin/mv "$MNTIMAGE"
+    inst /bin/sleep "$MNTIMAGE"
+    inst /bin/echo "$MNTIMAGE"
+    inst /usr/sbin/chroot "$MNTIMAGE" /sbin/chroot
+    inst /sbin/pidof "$MNTIMAGE" /sbin/pidof
+    inst /bin/grep "$MNTIMAGE" 
+    inst /bin/sed "$MNTIMAGE" 
+    inst /usr/bin/[ "$MNTIMAGE" /bin/[
+
+    emit "/bin/killall -USR2 bootchartd"
+    # give some time to bootchart to start the
+    # new instance.
+    emit "/bin/sleep 1s"
+fi
+
 emit "switchroot"
 emit "echo Booting has failed."
 emit "nash-if-splash splashy_update exit"