2012-09-24 22:42:58 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# post-build fixups
|
2013-09-25 21:07:50 +02:00
|
|
|
# for further details, see
|
|
|
|
#
|
|
|
|
# http://boundarydevices.com/u-boot-on-i-mx6/
|
|
|
|
#
|
2012-09-24 22:42:58 +02:00
|
|
|
|
|
|
|
BOARD_DIR="$(dirname $0)"
|
2018-07-19 12:31:05 +02:00
|
|
|
UBOOT_DEFCONFIG="$(grep BR2_TARGET_UBOOT_BOARD_DEFCONFIG ${BR2_CONFIG} | sed 's/.*\"\(.*\)\"/\1/')"
|
2012-09-24 22:42:58 +02:00
|
|
|
|
2018-07-19 12:31:07 +02:00
|
|
|
if grep -Eq "^BR2_aarch64=y$" ${BR2_CONFIG}; then
|
|
|
|
MKIMAGE_ARCH=arm64
|
|
|
|
UBOOT_BINARY=imx8-boot-sd.bin
|
|
|
|
else
|
|
|
|
MKIMAGE_ARCH=arm
|
|
|
|
UBOOT_BINARY=u-boot.imx
|
|
|
|
fi
|
|
|
|
|
2018-01-05 15:39:47 +01:00
|
|
|
# bd u-boot looks for standard bootscript
|
2018-07-19 12:31:07 +02:00
|
|
|
$HOST_DIR/bin/mkimage -A $MKIMAGE_ARCH -O linux -T script -C none -a 0 -e 0 \
|
|
|
|
-n "boot script" -d $BOARD_DIR/boot.cmd $TARGET_DIR/boot/boot.scr
|
2012-09-24 22:42:58 +02:00
|
|
|
|
|
|
|
# u-boot / update script for bd upgradeu command
|
2018-07-19 12:31:07 +02:00
|
|
|
if [ -e $BINARIES_DIR/$UBOOT_BINARY ]; then
|
|
|
|
install -D -m 0644 $BINARIES_DIR/$UBOOT_BINARY \
|
2018-07-19 12:31:05 +02:00
|
|
|
$TARGET_DIR/u-boot.$UBOOT_DEFCONFIG
|
2018-07-19 12:31:07 +02:00
|
|
|
$HOST_DIR/bin/mkimage -A $MKIMAGE_ARCH -O linux -T script -C none -a 0 -e 0 \
|
|
|
|
-n "upgrade script" -d $BOARD_DIR/upgrade.cmd $TARGET_DIR/upgrade.scr
|
2012-09-24 22:42:58 +02:00
|
|
|
fi
|