diff --git a/include/chromebook.sh b/include/chromebook.sh index 0b8b50f1..0becc601 100644 --- a/include/chromebook.sh +++ b/include/chromebook.sh @@ -31,9 +31,8 @@ mr_edk2tree="chromebook" # tree name in xbmk # mxlibreboot was here prep_mr_import() { - if [ -f "$xbmkpwd/CHANGELOG" ]; then + [ -f "$xbmkpwd/CHANGELOG" ] && \ err "Project import disabled on releases" "prep_mr_import" "$@" - fi mr_tmpdir="`mktemp -d || err "can't make mrtmpdir"`" || \ err "can't make mrtmpdir" "prep_mr_coreboot" "$@" diff --git a/include/init.sh b/include/init.sh index e611127f..52e87a6c 100644 --- a/include/init.sh +++ b/include/init.sh @@ -142,23 +142,12 @@ xbmk_set_env() [ -n "${TMPDIR+x}" ] && \ is_child="y" - if [ "$is_child" = "y" ] - then - # child instance of xbmk, so we stop init after this point - # and execute the given user command upon return: - + if [ "$is_child" = "y" ]; then xbmk_child_set_env - - return 1 + return 1 # child instance. discontinue initialisation. else - # parent instance of xbmk, so we continue initialising. - # a parent instance of xbmk never processes its own - # command directly; instead, it calls a child instance - # of xbmk, and exits with the corresponding return status. - xbmk_parent_set_env - - return 0 + return 0 # parent instance. continue initialisation. fi } @@ -188,7 +177,6 @@ xbmk_child_set_tmp() if [ "$locktmp" != "$xbtmpchk" ]; then badtmp="TMPDIR '$xbtmpchk' changed; was '$locktmp'" - printf "bad TMPDIR init, '%s': %s\n" "$TMPDIR" "$badtmp" 1>&2 err "'$xbmklock' present with bad tmpdir. is a build running?" fi diff --git a/include/inject.sh b/include/inject.sh index b037d2c5..eb764a98 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -104,9 +104,8 @@ check_target() . "$boarddir/target.cfg" || \ err "Can't read '$boarddir/target.cfg'" "check_target" "$@" - if [ -z "$tree" ]; then + [ -z "$tree" ] && \ err "tree unset in '$boarddir/target.cfg'" "check_target" "$@" - fi x_ ./mk -d coreboot "$tree" diff --git a/include/rom.sh b/include/rom.sh index 3d628acb..bf7f1164 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -368,8 +368,7 @@ add_uboot() ubtree="x86_64" ubtarget="amd64coreboot" - if [ "$payload_uboot" = "i386" ] - then + if [ "$payload_uboot" = "i386" ]; then ubpath="u-boot" # 32-bit ubtree="x86" ubtarget="i386coreboot"; : @@ -378,18 +377,13 @@ add_uboot() ubdir="elf/u-boot/$ubtree/$ubtarget/$uboot_config" - # aarch64 targets: - ubootelf="$ubdir/u-boot.elf" - if [ ! -f "$ubootelf" ]; then - ubootelf="$ubdir/u-boot" - fi - - # override for x86/x86_64 targets: - if [ "$payload_uboot" = "i386" ]; then - ubootelf="$ubdir/u-boot-dtb.bin" - elif [ "$payload_uboot" = "amd64" ]; then - ubootelf="$ubdir/u-boot-x86-with-spl.bin" # EFI-compatible - fi + ubootelf="$ubdir/u-boot.elf" # aarch64 + [ ! -f "$ubootelf" ] && \ + ubootelf="$ubdir/u-boot" # aarch64 (fallback) + [ "$payload_uboot" = "i386" ] && \ + ubootelf="$ubdir/u-boot-dtb.bin" # x86 override + [ "$payload_uboot" = "amd64" ] && \ + ubootelf="$ubdir/u-boot-x86-with-spl.bin" # x86_64 override cbfs "$tmprom" "$ubootelf" "$ubpath" $ubcbfsargs [ "$payload_seabios" != "y" ] && \ diff --git a/include/tree.sh b/include/tree.sh index d891c3af..9ac0ca6d 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -55,11 +55,8 @@ trees() if_dry_build="" if_not_do_make="" if_not_dry_build=":" - if [ "$flag" = "-F" ]; then - # don't skip git fetch/pull on cached src - - forcepull="y" - fi + [ "$flag" = "-F" ] && \ + forcepull="y"; : # never skip git fetch/pull ;; -s) mode="savedefconfig" ;; -l) mode="olddefconfig" ;; diff --git a/include/vendor.sh b/include/vendor.sh index b3ab60b1..07411ed8 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -123,8 +123,7 @@ fetch() remkdir "${_pre_dest%/*}" "$appdir" # HACK: if grabbing fsp from coreboot, fix the path for lbmk - if [ "$dl_type" = "fsp" ] - then + if [ "$dl_type" = "fsp" ]; then dl="${dl##*../}" _cdp="$dl" @@ -474,9 +473,8 @@ bootstrap() rmodtool="elf/coreboot/$tree/rmodtool" mecleaner="$xbmkpwd/$cbdir/util/me_cleaner/me_cleaner.py" - if [ "$XBMKmecleaner" = "y" ]; then + [ "$XBMKmecleaner" = "y" ] && \ mecleaner="$xbmkpwd/src/me_cleaner/me_cleaner.py" - fi x_ ./mk -f coreboot "${cbdir##*/}" x_ ./mk -f me_cleaner