From 1e0652b25996ee27dba026b7c86cd6f60ebc8185 2017-11-15 00:00:55 From: drtyhlpr Date: 2017-11-15 00:00:55 Subject: [PATCH] Debian Buster (testing) release support --- diff --git a/README.md b/README.md index 2181f6f..0ba14f8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # rpi23-gen-image ## Introduction -`rpi23-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for Raspberry Pi 2 (RPi2) and Raspberry Pi 3 (RPi3) computers. The script at this time supports the bootstrapping of the Debian (armhf) releases `jessie` and `stretch`. Raspberry Pi 3 images are generated for 32-bit mode only. Raspberry Pi 3 64-bit images can be generated using custom configuration parameters (```templates/rpi3-stretch-arm64-4.11.y```). +`rpi23-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for Raspberry Pi 2 (RPi2) and Raspberry Pi 3 (RPi3) computers. The script at this time supports the bootstrapping of the Debian (armhf) releases `jessie`, `stretch` and `buster`. Raspberry Pi 3 images are generated for 32-bit mode only. Raspberry Pi 3 64-bit images can be generated using custom configuration parameters (```templates/rpi3-stretch-arm64-4.11.y```). ## Build dependencies The following list of Debian packages must be installed on the build system because they are essentially required for the bootstrapping process. The script will check if all required packages are installed and missing packages will be installed automatically if confirmed by the user. @@ -70,7 +70,7 @@ A comma separated list of additional packages to be installed by apt after boots Specifiy the target Raspberry Pi hardware model. The script at this time supports the Raspberry Pi models `2` and `3`. `BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` is used. ##### `RELEASE`="jessie" -Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases "jessie" and "stretch". `BUILD_KERNEL`=true will automatically be set if the Debian release `stretch` is used. +Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases "jessie", "stretch" and "buster". `BUILD_KERNEL`=true will automatically be set if the Debian releases `stretch` or `buster` are used. ##### `RELEASE_ARCH`="armhf" Set the desired Debian release architecture. @@ -236,7 +236,7 @@ Path to a directory with scripts that should be run in the chroot before the ima Create an initramfs that that will be loaded during the Linux startup process. `ENABLE_INITRAMFS` will automatically get enabled if `ENABLE_CRYPTFS`=true. This parameter will be ignored if `BUILD_KERNEL`=false. ##### `ENABLE_IFNAMES`=true -Enable automatic assignment of predictable, stable network interface names for all local Ethernet, WLAN interfaces. This might create complex and long interface names. This parameter is only supported if the Debian release `stretch` is used. +Enable automatic assignment of predictable, stable network interface names for all local Ethernet, WLAN interfaces. This might create complex and long interface names. This parameter is only supported if the Debian releases `stretch` or `buster` are used. ##### `DISABLE_UNDERVOLT_WARNINGS`= Disable RPi2/3 under-voltage warnings and overlays. Setting the parameter to `1` will disable the warning overlay. Setting it to `2` will additionally allow RPi2/3 turbo mode when low-voltage is present. diff --git a/bootstrap.d/10-bootstrap.sh b/bootstrap.d/10-bootstrap.sh index e04335b..d23f772 100644 --- a/bootstrap.d/10-bootstrap.sh +++ b/bootstrap.d/10-bootstrap.sh @@ -20,7 +20,7 @@ if [ "$ENABLE_MINBASE" = true ] ; then fi # Exclude packages if required by Debian release -if [ "$RELEASE" = "stretch" ] ; then +if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then EXCLUDES="--exclude=init,systemd-sysv" fi diff --git a/bootstrap.d/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh index 0c2368a..6979b04 100644 --- a/bootstrap.d/15-rpi-config.sh +++ b/bootstrap.d/15-rpi-config.sh @@ -74,7 +74,7 @@ else fi # Set init to systemd if required by Debian release -if [ "$RELEASE" = "stretch" ] ; then +if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then CMDLINE="${CMDLINE} init=/bin/systemd" fi diff --git a/bootstrap.d/20-networking.sh b/bootstrap.d/20-networking.sh index 673b2d5..2229d72 100644 --- a/bootstrap.d/20-networking.sh +++ b/bootstrap.d/20-networking.sh @@ -57,7 +57,7 @@ fi sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/eth.network" # Move systemd network configuration if required by Debian release -if [ "$RELEASE" = "stretch" ] ; then +if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then mv -v "${ETC_DIR}/systemd/network/eth.network" "${LIB_DIR}/systemd/network/10-eth.network" rm -fr "${ETC_DIR}/systemd/network" fi diff --git a/bootstrap.d/42-fbturbo.sh b/bootstrap.d/42-fbturbo.sh index ae65126..a5ede42 100644 --- a/bootstrap.d/42-fbturbo.sh +++ b/bootstrap.d/42-fbturbo.sh @@ -30,7 +30,7 @@ if [ "$ENABLE_FBTURBO" = true ] ; then # Install Xorg build dependencies if [ "$RELEASE" = "jessie" ] ; then chroot_exec apt-get -q -y --no-install-recommends install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev - elif [ "$RELEASE" = "stretch" ] ; then + elif [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then chroot_exec apt-get -q -y --no-install-recommends --allow-unauthenticated install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev fi diff --git a/bootstrap.d/99-reduce.sh b/bootstrap.d/99-reduce.sh index adcc98a..c339e0d 100644 --- a/bootstrap.d/99-reduce.sh +++ b/bootstrap.d/99-reduce.sh @@ -46,7 +46,7 @@ if [ "$ENABLE_REDUCE" = true ] ; then # Replace bash shell by dash shell (experimental) if [ "$REDUCE_BASH" = true ] ; then - if [ "$RELEASE" = "stretch" ] ; then + if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --allow-remove-essential bash else echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --force-yes bash diff --git a/functions.sh b/functions.sh index 1ad716c..8c52abd 100644 --- a/functions.sh +++ b/functions.sh @@ -66,7 +66,7 @@ chroot_install_cc() { if [ "$RELEASE" = "jessie" ] ; then chroot_exec apt-get -q -y --no-install-recommends install ${COMPILER_PACKAGES} - elif [ "$RELEASE" = "stretch" ] ; then + elif [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install ${COMPILER_PACKAGES} fi fi diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 1046ab0..274afd1 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -3,7 +3,7 @@ ######################################################################## # rpi23-gen-image.sh 2015-2017 # -# Advanced Debian "jessie" and "stretch" bootstrap script for RPi2/3 +# Advanced Debian "jessie", "stretch" and "buster" bootstrap script for RPi2/3 # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,7 +12,7 @@ # # Copyright (C) 2015 Jan Wagner # -# Big thanks for patches and enhancements by 10+ github contributors! +# Big thanks for patches and enhancements by 20+ github contributors! ######################################################################## # Are we running as root? @@ -214,12 +214,6 @@ CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""} APT_INCLUDES=${APT_INCLUDES:=""} APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils" -# Package apt-transport-https has been removed from Debian Buster release -# this induces qemu error 383 which does not prevent building an image -if [ "$RELEASE" = "buster" ] ; then - APT_INCLUDES="$(echo ${APT_INCLUDES} | sed "s/apt-transport-https,//")" -fi - # Packages required for bootstrapping REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo" MISSING_PACKAGES="" @@ -257,7 +251,7 @@ if [ ! -z "$DISABLE_UNDERVOLT_WARNINGS" ] ; then fi # Build RPi2/3 Linux kernel if required by Debian release -if [ "$RELEASE" = "stretch" ] ; then +if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then BUILD_KERNEL=true fi diff --git a/templates/rpi2buster b/templates/rpi2buster new file mode 100644 index 0000000..01a3718 --- /dev/null +++ b/templates/rpi2buster @@ -0,0 +1,4 @@ +# Configuration template file used by rpi23-gen-image.sh +RPI_MODEL=2 +RELEASE=buster +BUILD_KERNEL=true diff --git a/templates/rpi3buster b/templates/rpi3buster new file mode 100644 index 0000000..b365f59 --- /dev/null +++ b/templates/rpi3buster @@ -0,0 +1,4 @@ +# Configuration template file used by rpi23-gen-image.sh +RPI_MODEL=3 +RELEASE=buster +BUILD_KERNEL=true