summaryrefslogtreecommitdiff
path: root/include/mrc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/mrc.sh')
-rw-r--r--include/mrc.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/mrc.sh b/include/mrc.sh
index 6bc8632c..92241b22 100644
--- a/include/mrc.sh
+++ b/include/mrc.sh
@@ -18,7 +18,10 @@ extract_refcode()
# and refcode is extracted from an image using the old scheme. we use
# cbfstool from coreboot 4.11_branch, the tree used by ASUS KGPE-D16:
- chkvars cbfstoolref
+ if [ -z "$cbfstoolref" ]; then
+ err "cbfstoolref not set" "extract_refcode" "$@"
+ fi
+
x_ mkdir -p "${_pre_dest%/*}"
x_ "$cbfstoolref" "$appdir/bios.bin" extract \
@@ -35,7 +38,12 @@ extract_refcode()
extract_mrc()
{
- chkvars "MRC_board" "CONFIG_MRC_FILE"
+ if [ -z "$MRC_board" ]; then
+ err "MRC_board unset" "extract_mrc" "$@"
+ elif [ -z "$CONFIG_MRC_FILE" ]; then
+ err "CONFIG_MRC_FILE unset" "extract_mrc" "$@"
+ fi
+
SHELLBALL="chromeos-firmwareupdate-$MRC_board"
(
@@ -52,10 +60,12 @@ extract_mrc()
extract_partition()
{
printf "Extracting ROOT-A partition\n"
+
ROOTP=$( printf "unit\nB\nprint\nquit\n" | \
parted "${1%.zip}" 2>/dev/null | grep "ROOT-A" )
START=$(( $( echo $ROOTP | cut -f2 -d\ | tr -d "B" ) ))
+
SIZE=$(( $( echo $ROOTP | cut -f4 -d\ | tr -d "B" ) ))
x_ dd if="${1%.zip}" of="root-a.ext2" bs=1024 skip=$(( $START / 1024 )) \