diff options
author | Tomasz Maciej Nowak <tomek_n@o2.pl> | 2018-02-14 17:28:09 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2018-03-02 21:33:07 +0100 |
commit | e4fa22397f0844481ed260ed599ff3851d30b71f (patch) | |
tree | 17b3d4f4db8a7126fd838b58c4ddf002b2856a3d | |
parent | e10ea566cc8fcf51ef0bceff05db374fae8f7e12 (diff) | |
download | upstream-e4fa22397f0844481ed260ed599ff3851d30b71f.tar.gz upstream-e4fa22397f0844481ed260ed599ff3851d30b71f.tar.bz2 upstream-e4fa22397f0844481ed260ed599ff3851d30b71f.zip |
mvebu: make sdcard bootloader option configurable
Remove the necessity for boot loader from SD card image creation process
and make it configurable.
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
-rw-r--r-- | target/linux/mvebu/image/Makefile | 5 | ||||
-rwxr-xr-x | target/linux/mvebu/image/gen_mvebu_sdcard_img.sh | 26 |
2 files changed, 21 insertions, 10 deletions
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index a78269bf1f..1f490905ff 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -44,10 +44,11 @@ define Build/boot-img endef define Build/sdcard-img + if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \ ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \ SIGNATURE="$(SIGNATURE)" \ ./gen_mvebu_sdcard_img.sh $@ \ - "$(STAGING_DIR_IMAGE)/clearfog-u-boot-spl.kwb" \ + $$UBOOT \ c 32768 $@.boot \ 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS) endef @@ -206,6 +207,7 @@ define Device/armada-388-clearfog-pro IMAGE/sdcard.img.gz := boot-scr-cfpro | boot-img | sdcard-img | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base SUPPORTED_DEVICES := armada-388-clearfog-pro armada-388-clearfog + UBOOT := clearfog-u-boot-spl.kwb endef TARGET_DEVICES += armada-388-clearfog-pro @@ -217,6 +219,7 @@ define Device/armada-388-clearfog-base IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr-cfbase | boot-img | sdcard-img | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base + UBOOT := clearfog-u-boot-spl.kwb endef TARGET_DEVICES += armada-388-clearfog-base diff --git a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh index 63acc79f40..67416ed80c 100755 --- a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh +++ b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh @@ -18,21 +18,27 @@ # usage() { - echo "$0 <outfile> <bootloader> [<type_partitionN> <sectors_partitionN> <img_partitionN>]?" + echo "$0 <outfile> [<bootloader> <type_partitionN> <sectors_partitionN> <img_partitionN>]?" } -# always require first 3 arguments +# always require first 2 or 3 arguments # then in pairs up to 8 more for a total of up to 4 partitions -if [ $# -lt 2 ] || [ $# -gt 15 ] || [ $((($# - 2) % 3)) -ne 0 ]; then - usage - exit 1 +if [ $# -lt 1 ] || [ $# -gt 14 ] || [ $((($# - 1) % 3)) -ne 0 ]; then + if [ $# -lt 2 ] || [ $# -gt 15 ] || [ $((($# - 2) % 3)) -ne 0 ]; then + usage + exit 1 + else + BOOTLOADER="$2" + fi fi set -e # parameters OUTFILE="$1"; shift -BOOTLOADER="$1"; shift +if [ -n "$BOOTLOADER" ]; then + shift +fi # generate image file printf "Creating $OUTFILE from /dev/zero: " @@ -54,9 +60,11 @@ set `ptgen -o "$OUTFILE" -h $head -s $sect -l 1024 -S 0x$SIGNATURE $ptgen_args` printf "Done\n" # install bootloader -printf "Writing bootloader: " -dd of="$OUTFILE" if="$BOOTLOADER" bs=512 seek=1 conv=notrunc 2>/dev/null -printf "Done\n" +if [ -n "$BOOTLOADER" ]; then + printf "Writing bootloader: " + dd of="$OUTFILE" if="$BOOTLOADER" bs=512 seek=1 conv=notrunc 2>/dev/null + printf "Done\n" +fi i=1 while [ "$#" -ge 2 ]; do |