@@ -149,6 +149,9 password, use only in trusted environments. | |||
|
149 | 149 | ##### `ENABLE_HARDNET`=false |
|
150 | 150 | Enable IPv4/IPv6 network stack hardening settings. |
|
151 | 151 | |
|
152 | ##### `CHROOT_SCRIPTS`="" | |
|
153 | Path to a directory with scripts that should be run in the chroot before the image is finally built. Every executable file in this direcory is run in lexicographical order. | |
|
154 | ||
|
152 | 155 | ## Logging of the bootstrapping process |
|
153 | 156 | 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: |
|
154 | 157 |
@@ -97,6 +97,7 ENABLE_IPTABLES=${ENABLE_IPTABLES:=false} | |||
|
97 | 97 | |
|
98 | 98 | # Image chroot path |
|
99 | 99 | R=${BUILDDIR}/chroot |
|
100 | CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""} | |
|
100 | 101 | |
|
101 | 102 | # Packages required for bootstrapping |
|
102 | 103 | REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git-core" |
@@ -615,6 +616,13 chroot_exec apt-get -y clean | |||
|
615 | 616 | chroot_exec apt-get -y autoclean |
|
616 | 617 | chroot_exec apt-get -y autoremove |
|
617 | 618 | |
|
619 | # Invoke custom scripts | |
|
620 | if [ -n "${CHROOT_SCRIPTS}" ]; then | |
|
621 | cp -r "${CHROOT_SCRIPTS}" "${R}/chroot_scripts" | |
|
622 | LANG=C chroot $R bash -c 'for SCRIPT in /chroot_scripts/*; do if [ -f $SCRIPT -a -x $SCRIPT ]; then $SCRIPT; fi done;' | |
|
623 | rm -rf "${R}/chroot_scripts" | |
|
624 | fi | |
|
625 | ||
|
618 | 626 | # Unmount mounted filesystems |
|
619 | 627 | umount -l $R/proc |
|
620 | 628 | umount -l $R/sys |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant