2024-01-07 01:11:46 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
. script_env
|
|
|
|
|
|
|
|
MKIMAGE="$UBOOT_DIR/tools/mkimage"
|
|
|
|
|
|
|
|
if [ ! -x "$MKIMAGE" ]; then
|
|
|
|
echo "ERROR: Missing $MKIMAGE" >&2
|
|
|
|
echo " Build U-Boot to prepare the mkimage tool" >&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$SDCARD_DIR"
|
|
|
|
|
2024-09-19 21:08:22 +02:00
|
|
|
# Copy U-Boot SPL and U-Boot program image
|
|
|
|
cp -a "$UBOOT_DIR/spl/boot.bin" "$SDCARD_DIR"
|
|
|
|
cp -a "$UBOOT_DIR/u-boot.img" "$SDCARD_DIR"
|
2024-01-07 01:11:46 +01:00
|
|
|
|
|
|
|
# Wrap Linux kernel in U-Boot image file
|
|
|
|
$MKIMAGE -A arm -O linux -C none -T kernel -a 0x8000 -e 0x8000 -n Linux -d "$LINUX_DIR/arch/arm/boot/zImage" "$SDCARD_DIR/uImage"
|
|
|
|
|
|
|
|
# Copy device tree
|
|
|
|
cp -a devicetree/devicetree.dtb "$SDCARD_DIR"
|
|
|
|
|
|
|
|
# Copy root fs image
|
|
|
|
cp -a "$BUILDROOT_DIR/output/images/rootfs.cpio.uboot" "$SDCARD_DIR"
|
|
|
|
|
|
|
|
# Wrap U-Boot script in image file
|
|
|
|
$MKIMAGE -A arm -T script -d config/uboot_script.txt "$SDCARD_DIR/boot.scr"
|
|
|
|
|
2024-01-13 16:01:49 +01:00
|
|
|
# Create SSH host key for embedded system
|
|
|
|
if [ ! -f "$SDCARD_DIR/dropbear_ed25519_host_key" ]; then
|
|
|
|
dropbearkey -t ed25519 -f "$SDCARD_DIR/dropbear_ed25519_host_key"
|
|
|
|
fi
|
|
|
|
|
2024-09-22 11:34:37 +02:00
|
|
|
# Copy FPGA firmware
|
|
|
|
cp -a "$FIRMWARE_FILE" "$SDCARD_DIR"
|
|
|
|
|