static usb ethnet addresses
[automated-distro-installer] / grub.cfg.autodiscover
index 8d102687c17d2b50e2a8d50e355a39115d26c4ae..31bcb084c44886324554cebc20333c9517df870e 100644 (file)
@@ -1,89 +1,66 @@
 ## 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
+set timeout=20
 
 # make sure we can access partitions
 insmod part_msdos
 insmod part_gpt
+insmod all_video
+insmod gfxterm
 
-if [ ${iso_path} ] ; then
-    set loopback="findiso=${iso_path}"
-fi
-
-menuentry "" --unrestricted {
-    set gfxpayload=$resolution
-}
-menuentry "        +------------------------------------------------------+" --unrestricted {
-    set gfxpayload=$resolution
-}
+set gfxmode=auto
+set color_normal=white/black
+set color_highlight=red/black
+set menu_color_normal=white/black
+set menu_color_highlight=black/yellow
 
-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
-}
 
 # 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.
-# Note, for a real cd or usb flash, we probably do not want reboot, so we can remove the disk
-# after install is done
+# Note, for a real cd or usb flash, if it is the default boot device, we would need to remove the disk
+# after install is done very quickly, or else remove the reboot arg here
 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 rootvol ip=dhcp FAI_FLAGS=verbose,sshd,createvt
+    search --set=root --file /FAI-CD
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt,reboot FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config root=/dev/nfs nfsroot=faiserver:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
     initrd  /boot/initrd.img
 }
 
-menuentry "Autodiscover the FAI server" {
+menuentry "FAI server via dns, no reboot" {
     set gfxpayload=$resolution
-    linux   /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt,reboot" fai.discover aufs rootovl root=/dev/nfs ip=dhcp quiet
+    search --set=root --file /FAI-CD
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config root=/dev/nfs nfsroot=faiserver:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
     initrd  /boot/initrd.img
 }
 
+# ro,noatime,vers=3,rsize=1048576,wsize=same,namelen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.2.0.2,nountvers=3,mountport=49179,mountproto=udp,lock_lock=all,addr=10.2.0.2
+menuentry "Autodiscover the FAI server" {
+    search --set=root --file /FAI-CD
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS="menu,verbose,createvt" fai.discover rootovl root=/dev/nfs ip=dhcp quiet
+    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
+menuentry "Boot OS from first partition on first disk" {
+   if [ "$grub_platform" = "efi" ]; then
+      if [ -f (hd0,gpt1)/efi/debian/grub.cfg ]; then
+           configfile (hd0,gpt1)/efi/debian/grub.cfg
+      elif [ -f (hd1,gpt1)/efi/debian/grub.cfg ]; then
+           configfile (hd1,gpt1)/efi/debian/grub.cfg
+      elif [ -f (hd0,gpt2)/boot/grub/grub.cfg ]; then
+           configfile (hd0,gpt2)/boot/grub/grub.cfg
+      elif [ -f (hd1,gpt2)/boot/grub/grub.cfg ]; then
+           configfile (hd1,gpt2)/boot/grub/grub.cfg
+      else
+          echo "cannot find grub.cfg"
+          sleep 7
+      fi
+   # legacy BIOS booting
+   elif [ -d (cd) ]; then
+       set root=(hd0)
+       chainloader +1
+   else
        set root=(hd1)
-       chainloader (hd1)+1
+       chainloader +1
    fi
 }