summaryrefslogtreecommitdiffstats
path: root/rescue/tree/ka/make_initrd
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2004-04-02 14:03:41 +0000
committerAntoine Ginies <aginies@mandriva.com>2004-04-02 14:03:41 +0000
commit54ddee710c26cb9c11f20cf6ae066c017139615b (patch)
tree3a2237158024ee35cf5b80fecc0eb9720452f331 /rescue/tree/ka/make_initrd
parentb48a5f4ad711f389f0613a754454b683a1220708 (diff)
downloaddrakx-54ddee710c26cb9c11f20cf6ae066c017139615b.tar
drakx-54ddee710c26cb9c11f20cf6ae066c017139615b.tar.gz
drakx-54ddee710c26cb9c11f20cf6ae066c017139615b.tar.bz2
drakx-54ddee710c26cb9c11f20cf6ae066c017139615b.tar.xz
drakx-54ddee710c26cb9c11f20cf6ae066c017139615b.zip
first relsease
Diffstat (limited to 'rescue/tree/ka/make_initrd')
-rwxr-xr-xrescue/tree/ka/make_initrd49
1 files changed, 49 insertions, 0 deletions
diff --git a/rescue/tree/ka/make_initrd b/rescue/tree/ka/make_initrd
new file mode 100755
index 000000000..d6f15a951
--- /dev/null
+++ b/rescue/tree/ka/make_initrd
@@ -0,0 +1,49 @@
+#!/bin/bash
+echo Looking for default kernel
+CHROOT=/mnt/disk
+IMG=`cat $CHROOT/etc/lilo.conf | grep default | cut -d "=" -f 2`
+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`
+ 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=`strings $KERN | grep "^2\.[2.4]"| cut -d " " -f 1`
+ if [ -z $KERN_VERSION ]; then
+ echo "No kernel version found !"
+ read
+ fi
+
+ chroot $CHROOT mount /proc
+ 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 mkinitrd -f $INITRD $KERN_VERSION
+ chroot $CHROOT umount /proc
+
+ exit
+ fi
+done