summaryrefslogtreecommitdiff
path: root/include/mrc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/mrc.sh')
-rwxr-xr-xinclude/mrc.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/include/mrc.sh b/include/mrc.sh
index 21ce5f01..43a59d82 100755
--- a/include/mrc.sh
+++ b/include/mrc.sh
@@ -14,15 +14,14 @@ extract_mrc()
_file="${_file%.zip}"
(
- cd "${appdir}" || err "extract_mrc: !cd ${appdir}"
+ x_ cd "${appdir}"
extract_partition ROOT-A "${_file}" root-a.ext2
extract_shellball root-a.ext2 chromeos-firmwareupdate-${MRC_board}
extract_coreboot chromeos-firmwareupdate-${MRC_board}
)
- "${cbfstool}" "${appdir}/"coreboot-*.bin extract -n mrc.bin \
- -f "${_dest}" -r RO_SECTION || \
- err "extract_mrc: could not fetch mrc.bin"
+ x_ "${cbfstool}" "${appdir}/"coreboot-*.bin extract -n mrc.bin \
+ -f "${_dest}" -r RO_SECTION
}
extract_partition()
@@ -39,9 +38,8 @@ extract_partition()
START=$(( $( echo ${ROOTP} | cut -f2 -d\ | tr -d "B" ) ))
SIZE=$(( $( echo ${ROOTP} | cut -f4 -d\ | tr -d "B" ) ))
- dd if="${FILE}" of="${ROOTFS}" bs=${_bs} skip=$(( ${START} / ${_bs} )) \
- count=$(( ${SIZE} / ${_bs} )) || \
- err "extract_partition: can't extract root file system"
+ x_ dd if="${FILE}" of="${ROOTFS}" bs=${_bs} \
+ skip=$(( ${START} / ${_bs} )) count=$(( ${SIZE} / ${_bs} ))
}
extract_shellball()
@@ -62,8 +60,7 @@ extract_coreboot()
printf "Extracting coreboot image\n"
[ -f "${_shellball}" ] || \
err "extract_coreboot: shellball missing in google cros image"
- sh "${_shellball}" --unpack "${_unpacked}" || \
- err "extract_coreboot: shellball exits with non-zero status"
+ x_ sh "${_shellball}" --unpack "${_unpacked}"
# TODO: audit the f* out of that shellball, for each mrc version.
# it has to be updated for each mrc update. we should ideally
@@ -75,6 +72,5 @@ extract_coreboot()
_version=$( cat "${_unpacked}/VERSION" | grep BIOS\ version: | \
cut -f2 -d: | tr -d \ )
- cp "${_unpacked}/bios.bin" "coreboot-${_version}.bin" || \
- err "extract_coreboot: cannot copy google cros rom"
+ x_ cp "${_unpacked}/bios.bin" "coreboot-${_version}.bin"
}