##// END OF EJS Templates
README beautify
drtyhlpr -
r428:becef7bb3b54
parent child
Show More
@@ -1,13 +1,13
1 # rpi23-gen-image
1 # rpi23-gen-image
2 ## Introduction
2 ## Introduction
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```).
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 ## Build dependencies
5 ## Build dependencies
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.
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 ```debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo```
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/armel) 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` 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.
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
@@ -61,14 +61,19 A comma separated list of additional packages to be installed by apt after boots
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.
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
62
63 ##### `RPI_MODEL`=2
63 ##### `RPI_MODEL`=2
64 Specifiy the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models:
64 Specifiy the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models (`BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` or `3P` is used) :
65
65 `0` = Used for Raspberry Pi 0 and Raspberry Pi 0 W
66 `0` = Used for Raspberry Pi 0 and Raspberry Pi 0 W
66 `1` = Used for Pi 1 model A and B
67
67 `1P` = Used for Pi 1 model B+ and A+
68 `1` = Used for Raspberry Pi 1 model A and B
68 `2` = Used for Pi 2 model B
69
69 `3` = Used for Pi 3 model B
70 `1P` = Used for Raspberry Pi 1 model B+ and A+
70 `3P` = Used for Pi 3 model B+
71
71 `BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` or `3P` is used.
72 `2` = Used for Raspberry Pi 2 model B
73
74 `3` = Used for Raspberry Pi 3 model B
75
76 `3P` = Used for Raspberry Pi 3 model B+
72
77
73 ##### `RELEASE`="buster"
78 ##### `RELEASE`="buster"
74 Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases `stretch` and `buster`.
79 Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases `stretch` and `buster`.
@@ -152,13 +157,13 Set the IP address for the second NTP server.
152
157
153 #### Basic system features:
158 #### Basic system features:
154 ##### `ENABLE_CONSOLE`=true
159 ##### `ENABLE_CONSOLE`=true
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.
160 Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi 0/1/2/3. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system.
156
161
157 ##### `ENABLE_I2C`=false
162 ##### `ENABLE_I2C`=false
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.
163 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.
159
164
160 ##### `ENABLE_SPI`=false
165 ##### `ENABLE_SPI`=false
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.
166 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.
162
167
163 ##### `ENABLE_IPV6`=true
168 ##### `ENABLE_IPV6`=true
164 Enable IPv6 support. The network interface configuration is managed via systemd-networkd.
169 Enable IPv6 support. The network interface configuration is managed via systemd-networkd.
@@ -207,7 +212,7 Use debootstrap script variant `minbase` which only includes essential packages
207 Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information.
212 Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information.
208
213
209 ##### `ENABLE_UBOOT`=false
214 ##### `ENABLE_UBOOT`=false
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.
215 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.
211
216
212 ##### `UBOOTSRC_DIR`=""
217 ##### `UBOOTSRC_DIR`=""
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.
218 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.
@@ -276,7 +281,7 Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enab
276
281
277 #### Kernel compilation:
282 #### Kernel compilation:
278 ##### `BUILD_KERNEL`=true
283 ##### `BUILD_KERNEL`=true
279 Build and install the latest RPi0/1/2/3 Linux kernel. Currently only the default RPi0/1/2/3 kernel configuration is used.
284 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.
280
285
281 ##### `CROSS_COMPILE`="arm-linux-gnueabihf-"
286 ##### `CROSS_COMPILE`="arm-linux-gnueabihf-"
282 This sets the cross compile enviornment for the compiler.
287 This sets the cross compile enviornment for the compiler.
@@ -399,9 +404,9 The functions of this script that are required for the different stages of the b
399 | `10-bootstrap.sh` | Debootstrap basic system |
404 | `10-bootstrap.sh` | Debootstrap basic system |
400 | `11-apt.sh` | Setup APT repositories |
405 | `11-apt.sh` | Setup APT repositories |
401 | `12-locale.sh` | Setup Locales and keyboard settings |
406 | `12-locale.sh` | Setup Locales and keyboard settings |
402 | `13-kernel.sh` | Build and install RPi0/1/2/3 Kernel |
407 | `13-kernel.sh` | Build and install RPi 0/1/2/3 Kernel |
403 | `14-fstab.sh` | Setup fstab and initramfs |
408 | `14-fstab.sh` | Setup fstab and initramfs |
404 | `15-rpi-config.sh` | Setup RPi0/1/2/3 config and cmdline |
409 | `15-rpi-config.sh` | Setup RPi 0/1/2/3 config and cmdline |
405 | `20-networking.sh` | Setup Networking |
410 | `20-networking.sh` | Setup Networking |
406 | `21-firewall.sh` | Setup Firewall |
411 | `21-firewall.sh` | Setup Firewall |
407 | `30-security.sh` | Setup Users and Security settings |
412 | `30-security.sh` | Setup Users and Security settings |
@@ -418,7 +423,7 All the required configuration files that will be copied to the generated OS ima
418 | Directory | Description |
423 | Directory | Description |
419 | --- | --- |
424 | --- | --- |
420 | `apt` | APT management configuration files |
425 | `apt` | APT management configuration files |
421 | `boot` | Boot and RPi0/1/2/3 configuration files |
426 | `boot` | Boot and RPi 0/1/2/3 configuration files |
422 | `dpkg` | Package Manager configuration |
427 | `dpkg` | Package Manager configuration |
423 | `etc` | Configuration files and rc scripts |
428 | `etc` | Configuration files and rc scripts |
424 | `firstboot` | Scripts that get executed on first boot |
429 | `firstboot` | Scripts that get executed on first boot |
@@ -444,7 +449,7 script -c 'APT_SERVER=ftp.de.debian.org ./rpi23-gen-image.sh' ./build.log
444 ```
449 ```
445
450
446 ## Flashing the image file
451 ## 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 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`.
452 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`.
448
453
449 ##### Flashing examples:
454 ##### Flashing examples:
450 ```shell
455 ```shell
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant