From 1d1cdd5d20ecf1352bdc5f2212bafcd04f2ddc37 2017-01-25 08:21:47 From: drtyhlpr Date: 2017-01-25 08:21:47 Subject: [PATCH] Added: Disable RPi2/3 under-volt warnings (from michaelfranzl PR) --- diff --git a/README.md b/README.md index 27f0c10..74921db 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,9 @@ Create an initramfs that that will be loaded during the Linux startup process. ` ##### `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. +##### `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. + #### SSH settings: ##### `SSH_ENABLE_ROOT`=false Enable password root login via SSH. This may be a security risk with default password, use only in trusted environments. `ENABLE_ROOT` must be set to `true`. diff --git a/bootstrap.d/14-rpi-config.sh b/bootstrap.d/14-rpi-config.sh index 3e17345..5ce837e 100644 --- a/bootstrap.d/14-rpi-config.sh +++ b/bootstrap.d/14-rpi-config.sh @@ -123,6 +123,11 @@ if [ "$ENABLE_SPI" = true ] ; then fi fi +# Disable RPi2/3 under-voltage warnings +if [ ! -z "$DISABLE_UNDERVOLT_WARNINGS" ] ; then + echo "avoid_warnings=${DISABLE_UNDERVOLT_WARNINGS}" >> "${BOOT_DIR}/config.txt" +fi + # Install kernel modules blacklist mkdir -p "${ETC_DIR}/modprobe.d/" install_readonly files/modules/raspi-blacklist.conf "${ETC_DIR}/modprobe.d/raspi-blacklist.conf" diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 1f4eecd..e567faf 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -146,6 +146,7 @@ ENABLE_IPTABLES=${ENABLE_IPTABLES:=false} ENABLE_SPLITFS=${ENABLE_SPLITFS:=false} ENABLE_INITRAMFS=${ENABLE_INITRAMFS:=false} ENABLE_IFNAMES=${ENABLE_IFNAMES:=true} +DISABLE_UNDERVOLT_WARNINGS=${DISABLE_UNDERVOLT_WARNINGS:=} # Kernel compilation settings BUILD_KERNEL=${BUILD_KERNEL:=false} @@ -213,6 +214,12 @@ if [ "$ENABLE_WIRELESS" = true ] && [ "$RPI_MODEL" != 3 ] ; then exit 1 fi +# Check if DISABLE_UNDERVOLT_WARNINGS parameter value is supported +if [ "$DISABLE_UNDERVOLT_WARNINGS" != 1 ] && [ "$DISABLE_UNDERVOLT_WARNINGS" != 2 ] ; then + echo "error: DISABLE_UNDERVOLT_WARNINGS=${DISABLE_UNDERVOLT_WARNINGS} is not supported" + exit 1 +fi + # Set compiler packages and build RPi2/3 Linux kernel if required by Debian release if [ "$RELEASE" = "jessie" ] ; then COMPILER_PACKAGES="linux-compiler-gcc-4.8-arm g++ make bc"