File: mklnim

package info (click to toggle)
mknbi 1.2.7-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 628 kB
  • ctags: 1,489
  • sloc: asm: 3,907; ansic: 1,980; perl: 1,147; makefile: 217; sh: 47; pascal: 37
file content (48 lines) | stat: -rwxr-xr-x 1,172 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#
#	Make Linux Netinstall Image
#	Takes a RedHat, TurboLinux or SuSE CD
#	and creates a network bootable image
#
#	mklnim outputfile [path-to-cdrom]
#
#	path-to-cdrom defaults to /mnt/cdrom
#
if [ $# -lt 1 ]
then
	echo Usage: $0 outputfile [path-to-cdrom]
	exit 1
fi
pathtocdrom=${2:-"/mnt/cdrom"}
trap '' INT
tmpmount=/tmp/lnim.$$
mkdir $tmpmount
if [ -r $pathtocdrom/images/cdboot.img ]
then
	bootfloppyimage="$pathtocdrom/images/cdboot.img"
	echo TurboLinux CDROM
elif [ -r $pathtocdrom/images/bootnet.img ]
then
	bootfloppyimage="$pathtocdrom/images/bootnet.img"
	append='--append=network'
	echo RedHat 6.x CDROM
elif [ -r $pathtocdrom/images/boot.img ]
then
	bootfloppyimage="$pathtocdrom/images/boot.img"
	echo RedHat 5.2 CDROM
elif [ -r $pathtocdrom/disks/bootdisk ]
then
	bootfloppyimage="$pathtocdrom/disks/bootdisk"
	linuximage=linux
	initdisk=initdisk.gz
	echo SuSE 6.x CDROM
else
	echo Cannot find either TurboLinux, RedHat or SuSE CD
	trap INT
	exit 1
fi
mount -t msdos -o loop,ro $bootfloppyimage $tmpmount
mknbi-linux $append --output=$1 $tmpmount/${linuximage:-vmlinuz} $tmpmount/${initdisk:-initrd.img}
umount $tmpmount
rmdir $tmpmount
trap INT