From 3f5e1cfcfee6468842b66348534bf8430a35cc31 2017-01-28 11:17:20 From: drtyhlpr Date: 2017-01-28 11:17:20 Subject: [PATCH] Fixed: RPi3 stretch support, uboot updated compiler and src dir --- diff --git a/README.md b/README.md index 48491c8..ac4cbde 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,9 @@ Reduce the disk space usage by deleting packages and files. See `REDUCE_*` param ##### `ENABLE_UBOOT`=false Replace the default RPi2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](http://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol. +##### `UBOOTSRC_DIR`="" +Path to a directory of [U-Boot bootloader sources](http://git.denx.de/?p=u-boot.git;a=summary) that will be copied, configured, build and installed inside the chroot. + ##### `ENABLE_FBTURBO`=false Install and enable the [hardware accelerated Xorg video driver](https://github.com/ssvb/xf86-video-fbturbo) `fbturbo`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling. diff --git a/bootstrap.d/41-uboot.sh b/bootstrap.d/41-uboot.sh index 8b91002..83f391b 100644 --- a/bootstrap.d/41-uboot.sh +++ b/bootstrap.d/41-uboot.sh @@ -13,8 +13,14 @@ fi # Fetch and build U-Boot bootloader if [ "$ENABLE_UBOOT" = true ] ; then - # Fetch U-Boot bootloader sources - git -C "${R}/tmp" clone "${UBOOT_URL}" + # 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 + # Fetch U-Boot sources + git -C "${R}/tmp" clone "${UBOOT_URL}" + fi # Build and install U-Boot inside chroot chroot_exec make -j${KERNEL_THREADS} -C /tmp/u-boot/ ${UBOOT_CONFIG} all diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 6cec1cc..655e50a 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -140,6 +140,7 @@ SSH_USER_PUB_KEY=${SSH_USER_PUB_KEY:=""} ENABLE_MINBASE=${ENABLE_MINBASE:=false} ENABLE_REDUCE=${ENABLE_REDUCE:=false} ENABLE_UBOOT=${ENABLE_UBOOT:=false} +UBOOTSRC_DIR=${UBOOTSRC_DIR:=""} ENABLE_FBTURBO=${ENABLE_FBTURBO:=false} ENABLE_HARDNET=${ENABLE_HARDNET:=false} ENABLE_IPTABLES=${ENABLE_IPTABLES:=false} @@ -226,7 +227,7 @@ fi if [ "$RELEASE" = "jessie" ] ; then COMPILER_PACKAGES="linux-compiler-gcc-4.8-arm g++ make bc" elif [ "$RELEASE" = "stretch" ] ; then - COMPILER_PACKAGES="linux-compiler-gcc-5-arm g++ make bc" + COMPILER_PACKAGES="g++ make bc" BUILD_KERNEL=true else echo "error: Debian release ${RELEASE} is not supported!" @@ -324,6 +325,12 @@ if [ -n "$KERNELSRC_DIR" ] && [ ! -d "$KERNELSRC_DIR" ] ; then exit 1 fi +# Check if specified UBOOTSRC_DIR directory exists +if [ -n "$UBOOTSRC_DIR" ] && [ ! -d "$UBOOTSRC_DIR" ] ; then + echo "error: '${UBOOTSRC_DIR}' specified directory not found (UBOOTSRC_DIR)!" + exit 1 +fi + # Check if specified CHROOT_SCRIPTS directory exists if [ -n "$CHROOT_SCRIPTS" ] && [ ! -d "$CHROOT_SCRIPTS" ] ; then echo "error: ${CHROOT_SCRIPTS} specified directory not found (CHROOT_SCRIPTS)!"