various fixes, make settable basefile dir
[automated-distro-installer] / grub.cfg.autodiscover
diff --git a/grub.cfg.autodiscover b/grub.cfg.autodiscover
new file mode 100644 (file)
index 0000000..b1516bb
--- /dev/null
@@ -0,0 +1,87 @@
+## grub2 configuration
+set default="FAI server via dns"
+set timeout=2
+set resolution=1024x768
+
+if loadfont /boot/grub/unicode.pf2 ; then
+   insmod png
+   set gfxmode=640x480
+   insmod gfxterm
+   insmod vbe
+   terminal_output gfxterm
+fi
+
+if background_image /boot/grub/fai.png ; then
+  set color_normal=black/black
+  set color_highlight=red/black
+  set menu_color_normal=black/black
+  set menu_color_highlight=black/yellow
+else
+  set menu_color_normal=white/black
+  set menu_color_highlight=black/yellow
+fi
+
+# make sure we can access partitions
+insmod part_msdos
+insmod part_gpt
+
+if [ ${iso_path} ] ; then
+    set loopback="findiso=${iso_path}"
+fi
+
+menuentry "" --unrestricted {
+    set gfxpayload=$resolution
+}
+menuentry "        +------------------------------------------------------+" --unrestricted {
+    set gfxpayload=$resolution
+}
+
+menuentry "        |        Fully  Automatic  Installation                |" --unrestricted {
+    set gfxpayload=$resolution
+
+}
+menuentry "        |     _VERSIONSTRING_     |" --unrestricted {
+    set gfxpayload=$resolution
+
+}
+menuentry "        |        (c) Thomas Lange  lange@debian.org            |" --unrestricted {
+    set gfxpayload=$resolution
+}
+menuentry "        +------------------------------------------------------+" --unrestricted {
+    set gfxpayload=$resolution
+}
+}
+menuentry "" --unrestricted {
+    set gfxpayload=$resolution
+}
+
+menuentry "Autodiscover the FAI server" {
+    set gfxpayload=$resolution
+    linux   /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt" fai.discover aufs rootovl root=/dev/nfs ip=dhcp quiet
+    initrd  /boot/initrd.img
+}
+
+# ian: Added this from fai
+# note, we could replace faiserver with an ip if we didn't want to mess with dns.
+# args are copied from myfai-chboot-local
+menuentry "FAI server via dns" {
+    set gfxpayload=$resolution
+    linux   /boot/vmlinuz FAI_FLAGS=verbose,sshd,createvt,reboot FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config root=/dev/nfs rw nfsroot=faiserver:/srv/fai/nfsroot,vers=3,nolock aufs rootovl ip=dhcp FAI_FLAGS=verbose,sshd,createvt,reboot
+    initrd  /boot/initrd.img
+}
+
+
+menuentry "Boot OS of first partition on first disk" --unrestricted {
+    if [ -d (cd) ]; then
+       chainloader (hd0)+1
+    fi
+
+    if [ "$root" = "hd1" ]; then
+       chainloader (hd0)+1
+    fi
+
+    if [ "$root" = "hd0" ]; then
+       set root=(hd1)
+       chainloader (hd1)+1
+   fi
+}