summaryrefslogtreecommitdiffstats
path: root/rescue/tree/ka/make_initrd
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-08-28 21:38:32 +0000
committerOlivier Blin <oblin@mandriva.org>2005-08-28 21:38:32 +0000
commitc33096066f32297bbc275ea820531fe55e45b705 (patch)
tree85b5c4fcb02b38d30805a4b22320924f7be41391 /rescue/tree/ka/make_initrd
parentfcd42ef1d7175f46663fde210e4e6cd9f059cfef (diff)
downloaddrakx-c33096066f32297bbc275ea820531fe55e45b705.tar
drakx-c33096066f32297bbc275ea820531fe55e45b705.tar.gz
drakx-c33096066f32297bbc275ea820531fe55e45b705.tar.bz2
drakx-c33096066f32297bbc275ea820531fe55e45b705.tar.xz
drakx-c33096066f32297bbc275ea820531fe55e45b705.zip
ka support (initially from Antoine Ginies and Erwan Velu)
Diffstat (limited to 'rescue/tree/ka/make_initrd')
-rwxr-xr-xrescue/tree/ka/make_initrd44
1 files changed, 44 insertions, 0 deletions
diff --git a/rescue/tree/ka/make_initrd b/rescue/tree/ka/make_initrd
new file mode 100755
index 000000000..8f8a0492d
--- /dev/null
+++ b/rescue/tree/ka/make_initrd
@@ -0,0 +1,44 @@
+#!/bin/bash
+echo Looking for default kernel
+CHROOT=/mnt/disk
+IMG=`cat $CHROOT/etc/lilo.conf | grep default | cut -d "=" -f 2 | sed -e 's/\"//g'`
+KERN="x"
+INITRD=""
+LABEL="x"
+
+modprobe loop
+
+for i in `cat $CHROOT/etc/lilo.conf`; do
+
+ if echo $i | grep image >/dev/null; then
+ KERN=$CHROOT`echo $i | cut -d "=" -f 2`
+ INITRD=""
+ LABEL="x"
+ fi
+ if echo $i | grep label >/dev/null; then
+ LABEL=`echo $i | cut -d "=" -f 2 | sed -e 's/\"//g'`
+ fi
+ if echo $i | grep initrd >/dev/null; then
+ INITRD=`echo $i | cut -d "=" -f 2`
+ fi
+ if [ ${LABEL} == ${IMG} ] && [ ! -z ${INITRD} ]; then
+ echo "Kernel name is $KERN"
+ echo "Initrd name is $INITRD"
+ KERN_VERSION=`/usr/bin/strings $KERN | grep "^2\.[2.6]"| cut -d " " -f 1`
+ if [ -z $KERN_VERSION ]; then
+ echo "No kernel version found !"
+ fi
+ chroot $CHROOT mount /proc
+ mount /dev/ $CHROOT/dev -o bind
+# chroot $CHROOT MAKEDEV loop
+# chroot $CHROOT MAKEDEV fd
+# chroot $CHROOT MAKEDEV hd
+# chroot $CHROOT MAKEDEV sd
+# chroot $CHROOT MAKEDEV md
+# chroot $CHROOT MAKEDEV zero
+ chroot $CHROOT /sbin/mkinitrd -f $INITRD $KERN_VERSION
+ umount $CHROOT/dev
+ chroot $CHROOT umount /proc
+ exit
+ fi
+done