From: Dagg Stompler <daggs@gmx.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 6/8] odoridc2: add mainline post image script.
Date: Sun, 3 Dec 2017 14:56:17 +0200 [thread overview]
Message-ID: <20171203125619.30919-6-daggs@gmx.com> (raw)
In-Reply-To: <20171203125619.30919-1-daggs@gmx.com>
the mainline image doesn't have the signed firmwarfe bundled in the
uboot images.
to address this issue, the needed files are required to be retrieved
from the vendor's site, prepared and embbeded into the final image.
Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
board/hardkernel/odroidc2/post-image-mailine.sh | 40 +++++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100755 board/hardkernel/odroidc2/post-image-mailine.sh
diff --git a/board/hardkernel/odroidc2/post-image-mailine.sh b/board/hardkernel/odroidc2/post-image-mailine.sh
new file mode 100755
index 0000000000..42e3c324b6
--- /dev/null
+++ b/board/hardkernel/odroidc2/post-image-mailine.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage-mainline.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+WORK_DIR="${BUILD_DIR}/hk-uboot-signing"
+FINAL_IMG_PATH="${BINARIES_DIR}/sdcard.img"
+SIGNED_UBOOT_IMG="${BINARIES_DIR}/uboot-odc2.img"
+SIGNED_FILES_URL="https://github.com/hardkernel/u-boot/archive/odroidc2-v2015.01.tar.gz"
+SIGNED_FILES_PATH_PREFIX="$(basename $(echo ${SIGNED_FILES_URL} | sed 's/\.tar.*$//g'))"
+
+rm -rf "${WORK_DIR}" "${GENIMAGE_TMP}"
+
+echo "Retrieving vendor files for signing"
+mkdir -p ${WORK_DIR}
+wget -qO- ${SIGNED_FILES_URL} | tar -C ${WORK_DIR} --strip-components=1 -zxf - u-boot-${SIGNED_FILES_PATH_PREFIX}/{tools/fip_create,fip/gxb,sd_fuse/bl1.bin.hardkernel}
+
+echo "Building nessesary tools"
+CC="${HOSTCC}" make -C ${WORK_DIR}/tools/fip_create
+
+echo "Prepering files"
+${WORK_DIR}/tools/fip_create/fip_create --bl30 ${WORK_DIR}/fip/gxb/bl30.bin --bl301 ${WORK_DIR}/fip/gxb/bl301.bin --bl31 ${WORK_DIR}/fip/gxb/bl31.bin --bl33 ${BINARIES_DIR}/u-boot.bin ${WORK_DIR}/fip.bin
+${WORK_DIR}/tools/fip_create/fip_create --dump ${WORK_DIR}/fip.bin
+cat ${WORK_DIR}/fip/gxb/bl2.package ${WORK_DIR}/fip.bin > ${WORK_DIR}/boot_new.bin
+${HOST_DIR}/bin/amlbootsig ${WORK_DIR}/boot_new.bin ${WORK_DIR}/u-boot.img
+cp ${WORK_DIR}/sd_fuse/bl1.bin.hardkernel ${BINARIES_DIR}
+
+echo "Genrating new uboot img file"
+dd if=${WORK_DIR}/u-boot.img of=${SIGNED_UBOOT_IMG} bs=512 skip=96
+
+genimage \
+ --rootpath "${TARGET_DIR}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
+
+echo "Signing image"
+dd if=${BINARIES_DIR}/bl1.bin.hardkernel of=${FINAL_IMG_PATH} conv=fsync,notrunc bs=1 count=442
+dd if=${BINARIES_DIR}/bl1.bin.hardkernel of=${FINAL_IMG_PATH} conv=fsync,notrunc bs=512 skip=1 seek=1
--
2.15.1
next prev parent reply other threads:[~2017-12-03 12:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-03 12:56 [Buildroot] [PATCH 1/8] meson-tools: New Package Dagg Stompler
2017-12-03 12:56 ` [Buildroot] [PATCH 2/8] odroidc2: add boot.cmd for mainline uboot Dagg Stompler
2017-12-03 12:56 ` [Buildroot] [PATCH 3/8] odroidc2: add post build script Dagg Stompler
2017-12-03 13:27 ` Thomas Petazzoni
2017-12-03 15:59 ` daggs
2017-12-03 12:56 ` [Buildroot] [PATCH 4/8] odroidc2: add mainline kernel config Dagg Stompler
2017-12-03 13:28 ` Thomas Petazzoni
2017-12-03 15:55 ` daggs
2017-12-03 17:19 ` Arnout Vandecappelle
2017-12-03 18:57 ` daggs
2017-12-03 12:56 ` [Buildroot] [PATCH 5/8] odroidc2: add mainline genimage Dagg Stompler
2017-12-03 12:56 ` Dagg Stompler [this message]
2017-12-03 13:31 ` [Buildroot] [PATCH 6/8] odoridc2: add mainline post image script Thomas Petazzoni
2017-12-03 15:54 ` daggs
2017-12-03 16:44 ` Thomas Petazzoni
2017-12-03 18:56 ` daggs
2017-12-03 12:56 ` [Buildroot] [PATCH 7/8] odoridc2: add defconfig for mainline image Dagg Stompler
2017-12-03 13:26 ` Thomas Petazzoni
2017-12-03 16:01 ` daggs
2017-12-03 12:56 ` [Buildroot] [PATCH 8/8] odroidc2: update readme file Dagg Stompler
2017-12-03 13:23 ` [Buildroot] [PATCH 1/8] meson-tools: New Package Thomas Petazzoni
2017-12-03 16:03 ` daggs
2017-12-03 19:06 ` Baruch Siach
2017-12-03 19:38 ` daggs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171203125619.30919-6-daggs@gmx.com \
--to=daggs@gmx.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox