249fbbf5e1ea72407d66e26c8739a9a963694e92
[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 default_boot_args_="ramdisk_size=24000 root=/dev/ram0 rw \
23 init=/etc/init nfsdir=$IP_:$MOUNT_POINT_ nodhcp noprompt noeject \
24 apm=power-off nomce lang=us"
25
26 # special boot arguments required by grub
27 grub_def_boot_args_="/linux26 $default_boot_args_"
28
29 # special boot arguments required by pxelinux
30 pxe_def_boot_args_="$default_boot_args_ initrd=minirt26.gz"
31
32 # default arguments for framebuffer console
33 def_fb_args_="vga=791"
34 no_fb_args_="vga=normal"
35
36 ###
37 ## create grub config
38 ###
39
40 cat >"$TFTPD_DATA_DIR_/menu.lst" <<EOT
41 default=0
42 timeout=10
43 title GRML
44   root (nd)
45   kernel $grub_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
46   initrd /minirt26.gz
47
48 title GRML no framebuffer
49   root (nd)
50   kernel $grub_def_boot_args_ $no_fb_args_ $BOOT_ARGS_
51
52 title GRML small
53   root (nd)
54   kernel $grub_def_boot_args_ small $def_fb_args_ $BOOT_ARGS_
55   initrd /minirt26.gz
56
57 title GRML small nofb
58   root (nd)
59   kernel $grub_def_boot_args_ small $no_fb_args_ $BOOT_ARGS_
60   initrd /minirt26.gz
61
62 title GRML debuginit
63   root (nd)
64   kernel $grub_def_boot_args_ debuginitrd $def_fb_args_ $BOOT_ARGS_
65   initrd /minirt26.gz
66
67 title GRML debuginit nofb
68   root (nd)
69   kernel $grub_def_boot_args_ debuginitrd $no_fb_args_ $BOOT_ARGS_
70   initrd /minirt26.gz
71
72 title GRML rescue
73   root (nd)
74   kernel $grub_def_boot_args_ $no_fb_args_
75   initrd /minirt26.gz
76
77 title memtest
78   root (nd)
79   kernel /memtest
80
81 title Reload config
82   configfile (nd)/menu.lst
83 EOT
84
85 ret_=$?
86
87
88 ###
89 ## create pxelinux config
90 ###
91
92 cat >"$TFTPD_DATA_DIR_/pxelinux.cfg/default" <<EOT
93 DEFAULT linux26
94 APPEND $pxe_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
95 TIMEOUT 100
96 PROMPT 1
97 DISPLAY boot.msg
98 F1 boot.msg
99 LABEL grml
100 KERNEL linux26
101 APPEND $pxe_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
102 LABEL grmlnofb
103 KERNEL linux26
104 APPEND $pxe_def_boot_args_ $no_fb_args_ $BOOT_ARGS_
105 LABEL small
106 KERNEL linux26
107 APPEND $pxe_def_boot_args_ small $def_fb_args_ $BOOT_ARGS_
108 LABEL smallnofb
109 KERNEL linux26
110 APPEND $pxe_def_boot_args_ small $no_fb_args_ $BOOT_ARGS_
111 LABEL debuginit
112 KERNEL linux26
113 APPEND $pxe_def_boot_args_ debuginit $def_fb_args_ $BOOT_ARGS_
114 LABEL debuginit
115 KERNEL linux26
116 APPEND $pxe_def_boot_args_ debuginit $no_fb_args_ $BOOT_ARGS_
117 LABEL rescue
118 KERNEL linux26
119 APPEND $pxe_def_boot_args_ $no_fb_args_
120 LABEL memtest
121 KERNEL memtest
122 APPEND fix
123
124 EOT
125
126 let ret_=$ret_+$?
127 return $ret_