##// END OF EJS Templates
Added ability to install custom packages
Stephen A. Brandli -
r86:d4a066f30735
parent child
Show More
@@ -1,5 +1,6
1 images
1 images
2 custom.d
2 custom.d
3 packages
3 *.swp
4 *.swp
4 *.bak
5 *.bak
5 *.log
6 *.log
@@ -1,303 +1,307
1 # rpi2-gen-image
1 # rpi2-gen-image
2 ## Introduction
2 ## Introduction
3 `rpi2-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for the Raspberry 2 (RPi2) computer. The script at this time only supports the bootstrapping of the current stable Debian 8 "jessie" release.
3 `rpi2-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for the Raspberry 2 (RPi2) computer. The script at this time only supports the bootstrapping of the current stable Debian 8 "jessie" release.
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```
8 ```debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git```
9
9
10 ## Command-line parameters
10 ## Command-line parameters
11 The script accepts certain command-line parameters to enable or disable specific OS features, services and configuration settings. These parameters are passed to the `rpi2-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 `rpi2-gen-image.sh` script.
11 The script accepts certain command-line parameters to enable or disable specific OS features, services and configuration settings. These parameters are passed to the `rpi2-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 `rpi2-gen-image.sh` script.
12
12
13 #####Command-line examples:
13 #####Command-line examples:
14 ```shell
14 ```shell
15 ENABLE_UBOOT=true ./rpi2-gen-image.sh
15 ENABLE_UBOOT=true ./rpi2-gen-image.sh
16 ENABLE_CONSOLE=false ENABLE_IPV6=false ./rpi2-gen-image.sh
16 ENABLE_CONSOLE=false ENABLE_IPV6=false ./rpi2-gen-image.sh
17 ENABLE_WM=xfce4 ENABLE_FBTURBO=true ENABLE_MINBASE=true ./rpi2-gen-image.sh
17 ENABLE_WM=xfce4 ENABLE_FBTURBO=true ENABLE_MINBASE=true ./rpi2-gen-image.sh
18 ENABLE_HARDNET=true ENABLE_IPTABLES=true /rpi2-gen-image.sh
18 ENABLE_HARDNET=true ENABLE_IPTABLES=true /rpi2-gen-image.sh
19 APT_SERVER=ftp.de.debian.org APT_PROXY="http://127.0.0.1:3142/" ./rpi2-gen-image.sh
19 APT_SERVER=ftp.de.debian.org APT_PROXY="http://127.0.0.1:3142/" ./rpi2-gen-image.sh
20 ENABLE_MINBASE=true ./rpi2-gen-image.sh
20 ENABLE_MINBASE=true ./rpi2-gen-image.sh
21 BUILD_KERNEL=true ENABLE_MINBASE=true ENABLE_IPV6=false ./rpi2-gen-image.sh
21 BUILD_KERNEL=true ENABLE_MINBASE=true ENABLE_IPV6=false ./rpi2-gen-image.sh
22 BUILD_KERNEL=true KERNELSRC_DIR=/tmp/linux ./rpi2-gen-image.sh
22 BUILD_KERNEL=true KERNELSRC_DIR=/tmp/linux ./rpi2-gen-image.sh
23 ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi2-gen-image.sh
23 ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi2-gen-image.sh
24 ENABLE_CRYPTFS=true CRYPTFS_PASSWORD=changeme EXPANDROOT=false ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi2-gen-image.sh
24 ENABLE_CRYPTFS=true CRYPTFS_PASSWORD=changeme EXPANDROOT=false ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi2-gen-image.sh
25 ```
25 ```
26
26
27 #### APT settings:
27 #### APT settings:
28 ##### `APT_SERVER`="ftp.debian.org"
28 ##### `APT_SERVER`="ftp.debian.org"
29 Set Debian packages server address. Choose a server from the list of Debian worldwide [mirror sites](https://www.debian.org/mirror/list). Using a nearby server will probably speed-up all required downloads within the bootstrapping process.
29 Set Debian packages server address. Choose a server from the list of Debian worldwide [mirror sites](https://www.debian.org/mirror/list). Using a nearby server will probably speed-up all required downloads within the bootstrapping process.
30
30
31 ##### `APT_PROXY`=""
31 ##### `APT_PROXY`=""
32 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.
32 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.
33
33
34 ##### `APT_INCLUDES`=""
34 ##### `APT_INCLUDES`=""
35 A comma separated list of additional packages to be installed during bootstrapping.
35 A comma separated list of additional packages to be installed during bootstrapping.
36
36
37 #### General system settings:
37 #### General system settings:
38 ##### `HOSTNAME`="rpi2-jessie"
38 ##### `HOSTNAME`="rpi2-jessie"
39 Set system host name. It's recommended that the host name is unique in the corresponding subnet.
39 Set system host name. It's recommended that the host name is unique in the corresponding subnet.
40
40
41 ##### `PASSWORD`="raspberry"
41 ##### `PASSWORD`="raspberry"
42 Set system `root` password. The same password is used for the created user `pi`. It's **STRONGLY** recommended that you choose a custom password.
42 Set system `root` password. The same password is used for the created user `pi`. It's **STRONGLY** recommended that you choose a custom password.
43
43
44 ##### `DEFLOCAL`="en_US.UTF-8"
44 ##### `DEFLOCAL`="en_US.UTF-8"
45 Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. The script variant `minbase` (ENABLE_MINBASE=true) doesn't install `locales`.
45 Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. The script variant `minbase` (ENABLE_MINBASE=true) doesn't install `locales`.
46
46
47 ##### `TIMEZONE`="Europe/Berlin"
47 ##### `TIMEZONE`="Europe/Berlin"
48 Set default system timezone. All available timezones can be found in the `/usr/share/zoneinfo/` directory. This setting can also be changed inside the running OS using the `dpkg-reconfigure tzdata` command.
48 Set default system timezone. All available timezones can be found in the `/usr/share/zoneinfo/` directory. This setting can also be changed inside the running OS using the `dpkg-reconfigure tzdata` command.
49
49
50 ##### `EXPANDROOT`=true
50 ##### `EXPANDROOT`=true
51 Expand the root partition and filesystem automatically on first boot.
51 Expand the root partition and filesystem automatically on first boot.
52
52
53 #### Keyboard settings:
53 #### Keyboard settings:
54 These options are used to configure keyboard layout in `/etc/default/keyboard` for console and Xorg. These settings can also be changed inside the running OS using the `dpkg-reconfigure keyboard-configuration` command.
54 These options are used to configure keyboard layout in `/etc/default/keyboard` for console and Xorg. These settings can also be changed inside the running OS using the `dpkg-reconfigure keyboard-configuration` command.
55
55
56 ##### `XKB_MODEL`=""
56 ##### `XKB_MODEL`=""
57 Set the name of the model of your keyboard type.
57 Set the name of the model of your keyboard type.
58
58
59 ##### `XKB_LAYOUT`=""
59 ##### `XKB_LAYOUT`=""
60 Set the supported keyboard layout(s).
60 Set the supported keyboard layout(s).
61
61
62 ##### `XKB_VARIANT`=""
62 ##### `XKB_VARIANT`=""
63 Set the supported variant(s) of the keyboard layout(s).
63 Set the supported variant(s) of the keyboard layout(s).
64
64
65 ##### `XKB_OPTIONS`=""
65 ##### `XKB_OPTIONS`=""
66 Set extra xkb configuration options.
66 Set extra xkb configuration options.
67
67
68 #### Networking settings (DHCP):
68 #### Networking settings (DHCP):
69 This parameter is used to set up networking auto configuration in `/etc/systemd/network/eth.network`.
69 This parameter is used to set up networking auto configuration in `/etc/systemd/network/eth.network`.
70
70
71 #####`ENABLE_DHCP`=true
71 #####`ENABLE_DHCP`=true
72 Set the system to use DHCP. This requires an DHCP server.
72 Set the system to use DHCP. This requires an DHCP server.
73
73
74 #### Networking settings (static):
74 #### Networking settings (static):
75 These parameters are used to set up a static networking configuration in /etc/systemd/network/eth.network. The following static networking parameters are only supported if `ENABLE_DHCP` was set to `false`.
75 These parameters are used to set up a static networking configuration in /etc/systemd/network/eth.network. The following static networking parameters are only supported if `ENABLE_DHCP` was set to `false`.
76
76
77 #####`NET_ADDRESS`=""
77 #####`NET_ADDRESS`=""
78 Set a static IPv4 or IPv6 address and its prefix, separated by "/", eg. "192.169.0.3/24".
78 Set a static IPv4 or IPv6 address and its prefix, separated by "/", eg. "192.169.0.3/24".
79
79
80 #####`NET_GATEWAY`=""
80 #####`NET_GATEWAY`=""
81 Set the IP address for the default gateway.
81 Set the IP address for the default gateway.
82
82
83 #####`NET_DNS_1`=""
83 #####`NET_DNS_1`=""
84 Set the IP address for the first DNS server.
84 Set the IP address for the first DNS server.
85
85
86 #####`NET_DNS_2`=""
86 #####`NET_DNS_2`=""
87 Set the IP address for the second DNS server.
87 Set the IP address for the second DNS server.
88
88
89 #####`NET_DNS_DOMAINS`=""
89 #####`NET_DNS_DOMAINS`=""
90 Set the default DNS search domains to use for non fully qualified host names.
90 Set the default DNS search domains to use for non fully qualified host names.
91
91
92 #####`NET_NTP_1`=""
92 #####`NET_NTP_1`=""
93 Set the IP address for the first NTP server.
93 Set the IP address for the first NTP server.
94
94
95 #####`NET_NTP_2`=""
95 #####`NET_NTP_2`=""
96 Set the IP address for the second NTP server.
96 Set the IP address for the second NTP server.
97
97
98 #### Basic system features:
98 #### Basic system features:
99 ##### `ENABLE_CONSOLE`=true
99 ##### `ENABLE_CONSOLE`=true
100 Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi2. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system.
100 Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi2. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system.
101
101
102 ##### `ENABLE_IPV6`=true
102 ##### `ENABLE_IPV6`=true
103 Enable IPv6 support. The network interface configuration is managed via systemd-networkd.
103 Enable IPv6 support. The network interface configuration is managed via systemd-networkd.
104
104
105 ##### `ENABLE_SSHD`=true
105 ##### `ENABLE_SSHD`=true
106 Install and enable OpenSSH service. The default configuration of the service doesn't allow `root` to login. Please use the user `pi` instead and `su -` or `sudo` to execute commands as root.
106 Install and enable OpenSSH service. The default configuration of the service doesn't allow `root` to login. Please use the user `pi` instead and `su -` or `sudo` to execute commands as root.
107
107
108 ##### `ENABLE_RSYSLOG`=true
108 ##### `ENABLE_RSYSLOG`=true
109 If set to false, disable and uninstall rsyslog (so logs will be available only
109 If set to false, disable and uninstall rsyslog (so logs will be available only
110 in journal files)
110 in journal files)
111
111
112 ##### `ENABLE_SOUND`=true
112 ##### `ENABLE_SOUND`=true
113 Enable sound hardware and install Advanced Linux Sound Architecture.
113 Enable sound hardware and install Advanced Linux Sound Architecture.
114
114
115 ##### `ENABLE_HWRANDOM`=true
115 ##### `ENABLE_HWRANDOM`=true
116 Enable Hardware Random Number Generator. Strong random numbers are important for most network based communications that use encryption. It's recommended to be enabled.
116 Enable Hardware Random Number Generator. Strong random numbers are important for most network based communications that use encryption. It's recommended to be enabled.
117
117
118 ##### `ENABLE_MINGPU`=false
118 ##### `ENABLE_MINGPU`=false
119 Minimize the amount of shared memory reserved for the GPU. It doesn't seem to be possible to fully disable the GPU.
119 Minimize the amount of shared memory reserved for the GPU. It doesn't seem to be possible to fully disable the GPU.
120
120
121 ##### `ENABLE_DBUS`=true
121 ##### `ENABLE_DBUS`=true
122 Install and enable D-Bus message bus. Please note that systemd should work without D-bus but it's recommended to be enabled.
122 Install and enable D-Bus message bus. Please note that systemd should work without D-bus but it's recommended to be enabled.
123
123
124 ##### `ENABLE_XORG`=false
124 ##### `ENABLE_XORG`=false
125 Install Xorg open-source X Window System.
125 Install Xorg open-source X Window System.
126
126
127 ##### `ENABLE_WM`=""
127 ##### `ENABLE_WM`=""
128 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 `rpi2-gen-image.sh` script has been tested with the following list of window managers: `blackbox`, `openbox`, `fluxbox`, `jwm`, `dwm`, `xfce4`, `awesome`.
128 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 `rpi2-gen-image.sh` script has been tested with the following list of window managers: `blackbox`, `openbox`, `fluxbox`, `jwm`, `dwm`, `xfce4`, `awesome`.
129
129
130 #### Advanced system features:
130 #### Advanced system features:
131 ##### `ENABLE_MINBASE`=false
131 ##### `ENABLE_MINBASE`=false
132 Use debootstrap script variant `minbase` which only includes essential packages and apt. This will reduce the disk usage by about 65 MB.
132 Use debootstrap script variant `minbase` which only includes essential packages and apt. This will reduce the disk usage by about 65 MB.
133
133
134 ##### `ENABLE_REDUCE`=false
134 ##### `ENABLE_REDUCE`=false
135 Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information.
135 Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information.
136
136
137 ##### `ENABLE_UBOOT`=false
137 ##### `ENABLE_UBOOT`=false
138 Replace default RPi2 second stage bootloader (bootcode.bin) with U-Boot bootloader. U-Boot can boot images via the network using the BOOTP/TFTP protocol.
138 Replace default RPi2 second stage bootloader (bootcode.bin) with U-Boot bootloader. U-Boot can boot images via the network using the BOOTP/TFTP protocol.
139
139
140 ##### `ENABLE_FBTURBO`=false
140 ##### `ENABLE_FBTURBO`=false
141 Install and enable the hardware accelerated Xorg video driver `fbturbo`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling.
141 Install and enable the hardware accelerated Xorg video driver `fbturbo`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling.
142
142
143 ##### `ENABLE_IPTABLES`=false
143 ##### `ENABLE_IPTABLES`=false
144 Enable iptables IPv4/IPv6 firewall. Simplified ruleset: Allow all outgoing connections. Block all incoming connections except to OpenSSH service.
144 Enable iptables IPv4/IPv6 firewall. Simplified ruleset: Allow all outgoing connections. Block all incoming connections except to OpenSSH service.
145
145
146 ##### `ENABLE_USER`=true
146 ##### `ENABLE_USER`=true
147 Create non-root user with password raspberry. Unless overridden with `USER_NAME`=user, username will be `pi`.
147 Create non-root user with password raspberry. Unless overridden with `USER_NAME`=user, username will be `pi`.
148
148
149 ##### `USER_NAME`=pi
149 ##### `USER_NAME`=pi
150 Non-root user to create. Ignored if `ENABLE_USER`=false
150 Non-root user to create. Ignored if `ENABLE_USER`=false
151
151
152 ##### `ENABLE_ROOT`=true
152 ##### `ENABLE_ROOT`=true
153 Set root user password so root login will be enabled
153 Set root user password so root login will be enabled
154
154
155 ##### `ENABLE_ROOT_SSH`=true
155 ##### `ENABLE_ROOT_SSH`=true
156 Enable password root login via SSH. May be a security risk with default
156 Enable password root login via SSH. May be a security risk with default
157 password, use only in trusted environments.
157 password, use only in trusted environments.
158
158
159 ##### `ENABLE_HARDNET`=false
159 ##### `ENABLE_HARDNET`=false
160 Enable IPv4/IPv6 network stack hardening settings.
160 Enable IPv4/IPv6 network stack hardening settings.
161
161
162 ##### `ENABLE_SPLITFS`=false
162 ##### `ENABLE_SPLITFS`=false
163 Enable having root partition on an USB drive by creating two image files: one for the `/boot/firmware` mount point, and another for `/`.
163 Enable having root partition on an USB drive by creating two image files: one for the `/boot/firmware` mount point, and another for `/`.
164
164
165 ##### `CHROOT_SCRIPTS`=""
165 ##### `CHROOT_SCRIPTS`=""
166 Path to a directory with scripts that should be run in the chroot before the image is finally built. Every executable file in this directory is run in lexicographical order.
166 Path to a directory with scripts that should be run in the chroot before the image is finally built. Every executable file in this directory is run in lexicographical order.
167
167
168 ##### `ENABLE_INITRAMFS`=false
168 ##### `ENABLE_INITRAMFS`=false
169 Create an initramfs that that will be loaded during the Linux startup process. `ENABLE_INITRAMFS` will automatically get enabled if `ENABLE_CRYPTFS`=true. This parameter will be ignored if `BUILD_KERNEL`=false.
169 Create an initramfs that that will be loaded during the Linux startup process. `ENABLE_INITRAMFS` will automatically get enabled if `ENABLE_CRYPTFS`=true. This parameter will be ignored if `BUILD_KERNEL`=false.
170
170
171 #### Kernel compilation:
171 #### Kernel compilation:
172 ##### `BUILD_KERNEL`=false
172 ##### `BUILD_KERNEL`=false
173 Build and install the latest RPi2 Linux kernel. Currently only the default RPi2 kernel configuration is used.
173 Build and install the latest RPi2 Linux kernel. Currently only the default RPi2 kernel configuration is used.
174
174
175 ##### `KERNEL_REDUCE`=false
175 ##### `KERNEL_REDUCE`=false
176 Reduce the size of the generated kernel by removing unwanted device, network and filesystem drivers (experimental).
176 Reduce the size of the generated kernel by removing unwanted device, network and filesystem drivers (experimental).
177
177
178 ##### `KERNEL_THREADS`=1
178 ##### `KERNEL_THREADS`=1
179 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.
179 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.
180
180
181 ##### `KERNEL_HEADERS`=true
181 ##### `KERNEL_HEADERS`=true
182 Install kernel headers with built kernel.
182 Install kernel headers with built kernel.
183
183
184 ##### `KERNEL_MENUCONFIG`=false
184 ##### `KERNEL_MENUCONFIG`=false
185 Start `make menuconfig` interactive menu-driven kernel configuration. The script will continue after `make menuconfig` was terminated.
185 Start `make menuconfig` interactive menu-driven kernel configuration. The script will continue after `make menuconfig` was terminated.
186
186
187 ##### `KERNEL_REMOVESRC`=true
187 ##### `KERNEL_REMOVESRC`=true
188 Remove all kernel sources from the generated OS image after it was built and installed.
188 Remove all kernel sources from the generated OS image after it was built and installed.
189
189
190 ##### `KERNELSRC_DIR`=""
190 ##### `KERNELSRC_DIR`=""
191 Path to a directory of [RaspberryPi Linux kernel sources](https://github.com/raspberrypi/linux) that will be copied, configured, build and installed inside the chroot.
191 Path to a directory of [RaspberryPi Linux kernel sources](https://github.com/raspberrypi/linux) that will be copied, configured, build and installed inside the chroot.
192
192
193 ##### `KERNELSRC_CLEAN`=false
193 ##### `KERNELSRC_CLEAN`=false
194 Clean the existing kernel sources directory `KERNELSRC_DIR` (using `make mrproper`) after it was copied to the chroot and before the compilation of the kernel has started. This parameter will be ignored if no `KERNELSRC_DIR` was specified or if `KERNELSRC_PREBUILT`=true.
194 Clean the existing kernel sources directory `KERNELSRC_DIR` (using `make mrproper`) after it was copied to the chroot and before the compilation of the kernel has started. This parameter will be ignored if no `KERNELSRC_DIR` was specified or if `KERNELSRC_PREBUILT`=true.
195
195
196 ##### `KERNELSRC_CONFIG`=true
196 ##### `KERNELSRC_CONFIG`=true
197 Run `make bcm2709_defconfig` (and optional `make menuconfig`) to configure the kernel sources before building. This parameter is automatically set to `true` if no existing kernel sources directory was specified using `KERNELSRC_DIR`. This parameter is ignored if `KERNELSRC_PREBUILT`=true.
197 Run `make bcm2709_defconfig` (and optional `make menuconfig`) to configure the kernel sources before building. This parameter is automatically set to `true` if no existing kernel sources directory was specified using `KERNELSRC_DIR`. This parameter is ignored if `KERNELSRC_PREBUILT`=true.
198
198
199 ##### `KERNELSRC_PREBUILT`=false
199 ##### `KERNELSRC_PREBUILT`=false
200 With this parameter set to true the script expects the existing kernel sources directory to be already successfully cross-compiled. The parameters `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG` and `KERNEL_MENUCONFIG` are ignored and no kernel compilation tasks are performed.
200 With this parameter set to true the script expects the existing kernel sources directory to be already successfully cross-compiled. The parameters `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG` and `KERNEL_MENUCONFIG` are ignored and no kernel compilation tasks are performed.
201
201
202 ##### `FIRMWAREDIR`=""
202 ##### `FIRMWAREDIR`=""
203 The directory containing a local copy of the firmware from the [RaspberryPi firmware project](https://github.com/raspberrypi/firmware). Default is to download the latest firmware directly from the project.
203 The directory containing a local copy of the firmware from the [RaspberryPi firmware project](https://github.com/raspberrypi/firmware). Default is to download the latest firmware directly from the project.
204
204
205 #### Reduce disk usage:
205 #### Reduce disk usage:
206 The following list of parameters is ignored if `ENABLE_REDUCE`=false.
206 The following list of parameters is ignored if `ENABLE_REDUCE`=false.
207
207
208 ##### `REDUCE_APT`=true
208 ##### `REDUCE_APT`=true
209 Configure APT to use compressed package repository lists and no package caching files.
209 Configure APT to use compressed package repository lists and no package caching files.
210
210
211 ##### `REDUCE_DOC`=true
211 ##### `REDUCE_DOC`=true
212 Remove all doc files (harsh). Configure APT to not include doc files on future `apt-get` package installations.
212 Remove all doc files (harsh). Configure APT to not include doc files on future `apt-get` package installations.
213
213
214 ##### `REDUCE_MAN`=true
214 ##### `REDUCE_MAN`=true
215 Remove all man pages and info files (harsh). Configure APT to not include man pages on future `apt-get` package installations.
215 Remove all man pages and info files (harsh). Configure APT to not include man pages on future `apt-get` package installations.
216
216
217 ##### `REDUCE_VIM`=false
217 ##### `REDUCE_VIM`=false
218 Replace `vim-tiny` package by `levee` a tiny vim clone.
218 Replace `vim-tiny` package by `levee` a tiny vim clone.
219
219
220 ##### `REDUCE_BASH`=false
220 ##### `REDUCE_BASH`=false
221 Remove `bash` package and switch to `dash` shell (experimental).
221 Remove `bash` package and switch to `dash` shell (experimental).
222
222
223 ##### `REDUCE_HWDB`=true
223 ##### `REDUCE_HWDB`=true
224 Remove PCI related hwdb files (experimental).
224 Remove PCI related hwdb files (experimental).
225
225
226 ##### `REDUCE_SSHD`=true
226 ##### `REDUCE_SSHD`=true
227 Replace `openssh-server` with `dropbear`.
227 Replace `openssh-server` with `dropbear`.
228
228
229 ##### `REDUCE_LOCALE`=true
229 ##### `REDUCE_LOCALE`=true
230 Remove all `locale` translation files.
230 Remove all `locale` translation files.
231
231
232 #### Encrypted root partition:
232 #### Encrypted root partition:
233
233
234 ##### `ENABLE_CRYPTFS`=false
234 ##### `ENABLE_CRYPTFS`=false
235 Enable full system encryption with dm-crypt. Setup a fully LUKS encrypted root partition (aes-xts-plain64:sha512) and generate required initramfs. The /boot directory will not be encrypted. This parameter will be ignored if `BUILD_KERNEL`=false. `ENABLE_CRYPTFS` is experimental. SSH-to-initramfs is currently not supported but will be soon - feel free to help.
235 Enable full system encryption with dm-crypt. Setup a fully LUKS encrypted root partition (aes-xts-plain64:sha512) and generate required initramfs. The /boot directory will not be encrypted. This parameter will be ignored if `BUILD_KERNEL`=false. `ENABLE_CRYPTFS` is experimental. SSH-to-initramfs is currently not supported but will be soon - feel free to help.
236
236
237 ##### `CRYPTFS_PASSWORD`=""
237 ##### `CRYPTFS_PASSWORD`=""
238 Set password of the encrypted root partition. This parameter is mandatory if `ENABLE_CRYPTFS`=true.
238 Set password of the encrypted root partition. This parameter is mandatory if `ENABLE_CRYPTFS`=true.
239
239
240 ##### `CRYPTFS_MAPPING`="secure"
240 ##### `CRYPTFS_MAPPING`="secure"
241 Set name of dm-crypt managed device-mapper mapping.
241 Set name of dm-crypt managed device-mapper mapping.
242
242
243 ##### `CRYPTFS_CIPHER`="aes-xts-plain64:sha512"
243 ##### `CRYPTFS_CIPHER`="aes-xts-plain64:sha512"
244 Set cipher specification string. `aes-xts*` ciphers are strongly recommended.
244 Set cipher specification string. `aes-xts*` ciphers are strongly recommended.
245
245
246 ##### `CRYPTFS_XTSKEYSIZE`=512
246 ##### `CRYPTFS_XTSKEYSIZE`=512
247 Sets key size in bits. The argument has to be a multiple of 8.
247 Sets key size in bits. The argument has to be a multiple of 8.
248
248
249 ## Understanding the script
249 ## Understanding the script
250 The functions of this script that are required for the different stages of the bootstrapping are split up into single files located inside the `bootstrap.d` directory. During the bootstrapping every script in this directory gets executed in lexicographical order:
250 The functions of this script that are required for the different stages of the bootstrapping are split up into single files located inside the `bootstrap.d` directory. During the bootstrapping every script in this directory gets executed in lexicographical order:
251
251
252 | Script | Description |
252 | Script | Description |
253 | --- | --- |
253 | --- | --- |
254 | `10-bootstrap.sh` | Debootstrap basic system |
254 | `10-bootstrap.sh` | Debootstrap basic system |
255 | `11-apt.sh` | Setup APT repositories |
255 | `11-apt.sh` | Setup APT repositories |
256 | `12-locale.sh` | Setup Locales and keyboard settings |
256 | `12-locale.sh` | Setup Locales and keyboard settings |
257 | `13-kernel.sh` | Build and install RPi2 Kernel |
257 | `13-kernel.sh` | Build and install RPi2 Kernel |
258 | `20-networking.sh` | Setup Networking |
258 | `20-networking.sh` | Setup Networking |
259 | `21-firewall.sh` | Setup Firewall |
259 | `21-firewall.sh` | Setup Firewall |
260 | `30-security.sh` | Setup Users and Security settings |
260 | `30-security.sh` | Setup Users and Security settings |
261 | `31-logging.sh` | Setup Logging |
261 | `31-logging.sh` | Setup Logging |
262 | `41-uboot.sh` | Build and Setup U-Boot |
262 | `41-uboot.sh` | Build and Setup U-Boot |
263 | `42-fbturbo.sh` | Build and Setup fbturbo Xorg driver |
263 | `42-fbturbo.sh` | Build and Setup fbturbo Xorg driver |
264 | `50-firstboot.sh` | First boot actions |
264 | `50-firstboot.sh` | First boot actions |
265 | `99-reduce.sh` | Reduce the disk space usage |
265 | `99-reduce.sh` | Reduce the disk space usage |
266
266
267 All the required configuration files that will be copied to the generated OS image are located inside the `files` directory. It is not recommended to modify these configuration files manually.
267 All the required configuration files that will be copied to the generated OS image are located inside the `files` directory. It is not recommended to modify these configuration files manually.
268
268
269 | Directory | Description |
269 | Directory | Description |
270 | --- | --- |
270 | --- | --- |
271 | `apt` | APT management configuration files |
271 | `apt` | APT management configuration files |
272 | `boot` | Boot and RPi2 configuration files |
272 | `boot` | Boot and RPi2 configuration files |
273 | `dpkg` | Package Manager configuration |
273 | `dpkg` | Package Manager configuration |
274 | `firstboot` | Scripts that get executed on first boot |
274 | `firstboot` | Scripts that get executed on first boot |
275 | `initramfs` | Initramfs scripts |
275 | `initramfs` | Initramfs scripts |
276 | `iptables` | Firewall configuration files |
276 | `iptables` | Firewall configuration files |
277 | `locales` | Locales configuration |
277 | `locales` | Locales configuration |
278 | `modules` | Kernel Modules configuration |
278 | `modules` | Kernel Modules configuration |
279 | `mount` | Fstab configuration |
279 | `mount` | Fstab configuration |
280 | `network` | Networking configuration files |
280 | `network` | Networking configuration files |
281 | `sysctl.d` | Swapping and Network Hardening configuration |
281 | `sysctl.d` | Swapping and Network Hardening configuration |
282 | `xorg` | fbturbo Xorg driver configuration |
282 | `xorg` | fbturbo Xorg driver configuration |
283
283
284 Debian custom packages, i.e. those not in the debian repositories, can be installed by placing them in the `packages` directory. They are installed immediately after packages from the repositories are installed. Any dependencies listed in the custom packages will be downloaded automatically from the repositories. Do not list these custom packages in `APT_INCLUDES`.
285
286 Scripts in the custom.d directory will be executed after all other installation is complete but before the image is created.
287
284 ## Logging of the bootstrapping process
288 ## Logging of the bootstrapping process
285 All information related to the bootstrapping process and the commands executed by the `rpi2-gen-image.sh` script can easily be saved into a logfile. The common shell command `script` can be used for this purpose:
289 All information related to the bootstrapping process and the commands executed by the `rpi2-gen-image.sh` script can easily be saved into a logfile. The common shell command `script` can be used for this purpose:
286
290
287 ```shell
291 ```shell
288 script -c 'APT_SERVER=ftp.de.debian.org ./rpi2-gen-image.sh' ./build.log
292 script -c 'APT_SERVER=ftp.de.debian.org ./rpi2-gen-image.sh' ./build.log
289 ```
293 ```
290
294
291 ## Flashing the image file
295 ## Flashing the image file
292 After the image file was successfully created by the `rpi2-gen-image.sh` script it can be copied to the microSD card that will be used by the RPi2 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`.
296 After the image file was successfully created by the `rpi2-gen-image.sh` script it can be copied to the microSD card that will be used by the RPi2 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`.
293
297
294 #####Flashing examples:
298 #####Flashing examples:
295 ```shell
299 ```shell
296 bmaptool copy ./images/jessie/2015-12-13-debian-jessie.img /dev/mmcblk0
300 bmaptool copy ./images/jessie/2015-12-13-debian-jessie.img /dev/mmcblk0
297 dd bs=4M if=./images/jessie/2015-12-13-debian-jessie.img of=/dev/mmcblk0
301 dd bs=4M if=./images/jessie/2015-12-13-debian-jessie.img of=/dev/mmcblk0
298 ```
302 ```
299 If you have set `ENABLE_SPLITFS`, copy the `-frmw` image on the microSD card, then the `-root` one on the USB drive:
303 If you have set `ENABLE_SPLITFS`, copy the `-frmw` image on the microSD card, then the `-root` one on the USB drive:
300 ```shell
304 ```shell
301 bmaptool copy ./images/jessie/2015-12-13-debian-jessie-frmw.img /dev/mmcblk0
305 bmaptool copy ./images/jessie/2015-12-13-debian-jessie-frmw.img /dev/mmcblk0
302 bmaptool copy ./images/jessie/2015-12-13-debian-jessie-root.img /dev/sdc
306 bmaptool copy ./images/jessie/2015-12-13-debian-jessie-root.img /dev/sdc
303 ```
307 ```
@@ -1,37 +1,46
1 #
1 #
2 # Setup APT repositories
2 # Setup APT repositories
3 #
3 #
4
4
5 # Load utility functions
5 # Load utility functions
6 . ./functions.sh
6 . ./functions.sh
7
7
8 # Install and setup APT proxy configuration
8 # Install and setup APT proxy configuration
9 if [ -z "$APT_PROXY" ] ; then
9 if [ -z "$APT_PROXY" ] ; then
10 install_readonly files/apt/10proxy "${ETCDIR}/apt/apt.conf.d/10proxy"
10 install_readonly files/apt/10proxy "${ETCDIR}/apt/apt.conf.d/10proxy"
11 sed -i "s/\"\"/\"${APT_PROXY}\"/" "${ETCDIR}/apt/apt.conf.d/10proxy"
11 sed -i "s/\"\"/\"${APT_PROXY}\"/" "${ETCDIR}/apt/apt.conf.d/10proxy"
12 fi
12 fi
13
13
14 if [ "$BUILD_KERNEL" = false ] ; then
14 if [ "$BUILD_KERNEL" = false ] ; then
15 # Install APT pinning configuration for flash-kernel package
15 # Install APT pinning configuration for flash-kernel package
16 install_readonly files/apt/flash-kernel "${ETCDIR}/apt/preferences.d/flash-kernel"
16 install_readonly files/apt/flash-kernel "${ETCDIR}/apt/preferences.d/flash-kernel"
17
17
18 # Install APT sources.list
18 # Install APT sources.list
19 install_readonly files/apt/sources.list "${ETCDIR}/apt/sources.list"
19 install_readonly files/apt/sources.list "${ETCDIR}/apt/sources.list"
20 echo "deb https://repositories.collabora.co.uk/debian ${RELEASE} rpi2" >> "${ETCDIR}/apt/sources.list"
20 echo "deb https://repositories.collabora.co.uk/debian ${RELEASE} rpi2" >> "${ETCDIR}/apt/sources.list"
21
21
22 # Upgrade collabora package index and install collabora keyring
22 # Upgrade collabora package index and install collabora keyring
23 chroot_exec apt-get -qq -y update
23 chroot_exec apt-get -qq -y update
24 chroot_exec apt-get -qq -y --force-yes install collabora-obs-archive-keyring
24 chroot_exec apt-get -qq -y --force-yes install collabora-obs-archive-keyring
25 else # BUILD_KERNEL=true
25 else # BUILD_KERNEL=true
26 # Install APT sources.list
26 # Install APT sources.list
27 install_readonly files/apt/sources.list "${ETCDIR}/apt/sources.list"
27 install_readonly files/apt/sources.list "${ETCDIR}/apt/sources.list"
28
28
29 # Use specified APT server and release
29 # Use specified APT server and release
30 sed -i "s/\/ftp.debian.org\//\/${APT_SERVER}\//" "${ETCDIR}/apt/sources.list"
30 sed -i "s/\/ftp.debian.org\//\/${APT_SERVER}\//" "${ETCDIR}/apt/sources.list"
31 sed -i "s/ jessie/ ${RELEASE}/" "${ETCDIR}/apt/sources.list"
31 sed -i "s/ jessie/ ${RELEASE}/" "${ETCDIR}/apt/sources.list"
32 fi
32 fi
33
33
34 # Upgrade package index and update all installed packages and changed dependencies
34 # Upgrade package index and update all installed packages and changed dependencies
35 chroot_exec apt-get -qq -y update
35 chroot_exec apt-get -qq -y update
36 chroot_exec apt-get -qq -y -u dist-upgrade
36 chroot_exec apt-get -qq -y -u dist-upgrade
37
38 if [ -d packages ] ; then
39 for package in packages/*.deb ; do
40 cp $package ${R}/tmp
41 chroot_exec dpkg --unpack /tmp/$(basename $package)
42 done
43 fi
44 chroot_exec apt-get -qq -y -f install
45
37 chroot_exec apt-get -qq -y check
46 chroot_exec apt-get -qq -y check
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant