X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=grub.cfg.autodiscover;h=9103e45ab1c928d677580373ffdf65cd804eb668;hp=b1516bb27446b76d775eb8c869b79d9469728065;hb=HEAD;hpb=527f50b38e4a94a771215131cafe016a97ba83cd diff --git a/grub.cfg.autodiscover b/grub.cfg.autodiscover index b1516bb..31bcb08 100644 --- a/grub.cfg.autodiscover +++ b/grub.cfg.autodiscover @@ -1,87 +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 { +# 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, 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 + 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" 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 } -# 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 +# 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 }