##// END OF EJS Templates
Added RPi0/1 support
drtyhlpr -
r424:294013ff4644
parent child
Show More
@@ -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 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```).
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 RPi3 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.
@@ -59,7 +59,6 A comma separated list of additional packages to be installed by apt after boots
59 59 #### General system settings:
60 60 ##### `SET_ARCH`=32
61 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
63 62
64 63 ##### `RPI_MODEL`=2
65 64 Specifiy the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models:
@@ -153,13 +152,13 Set the IP address for the second NTP server.
153 152
154 153 #### Basic system features:
155 154 ##### `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.
155 Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi0/1/2/3. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system.
157 156
158 157 ##### `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.
158 Enable I2C interface on the RPi0/1/2/3. Please check the [RPi0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins.
160 159
161 160 ##### `ENABLE_SPI`=false
162 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.
161 Enable SPI interface on the RPi0/1/2/3. Please check the [RPi0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins.
163 162
164 163 ##### `ENABLE_IPV6`=true
165 164 Enable IPv6 support. The network interface configuration is managed via systemd-networkd.
@@ -208,7 +207,7 Use debootstrap script variant `minbase` which only includes essential packages
208 207 Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information.
209 208
210 209 ##### `ENABLE_UBOOT`=false
211 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.
210 Replace the default RPi0/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.
212 211
213 212 ##### `UBOOTSRC_DIR`=""
214 213 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.
@@ -277,7 +276,7 Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enab
277 276
278 277 #### Kernel compilation:
279 278 ##### `BUILD_KERNEL`=true
280 Build and install the latest RPi2/3 Linux kernel. Currently only the default RPi2/3 kernel configuration is used.
279 Build and install the latest RPi0/1/2/3 Linux kernel. Currently only the default RPi0/1/2/3 kernel configuration is used.
281 280
282 281 ##### `CROSS_COMPILE`="arm-linux-gnueabihf-"
283 282 This sets the cross compile enviornment for the compiler.
@@ -400,9 +399,9 The functions of this script that are required for the different stages of the b
400 399 | `10-bootstrap.sh` | Debootstrap basic system |
401 400 | `11-apt.sh` | Setup APT repositories |
402 401 | `12-locale.sh` | Setup Locales and keyboard settings |
403 | `13-kernel.sh` | Build and install RPi2/3 Kernel |
402 | `13-kernel.sh` | Build and install RPi0/1/2/3 Kernel |
404 403 | `14-fstab.sh` | Setup fstab and initramfs |
405 | `15-rpi-config.sh` | Setup RPi2/3 config and cmdline |
404 | `15-rpi-config.sh` | Setup RPi0/1/2/3 config and cmdline |
406 405 | `20-networking.sh` | Setup Networking |
407 406 | `21-firewall.sh` | Setup Firewall |
408 407 | `30-security.sh` | Setup Users and Security settings |
@@ -410,6 +409,7 The functions of this script that are required for the different stages of the b
410 409 | `32-sshd.sh` | Setup SSH and public keys |
411 410 | `41-uboot.sh` | Build and Setup U-Boot |
412 411 | `42-fbturbo.sh` | Build and Setup fbturbo Xorg driver |
412 | `43-videocore.sh` | Build and Setup videocore libraries |
413 413 | `50-firstboot.sh` | First boot actions |
414 414 | `99-reduce.sh` | Reduce the disk space usage |
415 415
@@ -418,7 +418,7 All the required configuration files that will be copied to the generated OS ima
418 418 | Directory | Description |
419 419 | --- | --- |
420 420 | `apt` | APT management configuration files |
421 | `boot` | Boot and RPi2/3 configuration files |
421 | `boot` | Boot and RPi0/1/2/3 configuration files |
422 422 | `dpkg` | Package Manager configuration |
423 423 | `etc` | Configuration files and rc scripts |
424 424 | `firstboot` | Scripts that get executed on first boot |
@@ -444,7 +444,7 script -c 'APT_SERVER=ftp.de.debian.org ./rpi23-gen-image.sh' ./build.log
444 444 ```
445 445
446 446 ## Flashing the image file
447 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`.
447 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 RPi0/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`.
448 448
449 449 ##### Flashing examples:
450 450 ```shell
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant