diff --git a/README.md b/README.md index 68abb9f..d070161 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ Allow the installation of non-free Debian packages that do not comply with the D Download and install the [closed-source firmware binary blob](https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm) that is required to run the internal wireless interface of the Raspberry Pi model `3`. This parameter is ignored if the specified `RPI_MODEL` is not `3`. ##### `ENABLE_BLUETOOTH`=false -Enable Bluetooth interface on the RPi0/3. +Enable Bluetooth interface on the RPi0/3/3P. ##### `ENABLE_RSYSLOG`=true If set to false, disable and uninstall rsyslog (so logs will be available only in journal files) diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index d686765..9f7afb1 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -330,12 +330,22 @@ else IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}} fi -# Check if the internal wireless interface is supported by the RPi model -if [ "$ENABLE_WIRELESS" = true ] ; then - if [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 2 ] ; then - echo "error: The selected Raspberry Pi model has no internal wireless interface" - exit 1 +if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then + # Include bluetooth packages on supported boards + if [ "$ENABLE_BLUETOOTH" = true ] && [ "$ENABLE_CONSOLE" = false ]; then + APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" fi + # Check if console or bluetooth configuration is invalid on RPI 0,3,3P + if [ "$ENABLE_BLUETOOTH" = true ] && [ "$ENABLE_CONSOLE" = true ]; then + echo "error: ENABLE_BLUETOOTH and ENABLE_CONSOLE can't be active on the same time." + exit 1 + fi + else # if [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 2 ] ; then + # Check if the internal wireless interface is not supported by the RPi model + if [ "$ENABLE_WIRELESS" = true ] ; then + echo "error: The selected Raspberry Pi model has no internal wireless interface" + exit 1 + fi fi # Check if DISABLE_UNDERVOLT_WARNINGS parameter value is supported @@ -388,22 +398,6 @@ else fi fi -if [ "$ENABLE_BLUETOOTH" = true ] ; then - if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then - if [ "$ENABLE_CONSOLE" = false ] ; then - APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" - fi - fi -fi - -if [ "$ENABLE_BLUETOOTH" = true ] ; then - if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then - if [ "$ENABLE_CONSOLE" = false ] ; then - APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" - fi - fi -fi - # Check if root SSH (v2) public key file exists if [ -n "$SSH_ROOT_PUB_KEY" ] ; then if [ ! -f "$SSH_ROOT_PUB_KEY" ] ; then