##// END OF EJS Templates
bv
Unknown -
r469:ddccb0e95d50
parent child
Show More
@@ -416,14 +416,18 else # BUILD_KERNEL=false
416 # echo Install precompiled kernel...
416 # echo Install precompiled kernel...
417 # echo error: not implemented
417 # echo error: not implemented
418 if [ "$SET_ARCH" = 64 ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then
418 if [ "$SET_ARCH" = 64 ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then
419 if [ "$KERNEL_ZSWAP" = true ] ; then
419
420 # Use Sakakis modified kernel if ZSWAP is active
421 if [ "$KERNEL_ZSWAP" = true ] || ; then
420 RPI3_64_KERNEL_URL=RPI3_64_BIS_KERNEL_URL
422 RPI3_64_KERNEL_URL=RPI3_64_BIS_KERNEL_URL
421 fi
423 fi
424
422 # Create temporary directory for dl
425 # Create temporary directory for dl
423 temp_dir=$(as_nobody mktemp -d)
426 temp_dir=$(as_nobody mktemp -d)
424
427
425 # Fetch kernel dl
428 # Fetch kernel dl
426 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
429 as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL"
430
427 #extract download
431 #extract download
428 tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
432 tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}"
429
433
@@ -434,11 +438,10 else # BUILD_KERNEL=false
434
438
435 # Remove temporary directory for kernel sources
439 # Remove temporary directory for kernel sources
436 rm -fr "${temp_dir}"
440 rm -fr "${temp_dir}"
441
437 # Set permissions of the kernel sources
442 # Set permissions of the kernel sources
438 chown -R root:root "${R}/boot/firmware"
443 chown -R root:root "${R}/boot/firmware"
439 chown -R root:root "${R}/lib/modules"
444 chown -R root:root "${R}/lib/modules"
440 #Create cmdline.txt for 15-rpi-config.sh
441 touch "${BOOT_DIR}/cmdline.txt"
442 fi
445 fi
443
446
444 # INstall Kernel from hypriot comptabile with all Raspberry PI
447 # INstall Kernel from hypriot comptabile with all Raspberry PI
@@ -448,26 +451,36 else # BUILD_KERNEL=false
448
451
449 # Fetch kernel
452 # Fetch kernel
450 as_nobody wget -O "${temp_dir}"/kernel.deb -c "$RPI_32_KERNEL_URL"
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 # Copy downloaded U-Boot sources
455 # Copy downloaded U-Boot sources
455 mv "${temp_dir}"/kernel.deb "${R}"/tmp/kernel.deb
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 # Set permissions
458 # Set permissions
459 chown -R root:root "${R}"/tmp/kernel.deb
459 chown -R root:root "${R}"/tmp/kernel.deb
460 chown -R root:root "${R}"/tmp/kernel-header.deb
461
460
462 # Install kernel
461 # Install kernel
463 chroot_exec dpkg -i /tmp/kernel.deb
462 chroot_exec dpkg -i /tmp/kernel.deb
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
464 # Install kernel header
476 # Install kernel header
465 chroot_exec dpkg -i /tmp/kernel-header.deb
477 chroot_exec dpkg -i /tmp/kernel-header.deb
478 rm -f "${R}"/tmp/kernel-header.deb
479 fi
466
480
467 # Remove temporary directory and files
481 # Remove temporary directory and files
468 rm -fr "${temp_dir}"
482 rm -fr "${temp_dir}"
469 rm -f "${R}"/tmp/kernel.deb
483 rm -f "${R}"/tmp/kernel.deb
470 rm -f "${R}"/tmp/kernel-header.deb
471 fi
484 fi
472
485
473 # Check if kernel installation was successful
486 # Check if kernel installation was successful
@@ -64,6 +64,28 if [ "$ENABLE_CRYPTFS" = true ] ; then
64 fi
64 fi
65 fi
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 #locks cpu at max frequency
89 #locks cpu at max frequency
68 if [ "$ENABLE_TURBO" = true ] ; then
90 if [ "$ENABLE_TURBO" = true ] ; then
69 echo "force_turbo=1" >> "${BOOT_DIR}/config.txt"
91 echo "force_turbo=1" >> "${BOOT_DIR}/config.txt"
@@ -71,18 +93,8 if [ "$ENABLE_TURBO" = true ] ; then
71 echo "boot_delay=1" >> "${BOOT_DIR}/config.txt"
93 echo "boot_delay=1" >> "${BOOT_DIR}/config.txt"
72 fi
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 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
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 # Bluetooth enabled
98 # Bluetooth enabled
87 if [ "$ENABLE_BLUETOOTH" = true ] ; then
99 if [ "$ENABLE_BLUETOOTH" = true ] ; then
88 # Create temporary directory for Bluetooth sources
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 # 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
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 if [ "$ENABLE_MINIUART_OVERLAY" = true ] ; then
134 if [ "$ENABLE_MINIUART_OVERLAY" = true ] ; then
123 SET_SERIAL="ttyAMA0"
124
135
125 # set overlay to swap ttyAMA0 and ttyS0
136 # set overlay to swap ttyAMA0 and ttyS0
126 echo "dtoverlay=pi3-miniuart-bt" >> "${BOOT_DIR}/config.txt"
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 if [ "$ENABLE_TURBO" = false ] ; then
140 if [ "$ENABLE_TURBO" = false ] ; then
130 echo "core_freq=250" >> "${BOOT_DIR}/config.txt"
141 echo "core_freq=250" >> "${BOOT_DIR}/config.txt"
131 fi
142 fi
143 fi
132
144
133 # Activate services
145 # Activate services
134 chroot_exec systemctl enable pi-bluetooth.hciuart.service
146 chroot_exec systemctl enable pi-bluetooth.hciuart.service
135 #chroot_exec systemctl enable pi-bluetooth.bthelper@.service
147 chroot_exec systemctl enable pi-bluetooth.bthelper@serial1.service
136 else
137 chroot_exec systemctl enable pi-bluetooth.hciuart.service
138 #chroot_exec systemctl enable pi-bluetooth.bthelper@.service
139 fi
140
148
141 else # if ENABLE_BLUETOOTH = false
149 else # if ENABLE_BLUETOOTH = false
142 # set overlay to disable bluetooth
150 # set overlay to disable bluetooth
143 echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt"
151 echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt"
144 fi # ENABLE_BLUETOOTH end
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 fi
153 fi
150
154
151 # may need sudo systemctl disable hciuart
155 # may need sudo systemctl disable hciuart
@@ -155,11 +159,11 if [ "$ENABLE_CONSOLE" = true ] ; then
155 CMDLINE="${CMDLINE} console=serial0,115200"
159 CMDLINE="${CMDLINE} console=serial0,115200"
156
160
157 # Enable serial console systemd style
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 else
163 else
160 echo "enable_uart=0" >> "${BOOT_DIR}/config.txt"
164 echo "enable_uart=0" >> "${BOOT_DIR}/config.txt"
161 # disable serial console systemd style
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 fi
167 fi
164
168
165 # Remove cmdline.txt entry of starting zswap
169 # Remove cmdline.txt entry of starting zswap
@@ -204,24 +208,9 if [ "$ENABLE_SYSTEMDSWAP" = true ] ; then
204 cd "${WORKDIR}" || exit
208 cd "${WORKDIR}" || exit
205 fi
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 # Install firmware boot cmdline
211 # Install firmware boot cmdline
220 echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt"
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 # Setup minimal GPU memory allocation size: 16MB (no X)
214 # Setup minimal GPU memory allocation size: 16MB (no X)
226 if [ "$ENABLE_MINGPU" = true ] ; then
215 if [ "$ENABLE_MINGPU" = true ] ; then
227 echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt"
216 echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt"
@@ -225,8 +225,6 MISSING_PACKAGES=""
225 # Packages installed for c/c++ build environment in chroot (keep empty)
225 # Packages installed for c/c++ build environment in chroot (keep empty)
226 COMPILER_PACKAGES=""
226 COMPILER_PACKAGES=""
227
227
228 set +x
229
230 #Check if apt-cacher-ng has port 3142 open and set APT_PROXY
228 #Check if apt-cacher-ng has port 3142 open and set APT_PROXY
231 APT_CACHER_RUNNING=$(lsof -i :3142 | cut -d ' ' -f3 | uniq | sed '/^\s*$/d')
229 APT_CACHER_RUNNING=$(lsof -i :3142 | cut -d ' ' -f3 | uniq | sed '/^\s*$/d')
232 if [ "${APT_CACHER_RUNNING}" = "apt-cacher-ng" ] ; then
230 if [ "${APT_CACHER_RUNNING}" = "apt-cacher-ng" ] ; then
@@ -245,9 +243,9 rm "$(pwd)/files/apt/sources.list"
245 fi
243 fi
246
244
247 if [ "$ENABLE_NONFREE" = true ] ; then
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 else
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 fi
249 fi
252
250
253 #sed and cut the result string so we can use it as APT_SERVER
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 fi
365 fi
368 fi
366 fi
369
367
368 set +x
369
370 # Add cmake to compile videocore sources
370 # Add cmake to compile videocore sources
371 if [ "$ENABLE_VIDEOCORE" = true ] ; then
371 if [ "$ENABLE_VIDEOCORE" = true ] ; then
372 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cmake"
372 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cmake"
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant