##// END OF EJS Templates
0
Unknown -
r438:68e46fb40bfb
parent child
Show More
@@ -173,6 +173,9 Allow the installation of non-free Debian packages that do not comply with the D
173 ##### `ENABLE_WIRELESS`=false
173 ##### `ENABLE_WIRELESS`=false
174 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`.
174 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`.
175
175
176 ##### `ENABLE_BLUETOOTH`=false
177 Enable Bluetooth interface on the RPi0/3.
178
176 ##### `ENABLE_RSYSLOG`=true
179 ##### `ENABLE_RSYSLOG`=true
177 If set to false, disable and uninstall rsyslog (so logs will be available only
180 If set to false, disable and uninstall rsyslog (so logs will be available only
178 in journal files)
181 in journal files)
@@ -104,44 +104,46 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
104 if [ "$ENABLE_CONSOLE" = true ] && [ "$ENABLE_UBOOT" = false ] ; then
104 if [ "$ENABLE_CONSOLE" = true ] && [ "$ENABLE_UBOOT" = false ] ; then
105 echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt"
105 echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt"
106 echo "enable_uart=1" >> "${BOOT_DIR}/config.txt"
106 echo "enable_uart=1" >> "${BOOT_DIR}/config.txt"
107 else
107 fi
108 # Create temporary directory for Bluetooth sources
108 fi
109 temp_dir=$(as_nobody mktemp -d)
110
109
111 # Fetch Bluetooth sources
110 if [ "$ENABLE_BLUETOOTH" = true ] ; then
112 as_nobody git -C "${temp_dir}" clone "${BLUETOOTH_URL}"
111 # Create temporary directory for Bluetooth sources
112 temp_dir=$(as_nobody mktemp -d)
113
113
114 # Copy downloaded sources
114 # Fetch Bluetooth sources
115 mv "${temp_dir}/pi-bluetooth" "${R}/tmp/"
115 as_nobody git -C "${temp_dir}" clone "${BLUETOOTH_URL}"
116
116
117 # Raspberry-sys-mod package for /dev/serial device needed by bluetooth service
117 # Copy downloaded sources
118 as_nobody wget -q -O "${R}/tmp/pi-bluetooth/99-com.rules" https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules
118 mv "${temp_dir}/pi-bluetooth" "${R}/tmp/"
119 # Bluetooth firmware from arch aur https://aur.archlinux.org/packages/pi-bluetooth/
120 as_nobody wget -q -O "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" https://aur.archlinux.org/cgit/aur.git/plain/LICENCE.broadcom_bcm43xx?h=pi-bluetooth
121 as_nobody wget -q -O "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" https://aur.archlinux.org/cgit/aur.git/plain/BCM43430A1.hcd?h=pi-bluetooth
122
119
123 # Set permissions
120 # Raspberry-sys-mod package for /dev/serial device needed by bluetooth service
124 chown -R root:root "${R}/tmp/pi-bluetooth"
121 as_nobody wget -q -O "${R}/tmp/pi-bluetooth/99-com.rules" https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules
122 # Bluetooth firmware from arch aur https://aur.archlinux.org/packages/pi-bluetooth/
123 as_nobody wget -q -O "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" https://aur.archlinux.org/cgit/aur.git/plain/LICENCE.broadcom_bcm43xx?h=pi-bluetooth
124 as_nobody wget -q -O "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" https://aur.archlinux.org/cgit/aur.git/plain/BCM43430A1.hcd?h=pi-bluetooth
125
125
126 # Install tools
126 # Set permissions
127 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/btuart" "${R}/usr/bin/btuart"
127 chown -R root:root "${R}/tmp/pi-bluetooth"
128 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/bthelper" "${R}/usr/bin/bthelper"
129
128
130 # Install bluetooth udev rule
129 # Install tools
131 install_readonly "${R}/tmp/pi-bluetooth/lib/udev/rules.d/90-pi-bluetooth.rules" "${LIB_DIR}/udev/rules.d/90-pi-bluetooth.rules"
130 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/btuart" "${R}/usr/bin/btuart"
131 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/bthelper" "${R}/usr/bin/bthelper"
132
132
133 # Install Firmware Flash file and apropiate licence
133 # Install bluetooth udev rule
134 mkdir "${ETC_DIR}/firmware/"
134 install_readonly "${R}/tmp/pi-bluetooth/lib/udev/rules.d/90-pi-bluetooth.rules" "${LIB_DIR}/udev/rules.d/90-pi-bluetooth.rules"
135 install_readonly "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx"
135
136 install_readonly "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx"
136 # Install Firmware Flash file and apropiate licence
137 install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.bthelper@.service" "${ETC_DIR}/systemd/system/pi-bluetooth.bthelper@.service"
137 mkdir "${ETC_DIR}/firmware/"
138 install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.hciuart.service" "${ETC_DIR}/systemd/system/pi-bluetooth.hciuart.service"
138 install_readonly "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx"
139 # Install udev rule for bluetooth device
139 install_readonly "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx"
140 install_readonly "${R}/tmp/pi-bluetooth/99-com.rules" "${ETC_DIR}/udev/rules.d/99-com.rules"
140 install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.bthelper@.service" "${ETC_DIR}/systemd/system/pi-bluetooth.bthelper@.service"
141 install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.hciuart.service" "${ETC_DIR}/systemd/system/pi-bluetooth.hciuart.service"
142 # Install udev rule for bluetooth device
143 install_readonly "${R}/tmp/pi-bluetooth/99-com.rules" "${ETC_DIR}/udev/rules.d/99-com.rules"
141
144
142 # Remove temporary directory
145 # Remove temporary directory
143 rm -fr "${temp_dir}"
146 rm -fr "${temp_dir}"
144 fi
145 fi
147 fi
146
148
147 # Create firmware configuration and cmdline symlinks
149 # Create firmware configuration and cmdline symlinks
@@ -107,28 +107,26 if [ "$ENABLE_WIRELESS" = true ] ; then
107 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.bin"
107 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.bin"
108 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.txt"
108 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.txt"
109 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.clm_blob" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.clm_blob"
109 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.clm_blob" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.clm_blob"
110
111 # Move downloaded firmware binary blob
112 mv "${temp_dir}/brcmfmac43455-sdio."* "${WLAN_FIRMWARE_DIR}/"
113
114 # Set permissions of the firmware binary blob
115 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
116 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
110 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
117 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
111 # Fetch firmware binary blob for RPi3
118 # Fetch firmware binary blob for RPi3
112 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.bin"
119 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.bin"
113 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.txt"
120 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.txt"
114 fi
121
115
122 # Move downloaded firmware binary blob
116 # Move downloaded firmware binary blob
123 mv "${temp_dir}/brcmfmac43430-sdio."* "${WLAN_FIRMWARE_DIR}/"
117 if [ "$RPI_MODEL" = 3P ] ; then
124
118 mv "${temp_dir}/brcmfmac43455-sdio."* "${WLAN_FIRMWARE_DIR}/"
125 # Set permissions of the firmware binary blob
119 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
126 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
120 mv "${temp_dir}/brcmfmac43430-sdio."* "${WLAN_FIRMWARE_DIR}/"
127 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
121 fi
128 fi
122
129
123 # Remove temporary directory for firmware binary blob
130 # Remove temporary directory for firmware binary blob
124 rm -fr "${temp_dir}"
131 rm -fr "${temp_dir}"
125
126 # Set permissions of the firmware binary blob
127 if [ "$RPI_MODEL" = 3P ] ; then
128 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
129 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
130 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
131 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
132 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
133 fi
134 fi
132 fi
@@ -112,6 +112,7 APT_PROXY=${APT_PROXY:=""}
112 APT_SERVER=${APT_SERVER:="ftp.debian.org"}
112 APT_SERVER=${APT_SERVER:="ftp.debian.org"}
113
113
114 # Feature settings
114 # Feature settings
115 ENABLE_BLUETOOTH=${ENABLE_BLUETOOTH:=false}
115 ENABLE_CONSOLE=${ENABLE_CONSOLE:=true}
116 ENABLE_CONSOLE=${ENABLE_CONSOLE:=true}
116 ENABLE_I2C=${ENABLE_I2C:=false}
117 ENABLE_I2C=${ENABLE_I2C:=false}
117 ENABLE_SPI=${ENABLE_SPI:=false}
118 ENABLE_SPI=${ENABLE_SPI:=false}
@@ -387,6 +388,14 else
387 fi
388 fi
388 fi
389 fi
389
390
391 if [ "$ENABLE_BLUETOOTH" = true ] ; then
392 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
393 if [ "$ENABLE_CONSOLE" = false ] ; then
394 APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez"
395 fi
396 fi
397 fi
398
390 # Check if root SSH (v2) public key file exists
399 # Check if root SSH (v2) public key file exists
391 if [ -n "$SSH_ROOT_PUB_KEY" ] ; then
400 if [ -n "$SSH_ROOT_PUB_KEY" ] ; then
392 if [ ! -f "$SSH_ROOT_PUB_KEY" ] ; then
401 if [ ! -f "$SSH_ROOT_PUB_KEY" ] ; then
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant