##// END OF EJS Templates
add fixes pulled to dirty-master...
add fixes pulled to dirty-master fixes make it easier mergable with dirty-master

Fichier de la dernière révision:

r341:c71b9798972e
r341:c71b9798972e
Show More
41-uboot.sh
102 lines | 3.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
# Fetch and build U-Boot bootloader
if [ "$ENABLE_UBOOT" = true ] ; then
drtyhlpr
Updated: Dropping privileges, chroot compiler install, dropbear sshd config
r142 # Install c/c++ build environment inside the chroot
chroot_install_cc
drtyhlpr
Fixed: RPi3 stretch support, uboot updated compiler and src dir
r139 # Copy existing U-Boot sources into chroot directory
if [ -n "$UBOOTSRC_DIR" ] && [ -d "$UBOOTSRC_DIR" ] ; then
# Copy local U-Boot sources
cp -r "${UBOOTSRC_DIR}" "${R}/tmp"
else
drtyhlpr
Updated: Dropping privileges, chroot compiler install, dropbear sshd config
r142 # Create temporary directory for U-Boot sources
Petter Reinholdtsen
Introduce as_nobody() function to make it easier to control how it is done....
r174 temp_dir=$(as_nobody mktemp -d)
drtyhlpr
Updated: Dropping privileges, chroot compiler install, dropbear sshd config
r142
drtyhlpr
Fixed: RPi3 stretch support, uboot updated compiler and src dir
r139 # Fetch U-Boot sources
Petter Reinholdtsen
Introduce as_nobody() function to make it easier to control how it is done....
r174 as_nobody git -C "${temp_dir}" clone "${UBOOT_URL}"
drtyhlpr
Updated: Dropping privileges, chroot compiler install, dropbear sshd config
r142
# Copy downloaded U-Boot sources
mv "${temp_dir}/u-boot" "${R}/tmp/"
# Set permissions of the U-Boot sources
chown -R root:root "${R}/tmp/u-boot"
# Remove temporary directory for U-Boot sources
rm -fr "${temp_dir}"
drtyhlpr
Fixed: RPi3 stretch support, uboot updated compiler and src dir
r139 fi
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56
# Build and install U-Boot inside chroot
burnbabyburn
enhancment thx to spellcheck.net
r312 chroot_exec make -j"${KERNEL_THREADS}" -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
Unknown
add fixes pulled to dirty-master...
r341 # Install and setup U-Boot command file
Unknown
add bc if uboot gets compiled
r323 install_readonly files/boot/uboot.mkimage "${BOOT_DIR}/uboot.mkimage"
burnbabyburn
.
r327 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
burnbabyburn
.
r327 printf "# Set initramfs file\nsetenv initramfs initramfs-${KERNEL_VERSION}.uboot\n\n$(cat ${BOOT_DIR}/uboot.mkimage)" > "${BOOT_DIR}/uboot.mkimage"
burnbabyburn
fixes
r334 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
Unknown
add fixes pulled to dirty-master...
r341 # Remove dtbfile from U-Boot mkfile
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
burnbabyburn
.
r327
Unknown
u-boot fix...
r322 if [ "$SET_ARCH" = 64 ] ; then
echo "Setting up config.txt to boot 64bit uboot"
burnbabyburn
.
r327
printf "\n# 64bit-mode" >> "${BOOT_DIR}/config.txt"
printf "\n# arm_control=0x200 is deprecated https://www.raspberrypi.org/documentation/configuration/config-txt/misc.md" >> "${BOOT_DIR}/config.txt"
printf "\narm_64bit=1" >> "${BOOT_DIR}/config.txt"
sed -i "s|bootz|booti|g" "${BOOT_DIR}/uboot.mkimage"
Unknown
u-boot fix...
r322 fi
Unknown
usboot fix
r331
# instead of sd, boot from usb device
burnbabyburn
.
r327 if [ "$ENABLE_UBOOTUSB" = true ] ; then
sed -i "s|mmc|usb|g" "${BOOT_DIR}/uboot.mkimage"
fi
Unknown
add fixes pulled to dirty-master...
r341 # Set mkfile to use the correct dtb file
sed -i "s/^\(setenv dtbfile \).*/\1${DTB_FILE}/" "${BOOT_DIR}/uboot.mkimage"
drtyhlpr
fix: QEMU uboot (still problems)
r267 # Set mkfile to use the correct mach id
if [ "$ENABLE_QEMU" = true ] ; then
sed -i "s/^\(setenv machid \).*/\10x000008e0/" "${BOOT_DIR}/uboot.mkimage"
fi
burnbabyburn
.
r327
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 # Set mkfile to use kernel image
burnbabyburn
.
r327 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