##// END OF EJS Templates
bv
Unknown -
r469:ddccb0e95d50
parent child
Show More
@@ -416,14 +416,18 else # BUILD_KERNEL=false
416 416 # echo Install precompiled kernel...
417 417 # echo error: not implemented
418 418 if [ "$SET_ARCH" = 64 ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then
419 if [ "$KERNEL_ZSWAP" = true ] ; then
420 RPI3_64_KERNEL_URL=RPI3_64_BIS_KERNEL_URL
419
420 # Use Sakakis modified kernel if ZSWAP is active
421 if [ "$KERNEL_ZSWAP" = true ] || ; then
422 RPI3_64_KERNEL_URL=RPI3_64_BIS_KERNEL_URL
421 423 fi
424
422 425 # Create temporary directory for dl
423 426 temp_dir=$(as_nobody mktemp -d)
424 427
425 428 # Fetch kernel dl
426 429 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
430
427 431 #extract download
428 432 tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
429 433
@@ -434,11 +438,10 else # BUILD_KERNEL=false
434 438
435 439 # Remove temporary directory for kernel sources
436 440 rm -fr "${temp_dir}"
441
437 442 # Set permissions of the kernel sources
438 443 chown -R root:root "${R}/boot/firmware"
439 444 chown -R root:root "${R}/lib/modules"
440 #Create cmdline.txt for 15-rpi-config.sh
441 touch "${BOOT_DIR}/cmdline.txt"
442 445 fi
443 446
444 447 # INstall Kernel from hypriot comptabile with all Raspberry PI
@@ -448,26 +451,36 else # BUILD_KERNEL=false
448 451
449 452 # Fetch kernel
450 453 as_nobody wget -O "${temp_dir}"/kernel.deb -c "$RPI_32_KERNEL_URL"
451 # Fetch kernel header
452 as_nobody wget -O "${temp_dir}"/kernel-header.deb -c "$RPI_32_KERNELHEADER_URL"
453
454
454 455 # Copy downloaded U-Boot sources
455 456 mv "${temp_dir}"/kernel.deb "${R}"/tmp/kernel.deb
456 mv "${temp_dir}"/kernel-header.deb "${R}"/tmp/kernel-header.deb
457 457
458 458 # Set permissions
459 459 chown -R root:root "${R}"/tmp/kernel.deb
460 chown -R root:root "${R}"/tmp/kernel-header.deb
461 460
462 461 # Install kernel
463 462 chroot_exec dpkg -i /tmp/kernel.deb
464 # Install kernel header
465 chroot_exec dpkg -i /tmp/kernel-header.deb
466 463
464 # move /boot to /boot/firmware to fit script env.
465 #mkdir "${BOOT_DIR}"
466 mkdir "${temp_dir}"/firmware
467 mv "${R}"/boot/* "${temp_dir}"/firmware/
468 mv "${temp_dir}"/firmware "${R}"/boot/
469
470 #same for kernel headers
471 if [ "$KERNEL_HEADERS" = true ] ; then
472 # Fetch kernel header
473 as_nobody wget -O "${temp_dir}"/kernel-header.deb -c "$RPI_32_KERNELHEADER_URL"
474 mv "${temp_dir}"/kernel-header.deb "${R}"/tmp/kernel-header.deb
475 chown -R root:root "${R}"/tmp/kernel-header.deb
476 # Install kernel header
477 chroot_exec dpkg -i /tmp/kernel-header.deb
478 rm -f "${R}"/tmp/kernel-header.deb
479 fi
480
467 481 # Remove temporary directory and files
468 482 rm -fr "${temp_dir}"
469 483 rm -f "${R}"/tmp/kernel.deb
470 rm -f "${R}"/tmp/kernel-header.deb
471 484 fi
472 485
473 486 # Check if kernel installation was successful
@@ -477,4 +490,4 else # BUILD_KERNEL=false
477 490 cleanup
478 491 exit 1
479 492 fi
480 fi
493 fi
@@ -64,6 +64,28 if [ "$ENABLE_CRYPTFS" = true ] ; then
64 64 fi
65 65 fi
66 66
67 if [ "$ENABLE_PRINTK" = true ] ; then
68 install_readonly files/sysctl.d/83-rpi-printk.conf "${ETC_DIR}/sysctl.d/83-rpi-printk.conf"
69 fi
70
71 # Install udev rule for serial alias - serial0 = console serial1=bluetooth
72 install_readonly files/etc/99-com.rules "${LIB_DIR}/udev/rules.d/99-com.rules"
73
74 # Remove IPv6 networking support
75 if [ "$ENABLE_IPV6" = false ] ; then
76 CMDLINE="${CMDLINE} ipv6.disable=1"
77 fi
78
79 # Automatically assign predictable network interface names
80 if [ "$ENABLE_IFNAMES" = false ] ; then
81 CMDLINE="${CMDLINE} net.ifnames=0"
82 else
83 CMDLINE="${CMDLINE} net.ifnames=1"
84 fi
85
86 # Install firmware config
87 install_readonly files/boot/config.txt "${BOOT_DIR}/config.txt"
88
67 89 #locks cpu at max frequency
68 90 if [ "$ENABLE_TURBO" = true ] ; then
69 91 echo "force_turbo=1" >> "${BOOT_DIR}/config.txt"
@@ -71,18 +93,8 if [ "$ENABLE_TURBO" = true ] ; then
71 93 echo "boot_delay=1" >> "${BOOT_DIR}/config.txt"
72 94 fi
73 95
74 if [ "$ENABLE_PRINTK" = true ] ; then
75 install_readonly files/sysctl.d/83-rpi-printk.conf "${ETC_DIR}/sysctl.d/83-rpi-printk.conf"
76 fi
77
78 # Install udev rule for serial alias
79 install_readonly files/etc/99-com.rules "${LIB_DIR}/udev/rules.d/99-com.rules"
80
81 96 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
82 97
83 # RPI0,3,3P Use default ttyS0 (mini-UART)as serial interface
84 SET_SERIAL="ttyS0"
85
86 98 # Bluetooth enabled
87 99 if [ "$ENABLE_BLUETOOTH" = true ] ; then
88 100 # Create temporary directory for Bluetooth sources
@@ -120,7 +132,6 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
120 132
121 133 # Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore UART0/ttyAMA0 over GPIOs 14 & 15. Slow Bluetooth and slow cpu. Use /dev/ttyS0 instead of /dev/ttyAMA0
122 134 if [ "$ENABLE_MINIUART_OVERLAY" = true ] ; then
123 SET_SERIAL="ttyAMA0"
124 135
125 136 # set overlay to swap ttyAMA0 and ttyS0
126 137 echo "dtoverlay=pi3-miniuart-bt" >> "${BOOT_DIR}/config.txt"
@@ -129,23 +140,16 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
129 140 if [ "$ENABLE_TURBO" = false ] ; then
130 141 echo "core_freq=250" >> "${BOOT_DIR}/config.txt"
131 142 fi
132
133 # Activate services
134 chroot_exec systemctl enable pi-bluetooth.hciuart.service
135 #chroot_exec systemctl enable pi-bluetooth.bthelper@.service
136 else
137 chroot_exec systemctl enable pi-bluetooth.hciuart.service
138 #chroot_exec systemctl enable pi-bluetooth.bthelper@.service
139 143 fi
144
145 # Activate services
146 chroot_exec systemctl enable pi-bluetooth.hciuart.service
147 chroot_exec systemctl enable pi-bluetooth.bthelper@serial1.service
140 148
141 149 else # if ENABLE_BLUETOOTH = false
142 150 # set overlay to disable bluetooth
143 151 echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt"
144 152 fi # ENABLE_BLUETOOTH end
145
146 else
147 # RPI1,1P,2 Use default ttyAMA0 (full UART) as serial interface
148 SET_SERIAL="ttyAMA0"
149 153 fi
150 154
151 155 # may need sudo systemctl disable hciuart
@@ -155,11 +159,11 if [ "$ENABLE_CONSOLE" = true ] ; then
155 159 CMDLINE="${CMDLINE} console=serial0,115200"
156 160
157 161 # Enable serial console systemd style
158 chroot_exec systemctl enable serial-getty@"$SET_SERIAL".service
162 chroot_exec systemctl enable serial-getty@serial0.service
159 163 else
160 164 echo "enable_uart=0" >> "${BOOT_DIR}/config.txt"
161 165 # disable serial console systemd style
162 chroot_exec systemctl disable serial-getty@"$SET_SERIAL".service
166 #chroot_exec systemctl disable serial-getty@serial0.service
163 167 fi
164 168
165 169 # Remove cmdline.txt entry of starting zswap
@@ -204,24 +208,9 if [ "$ENABLE_SYSTEMDSWAP" = true ] ; then
204 208 cd "${WORKDIR}" || exit
205 209 fi
206 210
207 # Remove IPv6 networking support
208 if [ "$ENABLE_IPV6" = false ] ; then
209 CMDLINE="${CMDLINE} ipv6.disable=1"
210 fi
211
212 # Automatically assign predictable network interface names
213 if [ "$ENABLE_IFNAMES" = false ] ; then
214 CMDLINE="${CMDLINE} net.ifnames=0"
215 else
216 CMDLINE="${CMDLINE} net.ifnames=1"
217 fi
218
219 211 # Install firmware boot cmdline
220 212 echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt"
221 213
222 # Install firmware config
223 install_readonly files/boot/config.txt "${BOOT_DIR}/config.txt"
224
225 214 # Setup minimal GPU memory allocation size: 16MB (no X)
226 215 if [ "$ENABLE_MINGPU" = true ] ; then
227 216 echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt"
@@ -225,8 +225,6 MISSING_PACKAGES=""
225 225 # Packages installed for c/c++ build environment in chroot (keep empty)
226 226 COMPILER_PACKAGES=""
227 227
228 set +x
229
230 228 #Check if apt-cacher-ng has port 3142 open and set APT_PROXY
231 229 APT_CACHER_RUNNING=$(lsof -i :3142 | cut -d ' ' -f3 | uniq | sed '/^\s*$/d')
232 230 if [ "${APT_CACHER_RUNNING}" = "apt-cacher-ng" ] ; then
@@ -245,9 +243,9 rm "$(pwd)/files/apt/sources.list"
245 243 fi
246 244
247 245 if [ "$ENABLE_NONFREE" = true ] ; then
248 netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --nonfree --outfile "$(pwd)/files/apt/sources.list" -d "$RLS"
246 netselect-apt --arch "$RELEASE_ARCH" -t 3 --sources --nonfree --outfile "$(pwd)/files/apt/sources.list" -d "$RLS"
249 247 else
250 netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --outfile "$(pwd)/files/apt/sources.list" -d "$RLS"
248 netselect-apt --arch "$RELEASE_ARCH" -t 3 --sources --outfile "$(pwd)/files/apt/sources.list" -d "$RLS"
251 249 fi
252 250
253 251 #sed and cut the result string so we can use it as APT_SERVER
@@ -367,6 +365,8 if [ -n "$DISABLE_UNDERVOLT_WARNINGS" ] ; then
367 365 fi
368 366 fi
369 367
368 set +x
369
370 370 # Add cmake to compile videocore sources
371 371 if [ "$ENABLE_VIDEOCORE" = true ] ; then
372 372 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cmake"
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant