@@ -0,0 +1,1 | |||||
|
1 | kernel.printk = 3 4 1 3 No newline at end of file |
@@ -0,0 +1,33 | |||||
|
1 | SUBSYSTEM=="input", GROUP="input", MODE="0660" | |||
|
2 | SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660" | |||
|
3 | SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" | |||
|
4 | SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660" | |||
|
5 | ||||
|
6 | SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" | |||
|
7 | SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ | |||
|
8 | chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ | |||
|
9 | chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\ | |||
|
10 | chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\ | |||
|
11 | '" | |||
|
12 | ||||
|
13 | KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\ | |||
|
14 | ALIASES=/proc/device-tree/aliases; \ | |||
|
15 | if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \ | |||
|
16 | echo 0;\ | |||
|
17 | elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \ | |||
|
18 | echo 1; \ | |||
|
19 | else \ | |||
|
20 | exit 1; \ | |||
|
21 | fi\ | |||
|
22 | '", SYMLINK+="serial%c" | |||
|
23 | ||||
|
24 | KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\ | |||
|
25 | ALIASES=/proc/device-tree/aliases; \ | |||
|
26 | if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \ | |||
|
27 | echo 0; \ | |||
|
28 | elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \ | |||
|
29 | echo 1; \ | |||
|
30 | else \ | |||
|
31 | exit 1; \ | |||
|
32 | fi \ | |||
|
33 | '", SYMLINK+="serial%c" |
@@ -153,7 +153,19 Set the IP address for the second NTP server. | |||||
153 |
|
153 | |||
154 | #### Basic system features: |
|
154 | #### Basic system features: | |
155 | ##### `ENABLE_CONSOLE`=true |
|
155 | ##### `ENABLE_CONSOLE`=true | |
156 | Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi2/3. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system. |
|
156 | Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi2/3. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system. On RPI `0` `3` `3P` the CPU speed is locked at lowest speed. | |
|
157 | ||||
|
158 | ##### `ENABLE_PRINTK`=false | |||
|
159 | Enables printing kernel messages to konsole. printk is `3 4 1 3` as in raspbian. | |||
|
160 | ||||
|
161 | ##### `ENABLE_BLUETOOTH`=false | |||
|
162 | Enable onboard Bluetooth interface on the RPi0/3/3P. See: https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/ | |||
|
163 | ||||
|
164 | ##### `ENABLE_MINIUART_OVERLAY`=false | |||
|
165 | Enable Bluetooth to use this. Adds overlay to swap UART0 with UART1. Enabling (slower) Bluetooth and full speed serial console. - RPI `0` `3` `3P` have a fast `hardware UART0` (ttyAMA0) and a `mini UART1` (ttyS0)! RPI `1` `1P` `2` only have a `hardware UART0`. `UART0` is considered better, because is faster and more stable than `mini UART1`. By default the Bluetooth modem is mapped to the `hardware UART0` and `mini UART` is used for console. The `mini UART` is a problem for the serial console, because its baudrate depends on the cpu frequency, which is changing on runtime. Resulting in a volatile baudrate and thus in an unusable serial console. | |||
|
166 | ||||
|
167 | ##### `ENABLE_TURBO`=false | |||
|
168 | Enable Turbo mode. This setting locks cpu at highest frequency. As setting ENABLE_CONSOLE=true locks RPI to lowest CPU speed, this is can be used additionally to lock cpu hat max speed. Need a good power supply and probably cooling for the Raspberry PI. | |||
157 |
|
169 | |||
158 | ##### `ENABLE_I2C`=false |
|
170 | ##### `ENABLE_I2C`=false | |
159 | Enable I2C interface on the RPi2/3. Please check the [RPi2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins. |
|
171 | Enable I2C interface on the RPi2/3. Please check the [RPi2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins. | |
@@ -173,9 +185,6 Allow the installation of non-free Debian packages that do not comply with the D | |||||
173 | ##### `ENABLE_WIRELESS`=false |
|
185 | ##### `ENABLE_WIRELESS`=false | |
174 | Download and install the [closed-source firmware binary blob](https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm) that is required to run the internal wireless interface of the Raspberry Pi model `3`. This parameter is ignored if the specified `RPI_MODEL` is not `3`. |
|
186 | Download and install the [closed-source firmware binary blob](https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm) that is required to run the internal wireless interface of the Raspberry Pi model `3`. This parameter is ignored if the specified `RPI_MODEL` is not `3`. | |
175 |
|
187 | |||
176 | ##### `ENABLE_BLUETOOTH`=false |
|
|||
177 | Enable Bluetooth interface on the RPi0/3/3P. |
|
|||
178 |
|
||||
179 | ##### `ENABLE_RSYSLOG`=true |
|
188 | ##### `ENABLE_RSYSLOG`=true | |
180 | If set to false, disable and uninstall rsyslog (so logs will be available only in journal files) |
|
189 | If set to false, disable and uninstall rsyslog (so logs will be available only in journal files) | |
181 |
|
190 |
@@ -89,13 +89,8 if [ "$BUILD_KERNEL" = true ] ; then | |||||
89 | #Switch to KERNELSRC_DIR |
|
89 | #Switch to KERNELSRC_DIR | |
90 | cd "${KERNEL_DIR}" |
|
90 | cd "${KERNEL_DIR}" | |
91 |
|
91 | |||
92 | # GPL v2.0 |
|
92 | # enable ZSWAP see https://askubuntu.com/a/472227 or https://wiki.archlinux.org/index.php/zswap | |
93 | #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh |
|
|||
94 | if [ "$KERNEL_ZSWAP" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then |
|
93 | if [ "$KERNEL_ZSWAP" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then | |
95 | # enable ZSWAP support for better performance during large builds etc. |
|
|||
96 | # requires activation via kernel parameter or sysfs |
|
|||
97 | # see e.g. https://askubuntu.com/a/472227 for a summary of ZSWAP (vs ZRAM etc.) |
|
|||
98 | # and e.g. https://wiki.archlinux.org/index.php/zswap for parameters etc. |
|
|||
99 |
|
|
94 | set_kernel_config ZPOOL y | |
100 | set_kernel_config ZSWAP y |
|
95 | set_kernel_config ZSWAP y | |
101 | set_kernel_config ZBUD y |
|
96 | set_kernel_config ZBUD y | |
@@ -104,16 +99,15 if [ "$BUILD_KERNEL" = true ] ; then | |||||
104 | set_kernel_config PGTABLE_MAPPING y |
|
99 | set_kernel_config PGTABLE_MAPPING y | |
105 | fi |
|
100 | fi | |
106 |
|
101 | |||
|
102 | # enable basic KVM support; see https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453 | |||
107 | if [ "$KERNEL_VIRT" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then |
|
103 | if [ "$KERNEL_VIRT" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then | |
108 | # enable basic KVM support; see e.g. |
|
|||
109 | # https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=210546&start=25#p1300453 |
|
|||
110 |
|
|
104 | set_kernel_config VIRTUALIZATION y | |
111 | set_kernel_config KVM y |
|
105 | set_kernel_config KVM y | |
112 | set_kernel_config VHOST_NET m |
|
106 | set_kernel_config VHOST_NET m | |
113 | set_kernel_config VHOST_CROSS_ENDIAN_LEGACY y |
|
107 | set_kernel_config VHOST_CROSS_ENDIAN_LEGACY y | |
114 | fi |
|
108 | fi | |
115 | #See https://github.com/raspberrypi/linux/issues/2177#issuecomment-354647406 |
|
109 | ||
116 | # Netfilter kernel support |
|
110 | # Netfilter kernel support See https://github.com/raspberrypi/linux/issues/2177#issuecomment-354647406 | |
117 | if [ "$KERNEL_NF" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then |
|
111 | if [ "$KERNEL_NF" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then | |
118 | set_kernel_config CONFIG_NETFILTER_XTABLES m |
|
112 | set_kernel_config CONFIG_NETFILTER_XTABLES m | |
119 | set_kernel_config CONFIG_NF_DUP_NETDEV m |
|
113 | set_kernel_config CONFIG_NF_DUP_NETDEV m | |
@@ -205,9 +199,7 if [ "$BUILD_KERNEL" = true ] ; then | |||||
205 | set_kernel_config NETFILTER_XTABLES m |
|
199 | set_kernel_config NETFILTER_XTABLES m | |
206 | fi |
|
200 | fi | |
207 |
|
201 | |||
208 | #https://groups.google.com/forum/#!topic/linux.gentoo.user/_2aSc_ztGpA |
|
202 | # Enables BPF syscall for systemd-journald see https://github.com/torvalds/linux/blob/master/init/Kconfig#L848 or https://groups.google.com/forum/#!topic/linux.gentoo.user/_2aSc_ztGpA | |
209 | #https://github.com/torvalds/linux/blob/master/init/Kconfig#L848 |
|
|||
210 | # Enables BPF syscall for systemd-journald |
|
|||
211 | if [ "$KERNEL_BPF" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then |
|
203 | if [ "$KERNEL_BPF" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then | |
212 | set_kernel_config CONFIG_BPF_SYSCALL y |
|
204 | set_kernel_config CONFIG_BPF_SYSCALL y | |
213 | set_kernel_config CONFIG_CGROUP_BPF y |
|
205 | set_kernel_config CONFIG_CGROUP_BPF y |
@@ -51,8 +51,6 else | |||||
51 | fi |
|
51 | fi | |
52 | fi |
|
52 | fi | |
53 |
|
53 | |||
54 |
|
||||
55 |
|
||||
56 | # Add encrypted root partition to cmdline.txt |
|
54 | # Add encrypted root partition to cmdline.txt | |
57 | if [ "$ENABLE_CRYPTFS" = true ] ; then |
|
55 | if [ "$ENABLE_CRYPTFS" = true ] ; then | |
58 | if [ "$ENABLE_SPLITFS" = true ] ; then |
|
56 | if [ "$ENABLE_SPLITFS" = true ] ; then | |
@@ -66,47 +64,24 if [ "$ENABLE_CRYPTFS" = true ] ; then | |||||
66 | fi |
|
64 | fi | |
67 | fi |
|
65 | fi | |
68 |
|
66 | |||
69 | # Add serial console support |
|
67 | #locks cpu at max frequency | |
70 |
|
|
68 | if [ "$ENABLE_TURBO" = true ] ; then | |
71 | # CMDLINE="${CMDLINE} console=ttyAMA0,115200 kgdboc=ttyAMA0,115200" |
|
69 | echo "force_turbo=1" >> "${BOOT_DIR}/config.txt" | |
72 | #fi |
|
|||
73 |
|
||||
74 | # Remove IPv6 networking support |
|
|||
75 | if [ "$ENABLE_IPV6" = false ] ; then |
|
|||
76 | CMDLINE="${CMDLINE} ipv6.disable=1" |
|
|||
77 | fi |
|
70 | fi | |
78 |
|
71 | |||
79 | # Automatically assign predictable network interface names |
|
72 | if [ "$ENABLE_PRINTK" = true ] ; then | |
80 | if [ "$ENABLE_IFNAMES" = false ] ; then |
|
73 | install_readonly files/sysctl.d/83-rpi-printk.conf "${ETC_DIR}/sysctl.d/83-rpi-printk.conf" | |
81 | CMDLINE="${CMDLINE} net.ifnames=0" |
|
|||
82 | else |
|
|||
83 | CMDLINE="${CMDLINE} net.ifnames=1" |
|
|||
84 | fi |
|
74 | fi | |
85 |
|
75 | |||
86 | # Install firmware boot cmdline |
|
76 | # Install udev rule for serial alias | |
87 | echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt" |
|
77 | install_readonly files/etc/99-com.rules "${ETC_DIR}/udev/rules.d/99-com.rules" | |
88 |
|
78 | |||
89 | # Install firmware config |
|
79 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then | |
90 | install_readonly files/boot/config.txt "${BOOT_DIR}/config.txt" |
|
|||
91 |
|
80 | |||
92 | # Setup minimal GPU memory allocation size: 16MB (no X) |
|
81 | # RPI0,3,3P Use default ttyS0 (mini-UART)as serial interface | |
93 | if [ "$ENABLE_MINGPU" = true ] ; then |
|
82 | SET_SERIAL="ttyS0" | |
94 | echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt" |
|
|||
95 | fi |
|
|||
96 |
|
||||
97 | # Setup boot with initramfs |
|
|||
98 | if [ "$ENABLE_INITRAMFS" = true ] ; then |
|
|||
99 | echo "initramfs initramfs-${KERNEL_VERSION} followkernel" >> "${BOOT_DIR}/config.txt" |
|
|||
100 | fi |
|
|||
101 |
|
||||
102 | # Disable RPi3 Bluetooth and restore ttyAMA0 serial device |
|
|||
103 | if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then |
|
|||
104 | if [ "$ENABLE_CONSOLE" = true ] && [ "$ENABLE_UBOOT" = false ] ; then |
|
|||
105 | echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt" |
|
|||
106 | echo "enable_uart=1" >> "${BOOT_DIR}/config.txt" |
|
|||
107 | fi |
|
|||
108 | fi |
|
|||
109 |
|
83 | |||
|
84 | # Bluetooth enabled | |||
110 | if [ "$ENABLE_BLUETOOTH" = true ] ; then |
|
85 | if [ "$ENABLE_BLUETOOTH" = true ] ; then | |
111 | # Create temporary directory for Bluetooth sources |
|
86 | # Create temporary directory for Bluetooth sources | |
112 | temp_dir=$(as_nobody mktemp -d) |
|
87 | temp_dir=$(as_nobody mktemp -d) | |
@@ -117,8 +92,6 if [ "$ENABLE_BLUETOOTH" = true ] ; then | |||||
117 | # Copy downloaded sources |
|
92 | # Copy downloaded sources | |
118 | mv "${temp_dir}/pi-bluetooth" "${R}/tmp/" |
|
93 | mv "${temp_dir}/pi-bluetooth" "${R}/tmp/" | |
119 |
|
94 | |||
120 | # Raspberry-sys-mod package for /dev/serial device needed by bluetooth service |
|
|||
121 | as_nobody wget -q -O "${R}/tmp/pi-bluetooth/99-com.rules" https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules |
|
|||
122 | # Bluetooth firmware from arch aur https://aur.archlinux.org/packages/pi-bluetooth/ |
|
95 | # Bluetooth firmware from arch aur https://aur.archlinux.org/packages/pi-bluetooth/ | |
123 | as_nobody wget -q -O "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" https://aur.archlinux.org/cgit/aur.git/plain/LICENCE.broadcom_bcm43xx?h=pi-bluetooth |
|
96 | as_nobody wget -q -O "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" https://aur.archlinux.org/cgit/aur.git/plain/LICENCE.broadcom_bcm43xx?h=pi-bluetooth | |
124 | as_nobody wget -q -O "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" https://aur.archlinux.org/cgit/aur.git/plain/BCM43430A1.hcd?h=pi-bluetooth |
|
97 | as_nobody wget -q -O "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" https://aur.archlinux.org/cgit/aur.git/plain/BCM43430A1.hcd?h=pi-bluetooth | |
@@ -139,11 +112,76 if [ "$ENABLE_BLUETOOTH" = true ] ; then | |||||
139 | install_readonly "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx" |
|
112 | install_readonly "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx" | |
140 | install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.bthelper@.service" "${ETC_DIR}/systemd/system/pi-bluetooth.bthelper@.service" |
|
113 | install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.bthelper@.service" "${ETC_DIR}/systemd/system/pi-bluetooth.bthelper@.service" | |
141 | install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.hciuart.service" "${ETC_DIR}/systemd/system/pi-bluetooth.hciuart.service" |
|
114 | install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.hciuart.service" "${ETC_DIR}/systemd/system/pi-bluetooth.hciuart.service" | |
142 | # Install udev rule for bluetooth device |
|
|||
143 | install_readonly "${R}/tmp/pi-bluetooth/99-com.rules" "${ETC_DIR}/udev/rules.d/99-com.rules" |
|
|||
144 |
|
115 | |||
145 | # Remove temporary directory |
|
116 | # Remove temporary directory | |
146 | rm -fr "${temp_dir}" |
|
117 | rm -fr "${temp_dir}" | |
|
118 | ||||
|
119 | # 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 | |||
|
120 | if [ "$ENABLE_MINIUART_OVERLAY" = true ] ; then | |||
|
121 | ||||
|
122 | # set overlay to swap ttyAMA0 and ttyS0 | |||
|
123 | echo "dtoverlay=pi3-miniuart-bt" >> "${BOOT_DIR}/config.txt" | |||
|
124 | ||||
|
125 | # if force_turbo didn't lock cpu at high speed, lock it at low speed (XOR logic) or miniuart will be broken | |||
|
126 | if [ "$ENABLE_TURBO" = false ] ; then | |||
|
127 | echo "core_freq=250" >> "${BOOT_DIR}/config.txt" | |||
|
128 | fi | |||
|
129 | fi | |||
|
130 | ||||
|
131 | else # if ENABLE_BLUETOOTH = false | |||
|
132 | # set overlay to disable bluetooth | |||
|
133 | echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt" | |||
|
134 | fi # ENABLE_BLUETOOTH end | |||
|
135 | ||||
|
136 | else | |||
|
137 | # RPI1,1P,2 Use default ttyAMA0 (full UART) as serial interface | |||
|
138 | SET_SERIAL="ttyAMA0" | |||
|
139 | fi | |||
|
140 | ||||
|
141 | # may need sudo systemctl disable hciuart | |||
|
142 | if [ "$ENABLE_CONSOLE" = true ] ; then | |||
|
143 | echo "enable_uart=1" >> "${BOOT_DIR}/config.txt" | |||
|
144 | ||||
|
145 | # add string to cmdline | |||
|
146 | CMDLINE="${CMDLINE} console=serial0,115200" | |||
|
147 | ||||
|
148 | # Enable serial console systemd style | |||
|
149 | chroot_exec systemctl start serial-getty@"$SET_SERIAL".service | |||
|
150 | chroot_exec systemctl enable serial-getty@"$SET_SERIAL".service | |||
|
151 | else | |||
|
152 | echo "enable_uart=0" >> "${BOOT_DIR}/config.txt" | |||
|
153 | ||||
|
154 | # Enable serial console systemd style | |||
|
155 | chroot_exec systemctl stop serial-getty@"$SET_SERIAL".service | |||
|
156 | chroot_exec systemctl disable serial-getty@"$SET_SERIAL".service | |||
|
157 | fi | |||
|
158 | ||||
|
159 | # Remove IPv6 networking support | |||
|
160 | if [ "$ENABLE_IPV6" = false ] ; then | |||
|
161 | CMDLINE="${CMDLINE} ipv6.disable=1" | |||
|
162 | fi | |||
|
163 | ||||
|
164 | # Automatically assign predictable network interface names | |||
|
165 | if [ "$ENABLE_IFNAMES" = false ] ; then | |||
|
166 | CMDLINE="${CMDLINE} net.ifnames=0" | |||
|
167 | else | |||
|
168 | CMDLINE="${CMDLINE} net.ifnames=1" | |||
|
169 | fi | |||
|
170 | ||||
|
171 | # Install firmware boot cmdline | |||
|
172 | echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt" | |||
|
173 | ||||
|
174 | # Install firmware config | |||
|
175 | install_readonly files/boot/config.txt "${BOOT_DIR}/config.txt" | |||
|
176 | ||||
|
177 | # Setup minimal GPU memory allocation size: 16MB (no X) | |||
|
178 | if [ "$ENABLE_MINGPU" = true ] ; then | |||
|
179 | echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt" | |||
|
180 | fi | |||
|
181 | ||||
|
182 | # Setup boot with initramfs | |||
|
183 | if [ "$ENABLE_INITRAMFS" = true ] ; then | |||
|
184 | echo "initramfs initramfs-${KERNEL_VERSION} followkernel" >> "${BOOT_DIR}/config.txt" | |||
147 | fi |
|
185 | fi | |
148 |
|
186 | |||
149 | # Create firmware configuration and cmdline symlinks |
|
187 | # Create firmware configuration and cmdline symlinks |
@@ -22,8 +22,3 else | |||||
22 | # Set no root password to disable root login |
|
22 | # Set no root password to disable root login | |
23 | chroot_exec usermod -p \'!\' root |
|
23 | chroot_exec usermod -p \'!\' root | |
24 | fi |
|
24 | fi | |
25 |
|
||||
26 | # Enable serial console systemd style |
|
|||
27 | if [ "$ENABLE_CONSOLE" = true ] ; then |
|
|||
28 | chroot_exec systemctl enable serial-getty\@ttyAMA0.service |
|
|||
29 | fi |
|
@@ -112,7 +112,9 APT_PROXY=${APT_PROXY:=""} | |||||
112 | APT_SERVER=${APT_SERVER:="ftp.debian.org"} |
|
112 | APT_SERVER=${APT_SERVER:="ftp.debian.org"} | |
113 |
|
113 | |||
114 | # Feature settings |
|
114 | # Feature settings | |
|
115 | ENABLE_PRINTK=${ENABLE_PRINTK:=false} | |||
115 | ENABLE_BLUETOOTH=${ENABLE_BLUETOOTH:=false} |
|
116 | ENABLE_BLUETOOTH=${ENABLE_BLUETOOTH:=false} | |
|
117 | ENABLE_MINIUART_OVERLAY=${ENABLE_MINIUART_OVERLAY:=false} | |||
116 | ENABLE_CONSOLE=${ENABLE_CONSOLE:=true} |
|
118 | ENABLE_CONSOLE=${ENABLE_CONSOLE:=true} | |
117 | ENABLE_I2C=${ENABLE_I2C:=false} |
|
119 | ENABLE_I2C=${ENABLE_I2C:=false} | |
118 | ENABLE_SPI=${ENABLE_SPI:=false} |
|
120 | ENABLE_SPI=${ENABLE_SPI:=false} | |
@@ -214,7 +216,7 set +x | |||||
214 |
|
216 | |||
215 | #Check if apt-cacher-ng has port 3142 open and set APT_PROXY |
|
217 | #Check if apt-cacher-ng has port 3142 open and set APT_PROXY | |
216 | APT_CACHER_RUNNING=$(lsof -i :3142 | grep apt-cacher-ng | cut -d ' ' -f3 | uniq) |
|
218 | APT_CACHER_RUNNING=$(lsof -i :3142 | grep apt-cacher-ng | cut -d ' ' -f3 | uniq) | |
217 | if [ -n ${APT_CACHER_RUNNING} ] ; then |
|
219 | if [ -n "${APT_CACHER_RUNNING}" ] ; then | |
218 | APT_PROXY=http://127.0.0.1:3142/ |
|
220 | APT_PROXY=http://127.0.0.1:3142/ | |
219 | fi |
|
221 | fi | |
220 |
|
222 | |||
@@ -322,32 +324,28 case "$RPI_MODEL" in | |||||
322 | ;; |
|
324 | ;; | |
323 | esac |
|
325 | esac | |
324 |
|
326 | |||
325 | # Prepare date string for default image file name |
|
327 | # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard | |
326 | DATE="$(date +%Y-%m-%d)" |
|
|||
327 | if [ -z "$KERNEL_BRANCH" ] ; then |
|
|||
328 | IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-CURRENT-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}} |
|
|||
329 | else |
|
|||
330 | IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}} |
|
|||
331 | fi |
|
|||
332 |
|
||||
333 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then |
|
328 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then | |
334 | # Include bluetooth packages on supported boards |
|
329 | # Include bluetooth packages on supported boards | |
335 | if [ "$ENABLE_BLUETOOTH" = true ] && [ "$ENABLE_CONSOLE" = false ]; then |
|
330 | if [ "$ENABLE_BLUETOOTH" = true ] && [ "$ENABLE_CONSOLE" = false ]; then | |
336 | APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" |
|
331 | APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" | |
337 | fi |
|
332 | fi | |
338 | # Check if console or bluetooth configuration is invalid on RPI 0,3,3P |
|
333 | else # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard | |
339 | if [ "$ENABLE_BLUETOOTH" = true ] && [ "$ENABLE_CONSOLE" = true ]; then |
|
|||
340 | echo "error: ENABLE_BLUETOOTH and ENABLE_CONSOLE can't be active on the same time." |
|
|||
341 | exit 1 |
|
|||
342 | fi |
|
|||
343 | else # if [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 2 ] ; then |
|
|||
344 |
|
|
334 | # Check if the internal wireless interface is not supported by the RPi model | |
345 |
|
|
335 | if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_BLUETOOTH" = true ]; then | |
346 |
|
|
336 | echo "error: The selected Raspberry Pi model has no integrated interface for wireless or bluetooth" | |
347 |
|
|
337 | exit 1 | |
348 | fi |
|
338 | fi | |
349 | fi |
|
339 | fi | |
350 |
|
340 | |||
|
341 | # Prepare date string for default image file name | |||
|
342 | DATE="$(date +%Y-%m-%d)" | |||
|
343 | if [ -z "$KERNEL_BRANCH" ] ; then | |||
|
344 | IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-CURRENT-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}} | |||
|
345 | else | |||
|
346 | IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}} | |||
|
347 | fi | |||
|
348 | ||||
351 | # Check if DISABLE_UNDERVOLT_WARNINGS parameter value is supported |
|
349 | # Check if DISABLE_UNDERVOLT_WARNINGS parameter value is supported | |
352 | if [ -n "$DISABLE_UNDERVOLT_WARNINGS" ] ; then |
|
350 | if [ -n "$DISABLE_UNDERVOLT_WARNINGS" ] ; then | |
353 | if [ "$DISABLE_UNDERVOLT_WARNINGS" != 1 ] && [ "$DISABLE_UNDERVOLT_WARNINGS" != 2 ] ; then |
|
351 | if [ "$DISABLE_UNDERVOLT_WARNINGS" != 1 ] && [ "$DISABLE_UNDERVOLT_WARNINGS" != 2 ] ; then |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant