##// END OF EJS Templates
Added Raspberry Pi 3 model support
Added Raspberry Pi 3 model support

Fichier de la dernière révision:

r94:2ce085c56493
r94:2ce085c56493
Show More
41-uboot.sh
68 lines | 2.9 KiB | application/x-sh | BashLexer
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 #
Jan Wagner
comment-cleanup, net-cleanup, size-calc-fix, split-more, menuconfig
r71 # Build and Setup U-Boot
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 #
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 # Load utility functions
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 . ./functions.sh
# Install gcc/c++ build environment inside the chroot
Jan Wagner
Added: KERNEL_SRCDIR, path-checks, code-cleanup
r72 if [ "$ENABLE_UBOOT" = true ] || [ "$ENABLE_FBTURBO" = true ] ; then
drtyhlpr
Fixes for Debian stretch release support
r93 COMPILER_PACKAGES=$(chroot_exec apt-get -s install ${COMPILER_PACKAGES} | grep "^Inst " | awk -v ORS=" " '{ print $2 }')
chroot_exec apt-get -q -y --force-yes --no-install-recommends install ${COMPILER_PACKAGES}
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi
# Fetch and build U-Boot bootloader
if [ "$ENABLE_UBOOT" = true ] ; then
# Fetch U-Boot bootloader sources
drtyhlpr
Added ENABLE_NONFREE support and more
r91 git -C "${R}/tmp" clone "${UBOOT_URL}"
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56
# Build and install U-Boot inside chroot
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 chroot_exec make -C /tmp/u-boot/ ${UBOOT_CONFIG} all
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56
# Copy compiled bootloader binary and set config.txt to load it
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 install_exec "${R}/tmp/u-boot/tools/mkimage" "${R}/usr/sbin/mkimage"
drtyhlpr
Added Raspberry Pi 3 model support
r94 install_readonly "${R}/tmp/u-boot/u-boot.bin" "${BOOT_DIR}/u-boot.bin"
printf "\n# boot u-boot kernel\nkernel=u-boot.bin\n" >> "${BOOT_DIR}/config.txt"
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56
Jan Wagner
comment-cleanup, net-cleanup, size-calc-fix, split-more, menuconfig
r71 # Install and setup U-Boot command file
drtyhlpr
Added Raspberry Pi 3 model support
r94 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"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82
if [ "$ENABLE_INITRAMFS" = true ] ; then
# Convert generated initramfs for U-Boot using mkimage
chroot_exec /usr/sbin/mkimage -A "${KERNEL_ARCH}" -T ramdisk -C none -n "initramfs-${KERNEL_VERSION}" -d "/boot/firmware/initramfs-${KERNEL_VERSION}" "/boot/firmware/initramfs-${KERNEL_VERSION}.uboot"
# Remove original initramfs file
drtyhlpr
Added Raspberry Pi 3 model support
r94 rm -f "${BOOT_DIR}/initramfs-${KERNEL_VERSION}"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82
# Configure U-Boot to load generated initramfs
drtyhlpr
Added Raspberry Pi 3 model support
r94 printf "# Set initramfs file\nsetenv initramfs initramfs-${KERNEL_VERSION}.uboot\n\n$(cat ${BOOT_DIR}/uboot.mkimage)" > "${BOOT_DIR}/uboot.mkimage"
printf "\nbootz \${kernel_addr_r} \${ramdisk_addr_r} \${fdt_addr_r}" >> "${BOOT_DIR}/uboot.mkimage"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 else # ENABLE_INITRAMFS=false
# Remove initramfs from U-Boot mkfile
drtyhlpr
Added Raspberry Pi 3 model support
r94 sed -i '/.*initramfs.*/d' "${BOOT_DIR}/uboot.mkimage"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82
if [ "$BUILD_KERNEL" = false ] ; then
# Remove dtbfile from U-Boot mkfile
drtyhlpr
Added Raspberry Pi 3 model support
r94 sed -i '/.*dtbfile.*/d' "${BOOT_DIR}/uboot.mkimage"
printf "\nbootz \${kernel_addr_r}" >> "${BOOT_DIR}/uboot.mkimage"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 else
drtyhlpr
Added Raspberry Pi 3 model support
r94 printf "\nbootz \${kernel_addr_r} - \${fdt_addr_r}" >> "${BOOT_DIR}/uboot.mkimage"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 fi
fi
drtyhlpr
Added Raspberry Pi 3 model support
r94 # Set mkfile to use the correct dtb file
sed -i "s/^\(setenv dtbfile \).*/\1${DTB_FILE}/" "${BOOT_DIR}/uboot.mkimage"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82
# Set mkfile to use kernel image
drtyhlpr
Added Raspberry Pi 3 model support
r94 sed -i "s/^\(fatload mmc 0:1 \${kernel_addr_r} \).*/\1${KERNEL_IMAGE}/" "${BOOT_DIR}/uboot.mkimage"
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82
# Remove all leading blank lines
drtyhlpr
Added Raspberry Pi 3 model support
r94 sed -i "/./,\$!d" "${BOOT_DIR}/uboot.mkimage"
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56
Jan Wagner
comment-cleanup, net-cleanup, size-calc-fix, split-more, menuconfig
r71 # Generate U-Boot bootloader image
drtyhlpr
Added Raspberry Pi 3 model support
r94 chroot_exec /usr/sbin/mkimage -A "${KERNEL_ARCH}" -O linux -T script -C none -a 0x00000000 -e 0x00000000 -n "RPi${RPI_MODEL}" -d /boot/firmware/uboot.mkimage /boot/firmware/boot.scr
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82
# Remove U-Boot sources
rm -fr "${R}/tmp/u-boot"
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi