From d1ce055920e0a7666d0d0db2ac620578b9778364 2017-12-14 18:11:26 From: GĂ©rard Vidal Date: 2017-12-14 18:11:26 Subject: [PATCH] merge avec master --- diff --git a/README.md b/README.md index d7d1642..1eb16bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # 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`. This fork enables also `buster` release. 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 raspife3-buster-arm64```). + +`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 +72,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 +238,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/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh index 286e22b..6979b04 100644 --- a/bootstrap.d/15-rpi-config.sh +++ b/bootstrap.d/15-rpi-config.sh @@ -73,7 +73,7 @@ else CMDLINE="${CMDLINE} net.ifnames=1" fi -# Set init to systemd if required by Debian release stretch or buster +# Set init to systemd if required by Debian release 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 adc0a62..2229d72 100644 --- a/bootstrap.d/20-networking.sh +++ b/bootstrap.d/20-networking.sh @@ -56,7 +56,7 @@ fi # Remove empty settings from network configuration sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/eth.network" -# Move systemd network configuration if required by Debian release stretch or buster +# Move systemd network configuration if required by Debian release 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" diff --git a/bootstrap.d/42-fbturbo.sh b/bootstrap.d/42-fbturbo.sh index bc47105..7c307af 100644 --- a/bootstrap.d/42-fbturbo.sh +++ b/bootstrap.d/42-fbturbo.sh @@ -30,6 +30,8 @@ if [ "$ENABLE_FBTURBO" = true ] ; then # Install Xorg build dependencies if [ "$RELEASE" = "jessie" ] || [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; 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" ] || [ "$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 # Build and install fbturbo driver inside chroot 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 5d54564..9d36455 100644 --- a/functions.sh +++ b/functions.sh @@ -66,6 +66,8 @@ chroot_install_cc() { if [ "$RELEASE" = "jessie" ] || [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then chroot_exec apt-get -q -y --no-install-recommends install ${COMPILER_PACKAGES} + 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