summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/build/grub (renamed from script/build/fw/grub)2
-rwxr-xr-xscript/build/roms (renamed from script/build/fw/coreboot)48
-rwxr-xr-xscript/build/serprog (renamed from script/build/fw/serprog)4
-rwxr-xr-xscript/update/release (renamed from script/update/project/release)16
-rwxr-xr-xscript/update/trees (renamed from script/update/project/trees)79
-rwxr-xr-xscript/vendor/download (renamed from script/update/vendor/download)24
-rwxr-xr-xscript/vendor/inject (renamed from script/update/vendor/inject)48
7 files changed, 100 insertions, 121 deletions
diff --git a/script/build/fw/grub b/script/build/grub
index 66286732..ba0845d3 100755
--- a/script/build/fw/grub
+++ b/script/build/grub
@@ -23,7 +23,7 @@ main()
handle_dependencies()
{
- [ -d "src/grub" ] || x_ ./update project trees -f grub
+ [ -d "src/grub" ] || x_ ./update trees -f grub
[ -f "src/grub/grub-mkstandalone" ] || build_grub_utils
x_ mkdir -p "${elfdir}"
x_ rm -f "${elfdir}/"*
diff --git a/script/build/fw/coreboot b/script/build/roms
index 9e266ce7..2f7b93da 100755
--- a/script/build/fw/coreboot
+++ b/script/build/roms
@@ -25,15 +25,14 @@ pv="${pv} payload_seabios_withgrub payload_uboot memtest_bin"
v="romdir cbrom initmode displaymode cbcfg targetdir tree arch"
v="${v} grub_timeout ubdir vendorfiles board grub_scan_disk uboot_config"
eval "$(setvars "n" ${pv})"
-eval "$(setvars "" ${v})"
-eval "$(setvars "" boards _displaymode _payload _keyboard all targets)"
+eval "$(setvars "" ${v} boards _displaymode _payload _keyboard all targets)"
main()
{
while [ $# -gt 0 ]; do
case ${1} in
help) usage && exit 0 ;;
- list) listitems config/coreboot && exit 0 ;;
+ list) items config/coreboot && exit 0 ;;
-d) _displaymode="${2}" ;;
-p) _payload="${2}" ;;
-k) _keyboard="${2}" ;;
@@ -45,7 +44,7 @@ main()
shift 2
done
- [ "${all}" != "y" ] || boards=$(listitems config/coreboot) || \
+ [ "${all}" != "y" ] || boards=$(items config/coreboot) || \
err "Cannot generate list of boards for building"
for x in ${boards}; do
@@ -63,11 +62,7 @@ main()
printf "\nROM images available in these directories:\n"
printf "${targets}^^ ROM images available in these directories.\n\n"
- printf "WARNING!!!!!!! PLEASE READ:\n\n"
-
- printf "DO NOT flash ROM images contained under elf/, because they lack"
- printf " payloads and will BRICK your machine. Please flash ROM images"
- printf " contained under bin/ instead. YOU HAVE BEEN WARNED.\n\n"
+ printf "DO NOT flash ROM images from elf/ - please use bin/ instead.\n"
}
check_target()
@@ -133,13 +128,13 @@ prepare_target()
cbrom="${cbdir}/build/coreboot.rom"
[ -f "${cbfstool}" ] || \
- x_ ./update project trees -b coreboot utils ${tree}
+ x_ ./update trees -b coreboot utils ${tree}
build_dependency_seabios
memtest_bin="memtest86plus/build64/memtest.bin"
[ "${payload_memtest}" != "y" ] || [ -f "src/${memtest_bin}" ] || \
- x_ ./update project trees -b memtest86plus
+ x_ ./update trees -b memtest86plus
x_ rm -f "${romdir}/"*
@@ -151,13 +146,12 @@ prepare_target()
build_dependency_seabios()
{
[ "${payload_seabios}" = "y" ] || return 0
+ [ -f "${seavgabiosrom}" ] && \
+ [ -f elf/seabios/default/libgfxinit/bios.bin.elf ] && \
+ [ -f elf/seabios/default/vgarom/bios.bin.elf ] && \
+ [ -f elf/seabios/default/normal/bios.bin.elf ] && return 0
- if [ ! -f "${seavgabiosrom}" ] \
- || [ ! -f elf/seabios/default/libgfxinit/bios.bin.elf ] \
- || [ ! -f elf/seabios/default/vgarom/bios.bin.elf ] \
- || [ ! -f elf/seabios/default/normal/bios.bin.elf ]; then
- x_ ./update project trees -b seabios
- fi
+ x_ ./update trees -b seabios
}
build_dependency_grub()
@@ -177,14 +171,14 @@ build_dependency_grub()
rebuild_grub="y" && break
done
[ "${rebuild_grub}" = "y" ] || return 0
- x_ ./build fw grub
+ x_ ./build grub
}
build_dependency_uboot()
{
[ "${payload_uboot}" = "y" ] || return 0
- x_ ./update project trees -b u-boot ${board}
+ x_ ./update trees -b u-boot ${board}
ubdir="elf/u-boot/${board}/${uboot_config}"
ubootelf="${ubdir}/u-boot.elf"
[ ! -f "${ubootelf}" ] && [ -f "${ubdir}/u-boot" ] && \
@@ -221,7 +215,7 @@ build_roms()
"${cbcfg}" "${board}" "${displaymode}" "${initmode}" \
1>&2 && return 0
- x_ ./update project trees -b coreboot ${board}
+ x_ ./update trees -b coreboot ${board}
_cbrom="elf/coreboot_nopayload_DO_NOT_FLASH/${board}/${initmode}_${displaymode}"
[ "${initmode}" = "normal" ] && \
@@ -397,9 +391,9 @@ moverom() {
usage()
{
cat <<- EOF
- USAGE: ./build fw coreboot targetname
- To build *all* boards, do this: ./build fw coreboot all
- To list *all* boards, do this: ./build fw coreboot list
+ USAGE: ./build roms targetname
+ To build *all* boards, do this: ./build roms all
+ To list *all* boards, do this: ./build roms list
Optional Flags:
-d: displaymode
@@ -408,12 +402,12 @@ usage()
Example commands:
- ./build fw coreboot x60
- ./build fw coreboot x200_8mb x60
- ./build fw coreboot x60 -p grub -d corebootfb -k usqwerty
+ ./build roms x60
+ ./build roms x200_8mb x60
+ ./build roms x60 -p grub -d corebootfb -k usqwerty
possible values for 'target':
- $(listitems "config/coreboot")
+ $(items "config/coreboot")
Refer to the ${projectname} documentation for more information.
EOF
diff --git a/script/build/fw/serprog b/script/build/serprog
index eb0e5ede..43251acd 100755
--- a/script/build/fw/serprog
+++ b/script/build/serprog
@@ -22,12 +22,12 @@ main()
platform="rp2040"
boards_dir=${pico_sdk_dir}/src/boards/include/boards
[ -d "${pico_src_dir}/" ] || \
- x_ ./update project trees -f "rpi-pico-serprog"
+ x_ ./update trees -f "rpi-pico-serprog"
elif [ "${1}" = "stm32" ]; then
platform="stm32"
boards_dir=${stm32_src_dir}/boards
[ -d "${stm32_src_dir}/" ] || \
- x_ ./update project trees -f "stm32-vserprog"
+ x_ ./update trees -f "stm32-vserprog"
else
err "${usage}"
fi
diff --git a/script/update/project/release b/script/update/release
index e7973537..6188d793 100755
--- a/script/update/project/release
+++ b/script/update/release
@@ -46,7 +46,7 @@ mkvdir()
git clone . "${srcdir}" || err "mkdir: !gitclone \"${srcdir}\""
[ -z "${_nogit}" ] || x_ rm -Rf ".git"
- rm -Rf "${srcdir}/.git"
+ rm -Rf "${srcdir}/.git" || err "mkvdir: !rm -Rf ${srcdir}/.git"
insert_version_files "${srcdir}" || err "mkvdir ${srcdir}: versionfile"
}
@@ -87,7 +87,7 @@ build_release()
fetch_trees()
{
for x in ${_f}; do
- ./update project trees -f "${x}" || err "${_xm}: fetch ${x}"
+ ./update trees -f "${x}" || err "${_xm}: fetch ${x}"
done
for x in config/*/build.list; do
[ -f "${x}" ] || continue
@@ -101,9 +101,9 @@ fetch_trees()
mkrom_images()
{
- ./build fw coreboot all || err "${_xm}: roms-all"
- ./build fw serprog rp2040 || err "${_xm}: rp2040"
- ./build fw serprog stm32 || err "${_xm}: stm32"
+ ./build roms all || err "${_xm}: roms-all"
+ ./build serprog rp2040 || err "${_xm}: rp2040"
+ ./build serprog stm32 || err "${_xm}: stm32"
for rombuild in bin/*; do
[ -d "${rombuild}" ] || continue
@@ -161,7 +161,7 @@ nukerom()
fi
# Hash the images before removing vendor files
- # which ./update vendor inject uses for verification
+ # which "./vendor inject" uses for verification
x_ rm -f "${romdir}/vendorhashes"
x_ touch "${romdir}/vendorhashes"
(
@@ -171,7 +171,7 @@ nukerom()
for romfile in "${romdir}"/*.rom; do
[ -f "${romfile}" ] || continue
- x_ ./update vendor inject -r "${romfile}" -b ${target} -n nuke
+ x_ ./vendor inject -r "${romfile}" -b ${target} -n nuke
done
}
@@ -201,6 +201,8 @@ insert_copying_files()
x_ cp "src/seabios/default/COPYING" "${l}/COPYING.coreboot"
x_ cp "src/seabios/default/COPYING.LESSER" "${l}/COPYING.LESSER.seabios"
x_ cp -R "src/u-boot/default/Licenses" "${l}/COPYING.u-boot"
+ x_ printf "Multiple licenses. Check corresponding %s source archive\n" \
+ "${projectname}" > "${1}/COPYING"
}
mkrom_tarball()
diff --git a/script/update/project/trees b/script/update/trees
index c8643966..a71dbec0 100755
--- a/script/update/project/trees
+++ b/script/update/trees
@@ -16,12 +16,9 @@ export LOCALVERSION="-${projectname}-${version%%-*}"
eval "$(setvars "" arch cfgsdir codedir config config_name crossgcc_ada mode \
elfdir listfile project romtype target target_dir targets tree _f target1)"
-tmpclean="$(mktemp -d -t makeclean.XXXXXXXXXX)"
-
main()
{
- while getopts f:b:m:u:c:x:s:l:n: option
- do
+ while getopts f:b:m:u:c:x:s:l:n: option; do
_f="${1}"
case "${1}" in
-b) : ;;
@@ -37,27 +34,21 @@ main()
esac
shift; project="${OPTARG#src/}"; shift
done
- [ -z "${_f}" ] && err "flag not specified (-m, -u, -b, -c, -x, -f, -s, -l or -n)"
+ [ -z "${_f}" ] && err "missing flag (-m/-u/-b/-c/-x/-f/-s/-l/-n)"
[ -z "${project}" ] && err "project name not specified"
- if [ ! -f "config/${project}/build.list" ]; then
- build_projects $@
- else
- build_targets $@
- fi
+ [ -f "config/${project}/build.list" ] && build_targets $@ && return 0
+ build_projects $@
}
build_projects()
{
- [ $# -gt 0 ] && x_ ./update project trees ${_f} ${@}
+ [ $# -gt 0 ] && x_ ./update trees ${_f} ${@}
- if [ "${mode}" = "fetch" ]; then
- fetch_project_repo
- return 0
- fi
+ [ "${mode}" = "fetch" ] && fetch_project_repo && return 0
codedir="src/${project}"
- [ -d "${codedir}" ] || x_ ./update project trees -f "${project}"
+ [ -d "${codedir}" ] || x_ ./update trees -f "${project}"
if [ "${project}" = "uefitool" ]; then
(
@@ -87,7 +78,7 @@ build_targets()
[ $# -gt 0 ] && target1="${1}"
[ "${target1}" = "utils" ] && [ "${project}" = "coreboot" ] && \
shift 1
- targets=$(listitems "${cfgsdir}") || \
+ targets=$(items "${cfgsdir}") || \
err "Cannot get options for ${cfgsdir}"
[ $# -gt 0 ] && targets=$@
@@ -103,7 +94,7 @@ handle_targets()
printf "Running 'make %s' for project '%s, target '%s''\n" \
"${mode}" "${project}" "${target}"
[ "${project}" != "coreboot" ] || [ ! -z ${mode} ] || \
- x_ ./update vendor download ${target}
+ x_ ./vendor download ${target}
x_ handle_defconfig
done
@@ -140,10 +131,7 @@ handle_src_tree()
romtype="normal"
target_dir="${cfgsdir}/${target}"
- if [ "${mode}" = "fetch" ]; then
- fetch_project_trees
- return 1
- fi
+ [ "${mode}" = "fetch" ] && fetch_project_trees && return 1
x_ mkdir -p "${elfdir}/${target}"
eval "$(setvars "" arch tree)"
@@ -151,10 +139,9 @@ handle_src_tree()
. "${target_dir}/target.cfg" || \
err "handle_src_tree ${target_dir}: cannot load target.cfg"
- [ -z "${tree}" ] && \
- err "handle_src_tree: ${target_dir}: tree undefined"
- [ -z "${arch}" ] && \
- err "handle_src_tree: ${target_dir}: undefined cpu type"
+ for ix in arch tree; do
+ eval "[ -z \"\${$ix}\" ] && err \"handle_src: $ix undefined\""
+ done
codedir="src/${project}/${tree}"
@@ -165,23 +152,15 @@ handle_src_tree()
"${codedir}" 1>&2
return 1
fi
- x_ ./update project trees -f "${project}" "${target}"
- elif [ "${mode}" = "distclean" ] || \
- [ "${mode}" = "crossgcc-clean" ]; then
- [ -f "${tmpclean}/${tree}" ] && return 1
- touch "${tmpclean}/${tree}"
+ x_ ./update trees -f "${project}" "${target}"
fi
[ "${target1}" = "utils" ] && [ "${project}" = "coreboot" ] && return 0
+ [ "$project" != "coreboot" ] && [ "$project" != "u-boot" ] && return 0
# u-boot and coreboot are both compiled with coreboot's crossgcc
- if [ "${project}" = "coreboot" ] || [ "${project}" = "u-boot" ]; then
- [ ! -z ${mode} ] || check_cross_compiler || \
- err "handle_src_tree ${project}/${target}: crossgcc"
- cbfstool="cbutils/${tree}/cbfstool"
- [ -f "${cbfstool}" ] || \
- x_ ./update project trees -b coreboot utils "${tree}"
- fi
+ [ -z ${mode} ] || return 0
+ check_cross_compiler
}
# set up cross-compiler (coreboot crossgcc) for u-boot and coreboot
@@ -190,42 +169,35 @@ check_cross_compiler()
{
[ "${crossgcc_ada}" = "y" ] || [ "${crossgcc_ada}" = "n" ] || \
crossgcc_ada="y"
- [ "${crossgcc_ada}" != "y" ] && \
- export BUILD_LANGUAGES=c
+ [ "${crossgcc_ada}" = "y" ] || export BUILD_LANGUAGES=c
cbdir="src/coreboot/${tree}"
- [ "${project}" != "coreboot" ] && \
- cbdir="src/coreboot/default"
+ [ "${project}" != "coreboot" ] && cbdir="src/coreboot/default"
# only true if not building coreboot:
ctarget="${cbdir#src/coreboot/}"
- [ -d "${cbdir}" ] || \
- x_ ./update project trees -f coreboot ${ctarget}
+ [ -d "${cbdir}" ] || x_ ./update trees -f coreboot ${ctarget}
if [ "${arch}" = "x86_32" ] || [ "${arch}" = "x86_64" ]; then
[ -d "${cbdir}/util/crossgcc/xgcc/i386-elf/" ] || \
- make -C "${cbdir}" crossgcc-i386 CPUS=$(nproc) || \
- return 1
+ x_ make -C "${cbdir}" crossgcc-i386 CPUS=$(nproc)
case "$(uname -m)" in
x86*|i*86|amd64) : ;;
*) export CROSS_COMPILE=i386-elf- ;;
esac
elif [ "${arch}" = "ARMv7" ]; then
[ -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ] || \
- make -C "${cbdir}" crossgcc-arm CPUS=$(nproc) || \
- return 1
+ x_ make -C "${cbdir}" crossgcc-arm CPUS=$(nproc)
case "$(uname -m)" in
arm|arm32|armv6*|armv7*) : ;;
*) export CROSS_COMPILE=arm-eabi- ;;
esac
elif [ "${arch}" = "AArch64" ]; then
[ -d "${cbdir}/util/crossgcc/xgcc/aarch64-elf/" ] || \
- make -C "${cbdir}" crossgcc-aarch64 CPUS=$(nproc) || \
- return 1
+ x_ make -C "${cbdir}" crossgcc-aarch64 CPUS=$(nproc)
# aarch64 also needs armv7 toolchain for arm-trusted-firmware
[ -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ] || \
- make -C "${cbdir}" crossgcc-arm CPUS=$(nproc) || \
- return 1
+ x_ make -C "${cbdir}" crossgcc-arm CPUS=$(nproc)
case "$(uname -m)" in
arm64|aarch64) : ;;
*) export CROSS_COMPILE=aarch64-elf- ;;
@@ -233,7 +205,7 @@ check_cross_compiler()
fi
# we *must* ensure that u-boot's build system uses crossgcc first
- export PATH="$(pwd)/${cbdir}/util/crossgcc/xgcc/bin:$PATH"
+ export PATH="${PWD}/${cbdir}/util/crossgcc/xgcc/bin:$PATH"
}
check_config()
@@ -279,6 +251,7 @@ run_make_command()
x_ printf "%s\n" "${version%%-*}" >"${codedir}/.coreboot-version"
x_ make ${mode} -j$(nproc) -C "${codedir}"
+
[ "${mode}" != "clean" ] && return 0
make -C "${codedir}" distclean 2>/dev/null || :
}
diff --git a/script/update/vendor/download b/script/vendor/download
index 87e9d3a5..40244fff 100755
--- a/script/update/vendor/download
+++ b/script/vendor/download
@@ -54,18 +54,17 @@ detect_firmware()
build_dependencies()
{
[ -d ${cbdir} ] || \
- x_ ./update project trees -f coreboot ${cbdir##*/}
+ x_ ./update trees -f coreboot ${cbdir##*/}
for d in uefitool biosutilities bios_extract; do
[ -d "src/${d}" ] && continue
- x_ ./update project trees -f "${d}"
+ x_ ./update trees -f "${d}"
done
[ -f "${uefiextract}" ] || \
- x_ ./update project trees -b uefitool
+ x_ ./update trees -b uefitool
[ -f "${kbc1126_ec_dump}" ] || \
x_ make -C "${cbdir}/util/kbc1126"
- if [ ! -f "${cbfstool}" ] || [ ! -f "${ifdtool}" ]; then
- x_ ./update project trees -b coreboot utils default
- fi
+ [ -f "${cbfstool}" ] && [ -f "${ifdtool}" ] && return 0
+ x_ ./update trees -b coreboot utils default
}
download_vendorfiles()
@@ -85,8 +84,7 @@ download_vendorfiles()
"${E6400_VGA_DL_url_bkup}" "${E6400_VGA_DL_hash}" \
"${CONFIG_VGA_BIOS_FILE}"
[ -z "${CONFIG_HAVE_MRC}" ] && return 0
- fetch "mrc" "${MRC_url}" "${MRC_url_bkup}" "${MRC_hash}" \
- "${CONFIG_MRC_FILE}"
+ fetch "mrc" "$MRC_url" "$MRC_url_bkup" "$MRC_hash" "$CONFIG_MRC_FILE"
}
fetch()
@@ -136,7 +134,7 @@ mkdirs()
{
[ -f "${1}" ] && \
printf "mkdirs ${1} ${2}: already downloaded\n" 1>&2 && return 1
- x_ mkdir -p "${1%/*}"
+ mkdir -p "${1%/*}" || err "mkdirs: !mkdir -p ${1%/*}"
x_ rm -Rf "${appdir}"
x_ mkdir -p "${appdir}/"
extract_archive "${_dl}" "${appdir}" || \
@@ -192,7 +190,7 @@ extract_kbc1126ec()
mv Rompaq/68*.BIN ec.bin || :
if [ ! -f ec.bin ]; then
unar -D ROM.CAB Rom.bin || unar -D Rom.CAB Rom.bin || \
- x_ unar -D 68*.CAB Rom.bin
+ unar -D 68*.CAB Rom.bin || err "can't extract Rom.bin"
x_ mv Rom.bin ec.bin
fi
[ -f ec.bin ] || err "extract_kbc1126_ec ${board}: can't extract"
@@ -205,7 +203,8 @@ extract_kbc1126ec()
done
[ "${ec_ex}" = "y" ] || \
err "extract_kbc1126_ec ${board}: didn't extract ecfw1/2.bin"
- x_ cp "${appdir}/"ec.bin.fw* "${_dest%/*}/"
+ cp "${appdir}/"ec.bin.fw* "${_dest%/*}/" || \
+ err "extract_kbc1126_ec ${board}: can't copy ec binaries"
}
extract_e6400vga()
@@ -223,7 +222,8 @@ extract_e6400vga()
[ -f "${E6400_VGA_romname}" ] || \
err "extract_e6400vga: can't extract vga rom from bios.bin"
)
- x_ cp "${appdir}/${E6400_VGA_romname}" "${_dest}"
+ cp "${appdir}/${E6400_VGA_romname}" "${_dest}" || \
+ err "extract_e6400vga ${board}: can't copy vga rom to ${_dest}"
}
extract_sch5545ec()
diff --git a/script/update/vendor/inject b/script/vendor/inject
index c4a7f702..923224d0 100755
--- a/script/update/vendor/inject
+++ b/script/vendor/inject
@@ -15,7 +15,7 @@ main()
{
[ $# -lt 1 ] && err "No options specified."
[ "${1}" = "listboards" ] && \
- listitems config/coreboot && exit 0
+ items config/coreboot && exit 0
archive="${1}"
@@ -78,7 +78,7 @@ detect_board()
_stripped_prefix=${filename#*_}
board="${_stripped_prefix%.tar.xz}" ;;
*)
- err "detect_board: could not detect board type"
+ err "detect_board $filename: could not detect board type"
esac
[ -d "${boarddir}/" ] || \
err "detect_board: dir, ${boarddir}, doesn't exist"
@@ -87,18 +87,21 @@ detect_board()
build_dependencies()
{
- [ -d "${cbdir}" ] || x_ ./update project trees -f coreboot default
+ [ -d "${cbdir}" ] || x_ ./update trees -f coreboot default
if [ ! -f "${cbfstool}" ] || [ ! -f "${ifdtool}" ]; then
- x_ ./update project trees -b coreboot utils default
+ x_ ./update trees -b coreboot utils default
fi
[ -z "${new_mac}" ] || [ -f "${nvmutil}" ] || x_ make -C util/nvmutil
[ "${nukemode}" = "nuke" ] && return 0
- x_ ./update vendor download ${board}
+ x_ ./vendor download ${board}
}
inject_vendorfiles()
{
- [ "${release}" != "y" ] && x_ patch_rom "${rom}" && return 0
+ if [ "${release}" != "y" ]; then
+ patch_rom "${rom}"
+ return 0
+ fi
printf "patching release images\n"
patch_release_roms
}
@@ -108,11 +111,12 @@ patch_release_roms()
_tmpdir="tmp/romdir"
x_ rm -Rf "${_tmpdir}"
x_ mkdir -p "${_tmpdir}"
- x_ tar -xf "${archive}" -C "${_tmpdir}"
+ tar -xf "${archive}" -C "${_tmpdir}" || \
+ err "patch_release_roms: !tar -xf \"${archive}\" -C \"${_tmpdir}\""
for x in "${_tmpdir}"/bin/*/*.rom ; do
printf "patching rom: %s\n" "$x"
- x_ patch_rom "${x}"
+ patch_rom "${x}"
done
for x in "${_tmpdir}"/bin/*/*_nomicrocode.rom ; do
[ -f "${x}" ] || continue
@@ -123,7 +127,7 @@ patch_release_roms()
done
(
- x_ cd "${_tmpdir}/bin/"*
+ x_ cd "${_tmpdir}/bin/"* # TODO: very dodgy, re-write accordingly
# NOTE: For compatibility with older rom releases, defer to sha1
[ "${nukemode}" = "nuke" ] || \
@@ -211,22 +215,28 @@ inject()
if [ "${_t}" = "GbE" ]; then
x_ mkdir -p tmp
- x_ cp "${_dest}" "tmp/gbe.bin"
+ cp "${_dest}" "tmp/gbe.bin" || \
+ err "inject: !cp \"${_dest}\" \"tmp/gbe.bin\""
_dest="tmp/gbe.bin"
- x_ "${nvmutil}" "${_dest}" setmac "${new_mac}"
+ "${nvmutil}" "${_dest}" setmac "${new_mac}" || \
+ err "inject ${_dest}: can't change mac address"
fi
if [ "${cbfsname}" = "IFD" ]; then
if [ "${nukemode}" != "nuke" ]; then
- x_ "${ifdtool}" -i ${_t}:${_dest} "${rom}" -O "$rom"
+ "${ifdtool}" -i ${_t}:${_dest} "${rom}" -O "$rom" || \
+ err "inject: can't insert $_t ($dest) into $rom"
else
- x_ "${ifdtool}" --nuke ${_t} "${rom}" -O "${rom}"
+ "${ifdtool}" --nuke ${_t} "${rom}" -O "${rom}" || \
+ err "inject ${rom}: can't nuke ${_t} in IFD"
fi
else
if [ "${nukemode}" != "nuke" ]; then
- x_ "${cbfstool}" "${rom}" add -f "${_dest}" \
- -n "${cbfsname}" -t ${_t} ${_offset}
+ "${cbfstool}" "${rom}" add -f "${_dest}" \
+ -n "${cbfsname}" -t ${_t} ${_offset} || \
+ err "inject $rom: can't insert $_t file $_dest"
else
- x_ "${cbfstool}" "${rom}" remove -n "${cbfsname}"
+ "${cbfstool}" "${rom}" remove -n "${cbfsname}" || \
+ err "inject $rom: can't remove ${cbfsname}"
fi
fi
@@ -235,13 +245,13 @@ inject()
usage()
{
cat <<- EOF
- USAGE: ./update vendor inject -r [rom path] -b [boardname] -m [macaddress]
- Example: ./update vendor inject -r x230_12mb.rom -b x230_12mb
+ USAGE: ./vendor inject -r [rom path] -b [boardname] -m [macaddress]
+ Example: ./vendor inject -r x230_12mb.rom -b x230_12mb
Adding a macadress to the gbe is optional.
If the [-m] parameter is left blank, the gbe will not be touched.
- Type './update vendor inject listboards' to get a list of valid boards
+ Type './vendor inject listboards' to get a list of valid boards
EOF
}