diff options
13 files changed, 55 insertions, 84 deletions
diff --git a/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch b/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch index e32ba2ce..5af7ca30 100644 --- a/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch +++ b/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch @@ -16,7 +16,7 @@ index 04d058f55..b1cc8f236 100644 grub_term_cls (term); - msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); -+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 Corny Calamity (GRUB menu): https://libreboot.org/")); ++ msg_formatted = grub_xasprintf (_("Libreboot 25.04 rev1 (GRUB menu): https://libreboot.org/")); if (!msg_formatted) return; diff --git a/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch b/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch index f49c8340..f069333e 100644 --- a/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch +++ b/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch @@ -16,7 +16,7 @@ index 04d058f55..b1cc8f236 100644 grub_term_cls (term); - msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); -+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 Corny Calamity (GRUB menu): https://libreboot.org/")); ++ msg_formatted = grub_xasprintf (_("Libreboot 25.04 rev1 (GRUB menu): https://libreboot.org/")); if (!msg_formatted) return; diff --git a/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch b/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch index 5818c2ed..1e55067e 100644 --- a/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch +++ b/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch @@ -16,7 +16,7 @@ index 04d058f55..b1cc8f236 100644 grub_term_cls (term); - msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); -+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 Corny Calamity (GRUB menu): https://libreboot.org/")); ++ msg_formatted = grub_xasprintf (_("Libreboot 25.04 rev1 (GRUB menu): https://libreboot.org/")); if (!msg_formatted) return; diff --git a/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch b/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch index acde7f20..822da00a 100644 --- a/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch +++ b/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch @@ -17,7 +17,7 @@ index 538b316d..9eed0b12 100644 // Write to screen. - printf("SeaBIOS (version %s)\n", VERSION); -+ printf("Libreboot 25.04 Corny Calamity (SeaBIOS menu): https://libreboot.org/\n"); ++ printf("Libreboot 25.04 rev1 (SeaBIOS menu): https://libreboot.org/\n"); display_uuid(); } diff --git a/config/u-boot/default/patches/0007-Libreboot-branding-version-on-the-bootflow-menu.patch b/config/u-boot/default/patches/0007-Libreboot-branding-version-on-the-bootflow-menu.patch index 754e2162..71e44dff 100644 --- a/config/u-boot/default/patches/0007-Libreboot-branding-version-on-the-bootflow-menu.patch +++ b/config/u-boot/default/patches/0007-Libreboot-branding-version-on-the-bootflow-menu.patch @@ -18,7 +18,7 @@ index 84831915a2..8e26ec2aef 100644 ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100); ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE, - "U-Boot - Boot Menu", NULL); -+ "Libreboot 25.04 Corny Calamity (U-Boot menu): https://libreboot.org/", NULL); ++ "Libreboot 25.04 rev1 (U-Boot menu): https://libreboot.org/", NULL); ret |= scene_menu_set_title(scn, OBJ_MENU, OBJ_PROMPT); logo = video_get_u_boot_logo(); diff --git a/config/u-boot/x86/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch b/config/u-boot/x86/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch index 754e2162..71e44dff 100644 --- a/config/u-boot/x86/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch +++ b/config/u-boot/x86/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch @@ -18,7 +18,7 @@ index 84831915a2..8e26ec2aef 100644 ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100); ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE, - "U-Boot - Boot Menu", NULL); -+ "Libreboot 25.04 Corny Calamity (U-Boot menu): https://libreboot.org/", NULL); ++ "Libreboot 25.04 rev1 (U-Boot menu): https://libreboot.org/", NULL); ret |= scene_menu_set_title(scn, OBJ_MENU, OBJ_PROMPT); logo = video_get_u_boot_logo(); diff --git a/config/u-boot/x86_64/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch b/config/u-boot/x86_64/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch index 754e2162..71e44dff 100644 --- a/config/u-boot/x86_64/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch +++ b/config/u-boot/x86_64/patches/0005-Libreboot-branding-version-on-the-bootflow-menu.patch @@ -18,7 +18,7 @@ index 84831915a2..8e26ec2aef 100644 ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100); ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE, - "U-Boot - Boot Menu", NULL); -+ "Libreboot 25.04 Corny Calamity (U-Boot menu): https://libreboot.org/", NULL); ++ "Libreboot 25.04 rev1 (U-Boot menu): https://libreboot.org/", NULL); ret |= scene_menu_set_title(scn, OBJ_MENU, OBJ_PROMPT); logo = video_get_u_boot_logo(); diff --git a/include/get.sh b/include/get.sh index a3328454..4b31c7c9 100644 --- a/include/get.sh +++ b/include/get.sh @@ -106,8 +106,7 @@ try_file() eval "[ -$echk \"$cached\" ] || return 1" if [ "$2" = "git" ]; then - [ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || \ - err "Can't clone final repo in command: try_file $*"; : + [ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || err; : else bad_checksum "$6" "$cached" && x_ rm -f "$cached" && return 1 [ "$cached" != "$5" ] && x_ cp "$cached" "$5" diff --git a/include/inject.sh b/include/inject.sh index a58acc81..9354b439 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -38,7 +38,7 @@ inject() esac [ "$new_mac" = "keep" ] && new_mac="" - check_release + x_ e "$archive" f && check_release check_target && patch_release [ "$xchanged" = "y" ] && remktar @@ -52,20 +52,14 @@ inject() check_release() { [ -L "$archive" ] && err "'$archive' is a symlink" - e "$archive" f missing && err "'$archive' missing" archivename="`basename "$archive"`" || err "Can't get '$archive' name" - [ -z "$archivename" ] && err "Can't determine archive name" case "$archivename" in - *_src.tar.xz) - err "'$archive' is a src archive, silly!" ;; - grub_*|seagrub_*|custom_*|seauboot_*|seabios_withgrub_*) - err "'$archive' is a ROM image (it must be a tarball)" ;; + *_src.tar.xz) err "'$archive' is a src archive, silly!" ;; *.tar.xz) _stripped_prefix="${archivename#*_}" board="${_stripped_prefix%.tar.xz}" ;; - *) - err "'$archive': could not detect board type" + *) err "'$archive': could not detect board type" ;; esac; : } diff --git a/include/release.sh b/include/release.sh index 912687dc..c13be2c3 100644 --- a/include/release.sh +++ b/include/release.sh @@ -19,8 +19,7 @@ release() done reldest="$reldir/$version" - [ -e "$reldest" ] && \ - err "already exists: \"$reldest\"" + [ -e "$reldest" ] && err "already exists: \"$reldest\"" vdir="$XBMK_CACHE/relpwd/${xbtmp##*/}/$version" rsrc="$vdir/${relname}_src" diff --git a/include/rom.sh b/include/rom.sh index c1b78c75..972f264e 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -48,8 +48,7 @@ corebootpremake() [ -n "$mode" ] || [ ! -f "$srcdir/.config" ] || $dry printf \ "CONFIG_CCACHE=y\n" >> "$srcdir/.config" || err "$srcdir: !cook"; : fx_ check_coreboot_util printf "cbfstool\nifdtool\n" - printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ - err "!mk $srcdir .coreboot-version" + printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || err [ -z "$mode" ] && [ "$target" != "$tree" ] && \ x_ ./mk download "$target"; : } @@ -65,13 +64,9 @@ check_coreboot_util() utilmode="" && [ -n "$mode" ] && utilmode="clean" x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $makeargs [ -n "$mode" ] && x_ rm -Rf "$utilelfdir" && return 0 - [ -z "$mode" ] || return 0 - [ -f "$utilelfdir/$1" ] && return 0 - - x_ mkdir -p "$utilelfdir" - x_ cp "$utilsrcdir/$1" "$utilelfdir" - [ "$1" = "cbfstool" ] || return 0 - x_ cp "$utilsrcdir/rmodtool" "$utilelfdir" + [ ! -f "$utilelfdir/$1" ] && x_ mkdir -p "$utilelfdir" && \ + x_ cp "$utilsrcdir/$1" "$utilelfdir" && [ "$1" = "cbfstool" ] && \ + x_ cp "$utilsrcdir/rmodtool" "$utilelfdir"; : } mkcorebootbin() diff --git a/include/tree.sh b/include/tree.sh index 11607eed..7bfddf67 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -45,8 +45,7 @@ trees() [ -z "$_f" ] && err "missing flag ($flags)" [ -z "$project" ] && fx_ "x_ ./mk $_f" x_ ls -1 config/git && return 1 - [ -f "config/git/$project/pkg.cfg" ] || \ - err "config/git/$project/pkg.cfg missing" + e "config/git/$project/pkg.cfg" f missing && err "$project: no pkg.cfg" for d in "elf" "config/data" "config" "src"; do eval "${d#*/}dir=\"$d/$project\"" @@ -75,9 +74,7 @@ build_project() [ ! -f "$listfile" ] || $dry elfcheck || return 0 [ "$mode" = "distclean" ] && mode="clean" - run_make_command || return 0 - - [ -n "$mode" ] || $dry copy_elf; : + run_make_command && [ -z "$mode" ] && $dry copy_elf; : } build_targets() @@ -89,13 +86,9 @@ build_targets() unset CROSS_COMPILE export PATH="$xbmkpath" [ "$x" = "list" ] && x_ ls -1 "config/$project" && \ - listfile="" && break - - target="$x" + listfile="" && break; target="$x" printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target" - x_ handle_defconfig - - [ -n "$mode" ] || x_ $postmake + x_ handle_defconfig && [ -z "$mode" ] && x_ $postmake; : done; : } @@ -120,8 +113,7 @@ handle_defconfig() [ "$_f" = "-d" ] || defconfig="$y" [ -n "$mode" ] || check_defconfig || continue - handle_makefile - [ -n "$mode" ] || $dry copy_elf + handle_makefile && [ -z "$mode" ] && $dry copy_elf; : done; : } @@ -130,8 +122,7 @@ configure_project() eval "`setvars "" cleanargs build_depend autoconfargs xtree postmake \ makeargs btype mkhelper bootstrapargs premake release xlang xarch \ badhash`" - _tcfg="$1/target.cfg" - [ -f "$_tcfg" ] || btype="auto" + _tcfg="$1/target.cfg" && [ ! -f "$_tcfg" ] && btype="auto" e "$datadir/mkhelper.cfg" f && eval "`setcfg "$datadir/mkhelper.cfg"`" while e "$_tcfg" f || [ "$cmd" != "build_project" ]; do @@ -144,8 +135,7 @@ configure_project() [ "$do_make" != "n" ] && break [ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \ - && break - _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg" + && break; _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg" done [ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1 [ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1 @@ -187,8 +177,7 @@ check_project_hashes() [ "$pjhash" != "$old_pjhash" ] && badhash="y" [ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y" - printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || \ - err "!mk $XBMK_CACHE/hash/$project$tree" + printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || err [ "$badhash" != "y" ] || x_ rm -Rf "src/$project/$tree" \ "elf/$project/$tree" "elf/$project/$target"; : @@ -295,15 +284,17 @@ run_make_command() { [ -n "$mode" ] || x_ $premake - $dry check_cmake "$srcdir" && [ -z "$mode" ] && \ - $dry check_autoconf "$srcdir" + $dry check_cmake "$srcdir" + [ -n "$mode" ] || ( $dry check_autoconf "$srcdir" ) || err $dry check_makefile "$srcdir" || return 1 $dry x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs [ -n "$mode" ] || x_ $mkhelper + check_makefile "$srcdir" || return 0 [ "$mode" != "clean" ] || \ - $dry make -C "$srcdir" $cleanargs distclean || :; : + $dry make -C "$srcdir" $cleanargs distclean || \ + $dry x_ make -C "$srcdir" $cleanargs clean; : } check_cmake() @@ -315,12 +306,10 @@ check_cmake() check_autoconf() { - ( x_ cd "$1" [ -f "bootstrap" ] && x_ ./bootstrap $bootstrapargs [ -f "autogen.sh" ] && x_ ./autogen.sh $autogenargs [ -f "configure" ] && x_ ./configure $autoconfargs; : - ) || err "can't bootstrap project: $1"; : } check_makefile() diff --git a/include/vendor.sh b/include/vendor.sh index 55373913..f7dce827 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -21,16 +21,15 @@ appdir="$vendir/app" vfix="DO_NOT_FLASH_YET._FIRST,_INJECT_FILES_VIA_INSTRUCTIONS_ON_LIBREBOOT.ORG_" # lbmk-specific extension to the "cv" variable (not suitable for cbmk) -cvchk="CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \ +cvchk="CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_MRC_FILE CONFIG_ME_BIN_PATH \ CONFIG_LENOVO_TBFW_BIN CONFIG_VGA_BIOS_FILE CONFIG_FSP_M_FILE \ CONFIG_FSP_S_FILE CONFIG_KBC1126_FW1 CONFIG_KBC1126_FW2" # lbmk-specific extensions to the "cv" variable (not suitable for cbmk) -cvxbmk="CONFIG_ME_BIN_PATH CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_FSP_FULL_FD \ +cvxbmk="CONFIG_FSP_FULL_FD CONFIG_IFD_BIN_PATH CONFIG_FSP_M_CBFS \ CONFIG_KBC1126_FW1_OFFSET CONFIG_KBC1126_FW2_OFFSET CONFIG_FSP_USE_REPO \ CONFIG_VGA_BIOS_ID CONFIG_BOARD_DELL_E6400 CONFIG_FSP_S_CBFS \ - CONFIG_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE CONFIG_FSP_FD_PATH \ - CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE CONFIG_FSP_M_CBFS" + CONFIG_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE CONFIG_FSP_FD_PATH" # lbmk-specific extensions; mostly used for downloading vendor files eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ @@ -52,32 +51,28 @@ download() getfiles() { - [ -z "$CONFIG_HAVE_ME_BIN" ] || fetch intel_me "$DL_url" \ - "$DL_url_bkup" "$DL_hash" "$CONFIG_ME_BIN_PATH" curl "$ME_bin_hash" - [ -z "$CONFIG_INCLUDE_SMSC_SCH5545_EC_FW" ] || fetch sch5545ec \ - "$SCH5545EC_DL_url" "$SCH5545EC_DL_url_bkup" "$SCH5545EC_DL_hash" \ - "$CONFIG_SMSC_SCH5545_EC_FW_FILE" "curl" "$SCH5545EC_bin_hash" - [ -z "$CONFIG_KBC1126_FW1" ] || fetch kbc1126ec "$EC_url" \ - "$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW1" curl "$EC_FW1_hash" - [ -z "$CONFIG_KBC1126_FW2" ] || fetch kbc1126ec "$EC_url" \ - "$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW2" curl "$EC_FW2_hash" - [ -z "$CONFIG_VGA_BIOS_FILE" ] || fetch e6400vga "$E6400_VGA_DL_url" \ - "$E6400_VGA_DL_url_bkup" "$E6400_VGA_DL_hash" \ - "$CONFIG_VGA_BIOS_FILE" "curl" "$E6400_VGA_bin_hash" - [ -z "$CONFIG_HAVE_MRC" ] || fetch "mrc" "$MRC_url" "$MRC_url_bkup" \ - "$MRC_hash" "$CONFIG_MRC_FILE" "curl" "$MRC_bin_hash" - [ -z "$CONFIG_REFCODE_BLOB_FILE" ] || fetch "refcode" "$MRC_url" \ - "$MRC_url_bkup" "$MRC_hash" "$CONFIG_REFCODE_BLOB_FILE" "curl" \ - "$REF_bin_hash" - [ -z "$CONFIG_LENOVO_TBFW_BIN" ] || fetch "tbfw" "$TBFW_url" \ - "$TBFW_url_bkup" "$TBFW_hash" "$CONFIG_LENOVO_TBFW_BIN" "curl" \ - "$TBFW_bin_hash" - [ -z "$CONFIG_FSP_M_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ - "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_M_FILE" "copy" \ - "$FSPM_bin_hash" - [ -z "$CONFIG_FSP_S_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ - "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_S_FILE" "copy" \ - "$FSPS_bin_hash"; : + fetch intel_me "$DL_url" "$DL_url_bkup" "$DL_hash" \ + "$CONFIG_ME_BIN_PATH" curl "$ME_bin_hash" + fetch sch5545ec "$SCH5545EC_DL_url" "$SCH5545EC_DL_url_bkup" \ + "$SCH5545EC_DL_hash" "$CONFIG_SMSC_SCH5545_EC_FW_FILE" curl \ + "$SCH5545EC_bin_hash" + fetch kbc1126ec "$EC_url" "$EC_url_bkup" "$EC_hash" \ + "$CONFIG_KBC1126_FW1" curl "$EC_FW1_hash" + fetch kbc1126ec "$EC_url" "$EC_url_bkup" "$EC_hash" \ + "$CONFIG_KBC1126_FW2" curl "$EC_FW2_hash" + fetch e6400vga "$E6400_VGA_DL_url" "$E6400_VGA_DL_url_bkup" \ + "$E6400_VGA_DL_hash" "$CONFIG_VGA_BIOS_FILE" curl \ + "$E6400_VGA_bin_hash" + fetch mrc "$MRC_url" "$MRC_url_bkup" "$MRC_hash" "$CONFIG_MRC_FILE" \ + curl "$MRC_bin_hash" + fetch refcode "$MRC_url" "$MRC_url_bkup" "$MRC_hash" \ + "$CONFIG_REFCODE_BLOB_FILE" curl "$REF_bin_hash" + fetch tbfw "$TBFW_url" "$TBFW_url_bkup" "$TBFW_hash" \ + "$CONFIG_LENOVO_TBFW_BIN" curl "$TBFW_bin_hash" + fetch fsp "$CONFIG_FSP_FD_PATH" "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" \ + "$CONFIG_FSP_M_FILE" copy "$FSPM_bin_hash" + fetch fsp "$CONFIG_FSP_FD_PATH" "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" \ + "$CONFIG_FSP_S_FILE" copy "$FSPS_bin_hash"; : } fetch() @@ -86,7 +81,7 @@ fetch() dl="$2" dl_bkup="$3" dlsum="$4" - _dest="${5##*../}" + _dest="${5##*../}" && [ -z "$_dest" ] && return 0 _pre_dest="$XBMK_CACHE/tmpdl/check" || err "!fetch, mktemp, $*" dlop="$6" binsum="$7" |