From d4a066f30735ea721a85f210f9a7526bee144fd9 2016-06-08 05:39:50 From: Stephen A. Brandli Date: 2016-06-08 05:39:50 Subject: [PATCH] Added ability to install custom packages --- diff --git a/.gitignore b/.gitignore index 239ef3c..a65ad1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ images custom.d +packages *.swp *.bak *.log diff --git a/README.md b/README.md index 2f43742..3179047 100644 --- a/README.md +++ b/README.md @@ -281,6 +281,10 @@ All the required configuration files that will be copied to the generated OS ima | `sysctl.d` | Swapping and Network Hardening configuration | | `xorg` | fbturbo Xorg driver configuration | +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`. + +Scripts in the custom.d directory will be executed after all other installation is complete but before the image is created. + ## Logging of the bootstrapping process 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: diff --git a/bootstrap.d/11-apt.sh b/bootstrap.d/11-apt.sh index 1d32051..991e7e1 100644 --- a/bootstrap.d/11-apt.sh +++ b/bootstrap.d/11-apt.sh @@ -34,4 +34,13 @@ fi # Upgrade package index and update all installed packages and changed dependencies chroot_exec apt-get -qq -y update chroot_exec apt-get -qq -y -u dist-upgrade + +if [ -d packages ] ; then + for package in packages/*.deb ; do + cp $package ${R}/tmp + chroot_exec dpkg --unpack /tmp/$(basename $package) + done +fi +chroot_exec apt-get -qq -y -f install + chroot_exec apt-get -qq -y check