Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 6/8] odoridc2: add mainline post image script.
Date: Sun, 3 Dec 2017 14:31:02 +0100	[thread overview]
Message-ID: <20171203143102.2e05f11b@windsurf.lan> (raw)
In-Reply-To: <20171203125619.30919-6-daggs@gmx.com>

Hello,

On Sun,  3 Dec 2017 14:56:17 +0200, Dagg Stompler wrote:

> +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

Downloading and building stuff in the post-image script is clearly not
good. It works around the download and legal-info mechanisms of
Buildroot.

> +echo "Prepering files"

Preparing

> +${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

This feels like creating an ARM Trusted Firmware image. Don't you have
the source code for ATF, so that you can build it ?

> +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"

Generating

> +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

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2017-12-03 13:31 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 ` [Buildroot] [PATCH 6/8] odoridc2: add mainline post image script Dagg Stompler
2017-12-03 13:31   ` Thomas Petazzoni [this message]
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=20171203143102.2e05f11b@windsurf.lan \
    --to=thomas.petazzoni@free-electrons.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