| # Root grub.cfg used either to boot raw kernel and/or initramfs.img, or to |
| # chain to an installed distro's GRUB configuration file |
| |
| # These options are accessible to chain-loaded configurations as well: |
| # |
| # pnpacpi=off Disable on QEMU; allows serdev to claim platform serial |
| # acpi=noirq Do not configure IRQ routing using ACPI tables |
| # reboot=k Reboot using keyboard method, rather than ACPI |
| # noexec=off Some kernels panic when setting up NX |
| # noefi Some kernels panic when trying to use U-Boot EFI |
| # panic=-1 Don't reboot on panic |
| # console=hvc0 Switch kernel logging to virtio-console once available |
| # console=ttyAMA0 QEMU on ARM64 uses alternative serial implementation |
| # |
| if [ "$grub_cpu" = "i386" ]; then |
| set cmdline="pnpacpi=off acpi=noirq reboot=k noexec=off console=ttyS0 noefi panic=-1 console=hvc0" |
| elif [ "$grub_cpu" = "arm64" ]; then |
| set cmdline="console=ttyS0 console=ttyAMA0 noefi panic=-1 console=hvc0" |
| else |
| echo "Warning: No architecture found for ${grub_cpu}" |
| fi |
| |
| # Root filesystem is on a GUID partition with label "otheros_root" |
| set rootfs="/dev/vda14" |
| |
| # Root filesystem with grub installed |
| search --file --set root /boot/grub/grub.cfg --hint (hd0) |
| if [ $? = 0 ]; then |
| set prefix=($root)/boot/grub |
| export cmdline |
| export rootfs |
| configfile $prefix/grub.cfg |
| normal_exit |
| fi |
| |
| # Fall back if we couldn't chain to another GRUB install |
| set timeout=0 |
| menuentry "Linux" { |
| linux /vmlinuz $cmdline root=$rootfs |
| if [ -e /initrd.img ]; then |
| initrd /initrd.img |
| fi |
| } |