Merge branch 'master' into sudoman-mods
[fai-configs.git] / scripts / LILO / 20-create-liloconf
CommitLineData
2d1f8014 1#! /bin/bash
2
3# copyright Thomas Lange 2001-2005, lange@debian.org
4# LILO support may be dropped in a future release
5
6FFLAGS=${FAI_FLAGS// /,}
7
8cd $target/boot && kernelversion=$(ls vmlinuz-*)
9
10# if class NOMBR is defined, write boot loader into root partition, not into mbr
11ifclass NOMBR && BOOT_DEVICE=$ROOT_PARTITION
12
13if ifclass LILO; then
14 fcopy /etc/lilo.conf || {
15 # if the installed kernel is using an initial ramdisk
16 if [ -L $target/initrd.img ]; then
17 initrdopt="initrd=/initrd.img"
18 fi
19 # write lilo.conf and install lilo to disk
20 echo "Creating lilo.conf for /vmlinuz"
21 cat > $target/etc/lilo.conf <<-EOF
22 boot=$BOOT_DEVICE
23 root=$ROOT_PARTITION
24 install=/boot/boot.b
25 map=/boot/map
26 vga=normal
27 delay=50
28
29 image=/vmlinuz
30 append="devfs=nomount $kappend"
31 $initrdopt
32 label=linux
33 read-only
34
35 image=/vmlinuz.old
36 label=linux.old
37 read-only
38 optional
39 $liloappend
40EOF
41 }
42fi
43
44# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45ifclass FAI_BOOTPART && {
46
47 rev=`uname -r`
48 mkdir -p $target/fai-boot
49 cp -a /boot/vmlinuz-$rev $target/fai-boot
50
51 ifclass LILO && {
52 # write lilo.conf and install lilo to disk
53 echo "Add /fai-boot partition to lilo.conf"
54
55 cat >> $target/etc/lilo.conf <<-EOF
56 image=/fai-boot/boot/$kernelversion
57 $initrdopt
58 append="devfs=nomount"
59 label=FAI
60EOF
61 mkdir $target/fai-boot/etc
62 cp $target/etc/lilo.conf $target/fai-boot/etc
63 }
64
65}
66
67# now call lilo
68# you can also use this
69# $ROOTCMD lilo -v
70if ifclass LILO; then
71 $target/sbin/lilo -r $target
72fi