From 1ce7e339769c4fd38ce5a3818e5b5835a867422a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 14 May 2024 23:17:22 +0100 Subject: move rom tarball creation to script/roms export LBMK_RELEASE="y" if this is done, the tarball is created instead of a directory, and the rom images are nuked using ./vendor inject with the nuke option, inserting the correct version files; the rom directory is deleted now the release script logic simple renames existing tarballs. the benefit of this change is fewer lines of code, and now lbmk doesn't use an insane amount of disk space when building a *lot* of release images (the uncompressed directories are deleted after each build) Signed-off-by: Leah Rowe --- script/roms | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'script') diff --git a/script/roms b/script/roms index ce7e52f2..b48bb7a0 100755 --- a/script/roms +++ b/script/roms @@ -66,11 +66,16 @@ main() done fi + bstr="directories" + [ "$lbmk_release" = "y" ] && bstr="tarballs" + [ -z "${targets}" ] && $err "No ROM images were compiled" - printf "\nROM images available in these directories:\n" + printf "\nROM images available in these %s:\n" "$bstr" eval "printf \"${targets}\"" - printf "^^ ROM images available in these directories.\n\n" + printf "^^ ROM images available in these %s.\n\n" "$bstr" + [ "$lbmk_release" = "y" ] && \ + printf "Always run the inject command on release images!\n" printf "DO NOT flash images from elf/ - please use bin/ instead.\n" } @@ -89,6 +94,7 @@ handle_serprog() if [ $# -gt 1 ] && [ "${2}" = "list" ]; then print_serprog_boards ${serprog_boards_dir} + return 0 elif [ $# -gt 1 ]; then build_${1}_rom "${2}" else @@ -98,6 +104,8 @@ handle_serprog() build_${1}_rom "${board}" done fi + + [ "$lbmk_release" = "y" ] && mktar_release "bin/serprog_$1"; return 0 } build_rp2040_rom() @@ -151,7 +159,9 @@ handle_coreboot_target() build_target_mainboard [ -d "bin/${board}" ] || return 0 - targets="* bin/${board}\n${targets}" + [ "$lbmk_release" = "y" ] || targets="* bin/${board}\n${targets}" + [ "$lbmk_release" = "y" ] && targets="* bin/$board.tar.xz\n$targets" + [ "$lbmk_release" = "y" ] && mktar_release "bin/$board"; return 0 } configure_target() @@ -264,7 +274,7 @@ build_uboot_payload() build_target_mainboard() { - rm -f "${romdir}/"* || $err "!prepare, rm files, ${romdir}" + x_ rm -Rf "${romdir}" for x in "normal" "vgarom" "libgfxinit"; do initmode="${x}" @@ -460,6 +470,13 @@ moverom() x_ mkdir -p "${2%/*}" x_ cp "$1" "$2" + [ "$lbmk_release" = "y" ] || return 0 + + ( + cd "${2%/*}" || $err "moverom, !cd \"${2%/*}\"" + sha512sum ./"${2##*/}" >> vendorhashes || $err "!$2 vendorhashes" + ) || $err "Cannot create checksum for '$2'" + x_ ./vendor inject -r "${2}" -b "$board" -n nuke } usage() -- cgit v1.2.1