d224569041a2426b972b6821fc6a8e16d09de95a
[grml-terminalserver.git] / templates / grub-pxelinux_config
1 # the following variables are available in the template:
2 #
3 # $INTERFACE_     (interface for the terminalserver)
4 # $IP_            (ip for the terminalserver to bind)
5 # $NETMASK_       (network mask)
6 # $GW_            (gateway)
7 # $NAMESERVERS_   (nameservers for the nodes)
8 # $IPRANGE_FROM_  (user configured iprange, first ip)
9 # $IPRANGE_TO_    (user configured iprange, last ip)
10 # $NETWORK_       (first ip in this subnet)
11 # $OPTIONS_       (options for grml-terminalserver)
12 # $BOOT_ARGS_     (boot arguments for the nodes)
13 #
14 # NOTE:
15 # templates are shellscript fragments and will be sourced from the
16 # terminalserver
17 #
18 # GLOBAL_README_END
19
20
21 # default boot arguments used for both grub and pxelinux
22 if [ -e '/live/cow' ]; then
23     default_boot_args_="root=/dev/nfs rw nfsroot=$IP_:$MOUNT_POINT_ \
24 boot=live lang=us nomce quiet apm=power-off nodhcp noprompt noeject"
25 else
26     default_boot_args_="ramdisk_size=24000 root=/dev/ram0 rw \
27 init=/etc/init nfsdir=$IP_:$MOUNT_POINT_ nodhcp noprompt noeject \
28 apm=power-off nomce lang=us"
29 fi
30
31 # special boot arguments required by grub
32 grub_def_boot_args_="/linux26 $default_boot_args_"
33
34 # special boot arguments required by pxelinux
35 pxe_def_boot_args_="$default_boot_args_ initrd=minirt26.gz"
36
37 # default arguments for framebuffer console
38 def_fb_args_="vga=791"
39 no_fb_args_="vga=normal"
40
41 ###
42 ## create grub config
43 ###
44
45 cat >"$TFTPD_DATA_DIR_/menu.lst" <<EOT
46 default=0
47 timeout=10
48 title GRML
49   root (nd)
50   kernel $grub_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
51   initrd /minirt26.gz
52
53 title GRML no framebuffer
54   root (nd)
55   kernel $grub_def_boot_args_ $no_fb_args_ $BOOT_ARGS_
56
57 title GRML small
58   root (nd)
59   kernel $grub_def_boot_args_ small $def_fb_args_ $BOOT_ARGS_
60   initrd /minirt26.gz
61
62 title GRML small nofb
63   root (nd)
64   kernel $grub_def_boot_args_ small $no_fb_args_ $BOOT_ARGS_
65   initrd /minirt26.gz
66
67 title GRML debuginit
68   root (nd)
69   kernel $grub_def_boot_args_ debuginitrd $def_fb_args_ $BOOT_ARGS_
70   initrd /minirt26.gz
71
72 title GRML debuginit nofb
73   root (nd)
74   kernel $grub_def_boot_args_ debuginitrd $no_fb_args_ $BOOT_ARGS_
75   initrd /minirt26.gz
76
77 title GRML rescue
78   root (nd)
79   kernel $grub_def_boot_args_ $no_fb_args_
80   initrd /minirt26.gz
81
82 title memtest
83   root (nd)
84   kernel /memtest
85
86 title Reload config
87   configfile (nd)/menu.lst
88 EOT
89
90 ret_=$?
91
92
93 ###
94 ## create pxelinux config
95 ###
96
97 cat >"$TFTPD_DATA_DIR_/pxelinux.cfg/default" <<EOT
98 DEFAULT linux26
99 APPEND $pxe_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
100 TIMEOUT 100
101 PROMPT 1
102 DISPLAY boot.msg
103 F1 boot.msg
104 LABEL grml
105 KERNEL linux26
106 APPEND $pxe_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
107 LABEL grmlnofb
108 KERNEL linux26
109 APPEND $pxe_def_boot_args_ $no_fb_args_ $BOOT_ARGS_
110 LABEL small
111 KERNEL linux26
112 APPEND $pxe_def_boot_args_ small $def_fb_args_ $BOOT_ARGS_
113 LABEL smallnofb
114 KERNEL linux26
115 APPEND $pxe_def_boot_args_ small $no_fb_args_ $BOOT_ARGS_
116 LABEL debuginit
117 KERNEL linux26
118 APPEND $pxe_def_boot_args_ debuginit $def_fb_args_ $BOOT_ARGS_
119 LABEL debuginit
120 KERNEL linux26
121 APPEND $pxe_def_boot_args_ debuginit $no_fb_args_ $BOOT_ARGS_
122 LABEL rescue
123 KERNEL linux26
124 APPEND $pxe_def_boot_args_ $no_fb_args_
125 LABEL memtest
126 KERNEL memtest
127 APPEND fix
128
129 EOT
130
131 let ret_=$ret_+$?
132 return $ret_