summaryrefslogtreecommitdiff
path: root/include/inject.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/inject.sh')
-rw-r--r--include/inject.sh21
1 files changed, 8 insertions, 13 deletions
diff --git a/include/inject.sh b/include/inject.sh
index 6e8fa320..d4d20568 100644
--- a/include/inject.sh
+++ b/include/inject.sh
@@ -4,7 +4,6 @@
# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
cbcfgsdir="config/coreboot"
-hashfiles="vendorhashes blobhashes" # blobhashes for backwards compatibility
tmpromdel="$XBMK_CACHE/DO_NOT_FLASH"
nvm="util/nvmutil/nvm"
ifdtool="elf/ifdtool/default/ifdtool"
@@ -14,7 +13,7 @@ cv="CONFIG_GBE_BIN_PATH"
[ -n "$cvchk" ] && cv="$cv $cvchk"
eval "`setvars "" archive boarddir IFD_platform ifdprefix tree new_mac \
- tmpromdir board $cv`"
+ tmpromdir board xchanged $cv`"
inject()
{
@@ -39,9 +38,6 @@ inject()
esac
[ "$new_mac" = "keep" ] && new_mac=""
- [ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \
- x_ make -C util/nvmutil clean && x_ make -C util/nvmutil
-
check_release
check_target && patch_release
@@ -75,10 +71,7 @@ check_release()
check_target()
{
- if [ "$board" = "serprog_rp2040" ] || [ "$board" = "serprog_stm32" ] \
- || [ "$board" = "serprog_pico" ]; then
- return 1
- fi
+ [ "$board" = "${board#serprog_}" ] || return 1
boarddir="$cbcfgsdir/$board"
eval "`setcfg "$boarddir/target.cfg"`"
@@ -98,7 +91,7 @@ patch_release()
remkdir "${tmpromdir%"/bin/$board"}"
x_ tar -xf "$archive" -C "${tmpromdir%"/bin/$board"}"
- for _hashes in $hashfiles; do
+ for _hashes in "vendorhashes" "blobhashes"; do
e "$tmpromdir/$_hashes" f && \
has_hashes="y" && hashfile="$_hashes" && break; :
done
@@ -113,7 +106,7 @@ readkconfig()
x_ rm -f "$xbmktmp/cbcfg"
fx_ scankconfig x_ find "$boarddir/config" -type f
eval "`setcfg "$xbmktmp/cbcfg" 1`"
- setvfile "$@" && return 1; :
+ setvfile "$@" || return 1; :
}
scankconfig()
@@ -127,11 +120,12 @@ modify_mac()
{
x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$xbmklocal/gbe"
[ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \
+ x_ make -C util/nvmutil clean && x_ make -C util/nvmutil && \
x_ "$nvm" "$xbmklocal/gbe" setmac "$new_mac"
fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
- printf "\nGbE NVM written to '%s':\n" "$archive"
+ printf "\nThe following GbE NVM data will be written:\n"
x_ "$nvm" "$xbmklocal/gbe" dump | grep -v "bytes read from file" || :
}
@@ -145,7 +139,8 @@ remktar()
{
(
x_ cd "${tmpromdir%"/bin/$board"}"
- mkrom_tarball "bin/$board"
+ printf "Re-building tar archive (please wait)\n"
+ mkrom_tarball "bin/$board" 1>/dev/null
) || err "Cannot re-generate '$archive'"
mv "${tmpromdir%"/bin/$board"}/bin/${relname}_${board}.tar.xz" \