|
| 1 | +# This file is copied from https://github.com/coreos/coreos-assembler/blob/main/src/grub.cfg |
| 2 | +# Changes: |
| 3 | +# - Dropped Ignition glue, that can be injected into platform.cfg |
| 4 | +set pager=1 |
| 5 | +# petitboot doesn't support -e and doesn't support an empty path part |
| 6 | +if [ -d (md/md-boot)/grub2 ]; then |
| 7 | + # fcct currently creates /boot RAID with superblock 1.0, which allows |
| 8 | + # component partitions to be read directly as filesystems. This is |
| 9 | + # necessary because transposefs doesn't yet rerun grub2-install on BIOS, |
| 10 | + # so GRUB still expects /boot to be a partition on the first disk. |
| 11 | + # |
| 12 | + # There are two consequences: |
| 13 | + # 1. On BIOS and UEFI, the search command might pick an individual RAID |
| 14 | + # component, but we want it to use the full RAID in case there are bad |
| 15 | + # sectors etc. The undocumented --hint option is supposed to support |
| 16 | + # this sort of override, but it doesn't seem to work, so we set $boot |
| 17 | + # directly. |
| 18 | + # 2. On BIOS, the "normal" module has already been loaded from an |
| 19 | + # individual RAID component, and $prefix still points there. We want |
| 20 | + # future module loads to come from the RAID, so we reset $prefix. |
| 21 | + # (On UEFI, the stub grub.cfg has already set $prefix properly.) |
| 22 | + set boot=md/md-boot |
| 23 | + set prefix=($boot)/grub2 |
| 24 | +else |
| 25 | + if [ -f ${config_directory}/bootuuid.cfg ]; then |
| 26 | + source ${config_directory}/bootuuid.cfg |
| 27 | + fi |
| 28 | + if [ -n "${BOOT_UUID}" ]; then |
| 29 | + search --fs-uuid "${BOOT_UUID}" --set boot --no-floppy |
| 30 | + else |
| 31 | + search --label boot --set boot --no-floppy |
| 32 | + fi |
| 33 | +fi |
| 34 | +set root=$boot |
| 35 | + |
| 36 | +if [ -f ${config_directory}/grubenv ]; then |
| 37 | + load_env -f ${config_directory}/grubenv |
| 38 | +elif [ -s $prefix/grubenv ]; then |
| 39 | + load_env |
| 40 | +fi |
| 41 | + |
| 42 | +if [ x"${feature_menuentry_id}" = xy ]; then |
| 43 | + menuentry_id_option="--id" |
| 44 | +else |
| 45 | + menuentry_id_option="" |
| 46 | +fi |
| 47 | + |
| 48 | +function load_video { |
| 49 | + if [ x$feature_all_video_module = xy ]; then |
| 50 | + insmod all_video |
| 51 | + else |
| 52 | + insmod efi_gop |
| 53 | + insmod efi_uga |
| 54 | + insmod ieee1275_fb |
| 55 | + insmod vbe |
| 56 | + insmod vga |
| 57 | + insmod video_bochs |
| 58 | + insmod video_cirrus |
| 59 | + fi |
| 60 | +} |
| 61 | + |
| 62 | +# tracker: https://github.com/coreos/fedora-coreos-tracker/issues/805 |
| 63 | +if [ -f $prefix/platform.cfg ]; then |
| 64 | + source $prefix/platform.cfg |
| 65 | +fi |
| 66 | + |
| 67 | +if [ x$feature_timeout_style = xy ] ; then |
| 68 | + set timeout_style=menu |
| 69 | + set timeout=1 |
| 70 | +# Fallback normal timeout code in case the timeout_style feature is |
| 71 | +# unavailable. |
| 72 | +else |
| 73 | + set timeout=1 |
| 74 | +fi |
| 75 | + |
| 76 | +# Import user defined configuration |
| 77 | +# tracker: https://github.com/coreos/fedora-coreos-tracker/issues/805 |
| 78 | +if [ -f $prefix/user.cfg ]; then |
| 79 | + source $prefix/user.cfg |
| 80 | +fi |
| 81 | + |
| 82 | +blscfg |
| 83 | + |
0 commit comments