diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/git.sh | 13 | ||||
-rw-r--r-- | include/lib.sh | 17 | ||||
-rw-r--r-- | include/mrc.sh | 2 | ||||
-rw-r--r-- | include/rom.sh | 16 | ||||
-rw-r--r-- | include/vendor.sh | 31 |
5 files changed, 43 insertions, 36 deletions
diff --git a/include/git.sh b/include/git.sh index aaeabcd4..fb0b2b42 100644 --- a/include/git.sh +++ b/include/git.sh @@ -2,8 +2,8 @@ # Copyright (c) 2020-2021,2023-2024 Leah Rowe <leah@libreboot.org> # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> -eval `setvars "" loc url bkup_url subfile subhash subrepo subrepo_bkup \ - depend subfile_bkup repofail` +eval "`setvars "" loc url bkup_url subfile subhash subrepo subrepo_bkup \ + depend subfile_bkup repofail`" fetch_targets() { @@ -18,8 +18,8 @@ fetch_targets() fetch_project() { - eval `setvars "" xtree tree_depend` - eval `setcfg "config/git/$project/pkg.cfg"` + eval "`setvars "" xtree tree_depend`" + eval "`setcfg "config/git/$project/pkg.cfg"`" chkvars url @@ -71,7 +71,8 @@ prep_submodules() fetch_submodule() { mcfgdir="$mdir/${1##*/}" - eval `setvars "" subhash subrepo subrepo_bkup subfile subfile_bkup st` + eval "`setvars "" subhash subrepo subrepo_bkup subfile subfile_bkup \ + st`" [ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \ $err "! . $mcfgdir/module.cfg" @@ -103,7 +104,7 @@ tmpclone() mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo" if [ "$livepull" = "y" ] && [ ! -d "$repodir" ]; then - git clone $1 "$repodir" || git clone $2 "$repodir" || \ + git clone "$1" "$repodir" || git clone $2 "$repodir" || \ $err "!clone $1 $2 $repodir $4 $5" # elif [ -d "$repodir" ] && [ $# -lt 6 ]; then git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \ diff --git a/include/lib.sh b/include/lib.sh index 5a32d592..790f4fe9 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -33,23 +33,23 @@ err_() setvars() { _setvars="" && [ $# -lt 2 ] && $err "setvars: too few arguments" - val="$1" && shift 1 && for var in $@; do + val="$1" && shift 1 && for var in "$@"; do _setvars="$var=\"$val\"; $_setvars" done; printf "%s\n" "${_setvars% }" } chkvars() { - for var in $@; do + for var in "$@"; do eval "[ -n "\${$var+x}" ] || \$err \"$var unset\"" eval "[ -n "\$$var" ] || \$err \"$var unset\"" done; return 0 } -eval `setvars "" _nogit board xbmk_parent versiondate projectsite projectname \ - aur_notice configdir datadir version relname reinstall` +eval "`setvars "" _nogit board reinstall versiondate projectsite projectname \ + aur_notice configdir datadir version relname xbmk_parent`" for fv in projectname projectsite version versiondate; do - eval "[ ! -f "$fv" ] || read -r $fv < \"$fv\" || :" + eval "[ ! -f \"$fv\" ] || read -r $fv < \"$fv\" || :" done; chkvars projectname projectsite setcfg() @@ -75,12 +75,13 @@ install_packages() [ $# -lt 2 ] && $err "fewer than two arguments" [ $# -gt 2 ] && reinstall="$3" - eval `setcfg "config/dependencies/$2"` + eval "`setcfg "config/dependencies/$2"`" + chkvars pkg_add pkglist $pkg_add $pkglist || $err "Cannot install packages" [ -n "$aur_notice" ] && \ - printf "You need AUR packages: %s\n" "$aur_notice" 1>&2; return 0 + printf "You need AUR packages: %s\n" "$aur_notice" 1>&2; : } if [ $# -gt 0 ] && [ "$1" = "dependencies" ]; then install_packages "$@" || exit 1 @@ -267,7 +268,7 @@ cbfs() mk() { mk_flag="$1" || $err "No argument given" - shift 1 && for mk_arg in $@; do + shift 1 && for mk_arg in "$@"; do ./mk $mk_flag $mk_arg || $err "./mk $mk_flag $mk_arg"; : done; : } diff --git a/include/mrc.sh b/include/mrc.sh index 2e00d9f9..f5db2ff0 100644 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -4,7 +4,7 @@ # Modifications in this version are Copyright 2021, 2023 and 2024 Leah Rowe. # Original copyright detailed in repo: https://review.coreboot.org/coreboot/ -eval `setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board SHELLBALL` +eval "`setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board SHELLBALL`" extract_mrc() { diff --git a/include/rom.sh b/include/rom.sh index a53a6d8c..6c1d2b05 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -43,8 +43,9 @@ copyps1bios() mkpayload_grub() { - eval `setvars "" grub_modules grub_install_modules` - $dry eval `setcfg "$grubdata/module/$tree"` + eval "`setvars "" grub_modules grub_install_modules`" + $dry eval "`setcfg "$grubdata/module/$tree"`" + $dry chkvars grub_modules grub_install_modules $dry x_ rm -f "$srcdir/grub.elf"; $dry \ "$srcdir/grub-mkstandalone" --grub-mkimage="$srcdir/grub-mkimage" \ -O i386-coreboot -o "$srcdir/grub.elf" -d "${srcdir}/grub-core/" \ @@ -62,7 +63,7 @@ mkvendorfiles() printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ $err "!mk $srcdir .coreboot-version" [ -z "$mode" ] && [ "$target" != "$tree" ] && \ - x_ ./mk download $target; return 0 + x_ ./mk download "$target"; return 0 } cook_coreboot_config() @@ -113,7 +114,8 @@ mkcorebootbin() if [ "$payload_uboot_i386" = "y" ] || \ [ "$payload_uboot_amd64" = "y" ]; then - printf "'$target' has x86 U-Boot; assuming SeaBIOS=y\n" 1>&2 + printf "'%s' has x86 U-Boot; assuming SeaBIOS=y\n" \ + "$target" 1>&2 payload_seabios="y" fi @@ -204,10 +206,12 @@ mkseagrub() add_uboot() { if [ "$displaymode" = "txtmode" ]; then - printf "cb/$target: Cannot use U-Boot in text mode\n" 1>&2 + printf "cb/%s: Cannot use U-Boot in text mode\n" \ + "$target" 1>&2 return 0 elif [ "$initmode" = "normal" ]; then - printf "cb/$target: Cannot use U-Boot in normal initmode\n" 1>&2 + printf "cb/%s: Cannot use U-Boot in normal initmode\n" \ + "$target" 1>&2 return 0 fi diff --git a/include/vendor.sh b/include/vendor.sh index 29b991cd..15d4e5cb 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -26,14 +26,14 @@ cv="CONFIG_HAVE_ME_BIN CONFIG_ME_BIN_PATH CONFIG_INCLUDE_SMSC_SCH5545_EC_FW \ CONFIG_FSP_S_FILE CONFIG_FSP_S_CBFS CONFIG_FSP_M_CBFS CONFIG_FSP_USE_REPO \ CONFIG_FSP_FULL_FD" -eval `setvars "" EC_url_bkup EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ +eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ E6400_VGA_romname SCH5545EC_DL_url_bkup SCH5545EC_DL_hash _dest tree \ mecleaner kbc1126_ec_dump MRC_refcode_cbtree new_mac _dl SCH5545EC_DL_url \ archive EC_url boarddir rom cbdir DL_url nukemode cbfstoolref FSPFD_hash \ _7ztest ME11bootguard ME11delta ME11version ME11sku ME11pch tmpromdir \ IFD_platform ifdprefix cdir sdir _me _metmp mfs TBFW_url_bkup TBFW_url \ - TBFW_hash TBFW_size hashfile has_hashes xromsize xchanged $cv` + TBFW_hash TBFW_size hashfile xromsize xchanged EC_url_bkup $cv`" vendor_download() { @@ -58,14 +58,14 @@ readkconfig() done done < "$TMPDIR/vendorcfg.list" - eval `setcfg "$TMPDIR/tmpcbcfg"` + eval "`setcfg "$TMPDIR/tmpcbcfg"`" for c in CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN CONFIG_KBC1126_FIRMWARE \ CONFIG_VGA_BIOS_FILE CONFIG_INCLUDE_SMSC_SCH5545_EC_FW \ CONFIG_LENOVO_TBFW_BIN CONFIG_FSP_M_FILE CONFIG_FSP_S_FILE; do eval "[ \"\${$c}\" = \"/dev/null\" ] && continue" eval "[ -z \"\${$c}\" ] && continue" - eval `setcfg "config/vendor/$vcfg/pkg.cfg"`; return 0 + eval "`setcfg "config/vendor/$vcfg/pkg.cfg"`"; return 0 done printf "Vendor files not needed for: %s\n" "$board" 1>&2; return 1 } @@ -77,7 +77,7 @@ bootstrap() [ -d "${kbc1126_ec_dump%/*}" ] && x_ make -C "$cbdir/util/kbc1126" [ -n "$MRC_refcode_cbtree" ] && \ cbfstoolref="elf/cbfstool/$MRC_refcode_cbtree/cbfstool" && \ - x_ ./mk -d coreboot $MRC_refcode_cbtree; return 0 + x_ ./mk -d coreboot "$MRC_refcode_cbtree"; return 0 } getfiles() @@ -345,7 +345,7 @@ vendor_inject() remkdir "$tmpromdel" set +u +e; [ $# -lt 1 ] && $err "No options specified. - $dontflash" - eval `setvars "" nukemode new_mac xchanged` + eval "`setvars "" nukemode new_mac xchanged`" archive="$1"; [ $# -gt 1 ] && case "$2" in @@ -359,7 +359,7 @@ vendor_inject() check_release "$archive" || \ $err "You must run this script on a release archive. - $dontflash" if readcfg; then - [ "$nukemode" = "nuke" ] || x_ ./mk download $board + [ "$nukemode" = "nuke" ] || x_ ./mk download "$board" patch_release_roms else printf "Tarball '%s' (board '%s) doesn't need vendorfiles.\n" \ @@ -407,7 +407,7 @@ readcfg() [ "$board" = "serprog_pico" ]; then return 1 fi; boarddir="$cbcfgsdir/$board" - eval `setcfg "$boarddir/target.cfg"`; chkvars vcfg tree + eval "`setcfg "$boarddir/target.cfg"`"; chkvars vcfg tree cbdir="src/coreboot/$tree" cbfstool="elf/cbfstool/$tree/cbfstool" @@ -418,7 +418,7 @@ readcfg() ifdtool="elf/ifdtool/$tree/ifdtool" [ -n "$IFD_platform" ] && ifdprefix="-p $IFD_platform" - x_ ./mk -d coreboot $tree + x_ ./mk -d coreboot "$tree" } patch_release_roms() @@ -454,7 +454,7 @@ patch_release_roms() printf "Make sure you inserted vendor files: %s\n" \ "$vguide" > "$tmpromdir/README.md" || : else - printf "Skipping vendorfiles on '$archive'" + printf "Skipping vendorfiles on '%s'\n" "$archive" 1>&2 fi ( @@ -471,7 +471,7 @@ patch_release_roms() if [ -n "$new_mac" ]; then if ! modify_mac_addresses; then - printf "\nNo GbE region defined for '$board'\n" \ + printf "\nNo GbE region defined for '%s'\n" "$board" \ 1>&2 printf "Therefore, changing the MAC is impossible.\n" \ 1>&2 @@ -596,17 +596,17 @@ patch_rom() inject() { - [ $# -lt 3 ] && $err "$@, $rom: usage: inject name path type (offset)" + [ $# -lt 3 ] && $err "$*, $rom: usage: inject name path type (offset)" [ "$2" = "/dev/null" ] && return 0 - eval `setvars "" cbfsname _dest _t _offset` + eval "`setvars "" cbfsname _dest _t _offset`" cbfsname="$1"; _dest="${2##*../}"; _t="$3" if [ "$_t" = "fsp" ]; then [ $# -gt 3 ] && _offset="$4" else [ $# -gt 3 ] && _offset="-b $4" && [ -z "$4" ] && \ - $err "inject $@, $rom: offset given but empty (undefined)" + $err "inject $*, $rom: offset given but empty (undefined)" fi e "$_dest" f n && [ "$nukemode" != "nuke" ] && $err "!inject $dl_type" @@ -666,6 +666,7 @@ modify_mac_addresses() "$_xrom" || $err "'$_xrom': Can't insert new GbE file" xchanged="y" done < "tmp/rom.list" - printf "\nThe following GbE NVM words were written in '$archive':\n" + printf "\nThe following GbE NVM words were written in '%s':\n" \ + "$archive" x_ util/nvmutil/nvm tmp/gbe dump } |