@@ -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} |
|
|
111 |
install_readonly files/modules/rpi2.conf "${R} |
|
|
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} |
|
|
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} |
|
|
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} |
|
|
129 |
sed -i "s/^# i2c-dev/i2c-dev/" "${R} |
|
|
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} |
|
|
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} |
|
|
180 | sed -i "s/spi-bcm2708/spi-bcm2835/" "${LIB_DIR}/modules-load.d/rpi2.conf" | |
|
138 | 181 | fi |
|
139 | 182 | fi |
|
140 | 183 |
@@ -9,7 +9,7 if [ "$ENABLE_VIDEOCORE" = true ] ; then | |||
|
9 | 9 | # Copy existing videocore sources into chroot directory |
|
10 | 10 | if [ -n "$VIDEOCORESRC_DIR" ] && [ -d "$VIDEOCORESRC_DIR" ] ; then |
|
11 | 11 | # Copy local U-Boot sources |
|
12 | cp -r "${VIDEOCORESRC_DIR}" "${R}/tmp" | |
|
12 | cp -r "${VIDEOCORESRC_DIR}" "${R}/tmp/userland" | |
|
13 | 13 | else |
|
14 | 14 | # Create temporary directory for U-Boot sources |
|
15 | 15 | temp_dir=$(as_nobody mktemp -d) |
@@ -27,7 +27,25 if [ "$ENABLE_VIDEOCORE" = true ] ; then | |||
|
27 | 27 | rm -fr "${temp_dir}" |
|
28 | 28 | fi |
|
29 | 29 | |
|
30 | cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_BUILD_TYPE=release -DARM64=ON -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_ASM_COMPILER=aarch64-linux-gnu-gcc -DVIDEOCORE_BUILD_DIR="${R}"/opt/vc | |
|
30 | # Create build dir | |
|
31 | mkdir "${R}"/tmp/userland/build | |
|
32 | # push us to build directory | |
|
33 | pushd "${R}"/tmp/userland/build | |
|
34 | ||
|
35 | if [ "$RELEASE_ARCH" = "arm64" ] ; then | |
|
36 | cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_BUILD_TYPE=release -DARM64=ON -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_ASM_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE" -DCMAKE_ASM_FLAGS="${CMAKE_ASM_FLAGS} -c" -DVIDEOCORE_BUILD_DIR="${R}" "${R}/tmp/userland" | |
|
37 | fi | |
|
38 | ||
|
39 | if [ "$RELEASE_ARCH" = "armel" ] ; then | |
|
40 | cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=arm-linux-gnueabi-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabi-g++ -DCMAKE_ASM_COMPILER=arm-linux-gnueabi-gcc -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE" -DCMAKE_ASM_FLAGS="${CMAKE_ASM_FLAGS} -c" -DCMAKE_SYSTEM_PROCESSOR="arm" -DVIDEOCORE_BUILD_DIR="${R}" "${R}/tmp/userland" | |
|
41 | fi | |
|
42 | ||
|
43 | if [ "$RELEASE_ARCH" = "armhf" ] ; then | |
|
44 | cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_BUILD_TYPE=release -DCMAKE_TOOLCHAIN_FILE="${R}"/tmp/userland/makefiles/cmake/toolchains/arm-linux-gnueabihf.cmake -DVIDEOCORE_BUILD_DIR="${R}" "${R}/tmp/userland" | |
|
45 | fi | |
|
46 | ||
|
47 | #build userland | |
|
31 | 48 | make -j "$(nproc)" |
|
32 | chroot_exec PATH="${PATH}":/opt/vc/bin | |
|
49 | #pop us out of build dir | |
|
50 | popd | |
|
33 | 51 | fi |
@@ -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