summaryrefslogtreecommitdiff
path: root/scripts/image_signing/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/image_signing/common.sh')
-rw-r--r--scripts/image_signing/common.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/image_signing/common.sh b/scripts/image_signing/common.sh
index 599c9e1e..62dc362a 100644
--- a/scripts/image_signing/common.sh
+++ b/scripts/image_signing/common.sh
@@ -75,6 +75,16 @@ die() {
exit 1
}
+# Extract and return board name from /etc/lsb-release.
+# Args: rootfs
+get_board_from_lsb_release() {
+ local rootfs=$1
+ # The cuts turn e.g. x86-foo as a well as x86-foo-pvtkeys into x86_foo.
+ local board=$(grep CHROMEOS_RELEASE_BOARD= "${rootfs}/etc/lsb-release" | \
+ cut -d = -f 2 | cut -d - -f 1,2 --output-delimiter=_)
+ echo "${board}"
+}
+
# This will override the trap set in common_minmal.sh
trap "cleanup" INT TERM EXIT