##// END OF EJS Templates
Merge pull request #140 from burnbabyburn/RPI3B...
drtyhlpr -
r257:0a79ba1f3943 Fusion
parent child
Show More
@@ -0,0 +1,12
1 [Match]
2 Name=wlan0
3
4 [Network]
5 DHCP=no
6 Address=
7 Gateway=
8 DNS=
9 DNS=
10 Domains=
11 NTP=
12 NTP=
@@ -67,7 +67,14 A comma separated list of additional packages to be installed by apt after boots
67 67
68 68 #### General system settings:
69 69 ##### `RPI_MODEL`=2
70 Specifiy the target Raspberry Pi hardware model. The script at this time supports the Raspberry Pi models `2` and `3`. `BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` is used.
70 Specifiy the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models:
71 `0` = Used for Raspberry Pi 0 and Raspberry Pi 0 W
72 `1` = Used for Pi 1 model A and B
73 `1P` = Used for Pi 1 model B+ and A+
74 `2` = Used for Pi 2 model B
75 `3` = Used for Pi 3 model B
76 `3P` = Used for Pi 3 model B+
77 `BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` or `3P` is used.
71 78
72 79 ##### `RELEASE`="jessie"
73 80 Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases "jessie", "stretch" and "buster". `BUILD_KERNEL`=true will automatically be set if the Debian releases `stretch` or `buster` are used.
@@ -30,10 +30,16 install_readonly files/network/interfaces "${ETC_DIR}/network/interfaces"
30 30 # Install configuration for interface eth0
31 31 install_readonly files/network/eth.network "${ETC_DIR}/systemd/network/eth.network"
32 32
33 # Install configuration for interface wl*
34 install_readonly files/network/wlan.network "${ETC_DIR}/systemd/network/wlan.network"
35
36 #always with dhcp since wpa_supplicant integration is missing
37 sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan.network"
38
33 39 if [ "$ENABLE_DHCP" = true ] ; then
34 40 # Enable DHCP configuration for interface eth0
35 41 sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/eth.network"
36
42
37 43 # Set DHCP configuration to IPv4 only
38 44 if [ "$ENABLE_IPV6" = false ] ; then
39 45 sed -i "s/DHCP=.*/DHCP=v4/" "${ETC_DIR}/systemd/network/eth.network"
@@ -55,10 +61,15 fi
55 61
56 62 # Remove empty settings from network configuration
57 63 sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/eth.network"
64 # Remove empty settings from wlan configuration
65 sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/wlan.network"
58 66
59 67 # Move systemd network configuration if required by Debian release
60 68 if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
61 69 mv -v "${ETC_DIR}/systemd/network/eth.network" "${LIB_DIR}/systemd/network/10-eth.network"
70 if [ "$ENABLE_WIRELESS" = true ] ; then
71 mv -v "${ETC_DIR}/systemd/network/wlan.network" "${LIB_DIR}/systemd/network/11-wlan.network"
72 fi
62 73 rm -fr "${ETC_DIR}/systemd/network"
63 74 fi
64 75
@@ -85,23 +96,39 fi
85 96 # Download the firmware binary blob required to use the RPi3 wireless interface
86 97 if [ "$ENABLE_WIRELESS" = true ] ; then
87 98 if [ ! -d ${WLAN_FIRMWARE_DIR} ] ; then
88 mkdir -p ${WLAN_FIRMWARE_DIR}
99 mkdir -p ${WLAN_FIRMWARE_DIR}
89 100 fi
90 101
91 102 # Create temporary directory for firmware binary blob
92 103 temp_dir=$(as_nobody mktemp -d)
93 104
94 # Fetch firmware binary blob
105 # Fetch firmware binary blob for RPI3B+
106 if [ "$RPI_MODEL" = 3B ] ; then
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"
109 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.clm_blob" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.clm_blob"
110 else
111 # Fetch firmware binary blob for RPI3
95 112 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.bin"
96 113 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.txt"
97
114 fi
115
98 116 # Move downloaded firmware binary blob
117 if [ "$RPI_MODEL" = 3B ] ; then
118 mv "${temp_dir}/brcmfmac43455-sdio."* "${WLAN_FIRMWARE_DIR}/"
119 else
99 120 mv "${temp_dir}/brcmfmac43430-sdio."* "${WLAN_FIRMWARE_DIR}/"
100
121 fi
122
101 123 # Remove temporary directory for firmware binary blob
102 124 rm -fr "${temp_dir}"
103 125
104 126 # Set permissions of the firmware binary blob
127 if [ "$RPI_MODEL" = 3B ] ; then
128 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
129 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
130 else
105 131 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
106 132 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
133 fi
107 134 fi
@@ -42,10 +42,24 set -x
42 42
43 43 # Raspberry Pi model configuration
44 44 RPI_MODEL=${RPI_MODEL:=2}
45 #bcm2708-rpi-0-w.dtb (Used for Pi 0 and PI 0W)
46 RPI0_DTB_FILE=${RPI0_DTB_FILE:=bcm2708-rpi-0-w.dtb}
47 RPI0_UBOOT_CONFIG=${RPI0_UBOOT_CONFIG:=rpi_defconfig}
48 #bcm2708-rpi-b.dtb (Used for Pi 1 model A and B)
49 RPI1_DTB_FILE=${RPI1_DTB_FILE:=bcm2708-rpi-b.dtb}
50 RPI1_UBOOT_CONFIG=${RPI1_UBOOT_CONFIG:=rpi_defconfig}
51 #bcm2708-rpi-b-plus.dtb (Used for Pi 1 model B+ and A+)
52 RPI1P_DTB_FILE=${RPI1P_DTB_FILE:=bcm2708-rpi-b-plus.dtb}
53 RPI1P_UBOOT_CONFIG=${RPI1P_UBOOT_CONFIG:=rpi_defconfig}
54 #bcm2709-rpi-2-b.dtb (Used for Pi 2 model B)
45 55 RPI2_DTB_FILE=${RPI2_DTB_FILE:=bcm2709-rpi-2-b.dtb}
46 56 RPI2_UBOOT_CONFIG=${RPI2_UBOOT_CONFIG:=rpi_2_defconfig}
57 #bcm2710-rpi-3-b.dtb (Used for Pi 3 model B)
47 58 RPI3_DTB_FILE=${RPI3_DTB_FILE:=bcm2710-rpi-3-b.dtb}
48 59 RPI3_UBOOT_CONFIG=${RPI3_UBOOT_CONFIG:=rpi_3_32b_defconfig}
60 #bcm2710-rpi-3-b-plus.dtb (Used for Pi 3 model B+)
61 RPI3P_DTB_FILE=${RPI3P_DTB_FILE:=bcm2710-rpi-3-b-plus.dtb}
62 RPI3P_UBOOT_CONFIG=${RPI3P_UBOOT_CONFIG:=rpi_3_32b_defconfig}
49 63
50 64 # Debian release
51 65 RELEASE=${RELEASE:=jessie}
@@ -56,10 +70,19 COLLABORA_KERNEL=${COLLABORA_KERNEL:=3.18.0-trunk-rpi2}
56 70 if [ "$KERNEL_ARCH" = "arm64" ] ; then
57 71 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
58 72 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
73 fi
74
75 if [RPI_MODEL] = 0 || [RPI_MODEL = 1] || [RPI_MODEL = 1P]
76 #RASPBERRY PI 1, PI ZERO, PI ZERO W, AND COMPUTE MODULE DEFAULT Kernel BUILD CONFIGURATION
77 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig}
78 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img}
59 79 else
80 #RASPBERRY PI 2, PI 3, PI 3+, AND COMPUTE MODULE 3 DEFAULT Kernel BUILD CONFIGURATION
81 #https://www.raspberrypi.org/documentation/linux/kernel/building.md
60 82 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
61 83 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img}
62 84 fi
85
63 86 if [ "$RELEASE_ARCH" = "arm64" ] ; then
64 87 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static}
65 88 else
@@ -207,9 +230,6 CRYPTFS_MAPPING=${CRYPTFS_MAPPING:="secure"}
207 230 CRYPTFS_CIPHER=${CRYPTFS_CIPHER:="aes-xts-plain64:sha512"}
208 231 CRYPTFS_XTSKEYSIZE=${CRYPTFS_XTSKEYSIZE:=512}
209 232
210 # Stop the Crypto Wars
211 DISABLE_FBI=${DISABLE_FBI:=false}
212
213 233 # Chroot scripts directory
214 234 CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""}
215 235
@@ -227,23 +247,36 COMPILER_PACKAGES=""
227 247 set +x
228 248
229 249 # Set Raspberry Pi model specific configuration
230 if [ "$RPI_MODEL" = 2 ] ; then
250 elif [ "$RPI_MODEL" = 0 ] ; then
251 DTB_FILE=${RPI2_DTB_FILE}
252 UBOOT_CONFIG=${RPI2_UBOOT_CONFIG}
253 elif [ "$RPI_MODEL" = 1 ] ; then
254 DTB_FILE=${RPI2_DTB_FILE}
255 UBOOT_CONFIG=${RPI2_UBOOT_CONFIG}
256 elif [ "$RPI_MODEL" = 1P ] ; then
257 DTB_FILE=${RPI2_DTB_FILE}
258 UBOOT_CONFIG=${RPI2_UBOOT_CONFIG}
259 elif [ "$RPI_MODEL" = 2 ] ; then
231 260 DTB_FILE=${RPI2_DTB_FILE}
232 261 UBOOT_CONFIG=${RPI2_UBOOT_CONFIG}
233 262 elif [ "$RPI_MODEL" = 3 ] ; then
234 263 DTB_FILE=${RPI3_DTB_FILE}
235 264 UBOOT_CONFIG=${RPI3_UBOOT_CONFIG}
236 265 BUILD_KERNEL=true
266 elif [ "$RPI_MODEL" = 3P ] ; then
267 DTB_FILE=${RPI3P_DTB_FILE}
268 UBOOT_CONFIG=${RPI3P_UBOOT_CONFIG}
269 BUILD_KERNEL=true
237 270 else
238 271 echo "error: Raspberry Pi model ${RPI_MODEL} is not supported!"
239 272 exit 1
240 273 fi
241 274
242 275 # Check if the internal wireless interface is supported by the RPi model
243 if [ "$ENABLE_WIRELESS" = true ] && [ "$RPI_MODEL" != 3 ] ; then
276 if [ "$ENABLE_WIRELESS" = true ] && [ "$RPI_MODEL" = 2 ]; then
244 277 echo "error: The selected Raspberry Pi model has no internal wireless interface"
245 278 exit 1
246 fi
279 fi
247 280
248 281 # Check if DISABLE_UNDERVOLT_WARNINGS parameter value is supported
249 282 if [ ! -z "$DISABLE_UNDERVOLT_WARNINGS" ] ; then
@@ -277,15 +310,10 if [ "$KERNEL_CCACHE" = true ] ; then
277 310 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} ccache"
278 311 fi
279 312
280 # Stop the Crypto Wars
281 if [ "$DISABLE_FBI" = true ] ; then
282 ENABLE_CRYPTFS=true
283 fi
284
285 313 # Add cryptsetup package to enable filesystem encryption
286 314 if [ "$ENABLE_CRYPTFS" = true ] && [ "$BUILD_KERNEL" = true ] ; then
287 315 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cryptsetup"
288 APT_INCLUDES="${APT_INCLUDES},cryptsetup"
316 APT_INCLUDES="${APT_INCLUDES},cryptsetup,console-setup"
289 317
290 318 if [ -z "$CRYPTFS_PASSWORD" ] ; then
291 319 echo "error: no password defined (CRYPTFS_PASSWORD)!"
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant