From 3bb7303416dc7a5c1db51abe9fad0c8336487b06 2018-11-14 23:10:02 From: Unknown Date: 2018-11-14 23:10:02 Subject: [PATCH] add bc if uboot gets compiled --- diff --git a/bootstrap.d/41-uboot.sh b/bootstrap.d/41-uboot.sh index a28db20..999e7ca 100644 --- a/bootstrap.d/41-uboot.sh +++ b/bootstrap.d/41-uboot.sh @@ -41,12 +41,12 @@ if [ "$ENABLE_UBOOT" = true ] ; then printf "\n# boot u-boot kernel\nkernel=u-boot.bin\n" >> "${BOOT_DIR}/config.txt" # Install and setup U-Boot command file - install_readonly files/boot/uboot.mkimage "${BOOT_DIR}/uboot.mkimage" - printf "# Set the kernel boot command line\nsetenv bootargs \"earlyprintk ${CMDLINE}\"\n\n$(cat "${BOOT_DIR}"/uboot.mkimage)" > "${BOOT_DIR}/uboot.mkimage" - #Set correkt KERNEL_IMAGE + # Set correct KERNEL_IMAGE in mkfile sed -i "s/kernel7.img/$KERNEL_BIN_IMAGE/g" files/boot/uboot.mkimage - #Set correct DTB_FILE + # Set correct DTB_FILE sed -i "s/bcm2709-rpi-2-b.dtb/$DTB_FILE/g" files/boot/uboot.mkimage + install_readonly files/boot/uboot.mkimage "${BOOT_DIR}/uboot.mkimage" + printf "# Set the kernel boot command line\nsetenv bootargs \"earlyprintk ${CMDLINE}\"\n\n$(cat "${BOOT_DIR}"/uboot.mkimage)" > "${BOOT_DIR}/uboot.mkimage" if [ "$ENABLE_INITRAMFS" = true ] ; then # Convert generated initramfs for U-Boot using mkimage @@ -70,22 +70,24 @@ if [ "$ENABLE_UBOOT" = true ] ; then printf "\nbootz \${kernel_addr_r} - \${fdt_addr_r}" >> "${BOOT_DIR}/uboot.mkimage" fi fi - + if [ "$SET_ARCH" = 64 ] ; then echo "Setting up config.txt to boot 64bit uboot" - printf \n# Tell u-boot a 64bit kernel is used\narm_64bit=1\n" >> "${BOOT_DIR}/config.txt" - printf \n# Device tree start addr\ndevice_tree_address=0x100\n" >> "${BOOT_DIR}/config.txt" - printf \n# Device tree stop adrr\ndevice_tree_end=0x8000\n" >> "${BOOT_DIR}/config.txt" - #to config.txt + printf "\n# Tell u-boot a 64bit kernel is used\narm_64bit=1\n" >> "${BOOT_DIR}/config.txt" + printf "\n# Device tree start addr\ndevice_tree_address=0x100\n" >> "${BOOT_DIR}/config.txt" + printf "\n# Device tree stop adrr\ndevice_tree_end=0x8000\n" >> "${BOOT_DIR}/config.txt" fi # 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 the correct dtb file + sed -i "s/^\(setenv dtbfile \).*/\1${DTB_FILE}/" "${BOOT_DIR}/uboot.mkimage" # Set mkfile to use kernel image - sed -i "s/^\(fatload mmc 0:1 \${kernel_addr_r} \).*/\1${KERNEL_IMAGE}/" "${BOOT_DIR}/uboot.mkimage" + sed "s/^\(fatload mmc 0:1 \${kernel_addr_r} \).*/\1${KERNEL_IMAGE}/" "${BOOT_DIR}/uboot.mkimage" # Remove all leading blank lines sed -i "/./,\$!d" "${BOOT_DIR}/uboot.mkimage" diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index ddaf2fd..4dffe8d 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -340,7 +340,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,bison,flex" + APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bison,flex,bc" fi # Check if root SSH (v2) public key file exists