diff mbox series

[U-Boot,v2,1/2] flash: Script to create a flash image from u-boot

Message ID 20190715231421.10336-2-joel@jms.id.au
State Accepted
Headers show
Series uboot-test-hooks: aspeed ast2500 support | expand

Commit Message

Joel Stanley July 15, 2019, 11:14 p.m. UTC
This creates an empty flash image and places u-boot at the start of it.
It will be used by the ASPEED Qemu tests which boot u-boot from an
emaulated flash device.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 bin/flash.create_image_32mb | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100755 bin/flash.create_image_32mb

Comments

Stephen Warren July 16, 2019, 3:26 p.m. UTC | #1
On 7/15/19 5:14 PM, Joel Stanley wrote:
> This creates an empty flash image and places u-boot at the start of it.
> It will be used by the ASPEED Qemu tests which boot u-boot from an
> emaulated flash device.

> diff --git a/bin/flash.create_image_32mb b/bin/flash.create_image_32mb

I can foresee a future where we rename this flash.create_image and pass 
in the image size via a variable that's set by the conf.xxx file. But 
this is fine for now.

I've applied both patches. Thanks.
diff mbox series

Patch

diff --git a/bin/flash.create_image_32mb b/bin/flash.create_image_32mb
new file mode 100755
index 000000000000..8c2770d50e2b
--- /dev/null
+++ b/bin/flash.create_image_32mb
@@ -0,0 +1,9 @@ 
+# Copyright 2019 IBM Corp.
+# Joel Stanley <joel@jms.id.au>
+# SPDX-License-Identifier: GPL-2.0+
+
+# TODO: Work out a better temp directory
+FLASH_IMG="${U_BOOT_BUILD_DIR}"/flash.img
+
+dd if=/dev/zero of="${FLASH_IMG}" count=32 bs=1M
+dd if="${U_BOOT_BUILD_DIR}"/u-boot.bin of="${FLASH_IMG}" conv=notrunc