1 # the following variables are available in the template:
3 # $INTERFACE_ (interface for the terminalserver)
4 # $IP_ (ip for the terminalserver to bind)
5 # $NETMASK_ (network mask)
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)
15 # templates are shellscript fragments and will be sourced from the
20 if grep -q live-media-path= /proc/cmdline 2>/dev/null ; then
21 live_media_path_="live-media-path=$(awk -F live-media-path= '{print $2}' /proc/cmdline)"
24 # default boot arguments used for both grub and pxelinux
25 if [ -e '/live/cow' ]; then
26 default_boot_args_="root=/dev/nfs rw nfsroot=$IP_:$MOUNT_POINT_ \
27 nodhcp noprompt noeject"
29 default_boot_args_="ramdisk_size=24000 root=/dev/ram0 rw \
30 init=/etc/init nfsdir=$IP_:$MOUNT_POINT_ nodhcp noprompt noeject \
34 # special boot arguments required by grub
35 grub_def_boot_args_="/linux26 $default_boot_args_"
37 # special boot arguments required by pxelinux
38 pxe_def_boot_args_="$default_boot_args_"
40 # default arguments for framebuffer console
41 def_fb_args_="vga=791"
42 no_fb_args_="vga=normal"
48 cat >"$TFTPD_DATA_DIR_/menu.lst" <<EOT
53 kernel $grub_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
56 title GRML no framebuffer
58 kernel $grub_def_boot_args_ $no_fb_args_ $BOOT_ARGS_
62 kernel $grub_def_boot_args_ small $def_fb_args_ $BOOT_ARGS_
67 kernel $grub_def_boot_args_ small $no_fb_args_ $BOOT_ARGS_
72 kernel $grub_def_boot_args_ debuginitrd $def_fb_args_ $BOOT_ARGS_
75 title GRML debuginit nofb
77 kernel $grub_def_boot_args_ debuginitrd $no_fb_args_ $BOOT_ARGS_
82 kernel $grub_def_boot_args_ $no_fb_args_
90 configfile (nd)/menu.lst
97 ## create pxelinux config
100 grml2usb --bootloader-only \
101 --bootoptions="$pxe_def_boot_args_ $BOOT_ARGS_" /live/image "$DEST_DIR"
103 mv "$DEST_DIR"/boot/syslinux/* "$TFTPD_DATA_DIR_/"
104 rmdir "$DEST_DIR"/boot/syslinux
106 mv "$DEST_DIR"/boot/ "$TFTPD_DATA_DIR_"
109 # cd is multi iso, grml2usb got it right ;0
110 if [ -d "$MOUNT_POINT_"/boot/release ] ; then
111 sed -i -e 's#\(.*\)/boot/\(.*\)#\1\2#' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null
113 # remove normal kernel path and use our image
114 sed -i -e 's/.*kernel.*linux26/kernel linux26/' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null
115 sed -i -e 's/\(initrd\)=[[:alnum:]/._-]*/\1=minirt26.gz/' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null
117 # only append live-media-path if needed
118 if [ ! -z "$live_media_path_" ] ; then
119 sed -i -e 's/\(live-media-path\)=[[:alnum:]/._-]*/\1='$live_media_path_'/' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null
121 sed -i -e 's/live-media-path=[[:alnum:]/._-]*//' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/nul
125 # adjust ldbsd.com bootline
126 sed -i -e 's#\(.*kernel .*/ldbsd.com\)#\1 set image /boot/addons/bsd4grml/bsd.rd`echo Type "boot" to load MirOS bsd4grml via keeppxe#' "$TFTPD_DATA_DIR_/"addon_*_bsd.cfg
128 # remove grub entries
129 rm -f "$TFTPD_DATA_DIR_/"addon_*grub*.cfg
131 mv "$TFTPD_DATA_DIR_/syslinux.cfg" "$TFTPD_DATA_DIR_/pxelinux.cfg/default"