Adjust memory layout for 2.6.22+ kernels with 32KB setup code
[mknbi.git] / mklnim
1 #!/bin/sh
2 #
3 #       Make Linux Netinstall Image
4 #       Takes a RedHat, TurboLinux or SuSE CD
5 #       and creates a network bootable image
6 #
7 #       mklnim outputfile [path-to-cdrom]
8 #
9 #       path-to-cdrom defaults to /mnt/cdrom
10 #
11 if [ $# -lt 1 ]
12 then
13         echo Usage: $0 outputfile [path-to-cdrom]
14         exit 1
15 fi
16 pathtocdrom=${2:-"/mnt/cdrom"}
17 trap '' INT
18 tmpmount=/tmp/lnim.$$
19 mkdir $tmpmount
20 if [ -r $pathtocdrom/images/cdboot.img ]
21 then
22         bootfloppyimage="$pathtocdrom/images/cdboot.img"
23         echo TurboLinux CDROM
24 elif [ -r $pathtocdrom/images/bootnet.img ]
25 then
26         bootfloppyimage="$pathtocdrom/images/bootnet.img"
27         append='--append=network'
28         echo RedHat 6.x CDROM
29 elif [ -r $pathtocdrom/images/boot.img ]
30 then
31         bootfloppyimage="$pathtocdrom/images/boot.img"
32         echo RedHat 5.2 CDROM
33 elif [ -r $pathtocdrom/disks/bootdisk ]
34 then
35         bootfloppyimage="$pathtocdrom/disks/bootdisk"
36         linuximage=linux
37         initdisk=initdisk.gz
38         echo SuSE 6.x CDROM
39 else
40         echo Cannot find either TurboLinux, RedHat or SuSE CD
41         trap INT
42         exit 1
43 fi
44 mount -t msdos -o loop,ro $bootfloppyimage $tmpmount
45 mknbi-linux $append --output=$1 $tmpmount/${linuximage:-vmlinuz} $tmpmount/${initdisk:-initrd.img}
46 umount $tmpmount
47 rmdir $tmpmount
48 trap INT