diff --git a/bootstrap.d/41-uboot.sh b/bootstrap.d/41-uboot.sh index cd9e67b..a7f4709 100644 --- a/bootstrap.d/41-uboot.sh +++ b/bootstrap.d/41-uboot.sh @@ -69,6 +69,11 @@ if [ "$ENABLE_UBOOT" = true ] ; then # Set mkfile to use the correct dtb file sed -i "s/^\(setenv dtbfile \).*/\1${DTB_FILE}/" "${BOOT_DIR}/uboot.mkimage" + # Set mkfile to use the correct mach id + if [ "$ENABLE_QEMU" = true ] ; then + sed -i "s/^\(setenv machid \).*/\10x000008e0/" "${BOOT_DIR}/uboot.mkimage" + fi + # Set mkfile to use kernel image sed -i "s/^\(fatload mmc 0:1 \${kernel_addr_r} \).*/\1${KERNEL_IMAGE}/" "${BOOT_DIR}/uboot.mkimage" diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 50c37dc..b58dc3d 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -336,7 +336,7 @@ fi # Add device-tree-compiler required for building the U-Boot bootloader if [ "$ENABLE_UBOOT" = true ] ; then - APT_INCLUDES="${APT_INCLUDES},device-tree-compiler" + APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bison,flex" fi # Check if root SSH (v2) public key file exists @@ -525,6 +525,8 @@ fi # Configure qemu compatible kernel if [ "$ENABLE_QEMU" = true ] ; then + DTB_FILE=vexpress-v2p-ca15_a7.dtb + UBOOT_CONFIG=vexpress_ca15_tc2_defconfig KERNEL_DEFCONFIG="vexpress_defconfig" if [ "$KERNEL_MENUCONFIG" = false ] ; then KERNEL_OLDDEFCONFIG=true @@ -626,6 +628,19 @@ if [ "$ENABLE_QEMU" = true ] ; then done fi + # Copy u-boot files to QEMU directory + if [ "$ENABLE_UBOOT" = true ] ; then + if [ -f "${BOOT_DIR}/u-boot.bin" ] ; then + install_readonly "${BOOT_DIR}/u-boot.bin" "${BASEDIR}/qemu/u-boot.bin" + fi + if [ -f "${BOOT_DIR}/uboot.mkimage" ] ; then + install_readonly "${BOOT_DIR}/uboot.mkimage" "${BASEDIR}/qemu/uboot.mkimage" + fi + if [ -f "${BOOT_DIR}/boot.scr" ] ; then + install_readonly "${BOOT_DIR}/boot.scr" "${BASEDIR}/qemu/boot.scr" + fi + fi + # Copy initramfs to QEMU directory if [ -f "${BOOT_DIR}/initramfs-${KERNEL_VERSION}" ] ; then install_readonly "${BOOT_DIR}/initramfs-${KERNEL_VERSION}" "${BASEDIR}/qemu/initramfs-${KERNEL_VERSION}"