fac9ef779ae1fd45534c0adc8f6fbe04d7f9aac2
[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 to faiserver.b8.nz" {
24 set gfxpayload=$resolution
25 search --set=root --file /FAI-CD
26 linux /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt,reboot FAI_CONFIG_SRC=nfs://faiserver.b8.nz/srv/fai/config root=/dev/nfs nfsroot=faiserver.b8.nz:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
27 initrd /boot/initrd.img
28 }
29
30 menuentry "FAI server via dns, no reboot" {
31 set gfxpayload=$resolution
32 search --set=root --file /FAI-CD
33 linux /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://faiserver.b8.nz/srv/fai/config root=/dev/nfs nfsroot=faiserver.b8.nz:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
34 initrd /boot/initrd.img
35 }
36
37 menuentry "FAI server via 192.168.122.1, no reboot" {
38 set gfxpayload=$resolution
39 search --set=root --file /FAI-CD
40 linux /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://192.168.122.1/srv/fai/config root=/dev/nfs nfsroot=192.168.122.1:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
41 initrd /boot/initrd.img
42 }
43
44
45 # 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
46 menuentry "Autodiscover the FAI server" {
47 search --set=root --file /FAI-CD
48 linux /boot/vmlinuz libata.force=noncq FAI_FLAGS="menu,verbose,createvt" fai.discover rootovl root=/dev/nfs ip=dhcp quiet
49 initrd /boot/initrd.img
50 }
51
52 menuentry "Boot OS from first partition on first disk" {
53 if [ "$grub_platform" = "efi" ]; then
54 if [ -f (hd0,gpt1)/efi/debian/grub.cfg ]; then
55 configfile (hd0,gpt1)/efi/debian/grub.cfg
56 elif [ -f (hd1,gpt1)/efi/debian/grub.cfg ]; then
57 configfile (hd1,gpt1)/efi/debian/grub.cfg
58 elif [ -f (hd0,gpt2)/boot/grub/grub.cfg ]; then
59 configfile (hd0,gpt2)/boot/grub/grub.cfg
60 elif [ -f (hd1,gpt2)/boot/grub/grub.cfg ]; then
61 configfile (hd1,gpt2)/boot/grub/grub.cfg
62 else
63 echo "cannot find grub.cfg"
64 sleep 7
65 fi
66 # legacy BIOS booting
67 elif [ -d (cd) ]; then
68 set root=(hd0)
69 chainloader +1
70 else
71 set root=(hd1)
72 chainloader +1
73 fi
74 }