##// END OF EJS Templates
add bluetooth firmware and systemd service...
Unknown -
r368:58132f93ec65
parent child
Show More
@@ -99,6 +99,49 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
99 99 if [ "$ENABLE_CONSOLE" = true ] && [ "$ENABLE_UBOOT" = false ] ; then
100 100 echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt"
101 101 echo "enable_uart=1" >> "${BOOT_DIR}/config.txt"
102 else
103 # Create temporary directory for Bluetooth sources
104 temp_dir=$(as_nobody mktemp -d)
105
106 # Fetch Bluetooth sources
107 as_nobody git -C "${temp_dir}" clone "${BLUETOOTH_URL}"
108
109 # Copy downloaded sources
110 mv "${temp_dir}/pi-bluetooth" "${R}/tmp/"
111
112 # Set permissions
113 chown -R root:root "${R}/tmp/pi-bluetooth"
114
115 # Install files to chroot
116 # Install tools
117 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/btuart" "${R}/usr/bin/btuart"
118 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/bthelper" "${R}/usr/bin/bthelper"
119
120 # Install bluetooth udev rule
121 install_readonly "${R}/tmp/pi-bluetooth/lib/udev/rules.d/90-pi-bluetooth.rules" "${LIB_DIR}/udev/rules.d/90-pi-bluetooth.rules"
122 #aur
123 #install_readonly "${R}/tmp/pi-bluetooth/50-bluetooth-hci-auto-poweron.rules" "${ETC_DIR}/udev/rules.d/50-bluetooth-hci-auto-poweron.rules"
124
125 # Install Firmware Flash file and apropiate licence
126 mkdir "${ETC_DIR}/firmware/"
127
128 #aur https://aur.archlinux.org/packages/pi-bluetooth/
129 #install_readonly "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx"
130 #install_readonly "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" "${ETC_DIR}/firmware/BCM43430A1.hcd"
131
132 wget -O "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" https://aur.archlinux.org/cgit/aur.git/plain/LICENCE.broadcom_bcm43xx?h=pi-bluetooth
133 wget -O "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" https://aur.archlinux.org/cgit/aur.git/plain/BCM43430A1.hcd?h=pi-bluetooth
134
135 # Install systemd service for bluetooth
136 #install_readonly "${R}/tmp/pi-bluetooth/brcm43438.service" "${ETC_DIR}/systemd/system/brcm43438.service"
137
138 # Remove temporary directory
139 #rm -fr "${temp_dir}"
140
141 # Get /dev/serial back for compability
142 # Raspberry-sys-mod package
143 wget -O "${ETC_DIR}/udev/rules.d/99-com.rules" https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules
144
102 145 fi
103 146 fi
104 147
@@ -107,17 +150,17 ln -sf firmware/config.txt "${R}/boot/config.txt"
107 150 ln -sf firmware/cmdline.txt "${R}/boot/cmdline.txt"
108 151
109 152 # Install and setup kernel modules to load at boot
110 mkdir -p "${R}/lib/modules-load.d/"
111 install_readonly files/modules/rpi2.conf "${R}/lib/modules-load.d/rpi2.conf"
153 mkdir -p "${LIB_DIR}/modules-load.d/"
154 install_readonly files/modules/rpi2.conf "${LIB_DIR}/modules-load.d/rpi2.conf"
112 155
113 156 # Load hardware random module at boot
114 157 if [ "$ENABLE_HWRANDOM" = true ] && [ "$BUILD_KERNEL" = false ] ; then
115 sed -i "s/^# bcm2708_rng/bcm2708_rng/" "${R}/lib/modules-load.d/rpi2.conf"
158 sed -i "s/^# bcm2708_rng/bcm2708_rng/" "${LIB_DIR}/modules-load.d/rpi2.conf"
116 159 fi
117 160
118 161 # Load sound module at boot
119 162 if [ "$ENABLE_SOUND" = true ] ; then
120 sed -i "s/^# snd_bcm2835/snd_bcm2835/" "${R}/lib/modules-load.d/rpi2.conf"
163 sed -i "s/^# snd_bcm2835/snd_bcm2835/" "${LIB_DIR}/modules-load.d/rpi2.conf"
121 164 else
122 165 echo "dtparam=audio=off" >> "${BOOT_DIR}/config.txt"
123 166 fi
@@ -125,16 +168,16 fi
125 168 # Enable I2C interface
126 169 if [ "$ENABLE_I2C" = true ] ; then
127 170 echo "dtparam=i2c_arm=on" >> "${BOOT_DIR}/config.txt"
128 sed -i "s/^# i2c-bcm2708/i2c-bcm2708/" "${R}/lib/modules-load.d/rpi2.conf"
129 sed -i "s/^# i2c-dev/i2c-dev/" "${R}/lib/modules-load.d/rpi2.conf"
171 sed -i "s/^# i2c-bcm2708/i2c-bcm2708/" "${LIB_DIR}/modules-load.d/rpi2.conf"
172 sed -i "s/^# i2c-dev/i2c-dev/" "${LIB_DIR}/modules-load.d/rpi2.conf"
130 173 fi
131 174
132 175 # Enable SPI interface
133 176 if [ "$ENABLE_SPI" = true ] ; then
134 177 echo "dtparam=spi=on" >> "${BOOT_DIR}/config.txt"
135 echo "spi-bcm2708" >> "${R}/lib/modules-load.d/rpi2.conf"
178 echo "spi-bcm2708" >> "${LIB_DIR}/modules-load.d/rpi2.conf"
136 179 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ]; then
137 sed -i "s/spi-bcm2708/spi-bcm2835/" "${R}/lib/modules-load.d/rpi2.conf"
180 sed -i "s/spi-bcm2708/spi-bcm2835/" "${LIB_DIR}/modules-load.d/rpi2.conf"
138 181 fi
139 182 fi
140 183
@@ -104,6 +104,7 COLLABORA_URL=${COLLABORA_URL:=https://repositories.collabora.co.uk/debian}
104 104 FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git}
105 105 UBOOT_URL=${UBOOT_URL:=https://git.denx.de/u-boot.git}
106 106 VIDEOCORE_URL=${VIDEOCORE_URL=https://github.com/raspberrypi/userland}
107 BLUETOOTH_URL=${BLUETOOTH_URL:=https://github.com/RPi-Distro/pi-bluetooth.git}
107 108
108 109 # Build directories
109 110 BASEDIR=${BASEDIR:=$(pwd)/images/${RELEASE}}
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant