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