Tristan Corrick has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30549
Change subject: util/chromeos/crosfirmware.sh: Check for dependencies
......................................................................
util/chromeos/crosfirmware.sh: Check for dependencies
crosfirmware.sh has dependencies that might not be installed on some
systems. If a dependency is missing, provide a clear message about the
issue and how to resolve it.
Change-Id: I265bd03666f1273d3c22b60aae860c48c758005b
Signed-off-by: Tristan Corrick <tristan(a)corrick.kiwi>
---
M util/chromeos/crosfirmware.sh
1 file changed, 24 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/30549/1
diff --git a/util/chromeos/crosfirmware.sh b/util/chromeos/crosfirmware.sh
index 7cd9af9..567d58e 100755
--- a/util/chromeos/crosfirmware.sh
+++ b/util/chromeos/crosfirmware.sh
@@ -14,9 +14,6 @@
# GNU General Public License for more details.
#
-# This script needs
-# * sharutils
-
#DEBUG=1
export PATH="$PATH:/sbin"
@@ -26,6 +23,28 @@
test "$DEBUG" == "1" && echo "$*"
}
+exit_if_uninstalled() {
+ local cmd_name="$1"
+ local deb_pkg_name="$2"
+
+ if type "$cmd_name" >/dev/null 2>&1; then
+ return
+ fi
+
+ printf '`%s` was not found. ' "$cmd_name" >&2
+ printf 'On Debian-based systems, it can be installed\n' >&2
+ printf 'by running `apt install %s`.\n' "$deb_pkg_name" >&2
+
+ exit 1
+}
+
+exit_if_dependencies_are_missing() {
+ exit_if_uninstalled "uudecode" "sharutils"
+ exit_if_uninstalled "debugfs" "e2fsprogs"
+ exit_if_uninstalled "parted" "parted"
+ exit_if_uninstalled "curl" "curl"
+}
+
get_inventory()
{
_conf=$1
@@ -112,6 +131,8 @@
BOARD=$1
+exit_if_dependencies_are_missing
+
if [ "$BOARD" == "all" ]; then
CONF=$( mktemp )
get_inventory $CONF
--
To view, visit https://review.coreboot.org/c/coreboot/+/30549
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I265bd03666f1273d3c22b60aae860c48c758005b
Gerrit-Change-Number: 30549
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Corrick <tristan(a)corrick.kiwi>
Gerrit-MessageType: newchange
Tristan Corrick has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30548
Change subject: util/chromeos/crosfirmware.sh: Print download status
......................................................................
util/chromeos/crosfirmware.sh: Print download status
It's quite useful to know the download progress, as it can take a while
even with a fast connection. For example, the peppy recovery image is
~600 MiB. It also lets the user know that disk space is being filled.
Change-Id: I8c175f9095478ffe33c95b7ef9907c25b5f10f8c
Signed-off-by: Tristan Corrick <tristan(a)corrick.kiwi>
---
M util/chromeos/crosfirmware.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/30548/1
diff --git a/util/chromeos/crosfirmware.sh b/util/chromeos/crosfirmware.sh
index b4eae1a..7cd9af9 100755
--- a/util/chromeos/crosfirmware.sh
+++ b/util/chromeos/crosfirmware.sh
@@ -42,7 +42,7 @@
_file=$2
debug "Downloading recovery image"
- curl -s "$_url" > "$_file.zip"
+ curl "$_url" > "$_file.zip"
debug "Decompressing recovery image"
unzip -q "$_file.zip"
rm "$_file.zip"
--
To view, visit https://review.coreboot.org/c/coreboot/+/30548
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8c175f9095478ffe33c95b7ef9907c25b5f10f8c
Gerrit-Change-Number: 30548
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Corrick <tristan(a)corrick.kiwi>
Gerrit-MessageType: newchange
Tristan Corrick has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30547
Change subject: util/chromeos/crosfirmware.sh: Add /sbin to PATH
......................................................................
util/chromeos/crosfirmware.sh: Add /sbin to PATH
On some systems, such as Debian 9.6, `parted` and `debugfs` are located
in /sbin. Adding /sbin to PATH means that this script can work when run
as a regular user.
Change-Id: I151dba467e2b196f13093334273dae8a05865491
Signed-off-by: Tristan Corrick <tristan(a)corrick.kiwi>
---
M util/chromeos/crosfirmware.sh
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/30547/1
diff --git a/util/chromeos/crosfirmware.sh b/util/chromeos/crosfirmware.sh
index ba0c259..b4eae1a 100755
--- a/util/chromeos/crosfirmware.sh
+++ b/util/chromeos/crosfirmware.sh
@@ -19,6 +19,8 @@
#DEBUG=1
+export PATH="$PATH:/sbin"
+
debug()
{
test "$DEBUG" == "1" && echo "$*"
--
To view, visit https://review.coreboot.org/c/coreboot/+/30547
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I151dba467e2b196f13093334273dae8a05865491
Gerrit-Change-Number: 30547
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Corrick <tristan(a)corrick.kiwi>
Gerrit-MessageType: newchange
Tristan Corrick has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30546
Change subject: Doc/nb/intel/haswell: Mention util/chromeos as a way to get mrc.bin
......................................................................
Doc/nb/intel/haswell: Mention util/chromeos as a way to get mrc.bin
Change-Id: Ic099d0f052db5ef6a699d54b26028bae2fae4770
Signed-off-by: Tristan Corrick <tristan(a)corrick.kiwi>
---
M Documentation/northbridge/intel/haswell/mrc.bin.md
1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/30546/1
diff --git a/Documentation/northbridge/intel/haswell/mrc.bin.md b/Documentation/northbridge/intel/haswell/mrc.bin.md
index e27e9d6..36ab4c4 100644
--- a/Documentation/northbridge/intel/haswell/mrc.bin.md
+++ b/Documentation/northbridge/intel/haswell/mrc.bin.md
@@ -14,12 +14,13 @@
Unfortunately, it is not currently possible to distribute `mrc.bin` as
part of coreboot. Though, it can be obtained from a Haswell Chromebook
-or Chromebox firmware image, and you might find one online. `mrc.bin`
-can be extracted with the following command. If extracting from a
-"standard" coreboot image, omit `-r RO_SECTION`.
+firmware image like so, starting in the root of the coreboot directory:
```bash
-cbfstool coreboot.rom extract -f mrc.bin -n mrc.bin -r RO_SECTION
+make -C util/cbfstool
+cd util/chromeos
+./crosfirmware.sh peppy
+../cbfstool/cbfstool coreboot-*.bin extract -f mrc.bin -n mrc.bin -r RO_SECTION
```
Now, place `mrc.bin` in the root of the coreboot directory.
--
To view, visit https://review.coreboot.org/c/coreboot/+/30546
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic099d0f052db5ef6a699d54b26028bae2fae4770
Gerrit-Change-Number: 30546
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Corrick <tristan(a)corrick.kiwi>
Gerrit-MessageType: newchange