diff --git a/config/coreboot/d510mo_16mb/target.cfg b/config/coreboot/d510mo_16mb/target.cfg index ef75af4..62768ec 100644 --- a/config/coreboot/d510mo_16mb/target.cfg +++ b/config/coreboot/d510mo_16mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" release="n" diff --git a/config/coreboot/d945gclf_8mb/target.cfg b/config/coreboot/d945gclf_8mb/target.cfg index 38e5763..3f02032 100644 --- a/config/coreboot/d945gclf_8mb/target.cfg +++ b/config/coreboot/d945gclf_8mb/target.cfg @@ -1,5 +1,5 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" release="n" diff --git a/config/coreboot/e6400_4mb/target.cfg b/config/coreboot/e6400_4mb/target.cfg index 3aba905..f6d540d 100644 --- a/config/coreboot/e6400_4mb/target.cfg +++ b/config/coreboot/e6400_4mb/target.cfg @@ -1,7 +1,7 @@ tree="dell" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" vcfg="e6400" diff --git a/config/coreboot/kcma_d8-udimm_16mb/target.cfg b/config/coreboot/kcma_d8-udimm_16mb/target.cfg index 749c4e4..ce97e14 100644 --- a/config/coreboot/kcma_d8-udimm_16mb/target.cfg +++ b/config/coreboot/kcma_d8-udimm_16mb/target.cfg @@ -2,7 +2,7 @@ tree="fam15h_udimm" xtree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_timout=10 diff --git a/config/coreboot/kcma_d8_rdimm_16mb/target.cfg b/config/coreboot/kcma_d8_rdimm_16mb/target.cfg index 744b6e1..cb012f9 100644 --- a/config/coreboot/kcma_d8_rdimm_16mb/target.cfg +++ b/config/coreboot/kcma_d8_rdimm_16mb/target.cfg @@ -1,7 +1,7 @@ tree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_scan_disk="nvme ahci" diff --git a/config/coreboot/kcma_d8_rdimm_2mb/target.cfg b/config/coreboot/kcma_d8_rdimm_2mb/target.cfg index 744b6e1..cb012f9 100644 --- a/config/coreboot/kcma_d8_rdimm_2mb/target.cfg +++ b/config/coreboot/kcma_d8_rdimm_2mb/target.cfg @@ -1,7 +1,7 @@ tree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_scan_disk="nvme ahci" diff --git a/config/coreboot/kcma_d8_udimm_2mb/target.cfg b/config/coreboot/kcma_d8_udimm_2mb/target.cfg index 00e1d51..9c3a090 100644 --- a/config/coreboot/kcma_d8_udimm_2mb/target.cfg +++ b/config/coreboot/kcma_d8_udimm_2mb/target.cfg @@ -2,7 +2,7 @@ tree="fam15h_udimm" xtree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_scan_disk="nvme ahci" diff --git a/config/coreboot/kfsn4_dre_2mb/target.cfg b/config/coreboot/kfsn4_dre_2mb/target.cfg index 51b50a3..ab87dd2 100644 --- a/config/coreboot/kfsn4_dre_2mb/target.cfg +++ b/config/coreboot/kfsn4_dre_2mb/target.cfg @@ -1,6 +1,6 @@ tree="fam15h_udimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" diff --git a/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg b/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg index 744b6e1..cb012f9 100644 --- a/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg +++ b/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg @@ -1,7 +1,7 @@ tree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_scan_disk="nvme ahci" diff --git a/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg b/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg index 744b6e1..cb012f9 100644 --- a/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg +++ b/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg @@ -1,7 +1,7 @@ tree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_scan_disk="nvme ahci" diff --git a/config/coreboot/kgpe_d16_udimm_16mb/target.cfg b/config/coreboot/kgpe_d16_udimm_16mb/target.cfg index 00e1d51..9c3a090 100644 --- a/config/coreboot/kgpe_d16_udimm_16mb/target.cfg +++ b/config/coreboot/kgpe_d16_udimm_16mb/target.cfg @@ -2,7 +2,7 @@ tree="fam15h_udimm" xtree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_scan_disk="nvme ahci" diff --git a/config/coreboot/kgpe_d16_udimm_2mb/target.cfg b/config/coreboot/kgpe_d16_udimm_2mb/target.cfg index 00e1d51..9c3a090 100644 --- a/config/coreboot/kgpe_d16_udimm_2mb/target.cfg +++ b/config/coreboot/kgpe_d16_udimm_2mb/target.cfg @@ -2,7 +2,7 @@ tree="fam15h_udimm" xtree="fam15h_rdimm" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" xlang="c" grub_scan_disk="nvme ahci" diff --git a/config/coreboot/macbook11/target.cfg b/config/coreboot/macbook11/target.cfg index 043bd36..c7eddcc 100644 --- a/config/coreboot/macbook11/target.cfg +++ b/config/coreboot/macbook11/target.cfg @@ -1,5 +1,5 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" grub_scan_disk="ahci" diff --git a/config/coreboot/macbook11_16mb/target.cfg b/config/coreboot/macbook11_16mb/target.cfg index a2231fc..1bdb98f 100644 --- a/config/coreboot/macbook11_16mb/target.cfg +++ b/config/coreboot/macbook11_16mb/target.cfg @@ -1,5 +1,5 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" scan_scan_disk="ahci" diff --git a/config/coreboot/macbook21/target.cfg b/config/coreboot/macbook21/target.cfg index 12e51f9..7e716a4 100644 --- a/config/coreboot/macbook21/target.cfg +++ b/config/coreboot/macbook21/target.cfg @@ -1,6 +1,6 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/macbook21_16mb/target.cfg b/config/coreboot/macbook21_16mb/target.cfg index 12e51f9..7e716a4 100644 --- a/config/coreboot/macbook21_16mb/target.cfg +++ b/config/coreboot/macbook21_16mb/target.cfg @@ -1,6 +1,6 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/qemu_x86_12mb/target.cfg b/config/coreboot/qemu_x86_12mb/target.cfg index 9572fdc..27921ff 100644 --- a/config/coreboot/qemu_x86_12mb/target.cfg +++ b/config/coreboot/qemu_x86_12mb/target.cfg @@ -1,6 +1,5 @@ tree="default" xarch="i386-elf" payload_grub="y" -payload_grub_withseabios="y" payload_seabios="y" payload_memtest="y" diff --git a/config/coreboot/r400_16mb/target.cfg b/config/coreboot/r400_16mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/r400_16mb/target.cfg +++ b/config/coreboot/r400_16mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/r400_4mb/target.cfg b/config/coreboot/r400_4mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/r400_4mb/target.cfg +++ b/config/coreboot/r400_4mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/r400_8mb/target.cfg b/config/coreboot/r400_8mb/target.cfg index 1e7b56c..f596cc0 100644 --- a/config/coreboot/r400_8mb/target.cfg +++ b/config/coreboot/r400_8mb/target.cfg @@ -1,5 +1,5 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" diff --git a/config/coreboot/r500_4mb/target.cfg b/config/coreboot/r500_4mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/r500_4mb/target.cfg +++ b/config/coreboot/r500_4mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t400_16mb/target.cfg b/config/coreboot/t400_16mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/t400_16mb/target.cfg +++ b/config/coreboot/t400_16mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t400_4mb/target.cfg b/config/coreboot/t400_4mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/t400_4mb/target.cfg +++ b/config/coreboot/t400_4mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t400_8mb/target.cfg b/config/coreboot/t400_8mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/t400_8mb/target.cfg +++ b/config/coreboot/t400_8mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t500_16mb/target.cfg b/config/coreboot/t500_16mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/t500_16mb/target.cfg +++ b/config/coreboot/t500_16mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t500_4mb/target.cfg b/config/coreboot/t500_4mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/t500_4mb/target.cfg +++ b/config/coreboot/t500_4mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t500_8mb/target.cfg b/config/coreboot/t500_8mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/t500_8mb/target.cfg +++ b/config/coreboot/t500_8mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t60_16mb_intelgpu/target.cfg b/config/coreboot/t60_16mb_intelgpu/target.cfg index 043bd36..c7eddcc 100644 --- a/config/coreboot/t60_16mb_intelgpu/target.cfg +++ b/config/coreboot/t60_16mb_intelgpu/target.cfg @@ -1,5 +1,5 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" grub_scan_disk="ahci" diff --git a/config/coreboot/t60_intelgpu/target.cfg b/config/coreboot/t60_intelgpu/target.cfg index 043bd36..c7eddcc 100644 --- a/config/coreboot/t60_intelgpu/target.cfg +++ b/config/coreboot/t60_intelgpu/target.cfg @@ -1,5 +1,5 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" grub_scan_disk="ahci" diff --git a/config/coreboot/w500_16mb/target.cfg b/config/coreboot/w500_16mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/w500_16mb/target.cfg +++ b/config/coreboot/w500_16mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/w500_4mb/target.cfg b/config/coreboot/w500_4mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/w500_4mb/target.cfg +++ b/config/coreboot/w500_4mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/w500_8mb/target.cfg b/config/coreboot/w500_8mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/w500_8mb/target.cfg +++ b/config/coreboot/w500_8mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/x200_16mb/target.cfg b/config/coreboot/x200_16mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/x200_16mb/target.cfg +++ b/config/coreboot/x200_16mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/x200_4mb/target.cfg b/config/coreboot/x200_4mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/x200_4mb/target.cfg +++ b/config/coreboot/x200_4mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/x200_8mb/target.cfg b/config/coreboot/x200_8mb/target.cfg index 341e655..4a9af47 100644 --- a/config/coreboot/x200_8mb/target.cfg +++ b/config/coreboot/x200_8mb/target.cfg @@ -1,6 +1,6 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" grub_scan_disk="ahci" diff --git a/config/coreboot/x301_16mb/target.cfg b/config/coreboot/x301_16mb/target.cfg index 50e91f6..16ffc81 100644 --- a/config/coreboot/x301_16mb/target.cfg +++ b/config/coreboot/x301_16mb/target.cfg @@ -1,7 +1,7 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" release="n" grub_scan_disk="ahci" diff --git a/config/coreboot/x301_4mb/target.cfg b/config/coreboot/x301_4mb/target.cfg index 50e91f6..16ffc81 100644 --- a/config/coreboot/x301_4mb/target.cfg +++ b/config/coreboot/x301_4mb/target.cfg @@ -1,7 +1,7 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" release="n" grub_scan_disk="ahci" diff --git a/config/coreboot/x301_8mb/target.cfg b/config/coreboot/x301_8mb/target.cfg index 50e91f6..16ffc81 100644 --- a/config/coreboot/x301_8mb/target.cfg +++ b/config/coreboot/x301_8mb/target.cfg @@ -1,7 +1,7 @@ tree="default" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" payload_memtest="y" release="n" grub_scan_disk="ahci" diff --git a/config/coreboot/x60/target.cfg b/config/coreboot/x60/target.cfg index 043bd36..c7eddcc 100644 --- a/config/coreboot/x60/target.cfg +++ b/config/coreboot/x60/target.cfg @@ -1,5 +1,5 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" grub_scan_disk="ahci" diff --git a/config/coreboot/x60_16mb/target.cfg b/config/coreboot/x60_16mb/target.cfg index 043bd36..c7eddcc 100644 --- a/config/coreboot/x60_16mb/target.cfg +++ b/config/coreboot/x60_16mb/target.cfg @@ -1,5 +1,5 @@ tree="i945" xarch="i386-elf" payload_seabios="y" -payload_seabios_withgrub="y" +payload_grub="y" grub_scan_disk="ahci" diff --git a/script/roms b/script/roms index 10d7ef0..ae64adc 100755 --- a/script/roms +++ b/script/roms @@ -22,10 +22,9 @@ stm32dir="$stm32src/boards" # Disable all payloads by default. # target.cfg files have to specifically enable [a] payload(s) -pv="payload_uboot payload_grub_withseabios payload_seabios payload_memtest t" -pv="$pv payload_seabios_withgrub payload_grub" +pv="payload_uboot payload_seabios payload_memtest t payload_grub" v="romdir cbrom initmode displaymode cbcfg targetdir tree release ubootelf" -v="$v grub_timeout board grub_scan_disk uboot_config grubtree grubelf tmpmv" +v="$v board grub_scan_disk uboot_config grubtree grubelf tmpmv" eval `setvars "n" $pv` eval `setvars "" $v boards targets serdir ser` @@ -97,30 +96,24 @@ configure_target() # Override the above defaults using target.cfg eval `setcfg "$targetdir/target.cfg"` + [ -z "$tree" ] && $err "$board: tree not defined" + [ "$xbmk_release" = "y" ] && [ "$release" = "n" ] && return 1 + [ "$board" = "$tree" ] && return 1 + + [ -n "$uboot_config" ] || uboot_config="default" + [ "$payload_uboot" = "y" ] || payload_seabios="y" + [ "$payload_grub" = "y" ] && payload_seabios="y" + [ "$payload_seabios" = "y" ] && [ -n "$payload_uboot" = "y" ] && \ + $err "$board: U-Boot and SeaBIOS/GRUB are both enabled." + [ -z "$grub_scan_disk" ] && grub_scan_disk="nvme ahci ata" [ -n "$grubtree" ] || grubtree="default" grubelf="elf/grub/$grubtree/payload/grub.elf" - [ -z "$tree" ] && $err "$board: tree not defined" - - [ "$payload_memtest" != "y" ] && payload_memtest="n" + [ "$payload_memtest" = "y" ] || payload_memtest="n" [ "$(uname -m)" = "x86_64" ] || payload_memtest="n" - - [ "$payload_grub_withseabios" = "y" ] && eval `setvars "y" \ - payload_grub payload_seabios payload_seabios_withgrub` - [ "$payload_seabios_withgrub" = "y" ] && payload_seabios="y" - - # The reverse logic must not be applied. If SeaBIOS-with-GRUB works, - # that doesn't mean GRUB-with-SeaBIOS will, e.g. VGA ROM execution - [ "$payload_grub" != "y" ] && [ "$payload_seabios" != "y" ] && \ - [ "$payload_uboot" != "y" ] && $err "'$board' defines no payload" - - [ "$payload_uboot" = "y" ] || payload_uboot="n" - [ -n "$uboot_config" ] || uboot_config="default" - - [ "$xbmk_release" = "y" ] && [ "$release" = "n" ] && return 1 - [ "$board" = "$tree" ] && return 1; return 0 + [ "$payload_uboot" = "y" ] && payload_memtest="n"; return 0 } build_payloads() @@ -134,11 +127,7 @@ build_payloads() [ -f "$cbfstool" ] || x_ ./update trees -b coreboot utils $tree [ "$payload_memtest" = "y" ] && x_ ./update trees -b memtest86plus [ "$payload_seabios" = "y" ] && x_ ./update trees -b seabios - - if [ "$payload_grub" = "y" ] || [ "$payload_seabios_withgrub" = "y" ] - then - [ -f "$grubelf" ] || x_ ./update trees -b grub $grubtree - fi + [ "$payload_grub" = "y" ] && x_ ./update trees -b grub $grubtree [ "$payload_uboot" = "y" ] || return 0 x_ ./update trees -b u-boot $board @@ -181,19 +170,18 @@ build_roms() [ "$payload_memtest" != "y" ] || cbfs "$cbrom" \ "elf/memtest86plus/memtest.bin" img/memtest [ "$payload_seabios" = "y" ] && build_seabios_roms - [ "$payload_grub" != "y" ] || build_grub_roms "$cbrom" "grub" [ "$payload_uboot" = "y" ] && x_ cp "$_cbrom" "$cbrom" && \ build_uboot_roms; return 0 } build_seabios_roms() { - if [ "$payload_seabios_withgrub" = "y" ]; then + if [ "$payload_grub" = "y" ]; then # SeaBIOS with GRUB t="$(mktemp -t coreboot_rom.XXXXXXXXXX)" x_ cp "$cbrom" "$t" - build_grub_roms "$t" "seabios_withgrub" - else - t="$(mkSeabiosRom "$cbrom" "fallback/payload")" || \ + build_seagrub_roms "$t" "seabios_withgrub" + else # SeaBIOS only + t="$(mkSeabiosRom "$cbrom")" || \ $err "build_seabios_roms: cannot build tmprom" newrom="$romdir/seabios_${board}_${initmode}_$displaymode" [ "$initmode" = "normal" ] && newrom="$romdir/seabios" \ @@ -203,40 +191,25 @@ build_seabios_roms() x_ rm -f "$t" } -# Make separate ROM images with GRUB payload -build_grub_roms() +build_seagrub_roms() { - tmprom="$1" - payload1="$2" # allow values: grub, seabios, seabios_withgrub - - grub_cbfs="fallback/payload" - if [ "$payload1" = "grub" ] && [ "$payload_grub_withseabios" = "y" ] - then - tmpmv="$(mkSeabiosRom "$tmprom" "seabios.elf")" || \ - $err "build_grub_roms 1 $board: can't build tmprom" - elif [ "$payload1" != "grub" ] && [ "$payload_seabios_withgrub" = "y" ] - then - grub_cbfs="img/grub2" - tmpmv="$(mkSeabiosRom "$tmprom" fallback/payload)" || \ - $err "build_grub_roms 2 $board: can't build tmprom" - fi - [ -n "$tmpmv" ] && [ -f "$tmpmv" ] && x_ mv "$tmpmv" "$tmprom" + tmpmv="$(mkSeabiosRom "$1")" || $err "$board: !mk grub tmprom" + x_ mv "$tmpmv" "$1" # we only need insert grub.elf once, for each coreboot config: - cbfs "$tmprom" "$grubelf" "$grub_cbfs" + cbfs "$1" "$grubelf" "img/grub2" printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ > "$tmpdir/tmpcfg" || $err "set grub_scan_disk, $grub_scan_disk" - cbfs "$tmprom" "$tmpdir/tmpcfg" scan.cfg raw + cbfs "$1" "$tmpdir/tmpcfg" scan.cfg raw - newrom="$romdir/${payload1}_${board}_${initmode}_$displaymode.rom" - [ "$initmode" = "normal" ] && newrom="$romdir/${payload1}_" \ + newrom="$romdir/seabios_withgrub_${board}_${initmode}_$displaymode.rom" + [ "$initmode" = "normal" ] && newrom="$romdir/seabios_withgrub_" \ && newrom="$newrom${board}_$initmode.rom" - cprom cp "$tmprom" "$newrom" + cprom cp "$1" "$newrom" - [ "$payload1" = "grub" ] && return 0 - cbfs "$tmprom" "$grubdata/bootorder" bootorder raw - cprom cp "$tmprom" "${newrom%.rom}_grubfirst.rom" + cbfs "$1" "$grubdata/bootorder" bootorder raw # SeaGRUB + cprom cp "$1" "${newrom%.rom}_grubfirst.rom" } # make a rom in /tmp/ and then print the path of that ROM @@ -245,7 +218,7 @@ mkSeabiosRom() { _seabioself="elf/seabios/default/$initmode/bios.bin.elf" x_ cp "$1" "$tmprom" - cbfs "$tmprom" "$_seabioself" "$2" + cbfs "$tmprom" "$_seabioself" "fallback/payload" x_ "$cbfstool" "$tmprom" add-int -i 3000 -n etc/ps2-keyboard-spinup z="2"; [ "$initmode" = "vgarom" ] && z="0"