##// END OF EJS Templates
remerge from master
Unknown -
r478:4199c2d6c38b
parent child
Show More
@@ -0,0 +1,5
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=0
3 RELEASE=buster
4 BUILD_KERNEL=true
5 # ENABLE_BLUETOOTH=false
@@ -0,0 +1,5
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=0
3 RELEASE=stretch
4 BUILD_KERNEL=true
5 # ENABLE_BLUETOOTH=false
@@ -0,0 +1,4
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=1P
3 RELEASE=buster
4 BUILD_KERNEL=true
@@ -0,0 +1,4
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=1P
3 RELEASE=stretch
4 BUILD_KERNEL=true
@@ -0,0 +1,4
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=3
3 RELEASE=buster
4 BUILD_KERNEL=true
@@ -0,0 +1,4
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=2
3 RELEASE=stretch
4 BUILD_KERNEL=true
@@ -0,0 +1,6
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=3P
3 RELEASE=buster
4 BUILD_KERNEL=true
5 # ENABLE_WIRELESS=false
6 # ENABLE_BLUETOOTH=false
@@ -0,0 +1,6
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=3P
3 RELEASE=stretch
4 BUILD_KERNEL=true
5 # ENABLE_WIRELESS=false
6 # ENABLE_BLUETOOTH=false
@@ -1,15 +1,15
1 1 # rpi23-gen-image
2 2 ## Introduction
3 `rpi23-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for Raspberry Pi 2 (RPi2) and Raspberry Pi 3 (RPi3) computers. The script at this time supports the bootstrapping of the Debian (armhf) releases `stretch` and `buster`. Raspberry Pi 3 images are generated for 32-bit mode only. Raspberry Pi 3 64-bit images can be generated using custom configuration parameters (```templates/rpi3-stretch-arm64-4.14.y```).
3 `rpi23-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for all Raspberry Pi computers. The script at this time supports the bootstrapping of the Debian (armhf/armel) releases `stretch` and `buster`. Raspberry Pi 0/1/2/3 images are generated for 32-bit mode only. Raspberry Pi 3 supports 64-bit images that can be generated using custom configuration parameters (```templates/rpi3-stretch-arm64-4.14.y```).
4 4
5 5 ## Build dependencies
6 6 The following list of Debian packages must be installed on the build system because they are essentially required for the bootstrapping process. The script will check if all required packages are installed and missing packages will be installed automatically if confirmed by the user.
7 7
8 8 ```debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo```
9 9
10 It is recommended to configure the `rpi23-gen-image.sh` script to build and install the latest Raspberry Pi Linux kernel. For the RPi3 this is mandatory. Kernel compilation and linking will be performed on the build system using an ARM (armhf) cross-compiler toolchain.
10 It is recommended to configure the `rpi23-gen-image.sh` script to build and install the latest Raspberry Pi Linux kernel. For the Raspberry 3 this is mandatory. Kernel compilation and linking will be performed on the build system using an ARM (armhf/armel) cross-compiler toolchain.
11 11
12 The script has been tested using the default `crossbuild-essential-armhf` toolchain meta package on Debian Linux `stretch` build systems. Please check the [Debian CrossToolchains Wiki](https://wiki.debian.org/CrossToolchains) for further information.
12 The script has been tested using the default `crossbuild-essential-armhf` and `crossbuild-essential-armel` toolchain meta packages on Debian Linux `stretch` build systems. Please check the [Debian CrossToolchains Wiki](https://wiki.debian.org/CrossToolchains) for further information.
13 13
14 14 ## Command-line parameters
15 15 The script accepts certain command-line parameters to enable or disable specific OS features, services and configuration settings. These parameters are passed to the `rpi23-gen-image.sh` script via (simple) shell-variables. Unlike environment shell-variables (simple) shell-variables are defined at the beginning of the command-line call of the `rpi23-gen-image.sh` script.
@@ -49,27 +49,25 Set Debian packages server address. Choose a server from the list of Debian worl
49 49 Set Proxy server address. Using a local Proxy-Cache like `apt-cacher-ng` will speed-up the bootstrapping process because all required Debian packages will only be downloaded from the Debian mirror site once. If `apt-cacher-ng` is running on default `http://127.0.0.1:3142` it is autodetected and you don't need to set this.
50 50
51 51 ##### `APT_INCLUDES`=""
52 A comma separated list of additional packages to be installed by debootstrap during bootstrapping.
52 A comma-separated list of additional packages to be installed by debootstrap during bootstrapping.
53 53
54 54 ##### `APT_INCLUDES_LATE`=""
55 A comma separated list of additional packages to be installed by apt after bootstrapping and after APT sources are set up. This is useful for packages with pre-depends, which debootstrap do not handle well.
55 A comma-separated list of additional packages to be installed by apt after bootstrapping and after APT sources are set up. This is useful for packages with pre-depends, which debootstrap do not handle well.
56 56
57 57 ---
58 58
59 59 #### General system settings:
60 60 ##### `SET_ARCH`=32
61 Set Architecture to default 32bit. If you want to to compile 64bit (RPI3 or RPI3+) set it to `64`. This option will set every needed crosscompiler or boeard specific option for a successful build.
62 If you want to change e.g. cross-compiler -> Templates always override defaults
61 Set Architecture to default 32bit. If you want to compile 64-bit (RPI3 or RPI3+) set it to `64`. This option will set every needed cross-compiler or board specific option for a successful build.
63 62
64 63 ##### `RPI_MODEL`=2
65 Specifiy the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models:
66 - `0` = Used for Raspberry Pi 0 and Raspberry Pi 0 W
67 - `1` = Used for Pi 1 model A and B
68 - `1P` = Used for Pi 1 model B+ and A+
69 - `2` = Used for Pi 2 model B
70 - `3` = Used for Pi 3 model B
71 - `3P` = Used for Pi 3 model B+
72 - `BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` or `3P` is used.
64 Specify the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models:
65 - `0` = Raspberry Pi 0 and Raspberry Pi 0 W
66 - `1` = Raspberry Pi 1 model A and B
67 - `1P` = Raspberry Pi 1 model B+ and A+
68 - `2` = Raspberry Pi 2 model B
69 - `3` = Raspberry Pi 3 model B
70 - `3P` = Raspberry Pi 3 model B+
73 71
74 72 ##### `RELEASE`="buster"
75 73 Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases `stretch` and `buster`.
@@ -118,7 +116,7 Set extra xkb configuration options.
118 116 ---
119 117
120 118 #### Networking settings (DHCP):
121 This parameter is used to set up networking auto configuration in `/etc/systemd/network/eth.network`. The default location of network configuration files in the Debian `stretch` release was changed to `/lib/systemd/network`.`
119 This parameter is used to set up networking auto-configuration in `/etc/systemd/network/eth.network`. The default location of network configuration files in the Debian `stretch` release was changed to `/lib/systemd/network`.`
122 120
123 121 ##### `ENABLE_DHCP`=true
124 122 Set the system to use DHCP. This requires an DHCP server.
@@ -159,19 +157,19 Enable serial console interface. Recommended if no monitor or keyboard is connec
159 157 Enables printing kernel messages to konsole. printk is `3 4 1 3` as in raspbian.
160 158
161 159 ##### `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/
160 Enable onboard Bluetooth interface on the RPi0/3/3P. See: [Configuring the GPIO serial port on Raspbian jessie and stretch](https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/).
163 161
164 162 ##### `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.
163 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 164
167 165 ##### `ENABLE_TURBO`=false
168 VOIDS WARRANTY! Enable Turbo mode - NO overclocking. 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.
166 Enable Turbo mode. This setting locks cpu at the 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.
169 167
170 168 ##### `ENABLE_I2C`=false
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.
169 Enable I2C interface on the RPi 0/1/2/3. Please check the [RPi 0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins.
172 170
173 171 ##### `ENABLE_SPI`=false
174 Enable SPI 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.
172 Enable SPI interface on the RPi 0/1/2/3. Please check the [RPi 0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins.
175 173
176 174 ##### `ENABLE_IPV6`=true
177 175 Enable IPv6 support. The network interface configuration is managed via systemd-networkd.
@@ -192,7 +190,7 If set to false, disable and uninstall rsyslog (so logs will be available only i
192 190 Enable sound hardware and install Advanced Linux Sound Architecture.
193 191
194 192 ##### `ENABLE_HWRANDOM`=true
195 Enable Hardware Random Number Generator. Strong random numbers are important for most network based communications that use encryption. It's recommended to be enabled.
193 Enable Hardware Random Number Generator. Strong random numbers are important for most network-based communications that use encryption. It's recommended to be enabled.
196 194
197 195 ##### `ENABLE_MINGPU`=false
198 196 Minimize the amount of shared memory reserved for the GPU. It doesn't seem to be possible to fully disable the GPU.
@@ -204,7 +202,7 Install and enable D-Bus message bus. Please note that systemd should work witho
204 202 Install Xorg open-source X Window System.
205 203
206 204 ##### `ENABLE_WM`=""
207 Install a user defined window manager for the X Window System. To make sure all X related package dependencies are getting installed `ENABLE_XORG` will automatically get enabled if `ENABLE_WM` is used. The `rpi23-gen-image.sh` script has been tested with the following list of window managers: `blackbox`, `openbox`, `fluxbox`, `jwm`, `dwm`, `xfce4`, `awesome`.
205 Install a user-defined window manager for the X Window System. To make sure all X related package dependencies are getting installed `ENABLE_XORG` will automatically get enabled if `ENABLE_WM` is used. The `rpi23-gen-image.sh` script has been tested with the following list of window managers: `blackbox`, `openbox`, `fluxbox`, `jwm`, `dwm`, `xfce4`, `awesome`.
208 206
209 207 ##### `ENABLE_SYSVINIT`=false
210 208 Support for halt,init,poweroff,reboot,runlevel,shutdown,telinit commands
@@ -222,7 +220,7 Use debootstrap script variant `minbase` which only includes essential packages
222 220 Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information.
223 221
224 222 ##### `ENABLE_UBOOT`=false
225 Replace the default RPi2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol.
223 Replace the default RPi 0/1/2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol.
226 224
227 225 ##### `UBOOTSRC_DIR`=""
228 226 Path to a directory (`u-boot`) of [U-Boot bootloader sources](https://git.denx.de/?p=u-boot.git;a=summary) that will be copied, configured, build and installed inside the chroot.
@@ -234,10 +232,10 Install and enable the [hardware accelerated Xorg video driver](https://github.c
234 232 Path to a directory (`xf86-video-fbturbo`) of [hardware accelerated Xorg video driver sources](https://github.com/ssvb/xf86-video-fbturbo) that will be copied, configured, build and installed inside the chroot.
235 233
236 234 ##### `ENABLE_VIDEOCORE`=false
237 Install and enable the [Source code for ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) `vcgencmd`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling.
235 Install and enable the [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) `vcgencmd`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling.
238 236
239 237 ##### `VIDEOCORESRC_DIR`=""
240 Path to a directory (`userland`) of [Source code for a C-based firmware patching framework for Broadcom/Cypress WiFi chips that enables you to write your own firmware patches, for example, to enable monitor mode with radiotap headers and frame injection](https://github.com/seemoo-lab/nexmon.git) that will be copied, configured, build and installed inside the chroot.
238 Path to a directory (`userland`) of [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) that will be copied, configured, build and installed inside the chroot.
241 239
242 240 ##### `ENABLE_NEXMON`=false
243 241 Install and enable the [Source code for a C-based firmware patching framework for Broadcom/Cypress WiFi chips that enables you to write your own firmware patches, for example, to enable monitor mode with radiotap headers and frame injection](https://github.com/seemoo-lab/nexmon.git).
@@ -249,7 +247,7 Path to a directory (`nexmon`) of [Source code for ARM side libraries for interf
249 247 Enable iptables IPv4/IPv6 firewall. Simplified ruleset: Allow all outgoing connections. Block all incoming connections except to OpenSSH service.
250 248
251 249 ##### `ENABLE_USER`=true
252 Create non-root user with password `USER_PASSWORD`=raspberry. Unless overridden with `USER_NAME`=user, username will be `pi`.
250 Create non-root user with password `USER_PASSWORD`=raspberry. Unless overridden with `USER_NAME`=user, the username will be `pi`.
253 251
254 252 ##### `USER_NAME`=pi
255 253 Non-root user to create. Ignored if `ENABLE_USER`=false
@@ -279,10 +277,10 Disable RPi2/3 under-voltage warnings and overlays. Setting the parameter to `1`
279 277
280 278 #### SSH settings:
281 279 ##### `SSH_ENABLE_ROOT`=false
282 Enable password root login via SSH. This may be a security risk with default password, use only in trusted environments. `ENABLE_ROOT` must be set to `true`.
280 Enable password-based root login via SSH. This may be a security risk with the default password set, use only in trusted environments. `ENABLE_ROOT` must be set to `true`.
283 281
284 282 ##### `SSH_DISABLE_PASSWORD_AUTH`=false
285 Disable password based SSH authentication. Only public key based SSH (v2) authentication will be supported.
283 Disable password-based SSH authentication. Only public key based SSH (v2) authentication will be supported.
286 284
287 285 ##### `SSH_LIMIT_USERS`=false
288 286 Limit the users that are allowed to login via SSH. Only allow user `USER_NAME`=pi and root if `SSH_ENABLE_ROOT`=true to login. This parameter will be ignored if `dropbear` SSH is used (`REDUCE_SSHD`=true).
@@ -297,10 +295,10 Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enab
297 295
298 296 #### Kernel compilation:
299 297 ##### `BUILD_KERNEL`=true
300 Build and install the latest RPi2/3 Linux kernel. Currently only the default RPi2/3 kernel configuration is used.
298 Build and install the latest RPi 0/1/2/3 Linux kernel. Currently only the default RPi 0/1/2/3 kernel configuration is used.
301 299
302 300 ##### `CROSS_COMPILE`="arm-linux-gnueabihf-"
303 This sets the cross compile enviornment for the compiler.
301 This sets the cross-compile environment for the compiler.
304 302
305 303 ##### `KERNEL_ARCH`="arm"
306 304 This sets the kernel architecture for the compiler.
@@ -318,13 +316,13 Sets the QEMU enviornment for the Debian archive. If not set, `QEMU_BINARY` will
318 316 Sets the default config for kernel compiling. If not set, `KERNEL_DEFCONFIG` will be set to "bcmrpi3\_defconfig" automatically if building for arm64.
319 317
320 318 ##### `KERNEL_REDUCE`=false
321 Reduce the size of the generated kernel by removing unwanted device, network and filesystem drivers (experimental).
319 Reduce the size of the generated kernel by removing unwanted devices, network and filesystem drivers (experimental).
322 320
323 321 ##### `KERNEL_THREADS`=1
324 322 Number of parallel kernel building threads. If the parameter is left untouched the script will automatically determine the number of CPU cores to set the number of parallel threads to speed the kernel compilation.
325 323
326 324 ##### `KERNEL_HEADERS`=true
327 Install kernel headers with built kernel.
325 Install kernel headers with the built kernel.
328 326
329 327 ##### `KERNEL_MENUCONFIG`=false
330 328 Start `make menuconfig` interactive menu-driven kernel configuration. The script will continue after `make menuconfig` was terminated.
@@ -441,9 +439,9 The functions of this script that are required for the different stages of the b
441 439 | `10-bootstrap.sh` | Debootstrap basic system |
442 440 | `11-apt.sh` | Setup APT repositories |
443 441 | `12-locale.sh` | Setup Locales and keyboard settings |
444 | `13-kernel.sh` | Build and install RPi2/3 Kernel |
442 | `13-kernel.sh` | Build and install RPi 0/1/2/3 Kernel |
445 443 | `14-fstab.sh` | Setup fstab and initramfs |
446 | `15-rpi-config.sh` | Setup RPi2/3 config and cmdline |
444 | `15-rpi-config.sh` | Setup RPi 0/1/2/3 config and cmdline |
447 445 | `20-networking.sh` | Setup Networking |
448 446 | `21-firewall.sh` | Setup Firewall |
449 447 | `30-security.sh` | Setup Users and Security settings |
@@ -451,6 +449,7 The functions of this script that are required for the different stages of the b
451 449 | `32-sshd.sh` | Setup SSH and public keys |
452 450 | `41-uboot.sh` | Build and Setup U-Boot |
453 451 | `42-fbturbo.sh` | Build and Setup fbturbo Xorg driver |
452 | `43-videocore.sh` | Build and Setup videocore libraries |
454 453 | `50-firstboot.sh` | First boot actions |
455 454 | `99-reduce.sh` | Reduce the disk space usage |
456 455
@@ -459,7 +458,7 All the required configuration files that will be copied to the generated OS ima
459 458 | Directory | Description |
460 459 | --- | --- |
461 460 | `apt` | APT management configuration files |
462 | `boot` | Boot and RPi2/3 configuration files |
461 | `boot` | Boot and RPi 0/1/2/3 configuration files |
463 462 | `dpkg` | Package Manager configuration |
464 463 | `etc` | Configuration files and rc scripts |
465 464 | `firstboot` | Scripts that get executed on first boot |
@@ -485,7 +484,7 script -c 'APT_SERVER=ftp.de.debian.org ./rpi23-gen-image.sh' ./build.log
485 484 ```
486 485
487 486 ## Flashing the image file
488 After the image file was successfully created by the `rpi23-gen-image.sh` script it can be copied to the microSD card that will be used by the RPi2/3 computer. This can be performed by using the tools `bmaptool` or `dd`. Using `bmaptool` will probably speed-up the copy process because `bmaptool` copies more wisely than `dd`.
487 After the image file was successfully created by the `rpi23-gen-image.sh` script it can be copied to the microSD card that will be used by the RPi 0/1/2/3 computer. This can be performed by using the tools `bmaptool` or `dd`. Using `bmaptool` will probably speed-up the copy process because `bmaptool` copies more wisely than `dd`.
489 488
490 489 ##### Flashing examples:
491 490 ```shell
@@ -2,7 +2,7
2 2 ########################################################################
3 3 # rpi23-gen-image.sh 2015-2017
4 4 #
5 # Advanced Debian "stretch" and "buster" bootstrap script for RPi2/3
5 # Advanced Debian "stretch" and "buster" bootstrap script for Raspberry Pi
6 6 #
7 7 # This program is free software; you can redistribute it and/or
8 8 # modify it under the terms of the GNU General Public License
@@ -36,7 +36,7 fi
36 36
37 37 # Introduce settings
38 38 set -e
39 echo -n -e "\n#\n# RPi2/3 Bootstrap Settings\n#\n"
39 echo -n -e "\n#\n# RPi 0/1/2/3 Bootstrap Settings\n#\n"
40 40 set -x
41 41
42 42 # Raspberry Pi model configuration
@@ -255,14 +255,14 APT_SERVER=$(grep -m 1 http files/apt/sources.list | sed "s|http://| |g" | cut -
255 255
256 256 #make script easier and more stable to use with convenient setup switch. Just setup SET_ARCH and RPI_MODEL and your good to go!
257 257 if [ -n "$SET_ARCH" ] ; then
258 # 64 bit configuration
258 # 64-bit configuration
259 259 if [ "$SET_ARCH" = 64 ] ; then
260 # General 64 bit depended settings
260 # General 64-bit depended settings
261 261 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static}
262 262 KERNEL_ARCH=${KERNEL_ARCH:=arm64}
263 263 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"}
264 264
265 # Board specific settings
265 # Raspberry Pi model specific settings
266 266 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
267 267 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64"
268 268 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
@@ -270,19 +270,19 if [ -n "$SET_ARCH" ] ; then
270 270 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
271 271 CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-}
272 272 else
273 echo "error: Only Raspberry PI 3 and 3B+ support 64 bit"
273 echo "error: Only Raspberry PI 3 and 3B+ support 64-bit"
274 274 exit 1
275 275 fi
276 276 fi
277 277
278 # 32 bit configuration
278 # 32-bit configuration
279 279 if [ "$SET_ARCH" = 32 ] ; then
280 # General 32 bit dependend settings
280 # General 32-bit dependend settings
281 281 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static}
282 282 KERNEL_ARCH=${KERNEL_ARCH:=arm}
283 283 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="zImage"}
284 284
285 # Hardware specific settings
285 # Raspberry Pi model specific settings
286 286 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then
287 287 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel"
288 288 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig}
@@ -291,7 +291,7 if [ -n "$SET_ARCH" ] ; then
291 291 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
292 292 fi
293 293
294 # Hardware specific settings
294 # Raspberry Pi model specific settings
295 295 if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
296 296 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf"
297 297 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
@@ -421,6 +421,14 else
421 421 fi
422 422 fi
423 423
424 if [ "$ENABLE_BLUETOOTH" = true ] ; then
425 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
426 if [ "$ENABLE_CONSOLE" = false ] ; then
427 APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez"
428 fi
429 fi
430 fi
431
424 432 # Check if root SSH (v2) public key file exists
425 433 if [ -n "$SSH_ROOT_PUB_KEY" ] ; then
426 434 if [ ! -f "$SSH_ROOT_PUB_KEY" ] ; then
@@ -454,7 +462,7 if [ -n "$MISSING_PACKAGES" ] ; then
454 462 [ "$confirm" != "y" ] && exit 1
455 463
456 464 # Make sure all missing required packages are installed
457 apt-get -qq -y install "${MISSING_PACKAGES}"
465 apt-get -qq -y install `echo "${MISSING_PACKAGES}" | sed "s/ //"`
458 466 fi
459 467
460 468 # Check if ./bootstrap.d directory exists
@@ -1,3 +1,4
1 1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=2
2 3 RELEASE=stretch
3 4 BUILD_KERNEL=true
@@ -2,3 +2,5
2 2 RPI_MODEL=3
3 3 RELEASE=buster
4 4 BUILD_KERNEL=true
5 # ENABLE_WIRELESS=false
6 # ENABLE_BLUETOOTH=false
@@ -2,3 +2,5
2 2 RPI_MODEL=3
3 3 RELEASE=stretch
4 4 BUILD_KERNEL=true
5 # ENABLE_WIRELESS=false
6 # ENABLE_BLUETOOTH=false
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant