From d975bb85d0ff7f8e910460d249a6edcc4e9075f7 2016-08-08 07:07:05 From: drtyhlpr Date: 2016-08-08 07:07:05 Subject: [PATCH] Fixes for Debian stretch release support --- diff --git a/README.md b/README.md index 42ef3b7..ebb6950 100644 --- a/README.md +++ b/README.md @@ -70,13 +70,13 @@ Set the supported variant(s) of the keyboard layout(s). Set extra xkb configuration options. #### Networking settings (DHCP): -This parameter is used to set up networking auto configuration in `/etc/systemd/network/eth.network`. +This parameter is used to set up networking auto configuration in `/etc/systemd/network/eth.network`. The default location of network configuration files in the Debian `stretch` release was changed to `/lib/systemd/network`.` #####`ENABLE_DHCP`=true Set the system to use DHCP. This requires an DHCP server. #### Networking settings (static): -These parameters are used to set up a static networking configuration in /etc/systemd/network/eth.network. The following static networking parameters are only supported if `ENABLE_DHCP` was set to `false`. +These parameters are used to set up a static networking configuration in `/etc/systemd/network/eth.network`. The following static networking parameters are only supported if `ENABLE_DHCP` was set to `false`. The default location of network configuration files in the Debian `stretch` release was changed to `/lib/systemd/network`. #####`NET_ADDRESS`="" Set a static IPv4 or IPv6 address and its prefix, separated by "/", eg. "192.169.0.3/24". @@ -281,6 +281,7 @@ All the required configuration files that will be copied to the generated OS ima | `apt` | APT management configuration files | | `boot` | Boot and RPi2 configuration files | | `dpkg` | Package Manager configuration | +| `etc` | Configuration files and rc scripts | | `firstboot` | Scripts that get executed on first boot | | `initramfs` | Initramfs scripts | | `iptables` | Firewall configuration files | diff --git a/bootstrap.d/41-uboot.sh b/bootstrap.d/41-uboot.sh index dca9cfc..f7a4faa 100644 --- a/bootstrap.d/41-uboot.sh +++ b/bootstrap.d/41-uboot.sh @@ -7,7 +7,8 @@ # Install gcc/c++ build environment inside the chroot if [ "$ENABLE_UBOOT" = true ] || [ "$ENABLE_FBTURBO" = true ] ; then - chroot_exec apt-get -q -y --force-yes --no-install-recommends install linux-compiler-gcc-4.8-arm g++ make bc + 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} fi # Fetch and build U-Boot bootloader diff --git a/bootstrap.d/42-fbturbo.sh b/bootstrap.d/42-fbturbo.sh index c3619f0..ef745eb 100644 --- a/bootstrap.d/42-fbturbo.sh +++ b/bootstrap.d/42-fbturbo.sh @@ -10,7 +10,7 @@ if [ "$ENABLE_FBTURBO" = true ] ; then git -C "${R}/tmp" clone "${FBTURBO_URL}" # Install Xorg build dependencies - chroot_exec apt-get -q -y --no-install-recommends install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev + chroot_exec apt-get -q -y --force-yes --no-install-recommends install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev # Build and install fbturbo driver inside chroot chroot_exec /bin/bash -x <<'EOF' @@ -30,5 +30,5 @@ fi # Remove gcc/c++ build environment from the chroot if [ "$ENABLE_UBOOT" = true ] || [ "$ENABLE_FBTURBO" = true ] ; then - chroot_exec apt-get -qq -y --auto-remove purge bc binutils cpp cpp-4.8 cpp-4.9 g++ g++-4.8 g++-4.9 gcc gcc-4.8 gcc-4.9 libasan1 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 libgcc-4.8-dev libgcc-4.9-dev libgomp1 libisl10 libmpc3 libmpfr4 libstdc++-4.9-dev libubsan0 linux-compiler-gcc-4.8-arm linux-libc-dev make + chroot_exec apt-get -qq -y --auto-remove purge ${COMPILER_PACKAGES} fi diff --git a/bootstrap.d/99-reduce.sh b/bootstrap.d/99-reduce.sh index 128e7a6..b5813c9 100644 --- a/bootstrap.d/99-reduce.sh +++ b/bootstrap.d/99-reduce.sh @@ -56,7 +56,9 @@ if [ "$ENABLE_REDUCE" = true ] ; then fi # Re-install tools for managing kernel moduless - chroot_exec apt-get -qq -y --force-yes install module-init-tools + if [ "$RELEASE" = "jessie" ] ; then + chroot_exec apt-get -qq -y --force-yes install module-init-tools + fi # Remove GPU kernels if [ "$ENABLE_MINGPU" = true ] ; then diff --git a/rpi2-gen-image.sh b/rpi2-gen-image.sh index 23534a4..2e2a0c8 100755 --- a/rpi2-gen-image.sh +++ b/rpi2-gen-image.sh @@ -68,6 +68,9 @@ KERNELDIR="${R}/usr/src/linux" # Firmware directory: Blank if download from github FIRMWAREDIR=${FIRMWAREDIR:=""} +# Packages for gcc/c++ inside the chroot +COMPILER_PACKAGES=${COMPILER_PACKAGES:="linux-compiler-gcc-4.8-arm g++ make bc"} + # General settings HOSTNAME=${HOSTNAME:=rpi2-${RELEASE}} PASSWORD=${PASSWORD:=raspberry} @@ -175,6 +178,7 @@ set +x # Build latest RPi2 Linux kernel if required by Debian release if [ "$RELEASE" = "stretch" ] ; then BUILD_KERNEL=true + COMPILER_PACKAGES=$(echo $COMPILER_PACKAGES | sed s/-4.8-arm/-5-arm/) fi # Add packages required for kernel cross compilation @@ -388,7 +392,9 @@ EOF fi # Remove apt-utils -chroot_exec apt-get purge -qq -y --force-yes apt-utils +if [ "$RELEASE" = "jessie" ] ; then + chroot_exec apt-get purge -qq -y --force-yes apt-utils +fi # Generate required machine-id MACHINE_ID=$(dbus-uuidgen) @@ -432,8 +438,8 @@ ROOT_OFFSET=$(expr ${TABLE_SECTORS} + ${FRMW_SECTORS}) # The root partition is EXT4 # This means more space than the actual used space of the chroot is used. -# As overhead for journaling and reserved blocks 20% are added. -ROOT_SECTORS=$(expr $(expr ${CHROOT_SIZE} + ${CHROOT_SIZE} \/ 100 \* 20) \* 1024 \/ 512) +# As overhead for journaling and reserved blocks 25% are added. +ROOT_SECTORS=$(expr $(expr ${CHROOT_SIZE} + ${CHROOT_SIZE} \/ 100 \* 25) \* 1024 \/ 512) # Calculate required image size in 512 Byte sectors IMAGE_SECTORS=$(expr ${TABLE_SECTORS} + ${FRMW_SECTORS} + ${ROOT_SECTORS})