fix efi, autodiscover, add a host
[automated-distro-installer] / grub.cfg.autodiscover
1 ## grub2 configuration
2 set default="FAI server via dns"
3 set timeout=20
4
5 # make sure we can access partitions
6 insmod part_msdos
7 insmod part_gpt
8 insmod all_video
9 insmod gfxterm
10
11 set gfxmode=auto
12 set color_normal=white/black
13 set color_highlight=red/black
14 set menu_color_normal=white/black
15 set menu_color_highlight=black/yellow
16
17
18 # ian: Added this from fai
19 # note, we could replace faiserver with an ip if we didn't want to mess with dns.
20 # args are copied from myfai-chboot-local.
21 # Note, for a real cd or usb flash, if it is the default boot device, we would need to remove the disk
22 # after install is done very quickly, or else remove the reboot arg here
23 menuentry "FAI server via dns" {
24 set gfxpayload=$resolution
25 search --set=root --file /FAI-CD
26 linux /boot/vmlinuz 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
27 initrd /boot/initrd.img
28 }
29 # 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
30 menuentry "Autodiscover the FAI server" {
31 search --set=root --file /FAI-CD
32 linux /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt" fai.discover rootovl root=/dev/nfs ip=dhcp quiet
33 initrd /boot/initrd.img
34 }
35
36 menuentry "Boot OS from first partition on first disk" {
37 if [ "$grub_platform" = "efi" ]; then
38 if [ -f (hd0,gpt1)/efi/debian/grub.cfg ]; then
39 configfile (hd0,gpt1)/efi/debian/grub.cfg
40 elif [ -f (hd1,gpt1)/efi/debian/grub.cfg ]; then
41 configfile (hd1,gpt1)/efi/debian/grub.cfg
42 elif [ -f (hd0,gpt2)/boot/grub/grub.cfg ]; then
43 configfile (hd0,gpt2)/boot/grub/grub.cfg
44 elif [ -f (hd1,gpt2)/boot/grub/grub.cfg ]; then
45 configfile (hd1,gpt2)/boot/grub/grub.cfg
46 else
47 echo "cannot find grub.cfg"
48 sleep 7
49 fi
50 # legacy BIOS booting
51 elif [ -d (cd) ]; then
52 set root=(hd0)
53 chainloader +1
54 else
55 set root=(hd1)
56 chainloader +1
57 fi
58 }