diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/rom.sh | 49 | ||||
-rw-r--r-- | include/vendor.sh | 12 |
2 files changed, 44 insertions, 17 deletions
diff --git a/include/rom.sh b/include/rom.sh index f86e5e1a..a5fe2213 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -55,7 +55,7 @@ mkvendorfiles() check_coreboot_utils "$tree" printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ $err "!mk $srcdir .coreboot-version" - [ -z "$mode" ] && [ "$target" != "$tree" ] && \ + [ -z "$mode" ] && [ "$target" != "$tree" ] && [ -n "$vcfg" ] && \ x_ ./vendor download $target; return 0 } @@ -96,6 +96,7 @@ mkcorebootbin() [ "$displaymode" = "$initmode" ] && displaymode="" # "normal" config initmode="${initmode%%_*}" cbfstool="elf/cbfstool/$tree/cbfstool" + ifdtool="elf/ifdtool/$tree/ifdtool" [ "$payload_uboot_i386" = "y" ] && \ [ "$payload_uboot_amd64" = "y" ] && \ @@ -137,23 +138,28 @@ add_seabios() $dry add_uboot fi + [ -n "$seabiosname" ] || seabiosname="fallback/payload" _seabioself="elf/seabios/default/$initmode/bios.bin.elf" - cbfs "$tmprom" "$_seabioself" "fallback/payload" - x_ "$cbfstool" "$tmprom" add-int -i 3000 -n etc/ps2-keyboard-spinup - - _z="2"; [ "$initmode" = "vgarom" ] && _z="0" - x_ "$cbfstool" "$tmprom" add-int -i $_z -n etc/pci-optionrom-exec - x_ "$cbfstool" "$tmprom" add-int -i 0 -n etc/optionroms-checksum - [ "$initmode" = "libgfxinit" ] && \ - cbfs "$tmprom" "$seavgabiosrom" vgaroms/seavgabios.bin raw + if [ "$seabiosname" != "none" ]; then + cbfs "$tmprom" "$_seabioself" "$seabiosname" + x_ "$cbfstool" "$tmprom" add-int -i 3000 \ + -n etc/ps2-keyboard-spinup + + _z="2"; [ "$initmode" = "vgarom" ] && _z="0" + x_ "$cbfstool" "$tmprom" add-int -i $_z \ + -n etc/pci-optionrom-exec + x_ "$cbfstool" "$tmprom" add-int -i 0 -n etc/optionroms-checksum + [ "$initmode" = "libgfxinit" ] && \ + cbfs "$tmprom" "$seavgabiosrom" vgaroms/seavgabios.bin raw + fi [ "$payload_memtest" = "y" ] && cbfs "$tmprom" \ "elf/memtest86plus/memtest.bin" img/memtest [ "$payload_grub" = "y" ] && add_grub - cprom + [ "$seabiosname" = "fallback/payload" ] && cprom [ "$payload_uboot_amd64" = "y" ] && [ "$displaymode" != "txtmode" ] && \ [ "$initmode" != "normal" ] && pname="seauboot" && cprom "seauboot" [ "$payload_grub" = "y" ] && pname="seagrub" && mkseagrub; : @@ -161,7 +167,10 @@ add_seabios() add_grub() { - cbfs "$tmprom" "$grubelf" "img/grub2" + [ "$grubname" = "none" ] && return 0 + [ "$grubname" = "fallback/payload" ] && pname="grub" + [ -n "$grubname" ] || grubname="img/grub2" + cbfs "$tmprom" "$grubelf" "$grubname" printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ > "$TMPDIR/tmpcfg" || $err "$target: !insert scandisk" cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw @@ -169,6 +178,8 @@ add_grub() mkseagrub() { + [ "$grubname" = "none" ] && return 0 + [ "$grubname" = "fallback/payload" ] && pname="grub" cbfs "$tmprom" "$grubdata/bootorder" bootorder raw for keymap in config/data/grub/keymap/*.gkb; do [ -f "$keymap" ] && cprom "${keymap##*/}"; : @@ -200,7 +211,9 @@ add_uboot() ubpath="img/u-boot" # 64-bit ubtarget="amd64coreboot" [ "$payload_uboot_i386" = "y" ] && ubpath="u-boot" # 32-bit - [ "$payload_uboot_i386" = "y" ] && ubtarget="i386coreboot"; : + [ "$payload_uboot_i386" = "y" ] && ubtarget="i386coreboot" + + [ -n "$ubootname" ] && ubpath="$ubootname"; : fi ubdir="elf/u-boot/$ubtarget/$uboot_config" @@ -214,11 +227,15 @@ add_uboot() ubootelf="$ubdir/u-boot-x86-with-spl.bin" # EFI-compatible [ -f "$ubootelf" ] || $err "cb/$ubtarget: Can't find u-boot" - cbfs "$tmprom" "$ubootelf" "$ubpath" $ubcbfsargs; cprom + cbfs "$tmprom" "$ubootelf" "$ubpath" $ubcbfsargs + [ "$seabiosname" != "none" ] && cprom; : } cprom() { + [ "$pname" = "seauboot" ] && [ "$ubootname" = "fallback/payload" ] && \ + pname="uboot" + newrom="bin/$target/${pname}_${target}_$initmode.rom" [ -n "$displaymode" ] && newrom="${newrom%.rom}_$displaymode.rom" [ $# -gt 0 ] && [ "$1" != "seauboot" ] && \ @@ -230,6 +247,12 @@ cprom() [ $# -gt 0 ] && [ "$1" = "seauboot" ] && \ cbfs "$newrom" "config/data/grub/bootorder_uboot" "bootorder" raw + _setplatform="" && [ -n "$IFD_platform" ] \ + && _setplatform="--platform $IFD_platform" + [ "$HAPdisable" != "y" ] || "$ifdtool" $_setplatform --altmedisable 1 \ + "$newrom" -O "$newrom" || \ + $err "Cannot set HAP bit in '$newrom'" + [ "$XBMK_RELEASE" = "y" ] || return 0 $dry mksha512sum "$newrom" "vendorhashes"; $dry ./vendor inject \ -r "$newrom" -b "$target" -n nuke || $err "!nuke $newrom" diff --git a/include/vendor.sh b/include/vendor.sh index 201359d7..d18fc70e 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -24,7 +24,7 @@ eval `setvars "" EC_url_bkup EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ mecleaner kbc1126_ec_dump MRC_refcode_cbtree new_mac _dl SCH5545EC_DL_url \ archive EC_url boarddir rom cbdir DL_url nukemode cbfstoolref vrelease \ verify _7ztest ME11bootguard ME11delta ME11version ME11sku ME11pch \ - IFD_platform ifdprefix cdir sdir _me _metmp mfs $cv` + IFD_platform ifdprefix cdir sdir _me _metmp mfs MEwhitelist $cv` vendor_download() { @@ -110,10 +110,14 @@ extract_intel_me() cdir="$PWD/$appdir" _me="$PWD/$_dest" _metmp="$PWD/tmp/me.bin" + + mfs="" && [ -n "$MEwhitelist" ] && mfs="$MEwhitelist" - mfs="" && [ "$ME11bootguard" = "y" ] && mfs="--whitelist MFS" && \ - chkvars ME11delta ME11version ME11sku ME11pch - [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard + if [ "$ME11bootguard" = "y" ]; then + [ -z "$mfs" ] && mfs="--whitelist MFS" + chkvars ME11delta ME11version ME11sku ME11pch + x_ ./mk -f deguard + fi x_ mkdir -p tmp |