├── .dockerignore ├── .gitignore ├── CLA.md ├── CODE_OF_CONDUCT.md ├── Dockerfile ├── LICENSE ├── README.md ├── build-docker.sh ├── build.sh ├── depends ├── docker-compose.yml ├── export-image ├── 00-allow-rerun │ └── 00-run.sh ├── 01-set-sources │ ├── 00-patches │ │ ├── 0-sources.diff │ │ └── series │ └── 01-run.sh ├── 02-network │ ├── 01-run.sh │ └── files │ │ └── resolv.conf ├── 03-set-partuuid │ └── 00-run.sh ├── 04-finalise │ ├── 01-run.sh │ └── files │ │ └── LICENSE.oracle └── prerun.sh ├── export-noobs ├── 00-release │ ├── 00-run.sh │ └── files │ │ ├── OS.png │ │ ├── marketing │ │ └── slides_vga │ │ │ ├── A.png │ │ │ ├── B.png │ │ │ ├── C.png │ │ │ ├── D.png │ │ │ ├── E.png │ │ │ ├── F.png │ │ │ └── G.png │ │ ├── os.json │ │ ├── partition_setup.sh │ │ ├── partitions.json │ │ └── release_notes.txt └── prerun.sh ├── scripts ├── common ├── dependencies_check └── remove-comments.sed ├── stage0 ├── 00-configure-apt │ ├── 00-run.sh │ └── files │ │ ├── 51cache │ │ ├── raspberrypi.gpg.key │ │ ├── raspi.list │ │ └── sources.list ├── 01-locale │ ├── 00-debconf │ └── 00-packages ├── 02-firmware │ └── 01-packages ├── files │ └── raspberrypi.gpg └── prerun.sh ├── stage1 ├── 00-boot-files │ ├── 00-run.sh │ └── files │ │ ├── cmdline.txt │ │ └── config.txt ├── 01-sys-tweaks │ ├── 00-patches │ │ ├── 01-bashrc.diff │ │ └── series │ ├── 00-run.sh │ └── files │ │ ├── fstab │ │ └── noclear.conf ├── 02-net-tweaks │ ├── 00-packages │ ├── 00-patches │ │ ├── 01-hosts.diff │ │ └── series │ ├── 00-run.sh │ └── files │ │ ├── hostname │ │ ├── interfaces │ │ └── ipv6.conf ├── 03-install-packages │ └── 00-packages └── prerun.sh ├── stage2 ├── 00-copies-and-fills │ └── 01-packages ├── 01-sys-tweaks │ ├── 00-debconf │ ├── 00-packages │ ├── 00-packages-nr │ ├── 00-patches │ │ ├── 01-useradd.diff │ │ ├── 02-swap.diff │ │ ├── 04-inputrc.diff │ │ ├── 05-path.diff │ │ ├── 07-resize-init.diff │ │ └── series │ ├── 01-run.sh │ └── files │ │ ├── 50raspi │ │ ├── 90-qemu.rules │ │ ├── console-setup │ │ ├── rc.local │ │ ├── resize2fs_once │ │ └── ttyoutput.conf ├── 02-net-tweaks │ ├── 00-packages │ ├── 01-run.sh │ └── files │ │ ├── wait.conf │ │ └── wpa_supplicant.conf ├── 03-set-timezone │ └── 02-run.sh └── prerun.sh ├── stage3 ├── 00-hassbian-repo │ ├── 00-run.sh │ └── files │ │ └── hassbian.list ├── 01-install-packages │ └── 00-packages ├── 02-tweaks │ └── 00-run.sh ├── 03-cleanup │ └── 00-run.sh ├── EXPORT_IMAGE └── prerun.sh └── stage4 ├── 00-hassbian-repo ├── 00-run.sh └── files │ └── hassbian.list ├── 01-install-packages └── 00-packages ├── 02-tweaks └── 00-run.sh ├── 03-cleanup └── 00-run.sh ├── EXPORT_IMAGE └── prerun.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | output/ 2 | work/ 3 | deploy/ 4 | apt-cacher-ng/ 5 | .git/objects/* 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | deploy/* 2 | work/* 3 | config 4 | postrun.sh 5 | SKIP 6 | SKIP_IMAGES 7 | .pc 8 | *-pc 9 | apt-cacher-ng/ 10 | -------------------------------------------------------------------------------- /CLA.md: -------------------------------------------------------------------------------- 1 | # Contributor License Agreement 2 | 3 | The following terms are used throughout this agreement: 4 | 5 | **You** - the person or legal entity including its affiliates asked to accept this agreement. 6 | An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it. 7 | 8 | **Project** - is an umbrella term that refers to any and all Home Assistant open source projects. 9 | 10 | **Contribution** - any type of work that is submitted to a Project, including any modifications or additions to existing work. 11 | 12 | **Submitted** - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or 13 | verbal communication with Home Assistant, contributors or maintainers. 14 | 15 | # 1. Grant of Copyright License. 16 | 17 | Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, 18 | users and to Home Assistant a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, 19 | prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your contributions and such 20 | derivative works. Except for this license, You reserve all rights, title, and interest in your contributions. 21 | 22 | # 2. Grant of Patent License. 23 | 24 | Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, users and to 25 | Home Assistant a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent 26 | license to make, have made, use, offer to sell, sell, import, and otherwise transfer your contributions, where such license 27 | applies only to those patent claims licensable by you that are necessarily infringed by your contribution or by combination of 28 | your contribution with the project to which this contribution was submitted. 29 | 30 | If any entity institutes patent litigation - including cross-claim or counterclaim in a lawsuit - against You alleging that 31 | your contribution or any project it was submitted to constitutes or is responsible for direct or contributory patent infringement, 32 | then any patent licenses granted to that entity under this agreement shall terminate as of the date such litigation is filed. 33 | 34 | # 3. Source of Contribution. 35 | 36 | Your contribution is either your original creation, based upon previous work that, to the best of your knowledge, 37 | is covered under an appropriate open source license and you have the right under that license to submit that work with modifications, 38 | whether created in whole or in part by you, or you have clearly identified the source of the contribution and any license or other 39 | restriction (like related patents, trademarks, and license agreements) of which you are personally aware. 40 | 41 | ## Attribution 42 | 43 | This Contributor License Agreement is adapted from the [GitHub CLA][github-cla]. 44 | 45 | ## Signing 46 | 47 | To sign this CLA you must first submit a pull request to a repository under the Home Assistant organization. 48 | 49 | ## Adoption 50 | 51 | This Contributor License Agreement (CLA) was first announced on January 21st, 2017 in [this][cla-blog] blog post and adopted January 28th, 2017. 52 | 53 | [github-cla]: https://cla.github.com/agreement 54 | [cla-blog]: https://home-assistant.io/blog/2017/01/21/home-assistant-governance/ 55 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at [safety@home-assistant.io][email]. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available [here][version]. 72 | 73 | ## Adoption 74 | 75 | This Code of Conduct was first adopted January 21st, 2017 and announced in [this][coc-blog] blog post. 76 | 77 | [homepage]: http://contributor-covenant.org 78 | [version]: http://contributor-covenant.org/version/1/4/ 79 | [email]: mailto:safety@home-assistant.io 80 | [coc-blog]: https://home-assistant.io/blog/2017/01/21/home-assistant-governance/ 81 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch 2 | 3 | ENV DEBIAN_FRONTEND noninteractive 4 | 5 | RUN apt-get -y update && \ 6 | apt-get -y install \ 7 | git vim parted \ 8 | quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \ 9 | bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod\ 10 | && rm -rf /var/lib/apt/lists/* 11 | 12 | COPY . /pi-gen/ 13 | 14 | VOLUME [ "/pi-gen/work", "/pi-gen/deploy"] 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Raspberry Pi (Trading) Ltd. 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | 11 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Fork of `pi_gen` by [@RPI-Distro](https://github.com/RPi-Distro/pi-gen). 2 | 3 | ## Building your own 4 | The Haspbian image is built with the same script that generates the official [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) image's from the [Raspberry Pi Foundation](https://www.raspberrypi.org/about/). 5 | 6 | By default the Haspbian image is built on a Debian 8 droplet on Digital Ocean and takes about 30 minutes to build on the cheapest droplet. Dependencies and everything is handled by the build script with the exception of `git`. 7 | 8 | Since this image is based on [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) it keeps the default password and username from [Raspbian](https://www.raspberrypi.org/downloads/raspbian/). Default user for use locally or over ssh is `pi` and the password is `raspberry`. 9 | 10 | Build instructions: 11 | - Install git. `sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install git` 12 | - Clone the `rpi_gen` code. `git clone https://github.com/home-assistant/pi-gen.git` 13 | - Create a file in the current folder named `config`. More about it's contents below. 14 | - Run the build script, with sudo or as root. `sudo ./build.sh` 15 | - Wait ~30 minutes for build to complete. 16 | - Retrieve your freshly built Raspberry Pi image from the `rpi_gen\deploy` folder. 17 | 18 | 19 | ======= 20 | 21 | ## Dependencies 22 | 23 | pi-gen runs on Debian based operating systems. Currently it is only supported on 24 | either Debian Stretch or Ubuntu Xenial and is known to have issues building on 25 | earlier releases of these systems. On other Linux distributions it may be possible 26 | to use the Docker build described below. 27 | 28 | To install the required dependencies for pi-gen you should run: 29 | 30 | ```bash 31 | apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \ 32 | dosfstools bsdtar libcap2-bin grep rsync xz-utils file git curl 33 | ``` 34 | 35 | The file `depends` contains a list of tools needed. The format of this 36 | package is `[:]`. 37 | 38 | 39 | ## Config 40 | 41 | Upon execution, `build.sh` will source the file `config` in the current 42 | working directory. This bash shell fragment is intended to set needed 43 | environment variables. 44 | 45 | The following environment variables are supported: 46 | 47 | * `APT_PROXY`, proxy/cache URL to be included in the build 48 | 49 | * `IMG_NAME`, the name of the distribution to build (required) 50 | The name of the image to build with the current stage directories. Setting 51 | `IMG_NAME=Raspbian` is logical for an unmodified RPi-Distro/pi-gen build, 52 | but you should use something else for a customized version. Export files 53 | in stages may add suffixes to `IMG_NAME`. 54 | 55 | * `APT_PROXY` (Default: unset) 56 | 57 | If you require the use of an apt proxy, set it here. This proxy setting 58 | will not be included in the image, making it safe to use an `apt-cacher` or 59 | similar package for development. 60 | 61 | If you have Docker installed, you can set up a local apt caching proxy to 62 | like speed up subsequent builds like this: 63 | 64 | docker-compose up -d 65 | echo 'APT_PROXY=http://172.17.0.1:3142' >> config 66 | 67 | * `BASE_DIR` (Default: location of `build.sh`) 68 | 69 | **CAUTION**: Currently, changing this value will probably break build.sh 70 | 71 | Top-level directory for `pi-gen`. Contains stage directories, build 72 | scripts, and by default both work and deployment directories. 73 | 74 | * `WORK_DIR` (Default: `"$BASE_DIR/work"`) 75 | 76 | Directory in which `pi-gen` builds the target system. This value can be 77 | changed if you have a suitably large, fast storage location for stages to 78 | be built and cached. Note, `WORK_DIR` stores a complete copy of the target 79 | system for each build stage, amounting to tens of gigabytes in the case of 80 | Raspbian. 81 | 82 | **CAUTION**: If your working directory is on an NTFS partition you probably won't be able to build. Make sure this is a proper Linux filesystem. 83 | 84 | * `DEPLOY_DIR` (Default: `"$BASE_DIR/deploy"`) 85 | 86 | Output directory for target system images and NOOBS bundles. 87 | 88 | ======= 89 | ======= 90 | * `DEPLOY_ZIP` (Default: `1`) 91 | 92 | Setting to `0` will deploy the actual image (`.img`) instead of a zipped image (`.zip`). 93 | 94 | * `USE_QEMU` (Default: `"0"`) 95 | 96 | Setting to '1' enables the QEMU mode - creating an image that can be mounted via QEMU for an emulated 97 | environment. These images include "-qemu" in the image file name. 98 | 99 | * `FIRST_USER_NAME` (Default: "pi" ) 100 | 101 | Username for the first user 102 | 103 | * `FIRST_USER_PASS` (Default: "raspberry") 104 | 105 | Password for the first user 106 | 107 | * `WPA_ESSID`, `WPA_PASSWORD` and `WPA_COUNTRY` (Default: unset) 108 | 109 | If these are set, they are use to configure `wpa_supplicant.conf`, so that the raspberry pi can automatically connect to a wifi network on first boot. 110 | 111 | * `ENABLE_SSH` (Default: `0`) 112 | 113 | Setting to `1` will enable ssh server for remote log in. Note that if you are using a common password such as the defaults there is a high risk of attackers taking over you RaspberryPi. 114 | 115 | * `STAGE_LIST` (Default: `stage*`) 116 | 117 | If set, then instead of working through the numeric stages in order, this list will be followed. For example setting to `stage0 stage1 mystage stage2` will run the contents of `mystage` before stage2. An absolute or relative path can be given for stages outside the pi-gen directory. 118 | 119 | * `WPA_ESSID`, `WPA_PASSWORD` and `WPA_COUNTRY` (Default: unset) 120 | 121 | If these are set, they are use to configure `wpa_supplicant.conf`, so that the raspberry pi can automatically connect to a wifi network on first boot. 122 | 123 | * `ENABLE_SSH` (Default: `0`) 124 | 125 | Setting to `1` will enable ssh server for remote log in. Note that if you are using a common password such as the defaults there is a high risk of attackers taking over you RaspberryPi. 126 | 127 | * `STAGE_LIST` (Default: `stage*`) 128 | 129 | If set, then instead of working through the numeric stages in order, this list will be followed. For example setting to `stage0 stage1 mystage stage2` will run the contents of `mystage` before stage2. An absolute or relative path can be given for stages outside the pi-gen directory. 130 | 131 | ## A simple example for building Raspbian: 132 | 133 | ```bash 134 | IMG_NAME='Hassbian' 135 | ``` 136 | 137 | The config file can also be specified on the command line as an argument the `build.sh` or `build-docker.sh` scripts. 138 | 139 | ``` 140 | ./build.sh -c myconfig 141 | ``` 142 | 143 | The config file can also be specified on the command line as an argument the `build.sh` or `build-docker.sh` scripts. 144 | 145 | ``` 146 | ./build.sh -c myconfig 147 | ``` 148 | 149 | This is parsed after `config` so can be used to override values set there. 150 | 151 | ## How the build process works 152 | 153 | The following process is followed to build images: 154 | 155 | * Loop through all of the stage directories in alphanumeric order 156 | 157 | * Move on to the next directory if this stage directory contains a file called 158 | "SKIP" 159 | 160 | * Run the script ```prerun.sh``` which is generally just used to copy the build 161 | directory between stages. 162 | 163 | * In each stage directory loop through each subdirectory and then run each of the 164 | install scripts it contains, again in alphanumeric order. These need to be named 165 | with a two digit padded number at the beginning. 166 | There are a number of different files and directories which can be used to 167 | control different parts of the build process: 168 | 169 | - **00-run.sh** - A unix shell script. Needs to be made executable for it to run. 170 | 171 | - **00-run-chroot.sh** - A unix shell script which will be run in the chroot 172 | of the image build directory. Needs to be made executable for it to run. 173 | 174 | - **00-debconf** - Contents of this file are passed to debconf-set-selections 175 | to configure things like locale, etc. 176 | 177 | - **00-packages** - A list of packages to install. Can have more than one, space 178 | separated, per line. 179 | 180 | - **00-packages-nr** - As 00-packages, except these will be installed using 181 | the ```--no-install-recommends -y``` parameters to apt-get. 182 | 183 | - **00-patches** - A directory containing patch files to be applied, using quilt. 184 | If a file named 'EDIT' is present in the directory, the build process will 185 | be interrupted with a bash session, allowing an opportunity to create/revise 186 | the patches. 187 | 188 | * If the stage directory contains files called "EXPORT_NOOBS" or "EXPORT_IMAGE" then 189 | add this stage to a list of images to generate 190 | 191 | * Generate the images for any stages that have specified them 192 | 193 | It is recommended to examine build.sh for finer details. 194 | 195 | 196 | ## Docker Build 197 | 198 | Docker can be used to perform the build inside a container. This partially isolates 199 | the build from the host system, and allows using the script on non-debian based 200 | systems (e.g. Fedora Linux). The isolate is not complete due to the need to use 201 | some kernel level services for arm emulation (binfmt) and loop devices (losetup). 202 | 203 | To build: 204 | 205 | ```bash 206 | nano config # Edit your config file. See above. 207 | ./build-docker.sh 208 | ``` 209 | 210 | If everything goes well, your finished image will be in the `deploy/` folder. 211 | You can then remove the build container with `docker rm -v pigen_work` 212 | 213 | If something breaks along the line, you can edit the corresponding scripts, and 214 | continue: 215 | 216 | ```bash 217 | CONTINUE=1 ./build-docker.sh 218 | ``` 219 | 220 | To examine the container after a failure you can enter a shell within it using: 221 | 222 | ```bash 223 | sudo docker run -it --privileged --volumes-from=pigen_work pi-gen /bin/bash 224 | ``` 225 | 226 | After successful build, the build container is by default removed. This may be undesired when making incremental changes to a customized build. To prevent the build script from remove the container add 227 | 228 | ```bash 229 | PRESERVE_CONTAINER=1 ./build-docker.sh 230 | ``` 231 | 232 | There is a possibility that even when running from a docker container, the 233 | installation of `qemu-user-static` will silently fail when building the image 234 | because `binfmt-support` _must be enabled on the underlying kernel_. An easy 235 | fix is to ensure `binfmt-support` is installed on the host machine before 236 | starting the `./build-docker.sh` script (or using your own docker build 237 | solution). 238 | 239 | 240 | ### Hasspbian Stage Anatomy 241 | 242 | The build of Hassbian is divided up into several stages for logical clarity 243 | and modularity. This causes some initial complexity, but it simplifies 244 | maintenance and allows for more easy customization. 245 | 246 | - **Stage 0** - bootstrap. The primary purpose of this stage is to create a 247 | usable filesystem. This is accomplished largely through the use of 248 | `debootstrap`, which creates a minimal filesystem suitable for use as a 249 | base.tgz on Debian systems. This stage also configures apt settings and 250 | installs `raspberrypi-bootloader` which is missed by debootstrap. The 251 | minimal core is installed but not configured, and the system will not quite 252 | boot yet. 253 | 254 | - **Stage 1** - truly minimal system. This stage makes the system bootable by 255 | installing system files like `/etc/fstab`, configures the bootloader, makes 256 | the network operable, and installs packages like raspi-config. At this 257 | stage the system should boot to a local console from which you have the 258 | means to perform basic tasks needed to configure and install the system. 259 | This is as minimal as a system can possibly get, and its arguably not 260 | really usable yet in a traditional sense yet. Still, if you want minimal, 261 | this is minimal and the rest you could reasonably do yourself as sysadmin. 262 | 263 | - **Stage 2** - lite system. This stage produces the Raspbian-Lite image. It 264 | installs some optimized memory functions, sets timezone and charmap 265 | defaults, installs fake-hwclock and ntp, wifi and bluetooth support, 266 | dphys-swapfile, and other basics for managing the hardware. It also 267 | creates necessary groups and gives the pi user access to sudo and the 268 | standard console hardware permission groups. This stage has a minor 269 | modification to prevent ssh from being disabled. 270 | 271 | There are a few tools that may not make a whole lot of sense here for 272 | development purposes on a minimal system such as basic Python and Lua 273 | packages as well as the `build-essential` package. They are lumped right 274 | in with more essential packages presently, though they need not be with 275 | pi-gen. These are understandable for Raspbian's target audience, but if 276 | you were looking for something between truly minimal and Raspbian-Lite, 277 | here's where you start trimming. 278 | 279 | - **Stage 3** - the HASSbian stage. This is where all the Home Assistant 280 | specific packages are installed, permissions are set and users created. 281 | This is the only stage we add to the original build script. 282 | 283 | The original **Stage 4** and **Stage 5** are removed since they are not 284 | used on the HASSbian image. 285 | 286 | 287 | ## Example for building a lite system without Home Assistant 288 | $ touch ./stage3/SKIP 289 | $ rm stage3/EXPORT* 290 | $ touch stage3/EXPORT_IMAGE 291 | ``` 292 | If you wish to build further configurations upon (for example) the lite system, you can also delete the contents of `./stage3` and replace with your own contents in the same format. 293 | 294 | ======= 295 | If you wish to build up to a specified stage (such as building up to stage 2 296 | for a lite system), place an empty file named `SKIP` in each of the `./stage` 297 | directories you wish not to include. 298 | 299 | Then add an empty file named `SKIP_IMAGES` to `./stage4` (if building up to stage 2) or 300 | to `./stage2` (if building a minimal system). 301 | 302 | ```bash 303 | # Example for building a lite system 304 | echo "IMG_NAME='Raspbian'" > config 305 | touch ./stage3/SKIP ./stage4/SKIP ./stage5/SKIP 306 | touch ./stage4/SKIP_IMAGES ./stage5/SKIP_IMAGES 307 | sudo ./build.sh # or ./build-docker.sh 308 | ``` 309 | 310 | ======= 311 | 312 | If you wish to build further configurations upon (for example) the lite 313 | system, you can also delete the contents of `./stage3` and `./stage4` and 314 | replace with your own contents in the same format. 315 | 316 | 317 | ## Skipping stages to speed up development 318 | 319 | If you're working on a specific stage the recommended development process is as 320 | follows: 321 | 322 | * Add a file called SKIP_IMAGES into the directories containing EXPORT_* files 323 | (currently stage2, stage4 and stage5) 324 | * Add SKIP files to the stages you don't want to build. For example, if you're 325 | basing your image on the lite image you would add these to stages 3, 4 and 5. 326 | * Run build.sh to build all stages 327 | * Add SKIP files to the earlier successfully built stages 328 | * Modify the last stage 329 | * Rebuild just the last stage using ```sudo CLEAN=1 ./build.sh``` 330 | * Once you're happy with the image you can remove the SKIP_IMAGES files and 331 | export your image to test 332 | 333 | # Troubleshooting 334 | 335 | ## `binfmt_misc` 336 | 337 | Linux is able execute binaries from other architectures, meaning that it should be 338 | possible to make use of `pi-gen` on an x86_64 system, even though it will be running 339 | ARM binaries. This requires support from the [`binfmt_misc`](https://en.wikipedia.org/wiki/Binfmt_misc) 340 | kernel module. 341 | 342 | You may see the following error: 343 | 344 | ``` 345 | update-binfmts: warning: Couldn't load the binfmt_misc module. 346 | ``` 347 | 348 | To resolve this, ensure that the following files are available (install them if necessary): 349 | 350 | ``` 351 | /lib/modules/$(uname -r)/kernel/fs/binfmt_misc.ko 352 | /usr/bin/qemu-arm-static 353 | ``` 354 | 355 | You may also need to load the module by hand - run `modprobe binfmt_misc`. 356 | -------------------------------------------------------------------------------- /build-docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | BUILD_OPTS="$*" 4 | 5 | DOCKER="docker" 6 | set +e 7 | if ! $DOCKER ps >/dev/null 2>&1; then 8 | DOCKER="sudo docker" 9 | fi 10 | if ! $DOCKER ps >/dev/null; then 11 | echo "error connecting to docker:" 12 | $DOCKER ps 13 | exit 1 14 | fi 15 | set -e 16 | 17 | if [ -f config ]; then 18 | # shellcheck disable=SC1091 19 | source config 20 | fi 21 | 22 | while getopts "c:" flag 23 | do 24 | case "$flag" in 25 | c) 26 | # shellcheck disable=SC1090 27 | source "$OPTARG" 28 | ;; 29 | *) 30 | ;; 31 | esac 32 | done 33 | 34 | CONTAINER_NAME=${CONTAINER_NAME:-pigen_work} 35 | CONTINUE=${CONTINUE:-0} 36 | PRESERVE_CONTAINER=${PRESERVE_CONTAINER:-0} 37 | 38 | if [ -z "${IMG_NAME}" ]; then 39 | echo "IMG_NAME not set in 'config'" 1>&2 40 | echo 1>&2 41 | exit 1 42 | fi 43 | 44 | CONTAINER_EXISTS=$($DOCKER ps -a --filter name="$CONTAINER_NAME" -q) 45 | CONTAINER_RUNNING=$($DOCKER ps --filter name="$CONTAINER_NAME" -q) 46 | if [ "$CONTAINER_RUNNING" != "" ]; then 47 | echo "The build is already running in container $CONTAINER_NAME. Aborting." 48 | exit 1 49 | fi 50 | if [ "$CONTAINER_EXISTS" != "" ] && [ "$CONTINUE" != "1" ]; then 51 | echo "Container $CONTAINER_NAME already exists and you did not specify CONTINUE=1. Aborting." 52 | echo "You can delete the existing container like this:" 53 | echo " $DOCKER rm -v $CONTAINER_NAME" 54 | exit 1 55 | fi 56 | 57 | $DOCKER build -t pi-gen . 58 | if [ "$CONTAINER_EXISTS" != "" ]; then 59 | trap 'echo "got CTRL+C... please wait 5s"; $DOCKER stop -t 5 ${CONTAINER_NAME}_cont' SIGINT SIGTERM 60 | time $DOCKER run --rm --privileged \ 61 | --volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \ 62 | pi-gen \ 63 | bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && 64 | cd /pi-gen; ./build.sh ${BUILD_OPTS} ; 65 | rsync -av work/*/build.log deploy/" & 66 | wait "$!" 67 | else 68 | trap 'echo "got CTRL+C... please wait 5s"; $DOCKER stop -t 5 ${CONTAINER_NAME}' SIGINT SIGTERM 69 | time $DOCKER run --name "${CONTAINER_NAME}" --privileged \ 70 | pi-gen \ 71 | bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && 72 | cd /pi-gen; ./build.sh ${BUILD_OPTS} && 73 | rsync -av work/*/build.log deploy/" & 74 | wait "$!" 75 | fi 76 | echo "copying results from deploy/" 77 | $DOCKER cp "${CONTAINER_NAME}":/pi-gen/deploy . 78 | ls -lah deploy 79 | 80 | # cleanup 81 | if [ "$PRESERVE_CONTAINER" != "1" ]; then 82 | $DOCKER rm -v "$CONTAINER_NAME" 83 | fi 84 | 85 | echo "Done! Your image(s) should be in deploy/" 86 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # shellcheck disable=SC2119 3 | run_sub_stage() 4 | { 5 | log "Begin ${SUB_STAGE_DIR}" 6 | pushd "${SUB_STAGE_DIR}" > /dev/null 7 | for i in {00..99}; do 8 | if [ -f "${i}-debconf" ]; then 9 | log "Begin ${SUB_STAGE_DIR}/${i}-debconf" 10 | on_chroot << EOF 11 | debconf-set-selections < /dev/null 41 | if [ "${CLEAN}" = "1" ]; then 42 | rm -rf .pc 43 | rm -rf ./*-pc 44 | fi 45 | QUILT_PATCHES="${SUB_STAGE_DIR}/${i}-patches" 46 | SUB_STAGE_QUILT_PATCH_DIR="$(basename "$SUB_STAGE_DIR")-pc" 47 | mkdir -p "$SUB_STAGE_QUILT_PATCH_DIR" 48 | ln -snf "$SUB_STAGE_QUILT_PATCH_DIR" .pc 49 | if [ -e "${SUB_STAGE_DIR}/${i}-patches/EDIT" ]; then 50 | echo "Dropping into bash to edit patches..." 51 | bash 52 | fi 53 | quilt upgrade 54 | RC=0 55 | quilt push -a || RC=$? 56 | case "$RC" in 57 | 0|2) 58 | ;; 59 | *) 60 | false 61 | ;; 62 | esac 63 | popd > /dev/null 64 | log "End ${SUB_STAGE_DIR}/${i}-patches" 65 | fi 66 | if [ -x ${i}-run.sh ]; then 67 | log "Begin ${SUB_STAGE_DIR}/${i}-run.sh" 68 | ./${i}-run.sh 69 | log "End ${SUB_STAGE_DIR}/${i}-run.sh" 70 | fi 71 | if [ -f ${i}-run-chroot.sh ]; then 72 | log "Begin ${SUB_STAGE_DIR}/${i}-run-chroot.sh" 73 | on_chroot < ${i}-run-chroot.sh 74 | log "End ${SUB_STAGE_DIR}/${i}-run-chroot.sh" 75 | fi 76 | done 77 | popd > /dev/null 78 | log "End ${SUB_STAGE_DIR}" 79 | } 80 | 81 | 82 | run_stage(){ 83 | log "Begin ${STAGE_DIR}" 84 | STAGE="$(basename "${STAGE_DIR}")" 85 | pushd "${STAGE_DIR}" > /dev/null 86 | unmount "${WORK_DIR}/${STAGE}" 87 | STAGE_WORK_DIR="${WORK_DIR}/${STAGE}" 88 | ROOTFS_DIR="${STAGE_WORK_DIR}"/rootfs 89 | if [ ! -f SKIP_IMAGES ]; then 90 | if [ -f "${STAGE_DIR}/EXPORT_IMAGE" ]; then 91 | EXPORT_DIRS="${EXPORT_DIRS} ${STAGE_DIR}" 92 | fi 93 | fi 94 | if [ ! -f SKIP ]; then 95 | if [ "${CLEAN}" = "1" ]; then 96 | if [ -d "${ROOTFS_DIR}" ]; then 97 | rm -rf "${ROOTFS_DIR}" 98 | fi 99 | fi 100 | if [ -x prerun.sh ]; then 101 | log "Begin ${STAGE_DIR}/prerun.sh" 102 | ./prerun.sh 103 | log "End ${STAGE_DIR}/prerun.sh" 104 | fi 105 | for SUB_STAGE_DIR in "${STAGE_DIR}"/*; do 106 | if [ -d "${SUB_STAGE_DIR}" ] && 107 | [ ! -f "${SUB_STAGE_DIR}/SKIP" ]; then 108 | run_sub_stage 109 | fi 110 | done 111 | fi 112 | unmount "${WORK_DIR}/${STAGE}" 113 | PREV_STAGE="${STAGE}" 114 | PREV_STAGE_DIR="${STAGE_DIR}" 115 | PREV_ROOTFS_DIR="${ROOTFS_DIR}" 116 | popd > /dev/null 117 | log "End ${STAGE_DIR}" 118 | } 119 | 120 | if [ "$(id -u)" != "0" ]; then 121 | echo "Please run as root" 1>&2 122 | exit 1 123 | fi 124 | 125 | 126 | if [ -f config ]; then 127 | # shellcheck disable=SC1091 128 | source config 129 | fi 130 | 131 | while getopts "c:" flag 132 | do 133 | case "$flag" in 134 | c) 135 | EXTRA_CONFIG="$OPTARG" 136 | # shellcheck disable=SC1090 137 | source "$EXTRA_CONFIG" 138 | ;; 139 | *) 140 | ;; 141 | esac 142 | done 143 | 144 | export PI_GEN=${PI_GEN:-pi-gen} 145 | export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen} 146 | 147 | if [ -z "${IMG_NAME}" ]; then 148 | echo "IMG_NAME not set" 1>&2 149 | exit 1 150 | fi 151 | 152 | export USE_QEMU="${USE_QEMU:-0}" 153 | export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}" 154 | export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_NAME}"}" 155 | export ZIP_FILENAME="${ZIP_FILENAME:-"image_${IMG_DATE}-${IMG_NAME}"}" 156 | 157 | BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 158 | export SCRIPT_DIR="${BASE_DIR}/scripts" 159 | export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}" 160 | export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"} 161 | export DEPLOY_ZIP="${DEPLOY_ZIP:-1}" 162 | export LOG_FILE="${WORK_DIR}/build.log" 163 | 164 | export FIRST_USER_NAME=${FIRST_USER_NAME:-pi} 165 | export FIRST_USER_PASS=${FIRST_USER_PASS:-raspberry} 166 | export WPA_ESSID 167 | export WPA_PASSWORD 168 | export WPA_COUNTRY 169 | export ENABLE_SSH="${ENABLE_SSH:-0}" 170 | 171 | export BASE_DIR 172 | 173 | export CLEAN 174 | export IMG_NAME 175 | export APT_PROXY 176 | 177 | export STAGE 178 | export STAGE_DIR 179 | export STAGE_WORK_DIR 180 | export PREV_STAGE 181 | export PREV_STAGE_DIR 182 | export ROOTFS_DIR 183 | export PREV_ROOTFS_DIR 184 | export IMG_SUFFIX 185 | export NOOBS_NAME 186 | export NOOBS_DESCRIPTION 187 | export EXPORT_DIR 188 | export EXPORT_ROOTFS_DIR 189 | 190 | export QUILT_PATCHES 191 | export QUILT_NO_DIFF_INDEX=1 192 | export QUILT_NO_DIFF_TIMESTAMPS=1 193 | export QUILT_REFRESH_ARGS="-p ab" 194 | 195 | # shellcheck source=scripts/common 196 | source "${SCRIPT_DIR}/common" 197 | # shellcheck source=scripts/dependencies_check 198 | source "${SCRIPT_DIR}/dependencies_check" 199 | 200 | #check username is valid 201 | if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then 202 | echo "Invalid FIRST_USER_NAME: $FIRST_USER_NAME" 203 | exit 1 204 | fi 205 | 206 | if [[ -n "${APT_PROXY}" ]] && ! curl --silent "${APT_PROXY}" >/dev/null ; then 207 | echo "Could not reach APT_PROXY server: ${APT_PROXY}" 208 | exit 1 209 | fi 210 | 211 | dependencies_check "${BASE_DIR}/depends" 212 | 213 | mkdir -p "${WORK_DIR}" 214 | log "Begin ${BASE_DIR}" 215 | 216 | STAGE_LIST=${STAGE_LIST:-${BASE_DIR}/stage*} 217 | 218 | for STAGE_DIR in $STAGE_LIST; do 219 | STAGE_DIR=$(realpath "${STAGE_DIR}") 220 | run_stage 221 | done 222 | 223 | CLEAN=1 224 | for EXPORT_DIR in ${EXPORT_DIRS}; do 225 | STAGE_DIR=${BASE_DIR}/export-image 226 | # shellcheck source=/dev/null 227 | source "${EXPORT_DIR}/EXPORT_IMAGE" 228 | EXPORT_ROOTFS_DIR=${WORK_DIR}/$(basename "${EXPORT_DIR}")/rootfs 229 | run_stage 230 | if [ "${USE_QEMU}" != "1" ]; then 231 | if [ -e "${EXPORT_DIR}/EXPORT_NOOBS" ]; then 232 | # shellcheck source=/dev/null 233 | source "${EXPORT_DIR}/EXPORT_NOOBS" 234 | STAGE_DIR="${BASE_DIR}/export-noobs" 235 | run_stage 236 | fi 237 | fi 238 | done 239 | 240 | if [ -x postrun.sh ]; then 241 | log "Begin postrun.sh" 242 | cd "${BASE_DIR}" 243 | ./postrun.sh 244 | log "End postrun.sh" 245 | fi 246 | 247 | log "End ${BASE_DIR}" 248 | -------------------------------------------------------------------------------- /depends: -------------------------------------------------------------------------------- 1 | quilt 2 | parted 3 | realpath:coreutils 4 | qemu-arm-static:qemu-user-static 5 | debootstrap 6 | zerofree 7 | zip 8 | mkdosfs:dosfstools 9 | capsh:libcap2-bin 10 | bsdtar 11 | grep 12 | rsync 13 | xz:xz-utils 14 | curl 15 | xxd 16 | file 17 | git 18 | lsmod:kmod 19 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | apt-cacher-ng: 5 | restart: unless-stopped 6 | image: sameersbn/apt-cacher-ng:latest 7 | ports: 8 | - "3142:3142" 9 | volumes: 10 | - ./apt-cacher-ng:/var/cache/apt-cacher-ng 11 | -------------------------------------------------------------------------------- /export-image/00-allow-rerun/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ ! -x "${ROOTFS_DIR}/usr/bin/qemu-arm-static" ]; then 4 | cp /usr/bin/qemu-arm-static "${ROOTFS_DIR}/usr/bin/" 5 | fi 6 | -------------------------------------------------------------------------------- /export-image/01-set-sources/00-patches/0-sources.diff: -------------------------------------------------------------------------------- 1 | Index: export-jessie/rootfs/etc/apt/sources.list.d/raspi.list 2 | =================================================================== 3 | --- export-jessie.orig/rootfs/etc/apt/sources.list.d/raspi.list 4 | +++ export-jessie/rootfs/etc/apt/sources.list.d/raspi.list 5 | @@ -1,3 +1,3 @@ 6 | -deb http://archive.raspberrypi.org/debian/ buster main ui staging 7 | +deb http://archive.raspberrypi.org/debian/ buster main ui 8 | # Uncomment line below then 'apt-get update' to enable 'apt-get source' 9 | #deb-src http://archive.raspberrypi.org/debian/ buster main ui 10 | -------------------------------------------------------------------------------- /export-image/01-set-sources/00-patches/series: -------------------------------------------------------------------------------- 1 | 0-sources.diff 2 | -------------------------------------------------------------------------------- /export-image/01-set-sources/01-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | on_chroot << EOF 4 | apt-get update 5 | apt-get -y dist-upgrade 6 | apt-get clean 7 | EOF 8 | -------------------------------------------------------------------------------- /export-image/02-network/01-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -m 644 files/resolv.conf "${ROOTFS_DIR}/etc/" 4 | -------------------------------------------------------------------------------- /export-image/02-network/files/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | -------------------------------------------------------------------------------- /export-image/03-set-partuuid/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" 4 | 5 | IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')" 6 | 7 | BOOT_PARTUUID="${IMGID}-01" 8 | ROOT_PARTUUID="${IMGID}-02" 9 | 10 | sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab" 11 | sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab" 12 | 13 | sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/boot/cmdline.txt" 14 | -------------------------------------------------------------------------------- /export-image/04-finalise/01-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" 4 | INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info" 5 | 6 | on_chroot << EOF 7 | /etc/init.d/fake-hwclock stop 8 | hardlink -t /usr/share/doc 9 | EOF 10 | 11 | if [ -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config" ]; then 12 | chmod 700 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config" 13 | fi 14 | 15 | rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" 16 | rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static" 17 | 18 | rm -f "${ROOTFS_DIR}/etc/apt/sources.list~" 19 | rm -f "${ROOTFS_DIR}/etc/apt/trusted.gpg~" 20 | 21 | rm -f "${ROOTFS_DIR}/etc/passwd-" 22 | rm -f "${ROOTFS_DIR}/etc/group-" 23 | rm -f "${ROOTFS_DIR}/etc/shadow-" 24 | rm -f "${ROOTFS_DIR}/etc/gshadow-" 25 | rm -f "${ROOTFS_DIR}/etc/subuid-" 26 | rm -f "${ROOTFS_DIR}/etc/subgid-" 27 | 28 | rm -f "${ROOTFS_DIR}"/var/cache/debconf/*-old 29 | rm -f "${ROOTFS_DIR}"/var/lib/dpkg/*-old 30 | 31 | rm -f "${ROOTFS_DIR}"/usr/share/icons/*/icon-theme.cache 32 | 33 | rm -f "${ROOTFS_DIR}/var/lib/dbus/machine-id" 34 | 35 | true > "${ROOTFS_DIR}/etc/machine-id" 36 | 37 | ln -nsf /proc/mounts "${ROOTFS_DIR}/etc/mtab" 38 | 39 | find "${ROOTFS_DIR}/var/log/" -type f -exec cp /dev/null {} \; 40 | 41 | rm -f "${ROOTFS_DIR}/root/.vnc/private.key" 42 | rm -f "${ROOTFS_DIR}/etc/vnc/updateid" 43 | 44 | update_issue "$(basename "${EXPORT_DIR}")" 45 | install -m 644 "${ROOTFS_DIR}/etc/rpi-issue" "${ROOTFS_DIR}/boot/issue.txt" 46 | install files/LICENSE.oracle "${ROOTFS_DIR}/boot/" 47 | 48 | 49 | cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE" 50 | 51 | 52 | { 53 | if [ -f "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" ]; then 54 | firmware=$(zgrep "firmware as of" \ 55 | "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" | \ 56 | head -n1 | sed -n 's|.* \([^ ]*\)$|\1|p') 57 | printf "\nFirmware: https://github.com/raspberrypi/firmware/tree/%s\n" "$firmware" 58 | 59 | kernel="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/git_hash")" 60 | printf "Kernel: https://github.com/raspberrypi/linux/tree/%s\n" "$kernel" 61 | 62 | uname="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/uname_string7")" 63 | printf "Uname string: %s\n" "$uname" 64 | fi 65 | 66 | printf "\nPackages:\n" 67 | dpkg -l --root "$ROOTFS_DIR" 68 | } >> "$INFO_FILE" 69 | 70 | ROOT_DEV="$(mount | grep "${ROOTFS_DIR} " | cut -f1 -d' ')" 71 | 72 | unmount "${ROOTFS_DIR}" 73 | zerofree "${ROOT_DEV}" 74 | 75 | unmount_image "${IMG_FILE}" 76 | 77 | mkdir -p "${DEPLOY_DIR}" 78 | 79 | rm -f "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" 80 | rm -f "${DEPLOY_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" 81 | 82 | if [ "${DEPLOY_ZIP}" == "1" ]; then 83 | pushd "${STAGE_WORK_DIR}" > /dev/null 84 | zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \ 85 | "$(basename "${IMG_FILE}")" 86 | popd > /dev/null 87 | else 88 | cp "$IMG_FILE" "$DEPLOY_DIR" 89 | fi 90 | 91 | cp "$INFO_FILE" "$DEPLOY_DIR" 92 | -------------------------------------------------------------------------------- /export-image/04-finalise/files/LICENSE.oracle: -------------------------------------------------------------------------------- 1 | Taken from http://www.java.com/license 2 | 3 | Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX 4 | 5 | ORACLE AMERICA, INC. ("ORACLE"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT"). PLEASE READ THE AGREEMENT CAREFULLY. BY SELECTING THE "ACCEPT LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND/OR BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, THEN SELECT THE "DECLINE LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED. 6 | 7 | 1. DEFINITIONS. "Software" means the software identified above in binary form that you selected for download, install or use (in the version You selected for download, install or use) from Oracle or its authorized licensees, any other machine readable materials (including, but not limited to, libraries, source files, header files, and data files), any updates or error corrections provided by Oracle, and any user manuals, programming guides and other documentation provided to you by Oracle under this Agreement. "General Purpose Desktop Computers and Servers" means computers, including desktop and laptop computers, or servers, used for general computing functions under end user control (such as but not specifically limited to email, general purpose Internet browsing, and office suite productivity tools). The use of Software in systems and solutions that provide dedicated functionality (other than as mentioned above) or designed for use in embedded or function-specific software applications, for example but not limited to: Software embedded in or bundled with industrial control systems, wireless mobile telephones, wireless handheld devices, kiosks, TV/STB, Blu-ray Disc devices, telematics and network control switching equipment, printers and storage management systems, and other related systems are excluded from this definition and not licensed under this Agreement. "Programs" means (a) Java technology applets and applications intended to run on the Java Platform, Standard Edition platform on Java-enabled General Purpose Desktop Computers and Servers; and (b) JavaFX technology applications intended to run on the JavaFX Runtime on JavaFX-enabled General Purpose Desktop Computers and Servers. “Commercial Features” means those features identified in Table 1-1 (Commercial Features In Java SE Product Editions) of the Java SE documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. “README File” means the README file for the Software accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. 8 | 9 | 2. LICENSE TO USE. Subject to the terms and conditions of this Agreement including, but not limited to, the Java Technology Restrictions of the Supplemental License Terms, Oracle grants you a non-exclusive, non-transferable, limited license without license fees to reproduce and use internally the Software complete and unmodified for the sole purpose of running Programs. THE LICENSE SET FORTH IN THIS SECTION 2 DOES NOT EXTEND TO THE COMMERCIAL FEATURES. YOUR RIGHTS AND OBLIGATIONS RELATED TO THE COMMERCIAL FEATURES ARE AS SET FORTH IN THE SUPPLEMENTAL TERMS ALONG WITH ADDITIONAL LICENSES FOR DEVELOPERS AND PUBLISHERS. 10 | 11 | 3. RESTRICTIONS. Software is copyrighted. Title to Software and all associated intellectual property rights is retained by Oracle and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. You acknowledge that the Software is developed for general use in a variety of information management applications; it is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use the Software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle disclaims any express or implied warranty of fitness for such uses. No right, title or interest in or to any trademark, service mark, logo or trade name of Oracle or its licensors is granted under this Agreement. Additional restrictions for developers and/or publishers licenses are set forth in the Supplemental License Terms. 12 | 13 | 4. DISCLAIMER OF WARRANTY. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ORACLE FURTHER DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. 14 | 15 | 5. LIMITATION OF LIABILITY. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ORACLE'S ENTIRE LIABILITY FOR DAMAGES HEREUNDER SHALL IN NO EVENT EXCEED ONE THOUSAND DOLLARS (U.S. $1,000). 16 | 17 | 6. TERMINATION. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without notice from Oracle if you fail to comply with any provision of this Agreement. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. Upon termination, you must destroy all copies of Software. 18 | 19 | 7. EXPORT REGULATIONS. You agree that U.S. export control laws and other applicable export and import laws govern your use of the Software, including technical data; additional information can be found on Oracle's Global Trade Compliance web site (http://www.oracle.com/products/export). You agree that neither the Software nor any direct product thereof will be exported, directly, or indirectly, in violation of these laws, or will be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation. 20 | 21 | 8. TRADEMARKS AND LOGOS. You acknowledge and agree as between you 22 | and Oracle that Oracle owns the ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand 23 | designations ("Oracle Marks"), and you agree to comply with the Third 24 | Party Usage Guidelines for Oracle Trademarks currently located at 25 | http://www.oracle.com/us/legal/third-party-trademarks/index.html . Any use you make of the Oracle Marks inures to Oracle's benefit. 26 | 27 | 9. U.S. GOVERNMENT LICENSE RIGHTS. If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation shall be only those set forth in this Agreement. 28 | 29 | 10. GOVERNING LAW. This agreement is governed by the substantive and procedural laws of California. You and Oracle agree to submit to the exclusive jurisdiction of, and venue in, the courts of San Francisco, or Santa Clara counties in California in any dispute arising out of or relating to this agreement. 30 | 31 | 11. SEVERABILITY. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. 32 | 33 | 12. INTEGRATION. This Agreement is the entire agreement between you and Oracle relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. 34 | 35 | SUPPLEMENTAL LICENSE TERMS 36 | 37 | These Supplemental License Terms add to or modify the terms of the Binary Code License Agreement. Capitalized terms not defined in these Supplemental Terms shall have the same meanings ascribed to them in the Binary Code License Agreement. These Supplemental Terms shall supersede any inconsistent or conflicting terms in the Binary Code License Agreement, or in any license contained within the Software. 38 | 39 | A. COMMERCIAL FEATURES. You may not use the Commercial Features for running Programs, Java applets or applications in your internal business operations or for any commercial or production purpose, or for any purpose other than as set forth in Sections B, C, D and E of these Supplemental Terms. If You want to use the Commercial Features for any purpose other than as permitted in this Agreement, You must obtain a separate license from Oracle. 40 | 41 | B. SOFTWARE INTERNAL USE FOR DEVELOPMENT LICENSE GRANT. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File incorporated herein by reference, including, but not limited to the Java Technology Restrictions of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce internally and use internally the Software complete and unmodified for the purpose of designing, developing, and testing your Programs. 42 | 43 | C. LICENSE TO DISTRIBUTE SOFTWARE. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File, including, but not limited to the Java Technology Restrictions and Limitations on Redistribution of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software, (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in this Agreement and that includes the notice set forth in Section H, and (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. The license set forth in this Section C does not extend to the Software identified in Section G. 44 | 45 | D. LICENSE TO DISTRIBUTE REDISTRIBUTABLES. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File, including but not limited to the Java Technology Restrictions and Limitations on Redistribution of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute those files specifically identified as redistributable in the README File ("Redistributables") provided that: (i) you distribute the Redistributables complete and unmodified, and only bundled as part of Programs, (ii) the Programs add significant and primary functionality to the Redistributables, (iii) you do not distribute additional software intended to supersede any component(s) of the Redistributables (unless otherwise specified in the applicable README File), (iv) you do not remove or alter any proprietary legends or notices contained in or on the Redistributables, (v) you only distribute the Redistributables pursuant to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in the Agreement and includes the notice set forth in Section H, (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. The license set forth in this Section D does not extend to the Software identified in Section G. 46 | 47 | E. DISTRIBUTION BY PUBLISHERS. This section pertains to your distribution of the JavaTM SE Development Kit Software (“JDK”) with your printed book or magazine (as those terms are commonly used in the industry) relating to Java technology ("Publication"). Subject to and conditioned upon your compliance with the restrictions and obligations contained in the Agreement, Oracle hereby grants to you a non-exclusive, nontransferable limited right to reproduce complete and unmodified copies of the JDK on electronic media (the "Media") for the sole purpose of inclusion and distribution with your Publication(s), subject to the following terms: (i) You may not distribute the JDK on a stand-alone basis; it must be distributed with your Publication(s); (ii) You are responsible for downloading the JDK from the applicable Oracle web site; (iii) You must refer to the JDK as JavaTM SE Development Kit; (iv) The JDK must be reproduced in its entirety and without any modification whatsoever (including with respect to all proprietary notices) and distributed with your Publication subject to a license agreement that is a complete, unmodified reproduction of this Agreement; (v) The Media label shall include the following information: “Copyright [YEAR], Oracle America, Inc. All rights reserved. Use is subject to license terms. ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand designations are trademarks or registered trademarks of Oracle in the U.S. and other countries.” [YEAR] is the year of Oracle's release of the Software; the year information can typically be found in the Software’s “About” box or screen. This information must be placed on the Media label in such a manner as to only apply to the JDK; (vi) You must clearly identify the JDK as Oracle's product on the Media holder or Media label, and you may not state or imply that Oracle is responsible for any third-party software contained on the Media; (vii) You may not include any third party software on the Media which is intended to be a replacement or substitute for the JDK; (viii) You agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of the JDK and/or the Publication; ; and (ix) You shall provide Oracle with a written notice for each Publication; such notice shall include the following information: (1) title of Publication, (2) author(s), (3) date of Publication, and (4) ISBN or ISSN numbers. Such notice shall be sent to Oracle America, Inc., 500 Oracle Parkway, Redwood Shores, California 94065 U.S.A , Attention: General Counsel. 48 | 49 | F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation. 50 | 51 | G. LIMITATIONS ON REDISTRIBUTION. You may not redistribute or otherwise transfer patches, bug fixes or updates made available by Oracle through Oracle Premier Support, including those made available under Oracle's Java SE Support program. 52 | 53 | H. COMMERCIAL FEATURES NOTICE. For purpose of complying with Supplemental Term Section C.(v)(b) and D.(v)(b), your license agreement shall include the following notice, where the notice is displayed in a manner that anyone using the Software will see the notice: 54 | 55 | Use of the Commercial Features for any commercial or production purpose requires a separate license from Oracle. “Commercial Features” means those features identified Table 1-1 (Commercial Features In Java SE Product Editions) of the Java SE documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html 56 | 57 | 58 | 59 | I. SOURCE CODE. Software may contain source code that, unless expressly licensed for other purposes, is provided solely for reference purposes pursuant to the terms of this Agreement. Source code may not be redistributed unless expressly provided for in this Agreement. 60 | 61 | J. THIRD PARTY CODE. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME file accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. In addition to any terms and conditions of any third party opensource/freeware license identified in the THIRDPARTYLICENSEREADME file, the disclaimer of warranty and limitation of liability provisions in paragraphs 4 and 5 of the Binary Code License Agreement shall apply to all Software in this distribution. 62 | 63 | K. TERMINATION FOR INFRINGEMENT. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. 64 | 65 | L. INSTALLATION AND AUTO-UPDATE. The Software's installation and auto-update processes transmit a limited amount of data to Oracle (or its service provider) about those specific processes to help Oracle understand and optimize them. Oracle does not associate the data with personally identifiable information. You can find more information about the data Oracle collects as a result of your Software download at http://www.oracle.com/technetwork/java/javase/documentation/index.html. 66 | 67 | For inquiries please contact: Oracle America, Inc., 500 Oracle Parkway, 68 | 69 | Redwood Shores, California 94065, USA. 70 | 71 | Last updated 02 April 2013 72 | 73 | -------------------------------------------------------------------------------- /export-image/prerun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" 4 | 5 | unmount_image "${IMG_FILE}" 6 | 7 | rm -f "${IMG_FILE}" 8 | 9 | rm -rf "${ROOTFS_DIR}" 10 | mkdir -p "${ROOTFS_DIR}" 11 | 12 | BOOT_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}/boot" --block-size=1 | cut -f 1) 13 | TOTAL_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --block-size=1 | cut -f 1) 14 | 15 | ROUND_SIZE="$((4 * 1024 * 1024))" 16 | ROUNDED_ROOT_SECTOR=$(((2 * BOOT_SIZE + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE / 512 + 8192)) 17 | IMG_SIZE=$(((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024) + ROUND_SIZE - 1) / ROUND_SIZE * ROUND_SIZE)) 18 | 19 | truncate -s "${IMG_SIZE}" "${IMG_FILE}" 20 | fdisk -H 255 -S 63 "${IMG_FILE}" < /dev/null 59 | mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null 60 | 61 | mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4 62 | mkdir -p "${ROOTFS_DIR}/boot" 63 | mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot" -t vfat 64 | 65 | rsync -aHAXx --exclude /var/cache/apt/archives --exclude /boot "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/" 66 | rsync -rtx "${EXPORT_ROOTFS_DIR}/boot/" "${ROOTFS_DIR}/boot/" 67 | -------------------------------------------------------------------------------- /export-noobs/00-release/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" 4 | 5 | install -v -m 744 files/partition_setup.sh "${NOOBS_DIR}/" 6 | install -v files/partitions.json "${NOOBS_DIR}/" 7 | install -v files/os.json "${NOOBS_DIR}/" 8 | install -v files/OS.png "${NOOBS_DIR}/" 9 | install -v files/release_notes.txt "${NOOBS_DIR}/" 10 | 11 | tar -v -c -C files/marketing -f "${NOOBS_DIR}/marketing.tar" . 12 | 13 | BOOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/boot.tar.xz" | grep totals | cut -f 5)" 14 | ROOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/root.tar.xz" | grep totals | cut -f 5)" 15 | 16 | BOOT_SIZE="$(( BOOT_SIZE / 1024 / 1024 + 1))" 17 | ROOT_SIZE="$(( ROOT_SIZE / 1024 / 1024 + 1))" 18 | 19 | BOOT_NOM="$(( BOOT_SIZE * 3 ))" 20 | ROOT_NOM="$(( ROOT_SIZE + 400 ))" 21 | 22 | mv "${NOOBS_DIR}/OS.png" "${NOOBS_DIR}/${NOOBS_NAME// /_}.png" 23 | 24 | sed "${NOOBS_DIR}/partitions.json" -i -e "s|BOOT_SIZE|${BOOT_SIZE}|" 25 | sed "${NOOBS_DIR}/partitions.json" -i -e "s|ROOT_SIZE|${ROOT_SIZE}|" 26 | 27 | sed "${NOOBS_DIR}/partitions.json" -i -e "s|BOOT_NOM|${BOOT_NOM}|" 28 | sed "${NOOBS_DIR}/partitions.json" -i -e "s|ROOT_NOM|${ROOT_NOM}|" 29 | 30 | sed "${NOOBS_DIR}/os.json" -i -e "s|UNRELEASED|${IMG_DATE}|" 31 | sed "${NOOBS_DIR}/os.json" -i -e "s|NOOBS_NAME|${NOOBS_NAME}|" 32 | sed "${NOOBS_DIR}/os.json" -i -e "s|NOOBS_DESCRIPTION|${NOOBS_DESCRIPTION}|" 33 | 34 | sed "${NOOBS_DIR}/release_notes.txt" -i -e "s|UNRELEASED|${IMG_DATE}|" 35 | 36 | cp -a "${NOOBS_DIR}" "${DEPLOY_DIR}/" 37 | -------------------------------------------------------------------------------- /export-noobs/00-release/files/OS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/OS.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/marketing/slides_vga/A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/marketing/slides_vga/A.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/marketing/slides_vga/B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/marketing/slides_vga/B.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/marketing/slides_vga/C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/marketing/slides_vga/C.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/marketing/slides_vga/D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/marketing/slides_vga/D.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/marketing/slides_vga/E.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/marketing/slides_vga/E.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/marketing/slides_vga/F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/marketing/slides_vga/F.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/marketing/slides_vga/G.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/export-noobs/00-release/files/marketing/slides_vga/G.png -------------------------------------------------------------------------------- /export-noobs/00-release/files/os.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "NOOBS_DESCRIPTION", 3 | "feature_level": 35120124, 4 | "kernel": "4.14", 5 | "name": "NOOBS_NAME", 6 | "password": "raspberry", 7 | "release_date": "UNRELEASED", 8 | "supported_hex_revisions": "2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,19,1040,1041,0092,0093,2082", 9 | "supported_models": [ 10 | "Pi Model", 11 | "Pi 2", 12 | "Pi Zero", 13 | "Pi 3", 14 | "Pi Compute Module 3" 15 | ], 16 | "url": "http://www.raspbian.org/", 17 | "username": "pi", 18 | "version": "stretch" 19 | } 20 | -------------------------------------------------------------------------------- /export-noobs/00-release/files/partition_setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #supports_backup in PINN 3 | 4 | set -ex 5 | 6 | # shellcheck disable=SC2154 7 | if [ -z "$part1" ] || [ -z "$part2" ]; then 8 | printf "Error: missing environment variable part1 or part2\n" 1>&2 9 | exit 1 10 | fi 11 | 12 | mkdir -p /tmp/1 /tmp/2 13 | 14 | mount "$part1" /tmp/1 15 | mount "$part2" /tmp/2 16 | 17 | sed /tmp/1/cmdline.txt -i -e "s|root=[^ ]*|root=${part2}|" 18 | sed /tmp/2/etc/fstab -i -e "s|^[^#].* / |${part2} / |" 19 | sed /tmp/2/etc/fstab -i -e "s|^[^#].* /boot |${part1} /boot |" 20 | 21 | # shellcheck disable=SC2154 22 | if [ -z "$restore" ]; then 23 | if [ -f /mnt/ssh ]; then 24 | cp /mnt/ssh /tmp/1/ 25 | fi 26 | 27 | if [ -f /mnt/ssh.txt ]; then 28 | cp /mnt/ssh.txt /tmp/1/ 29 | fi 30 | 31 | if [ -f /settings/wpa_supplicant.conf ]; then 32 | cp /settings/wpa_supplicant.conf /tmp/1/ 33 | fi 34 | 35 | if ! grep -q resize /proc/cmdline; then 36 | sed -i 's| init=/usr/lib/raspi-config/init_resize.sh||;s| quiet||2g' /tmp/1/cmdline.txt 37 | fi 38 | fi 39 | 40 | umount /tmp/1 41 | umount /tmp/2 42 | -------------------------------------------------------------------------------- /export-noobs/00-release/files/partitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "partitions": [ 3 | { 4 | "filesystem_type": "FAT", 5 | "label": "boot", 6 | "mkfs_options": "-F 32", 7 | "partition_size_nominal": BOOT_NOM, 8 | "uncompressed_tarball_size": BOOT_SIZE, 9 | "want_maximised": false 10 | }, 11 | { 12 | "filesystem_type": "ext4", 13 | "label": "root", 14 | "mkfs_options": "-O ^huge_file", 15 | "partition_size_nominal": ROOT_NOM, 16 | "uncompressed_tarball_size": ROOT_SIZE, 17 | "want_maximised": true 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /export-noobs/00-release/files/release_notes.txt: -------------------------------------------------------------------------------- 1 | UNRELEASED: 2 | * 3 | 2019-04-08: 4 | * Chromium browser updated to version 72 5 | * VLC media player updated to version 3.0.6 6 | * RealVNC Server updated to version 6.4.0 7 | * Flash player updated to version 32.0.0.156 8 | * Performance improvements to SDL library 9 | * Performance improvements to pixman library 10 | * Option to set display underscan added to startup wizard 11 | * Mounted external drives now displayed on desktop by default 12 | * Network plugin modified for improved compatibility with wpa_passphrase 13 | * SD Card Copier tweaks to reduce copy failures 14 | * Various minor bug fixes and appearance tweaks 15 | * Added ethtool 16 | * Added rng-tools 17 | * Add PINN restore support 18 | * Linux kernel 4.14.98 19 | * Raspberry Pi firmware f8939644f7bd3065068787f1f92b3f3c79cf3de9 20 | 2018-11-13: 21 | * Two versions of image created - "base" image has no optional software packages included; "full" image has all optional packages 22 | - Removed from "base" image - LibreOffice, Thonny, Scratch, Scratch 2, Sonic Pi, Minecraft, Python Games, SmartSim, SenseHAT Emulator 23 | - Added to "full" image - Mathematica, BlueJ, Greenfoot, Node-RED, Claws Mail, VNC Viewer 24 | * Python Games and SmartSim added to Recommended Software 25 | * VLC media player with VideoCore hardware acceleration included in image 26 | * Version 3.0.5 of Thonny included 27 | * Modifications to LXDE components to enable local configuration to override global configuration correctly 28 | * Modifications to Appearance Settings to support above configuration changes 29 | * Modifications to various initial config defaults and relevant package to support above configuration changes 30 | * Selecting default option in Appearance Settings now deletes relevant local configuration files 31 | * PiX theme modified so that all changes made in Appearance Settings are in override files rather than in theme files 32 | * Design of scrollbar buttons changed 33 | * Image Viewer moved into Graphics category on main menu 34 | * Recommended Software now installs LibreOffice language support files if needed, and suggests reboot if needed 35 | * Latest version of Pepper Flash plugin included 36 | * Chromium h264ify plugin permissions set correctly by default 37 | * Corrections to various MIME types so that files open in sensible default applications 38 | * Set default timezone to 'Europe/London' 39 | * Linux kernel 4.14.79 40 | * Raspberry Pi firmware 12e0bf86e08d6067372bc0a45d7e8a10d3113210 41 | 2018-10-09: 42 | * Raspberry Pi 3A+ support 43 | * In startup wizard, assign keyboard to country as per Debian installer recommendations 44 | * In startup wizard, add option to use US keyboard in preference to country-specific option 45 | * In startup wizard, show IP address on first page 46 | * In startup wizard, check for existing wifi network connection and show it if there is one 47 | * In startup wizard, install language support packages for LibreOffice and other applications 48 | * In startup wizard, improve operation with keyboard only and no mouse 49 | * Password change in Raspberry Pi Configuration and startup wizard now works properly if passwords contain shell characters 50 | * Battery indicator plugin modified to cope with Pi-top hardware monitor crashing 51 | * Networking plugin hides wifi password characters by default 52 | * In Scratch 2 GPIO plugin, set pin from dropdown list rather than free text 53 | * In Scratch 2 SenseHAT plugin, swap x and y axis values for LED array 54 | * Include latest Adobe Flash player (31.0.0.108) 55 | * Include latest RealVNC Server (6.3.1) 56 | * Include libav-tools 57 | * Include ssh-import-id 58 | * Removed Mathematica 59 | * Merge in latest third-party code for Bluetooth ALSA interface 60 | * Add ability to prevent software update changing configuration files, by creating ~/.config/.lock file 61 | * Various other small bug fixes, tweaks and changes to text 62 | * Make dhcpcd work with 3G devices 63 | * Add hw acceleration to ffmpeg 64 | * Improved WiFi-BT coexistence parameters 65 | * Run fake-hwclock before systemd-fsck-root 66 | * Raspberry Pi PoE HAT support 67 | * Linux kernel 4.14.71 68 | * Raspberry Pi firmware 5b49caa17e91d0e64024380119ad739bb201c674 69 | 2018-06-27: 70 | * New first-boot configuration wizard added 71 | * Recommended Software installer added 72 | * Bluej, Greenfoot, NodeRED, Claws Mail, VNC Viewer removed from image - can now be installed from Recommended Applications 73 | * Qpdfview PDF viewer installed instead of Xpdf 74 | * Version 65.0 of Chromium browser included, with latest Flash player 75 | * Volume up / down keys now change by 5% increments and affect currently-selected output device rather than internal device only 76 | * Network plugin now remembers previously-entered WiFi network passwords when prompting for reconnection 77 | * Serial port and serial console can now be switched separately in Raspberry Pi Configuration 78 | * Lxkeymap keyboard language setting application removed - replaced with dialog within Raspberry Pi Configuration 79 | * Wifi country and keyboard language setting dialogs in Raspberry Pi Configuration now callable from other applications 80 | * New version of Piboto font included to render with correct weight under some rogue applications 81 | * Reconnection to Bluetooth audio devices on reboot improved 82 | * Disable click-to-rename behaviour in file manager if single-click selection enabled 83 | * Appearance Settings dialog makes config changes to some Qt files to match selected theme 84 | * MIME file type associations improved 85 | * Multiple desktop management options removed from mouse middle-click menu 86 | * Menu shortcuts to Raspberry Pi website amended 87 | * Python 2 IDLE menu link removed 88 | * Sample Magpi PDF installed in /home/pi/MagPi 89 | * Various minor tweaks, bug fixes and appearance changes 90 | * Bluetooth updates 91 | - Firmware with Bluetooth 4.2 features 92 | - SCO profile suppot added via bthelper.service 93 | * Linux kernel 4.14.50+ 94 | * Raspberry Pi firmware 748fb17992426bb29d99224b93cb962fefbdc833 95 | 2018-04-18: 96 | * Fixed race between wifi-country.service and raspberrypi-net-mods.service 97 | * Linux kernel 4.14.34+ 98 | * Raspberry Pi firmware 5db8e4e1c63178e200d6fbea23ed4a9bf4656658 99 | 2018-03-13: 100 | * Raspberry Pi 3 B+ support 101 | * WiFi is disabled until wireless regulatory domain is set (Pi 3 B+ only) 102 | - The domain can be done through 'Raspberry Pi Configuration' (rc_gui), 103 | 'raspi-config' or by setting 'country=' to an appropriate ISO 3166 104 | alpha2 country code in /etc/wpa_supplicant/wpa_supplicant.conf. 105 | * Default wireless regulatory domain is now unset 106 | * Added support to desktop for different screen sizes and resolutions, 107 | including multiple preset options in Appearance Settings and pixel doubling 108 | option in Raspberry Pi Configuration 109 | * Version 2.1.16 of Thonny included 110 | * Version 29.0.0.113 of Adobe PepperFlash player included 111 | * Version 1.2.post1 of Pygame Zero included 112 | * Bluetooth plugin now supports connection to Bluetooth LE HID devices 113 | * Network plugin now indicates 5G-compatible APs 114 | * Latest changes to Bluez ALSA service merged 115 | - service now started on CLI boot as well as GUI boot 116 | * Latest changes to dhcpcd networking plugin merged 117 | * Improved support for running on pi-top devices 118 | * Small design changes to PiX theme and icons 119 | * Bug fix - hide spurious window resize handles 120 | * Bug fix - Scratch 2 remote GPIO state block now works correctly 121 | * Updated WiFi Firmware 122 | - brcmfmac43455-sdio 7.45.154 123 | - brcmfmac43430-sdio 7.45.98.38 124 | * New packages: 125 | - policykit-1 126 | - obconf 127 | - python-buttonshim python3-buttonshim 128 | - python-unicornhathd python3-unicornhathd 129 | - python-pantilthat python3-pantilthat 130 | * Linux kernel 4.9.80+ 131 | * Raspberry Pi firmware 3347884c7df574bbabeff6dca63caf686e629699 132 | 2017-11-29: 133 | * Added battery monitor plugin for taskbar - works on x86 images or first-generation Pi-Top 134 | * Added cutdown mode to PCManFM file manager to reduce complexity 135 | * Added ability to rename files in PCManFM by clicking name when selected 136 | * Bug fix in Bluetooth ALSA module to reduce truncation of audio at end of playback 137 | * Various small tweaks, bug fixes and theme modifications 138 | * New kernel and firmware 139 | 2017-09-07: 140 | * Disable predictable network interface names for Ethernet devices 141 | * Bug fix for keyboard settings dialog in Raspberry Pi Configuration 142 | * Bug fix for crash on some videos and animations in Chromium 143 | * Bug fix for taskbar crash when running RealVNC server 144 | * Bug fix for reloading projects with extensions in Scratch 2 145 | * Bug fix for MAC address problem in Bluetooth 146 | * Simple mode and new icons in Thonny 147 | * New Japanese translations in Raspberry Pi Configuration 148 | * Install fonts-droid-fallback for international fonts 149 | 2017-08-16: 150 | * Based on Raspbian Stretch (Debian version 9) 151 | * Version 60 of Chromium browser included 152 | * Version 3.0.1 of Sonic Pi included 153 | * Version 6.1.1 of RealVNC included 154 | * Version 0.17.4 of NodeRED included 155 | * Bluetooth audio routed via ALSA rather than Pulseaudio 156 | * SenseHAT extension added to Scratch 2 157 | * Various desktop applications modified to prompt for sudo password if needed 158 | * lxinput control options for mouse speed simplified 159 | * lxpanel plugins moved into separate packages 160 | * Wireless firmware for Pi 3 and Pi 0W modified to address Broadpwn exploit 161 | * Latest kernel and firmware 162 | * Various small tweaks, bug fixes and theme modifications 163 | 2017-07-05: 164 | * New kernel and firmware 165 | * Filesystem created without the metadata_csum feature 166 | 2017-06-21: 167 | * Scratch 2 application included 168 | * Thonny Python IDE included 169 | * New icons with thinner outlines 170 | * Volume control more linear in behaviour 171 | * Updated Flash player 172 | * Updated RealVNC server and viewer 173 | * Various tweaks and bugfixes 174 | * New kernel and firmware 175 | 2017-04-10: 176 | * Wolfram Mathematica updated to version 11.0.1 177 | * Adobe Flash Player updated to version 25.0.0.127 178 | * Use PARTUUID to support USB boot 179 | 2017-03-02: 180 | * Updated kernel and firmware (final Pi Zero W support) 181 | * Wolfram Mathematica updated to version 11 182 | * NOOBS installs now checks for presence of 'ssh' file on the NOOBS partition. 183 | 2017-02-16: 184 | * Chromium browser updated to version 56 185 | * Adobe Flash Player updated to version 24.0.0.221 186 | * RealVNC Server and Viewer updated to version 6.0.2 (RealVNC Connect) 187 | * Sonic Pi updated to version 2.11 188 | * Node-RED updated to version 0.15.3 189 | * Scratch updated to version 120117 190 | * Detection of SSH enabled with default password moved into PAM 191 | * Updated desktop GL driver to support use of fake KMS option 192 | * Raspberry Pi Configuration and raspi-config allow setting of fixed HDMI resolution 193 | * raspi-config allows enabling of serial hardware independent of serial terminal 194 | * Updates to kernel and firmware 195 | * Various minor bug fixes and usability and appearance tweaks 196 | 2017-01-11: 197 | * Re-release of the 2016-11-25 image with a FAT32-formatted boot partition 198 | 2016-11-25: 199 | * SSH disabled by default; can be enabled by creating a file with name "ssh" in boot partition 200 | * Prompt for password change at boot when SSH enabled with default password unchanged 201 | * Adobe Flash Player included 202 | * Updates to hardware video acceleration in Chromium browser 203 | * Greeter now uses background image from last set in Appearance Settings rather than pi user 204 | * Updated version of Scratch 205 | * Rastrack option removed from raspi-config and Raspberry Pi Configuration 206 | * Ability to disable graphical boot splash screen added to raspi-config and Raspberry Pi Configuration 207 | * Appearance Settings dialog made tabbed to work better on small screens 208 | * Raspberry Pi Configuration now requires current password to change password 209 | * Various small bug fixes 210 | * Updated firmware and kernel 211 | 2016-09-23: 212 | * New PIXEL desktop environment - new icon set, window design, desktop images, splash screen and greeter 213 | * Chromium web browser included 214 | * Infinality font rendering patches included 215 | * RealVNC server and viewer included 216 | * SenseHAT emulator included 217 | * Rfkill entries added to Wifi and Bluetooth panel plugins 218 | * Updates to various standard applications, including Scratch and NodeRED 219 | * Various bug fixes, tweaks and translation updates 220 | * Updated firmware and kernel (https://github.com/raspberrypi/firmware/commit/ad8608c08b122b2c228dba0ff5070d6e9519faf5) 221 | 2016-05-27: 222 | * Fixed crash of lxpanel when D-bus not accessible 223 | * Fixed permissions for D-bus Bluetooth access 224 | * Removed sudo from shutdown options 225 | * Appearance of tooltips updated in theme 226 | * Fixed ejecter plugin grabbing focus 227 | * raspi-config command line and GUI apps tidied; unnecessary reboots removed 228 | * More error detection in piclone; copying of volume names and IDs added 229 | * Updated translation files 230 | 2016-05-10: 231 | * New version of Scratch, which no longer requires sudo 232 | * New version of BlueJ 233 | * New version of NodeRED 234 | * New version of pypy 235 | * pigpio included 236 | * geany editor included 237 | * SD Card Copier added (can be used to duplicate or back up the Pi) 238 | * Bluetooth plugin added to taskbar 239 | * Volume control on taskbar now compatible with Bluetooth devices 240 | * New shutdown helper application 241 | * Mouse double-click speed setting added to mouse and keyboard preference application 242 | * Option to enable / disable 1-wire interface and remote access to pigpio added to Raspberry Pi config application 243 | * File system automatically expanded on first boot 244 | * Empty Wastebasket option added to right-click menu 245 | * Ctrl-Alt-T can be used to open a terminal window 246 | * Various small bug fixes and appearance tweaks 247 | * Updated firmware and kernel (https://github.com/raspberrypi/firmware/commit/cc6d7bf8b4c03a2a660ff9fdf4083fc165620866) 248 | 2016-03-18: 249 | * updated firmware and kernel (https://github.com/raspberrypi/firmware/commit/951799bbcd795ddf27769d14acf4813fdcbe53dc) 250 | * use serial0 in cmdline.txt 251 | * wpa_supplicant.conf country default to GB (allows use of channels 12 and 13) 252 | 2016-02-26: 253 | * Support added for Pi 3, including Wifi and Bluetooth 254 | * Option to set wifi country code added to raspi-config 255 | 2016-02-09: 256 | * dtb that uses mmc sdcard driver (fixes problems experienced with certain SD cards) 257 | 2016-02-03: 258 | * new version of Sonic Pi (2.9) 259 | * new version of Scratch (15/1/16) 260 | * new version of Node-Red (2.5) 261 | * new version of Wolfram (10.3) 262 | * optional experimental GL desktop driver (can be enabled using advanced options in command-line raspi-config) 263 | * new version of Java (1.8.0_65) 264 | * new version of WiringPi 265 | * raspi-gpio included 266 | * ping no longer requires sudo (except NOOBS installs) 267 | * support for more USB audio devices in lxpanel 268 | * bug fix for creation of new menus in Alacarte 269 | * various changes to raspi-config and GUI to tidy up board support and fix bugs, and updated translations 270 | * small tweaks to theme to support GL driver 271 | 2015-11-21: 272 | * Included IBM Node-RED IoT application 273 | * Included graphical package manager 274 | * Included accelerated pixman library 275 | * Updated Epiphany browser to improve video compatibility 276 | * Updated Scratch with performance improvements and bug fixes 277 | * Updated Raspberry Pi configuration to allow boot to pause while 278 | network is established 279 | * Various minor bug fixes 280 | 2015-09-25: 281 | * Based on Debian Jessie 282 | * Upgraded applications - Epiphany browser, Scratch and Sonic Pi 283 | * Included applications - LibreOffice, Claws Mail, Greenfoot, BlueJ 284 | * Included utilities - Alacarte menu editor, Lxkeymap, scrot, tree, pip 285 | * New GUI-based Raspberry Pi Configuration application 286 | * GPIO control now possible without need for sudo 287 | * Web link to Magpi magazine included 288 | * New taskbar plugin to eject mounted USB drives 289 | * Default boot is now to GUI not desktop 290 | * Look and feel now based on GTK+3 default theme 291 | * Print screen key launches scrot to produce screenshot 292 | * Common keyboards autodetected by GUI and drivers loaded accordingly 293 | * Numerous small tweaks and bugfixes 294 | 2015-05-05: 295 | * Updated UI changes 296 | * Updated firmware 297 | * Install raspberrypi-net-mods 298 | * Install avahi-daemon 299 | * Add user pi to new i2c and spi groups 300 | * Modified udev rules for i2c and spi devices 301 | 2015-02-16: 302 | * Newer firmware with various fixes 303 | * New Sonic Pi release 304 | * Pi2 compatible RPi.GPIO 305 | * Updated Wolfram Mathematica 306 | 2015-01-31: 307 | * Support for Pi2 308 | * Newer firmware 309 | * New Sonic Pi release 310 | * Updated Scratch 311 | * New Wolfram Mathematica release 312 | * Updated Epiphany 313 | 2014-12-24: 314 | * Fix regression with omission of python-pygame 315 | 2014-12-22: 316 | * New firmware with variosu fixes and improvements 317 | * New UI configuration for lxde 318 | * Various package updates 319 | * python3-pygame preinstalled 320 | * 'nuscratch', scratch running on the Cog StackVM 321 | * Misc other changes 322 | 2014-09-09: 323 | * New firmware with various fixes and improvements 324 | * Minecraft Pi pre-installed 325 | * Sonic Pi upgraded to 2.0 326 | * Include Epiphany browser work from Collabora 327 | * Switch to Java 8 from Java 7 328 | * Updated Mathematica 329 | * Misc minor configuration changes 330 | 2014-06-20: 331 | * New firmware with various fixes, and kernel bugfix 332 | 2014-06-02: 333 | * Many, many firmware updates with major USB improvements 334 | * pyserial installed by default 335 | * picamera installed by default 336 | 2014-01-07: 337 | * Firmware updated 338 | * Some space saved on the root filesystem 339 | 2013-12-20: 340 | * Firmware updated, includes V4L2 fixes 341 | * Update omxplayer 342 | 2013-12-18: 343 | * Firmware updated and now using kernel 3.10. Many, many improvements 344 | * fbturbo XOrg driver is now included and enabled by default. Thanks to 345 | ssvb https://github.com/ssvb/xf86-video-fbturbo 346 | * Update Scratch image with further bug fixes 347 | * Include Wolfram Mathematica 348 | * Update to PyPy 2.2 349 | * Update omxplayer 350 | * Include v4l-utils for use with experimental V4L2 Raspberry Pi camera driver 351 | * Update squeak-vm to fix issues with loading JPEGs 352 | 2013-09-25: 353 | * Update Scratch image for further performance improvements 354 | * Include Oracle JDK 355 | * At least a 4GiB SD card is now required (see above) 356 | * Include PyPy 2.1 357 | * Include base piface packages 358 | * Update raspi-config to include bugfix for inheriting language settings 359 | from NOOBS 360 | 2013-09-10: 361 | * Updated to current top of tree firmware 362 | * Update squeak-vm, including fastblit optimised for the Raspbery Pi 363 | * Include Sonic Pi and a fixed jackd2 package 364 | * Support boot to Scratch 365 | * Inherit keyboard and language settings from NOOBS 366 | -------------------------------------------------------------------------------- /export-noobs/prerun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" 4 | NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" 5 | unmount_image "${IMG_FILE}" 6 | 7 | mkdir -p "${STAGE_WORK_DIR}" 8 | cp "${WORK_DIR}/export-image/${IMG_FILENAME}${IMG_SUFFIX}.img" "${STAGE_WORK_DIR}/" 9 | 10 | rm -rf "${NOOBS_DIR}" 11 | 12 | PARTED_OUT=$(parted -sm "${IMG_FILE}" unit b print) 13 | BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 2 | tr -d B) 14 | BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 4 | tr -d B) 15 | 16 | ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 2 | tr -d B) 17 | ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 4 | tr -d B) 18 | 19 | BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") 20 | ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") 21 | echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH" 22 | echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH" 23 | 24 | mkdir -p "${STAGE_WORK_DIR}/rootfs" 25 | mkdir -p "${NOOBS_DIR}" 26 | 27 | mount "$ROOT_DEV" "${STAGE_WORK_DIR}/rootfs" 28 | mount "$BOOT_DEV" "${STAGE_WORK_DIR}/rootfs/boot" 29 | 30 | ln -sv "/lib/systemd/system/apply_noobs_os_config.service" "$ROOTFS_DIR/etc/systemd/system/multi-user.target.wants/apply_noobs_os_config.service" 31 | 32 | bsdtar --numeric-owner --format gnutar -C "${STAGE_WORK_DIR}/rootfs/boot" -cpf - . | xz -T0 > "${NOOBS_DIR}/boot.tar.xz" 33 | umount "${STAGE_WORK_DIR}/rootfs/boot" 34 | bsdtar --numeric-owner --format gnutar -C "${STAGE_WORK_DIR}/rootfs" --one-file-system -cpf - . | xz -T0 > "${NOOBS_DIR}/root.tar.xz" 35 | 36 | unmount_image "${IMG_FILE}" 37 | -------------------------------------------------------------------------------- /scripts/common: -------------------------------------------------------------------------------- 1 | log (){ 2 | date +"[%T] $*" | tee -a "${LOG_FILE}" 3 | } 4 | export -f log 5 | 6 | bootstrap(){ 7 | local BOOTSTRAP_CMD=debootstrap 8 | local BOOTSTRAP_ARGS=() 9 | 10 | export http_proxy=${APT_PROXY} 11 | 12 | if [ "$(dpkg --print-architecture)" != "armhf" ]; then 13 | BOOTSTRAP_CMD=qemu-debootstrap 14 | fi 15 | 16 | BOOTSTRAP_ARGS+=(--arch armhf) 17 | BOOTSTRAP_ARGS+=(--components "main,contrib,non-free") 18 | BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg") 19 | BOOTSTRAP_ARGS+=("$@") 20 | 21 | capsh --drop=cap_setfcap -- "${BOOTSTRAP_CMD}" "${BOOTSTRAP_ARGS[@]}" || true 22 | 23 | if [ -d "$2/debootstrap" ]; then 24 | rmdir "$2/debootstrap" 25 | fi 26 | } 27 | export -f bootstrap 28 | 29 | copy_previous(){ 30 | if [ ! -d "${PREV_ROOTFS_DIR}" ]; then 31 | echo "Previous stage rootfs not found" 32 | false 33 | fi 34 | mkdir -p "${ROOTFS_DIR}" 35 | rsync -aHAXx --exclude var/cache/apt/archives "${PREV_ROOTFS_DIR}/" "${ROOTFS_DIR}/" 36 | } 37 | export -f copy_previous 38 | 39 | unmount(){ 40 | if [ -z "$1" ]; then 41 | DIR=$PWD 42 | else 43 | DIR=$1 44 | fi 45 | 46 | while mount | grep -q "$DIR"; do 47 | local LOCS 48 | LOCS=$(mount | grep "$DIR" | cut -f 3 -d ' ' | sort -r) 49 | for loc in $LOCS; do 50 | umount "$loc" 51 | done 52 | done 53 | } 54 | export -f unmount 55 | 56 | unmount_image(){ 57 | sync 58 | sleep 1 59 | local LOOP_DEVICES 60 | LOOP_DEVICES=$(losetup --list | grep "$(basename "${1}")" | cut -f1 -d' ') 61 | for LOOP_DEV in ${LOOP_DEVICES}; do 62 | if [ -n "${LOOP_DEV}" ]; then 63 | local MOUNTED_DIR 64 | MOUNTED_DIR=$(mount | grep "$(basename "${LOOP_DEV}")" | head -n 1 | cut -f 3 -d ' ') 65 | if [ -n "${MOUNTED_DIR}" ] && [ "${MOUNTED_DIR}" != "/" ]; then 66 | unmount "$(dirname "${MOUNTED_DIR}")" 67 | fi 68 | sleep 1 69 | losetup -d "${LOOP_DEV}" 70 | fi 71 | done 72 | } 73 | export -f unmount_image 74 | 75 | on_chroot() { 76 | if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/proc)"; then 77 | mount -t proc proc "${ROOTFS_DIR}/proc" 78 | fi 79 | 80 | if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/dev)"; then 81 | mount --bind /dev "${ROOTFS_DIR}/dev" 82 | fi 83 | 84 | if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/dev/pts)"; then 85 | mount --bind /dev/pts "${ROOTFS_DIR}/dev/pts" 86 | fi 87 | 88 | if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/sys)"; then 89 | mount --bind /sys "${ROOTFS_DIR}/sys" 90 | fi 91 | 92 | capsh --drop=cap_setfcap "--chroot=${ROOTFS_DIR}/" -- -e "$@" 93 | } 94 | export -f on_chroot 95 | 96 | update_issue() { 97 | local GIT_HASH 98 | GIT_HASH=$(git rev-parse HEAD) 99 | echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue" 100 | } 101 | export -f update_issue 102 | 103 | -------------------------------------------------------------------------------- /scripts/dependencies_check: -------------------------------------------------------------------------------- 1 | # dependencies_check 2 | # $@ Dependency files to check 3 | # 4 | # Each dependency is in the form of a tool to test for, optionally followed by 5 | # a : and the name of a package if the package on a Debian-ish system is not 6 | # named for the tool (i.e., qemu-user-static). 7 | dependencies_check() 8 | { 9 | local depfile deps missing 10 | 11 | for depfile in "$@"; do 12 | if [[ -e "$depfile" ]]; then 13 | deps="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${BASE_DIR}/depends")" 14 | 15 | fi 16 | for dep in $deps; do 17 | if ! hash "${dep%:*}" 2>/dev/null; then 18 | missing="${missing:+$missing }${dep#*:}" 19 | fi 20 | done 21 | done 22 | 23 | if [[ "$missing" ]]; then 24 | echo "Required dependencies not installed" 25 | echo 26 | echo "This can be resolved on Debian/Raspbian systems by installing:" 27 | echo "$missing" 28 | false 29 | fi 30 | 31 | 32 | if ! grep -q "/proc/sys/fs/binfmt_misc" /proc/mounts; then 33 | echo "Module binfmt_misc not loaded in host" 34 | echo "Please run:" 35 | echo " sudo modprobe binfmt_misc" 36 | exit 1 37 | fi 38 | } 39 | -------------------------------------------------------------------------------- /scripts/remove-comments.sed: -------------------------------------------------------------------------------- 1 | # Deletes comments and collapses whitespace in ##-packages files 2 | 3 | # Append (N)ext line to buffer 4 | # if (!)not ($)buffer is EOF, (b)ranch to (:)label loop 5 | :loop 6 | N 7 | $ !b loop 8 | 9 | # Buffer is "line1\nline2\n...lineN", del comments and collapse whitespace 10 | s/#[^\n]*//g 11 | s/[[:space:]]\{1,\}/ /g 12 | -------------------------------------------------------------------------------- /stage0/00-configure-apt/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -m 644 files/sources.list "${ROOTFS_DIR}/etc/apt/" 4 | install -m 644 files/raspi.list "${ROOTFS_DIR}/etc/apt/sources.list.d/" 5 | 6 | if [ -n "$APT_PROXY" ]; then 7 | install -m 644 files/51cache "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" 8 | sed "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" -i -e "s|APT_PROXY|${APT_PROXY}|" 9 | else 10 | rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" 11 | fi 12 | 13 | on_chroot apt-key add - < files/raspberrypi.gpg.key 14 | on_chroot << EOF 15 | apt-get update 16 | apt-get dist-upgrade -y 17 | EOF 18 | -------------------------------------------------------------------------------- /stage0/00-configure-apt/files/51cache: -------------------------------------------------------------------------------- 1 | Acquire::http { Proxy "APT_PROXY"; }; 2 | -------------------------------------------------------------------------------- /stage0/00-configure-apt/files/raspberrypi.gpg.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1.4.12 (GNU/Linux) 3 | 4 | mQENBE/d7o8BCACrwqQacGJfn3tnMzGui6mv2lLxYbsOuy/+U4rqMmGEuo3h9m92 5 | 30E2EtypsoWczkBretzLUCFv+VUOxaA6sV9+puTqYGhhQZFuKUWcG7orf7QbZRuu 6 | TxsEUepW5lg7MExmAu1JJzqM0kMQX8fVyWVDkjchZ/is4q3BPOUCJbUJOsE+kK/6 7 | 8kW6nWdhwSAjfDh06bA5wvoXNjYoDdnSZyVdcYCPEJXEg5jfF/+nmiFKMZBraHwn 8 | eQsepr7rBXxNcEvDlSOPal11fg90KXpy7Umre1UcAZYJdQeWcHu7X5uoJx/MG5J8 9 | ic6CwYmDaShIFa92f8qmFcna05+lppk76fsnABEBAAG0IFJhc3BiZXJyeSBQaSBB 10 | cmNoaXZlIFNpZ25pbmcgS2V5iQE4BBMBAgAiBQJP3e6PAhsDBgsJCAcDAgYVCAIJ 11 | CgsEFgIDAQIeAQIXgAAKCRCCsSmSf6MwPk6vB/9pePB3IukU9WC9Bammh3mpQTvL 12 | OifbkzHkmAYxzjfK6D2I8pT0xMxy949+ThzJ7uL60p6T/32ED9DR3LHIMXZvKtuc 13 | mQnSiNDX03E2p7lIP/htoxW2hDP2n8cdlNdt0M9IjaWBppsbO7IrDppG2B1aRLni 14 | uD7v8bHRL2mKTtIDLX42Enl8aLAkJYgNWpZyPkDyOqamjijarIWjGEPCkaURF7g4 15 | d44HvYhpbLMOrz1m6N5Bzoa5+nq3lmifeiWKxioFXU+Hy5bhtAM6ljVb59hbD2ra 16 | X4+3LXC9oox2flmQnyqwoyfZqVgSQa0B41qEQo8t1bz6Q1Ti7fbMLThmbRHiuQEN 17 | BE/d7o8BCADNlVtBZU63fm79SjHh5AEKFs0C3kwa0mOhp9oas/haDggmhiXdzeD3 18 | 49JWz9ZTx+vlTq0s+I+nIR1a+q+GL+hxYt4HhxoA6vlDMegVfvZKzqTX9Nr2VqQa 19 | S4Kz3W5ULv81tw3WowK6i0L7pqDmvDqgm73mMbbxfHD0SyTt8+fk7qX6Ag2pZ4a9 20 | ZdJGxvASkh0McGpbYJhk1WYD+eh4fqH3IaeJi6xtNoRdc5YXuzILnp+KaJyPE5CR 21 | qUY5JibOD3qR7zDjP0ueP93jLqmoKltCdN5+yYEExtSwz5lXniiYOJp8LWFCgv5h 22 | m8aYXkcJS1xVV9Ltno23YvX5edw9QY4hABEBAAGJAR8EGAECAAkFAk/d7o8CGwwA 23 | CgkQgrEpkn+jMD5Figf/dIC1qtDMTbu5IsI5uZPX63xydaExQNYf98cq5H2fWF6O 24 | yVR7ERzA2w33hI0yZQrqO6pU9SRnHRxCFvGv6y+mXXXMRcmjZG7GiD6tQWeN/3wb 25 | EbAn5cg6CJ/Lk/BI4iRRfBX07LbYULCohlGkwBOkRo10T+Ld4vCCnBftCh5x2OtZ 26 | TOWRULxP36y2PLGVNF+q9pho98qx+RIxvpofQM/842ZycjPJvzgVQsW4LT91KYAE 27 | 4TVf6JjwUM6HZDoiNcX6d7zOhNfQihXTsniZZ6rky287htsWVDNkqOi5T3oTxWUo 28 | m++/7s3K3L0zWopdhMVcgg6Nt9gcjzqN1c0gy55L/g== 29 | =mNSj 30 | -----END PGP PUBLIC KEY BLOCK----- 31 | -------------------------------------------------------------------------------- /stage0/00-configure-apt/files/raspi.list: -------------------------------------------------------------------------------- 1 | deb http://archive.raspberrypi.org/debian/ buster main ui staging 2 | # Uncomment line below then 'apt-get update' to enable 'apt-get source' 3 | #deb-src http://archive.raspberrypi.org/debian/ buster main ui 4 | -------------------------------------------------------------------------------- /stage0/00-configure-apt/files/sources.list: -------------------------------------------------------------------------------- 1 | deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi 2 | # Uncomment line below then 'apt-get update' to enable 'apt-get source' 3 | #deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi 4 | -------------------------------------------------------------------------------- /stage0/01-locale/00-debconf: -------------------------------------------------------------------------------- 1 | # Locales to be generated: 2 | # Choices: All locales, aa_DJ ISO-8859-1, aa_DJ.UTF-8 UTF-8, aa_ER UTF-8, aa_ER@saaho UTF-8, aa_ET UTF-8, af_ZA ISO-8859-1, af_ZA.UTF-8 UTF-8, ak_GH UTF-8, am_ET UTF-8, an_ES ISO-8859-15, an_ES.UTF-8 UTF-8, anp_IN UTF-8, ar_AE ISO-8859-6, ar_AE.UTF-8 UTF-8, ar_BH ISO-8859-6, ar_BH.UTF-8 UTF-8, ar_DZ ISO-8859-6, ar_DZ.UTF-8 UTF-8, ar_EG ISO-8859-6, ar_EG.UTF-8 UTF-8, ar_IN UTF-8, ar_IQ ISO-8859-6, ar_IQ.UTF-8 UTF-8, ar_JO ISO-8859-6, ar_JO.UTF-8 UTF-8, ar_KW ISO-8859-6, ar_KW.UTF-8 UTF-8, ar_LB ISO-8859-6, ar_LB.UTF-8 UTF-8, ar_LY ISO-8859-6, ar_LY.UTF-8 UTF-8, ar_MA ISO-8859-6, ar_MA.UTF-8 UTF-8, ar_OM ISO-8859-6, ar_OM.UTF-8 UTF-8, ar_QA ISO-8859-6, ar_QA.UTF-8 UTF-8, ar_SA ISO-8859-6, ar_SA.UTF-8 UTF-8, ar_SD ISO-8859-6, ar_SD.UTF-8 UTF-8, ar_SS UTF-8, ar_SY ISO-8859-6, ar_SY.UTF-8 UTF-8, ar_TN ISO-8859-6, ar_TN.UTF-8 UTF-8, ar_YE ISO-8859-6, ar_YE.UTF-8 UTF-8, as_IN UTF-8, ast_ES ISO-8859-15, ast_ES.UTF-8 UTF-8, ayc_PE UTF-8, az_AZ UTF-8, be_BY CP1251, be_BY.UTF-8 UTF-8, be_BY@latin UTF-8, bem_ZM UTF-8, ber_DZ UTF-8, ber_MA UTF-8, bg_BG CP1251, bg_BG.UTF-8 UTF-8, bho_IN UTF-8, bn_BD UTF-8, bn_IN UTF-8, bo_CN UTF-8, bo_IN UTF-8, br_FR ISO-8859-1, br_FR.UTF-8 UTF-8, br_FR@euro ISO-8859-15, brx_IN UTF-8, bs_BA ISO-8859-2, bs_BA.UTF-8 UTF-8, byn_ER UTF-8, ca_AD ISO-8859-15, ca_AD.UTF-8 UTF-8, ca_ES ISO-8859-1, ca_ES.UTF-8 UTF-8, ca_ES.UTF-8@valencia UTF-8, ca_ES@euro ISO-8859-15, ca_ES@valencia ISO-8859-15, ca_FR ISO-8859-15, ca_FR.UTF-8 UTF-8, ca_IT ISO-8859-15, ca_IT.UTF-8 UTF-8, cmn_TW UTF-8, crh_UA UTF-8, cs_CZ ISO-8859-2, cs_CZ.UTF-8 UTF-8, csb_PL UTF-8, cv_RU UTF-8, cy_GB ISO-8859-14, cy_GB.UTF-8 UTF-8, da_DK ISO-8859-1, da_DK.UTF-8 UTF-8, de_AT ISO-8859-1, de_AT.UTF-8 UTF-8, de_AT@euro ISO-8859-15, de_BE ISO-8859-1, de_BE.UTF-8 UTF-8, de_BE@euro ISO-8859-15, de_CH ISO-8859-1, de_CH.UTF-8 UTF-8, de_DE ISO-8859-1, de_DE.UTF-8 UTF-8, de_DE@euro ISO-8859-15, de_LI.UTF-8 UTF-8, de_LU ISO-8859-1, de_LU.UTF-8 UTF-8, de_LU@euro ISO-8859-15, doi_IN UTF-8, dv_MV UTF-8, dz_BT UTF-8, el_CY ISO-8859-7, el_CY.UTF-8 UTF-8, el_GR ISO-8859-7, el_GR.UTF-8 UTF-8, en_AG UTF-8, en_AU ISO-8859-1, en_AU.UTF-8 UTF-8, en_BW ISO-8859-1, en_BW.UTF-8 UTF-8, en_CA ISO-8859-1, en_CA.UTF-8 UTF-8, en_DK ISO-8859-1, en_DK.ISO-8859-15 ISO-8859-15, en_DK.UTF-8 UTF-8, en_GB ISO-8859-1, en_GB.ISO-8859-15 ISO-8859-15, en_GB.UTF-8 UTF-8, en_HK ISO-8859-1, en_HK.UTF-8 UTF-8, en_IE ISO-8859-1, en_IE.UTF-8 UTF-8, en_IE@euro ISO-8859-15, en_IN UTF-8, en_NG UTF-8, en_NZ ISO-8859-1, en_NZ.UTF-8 UTF-8, en_PH ISO-8859-1, en_PH.UTF-8 UTF-8, en_SG ISO-8859-1, en_SG.UTF-8 UTF-8, en_US ISO-8859-1, en_US.ISO-8859-15 ISO-8859-15, en_US.UTF-8 UTF-8, en_ZA ISO-8859-1, en_ZA.UTF-8 UTF-8, en_ZM UTF-8, en_ZW ISO-8859-1, en_ZW.UTF-8 UTF-8, eo ISO-8859-3, eo.UTF-8 UTF-8, es_AR ISO-8859-1, es_AR.UTF-8 UTF-8, es_BO ISO-8859-1, es_BO.UTF-8 UTF-8, es_CL ISO-8859-1, es_CL.UTF-8 UTF-8, es_CO ISO-8859-1, es_CO.UTF-8 UTF-8, es_CR ISO-8859-1, es_CR.UTF-8 UTF-8, es_CU UTF-8, es_DO ISO-8859-1, es_DO.UTF-8 UTF-8, es_EC ISO-8859-1, es_EC.UTF-8 UTF-8, es_ES ISO-8859-1, es_ES.UTF-8 UTF-8, es_ES@euro ISO-8859-15, es_GT ISO-8859-1, es_GT.UTF-8 UTF-8, es_HN ISO-8859-1, es_HN.UTF-8 UTF-8, es_MX ISO-8859-1, es_MX.UTF-8 UTF-8, es_NI ISO-8859-1, es_NI.UTF-8 UTF-8, es_PA ISO-8859-1, es_PA.UTF-8 UTF-8, es_PE ISO-8859-1, es_PE.UTF-8 UTF-8, es_PR ISO-8859-1, es_PR.UTF-8 UTF-8, es_PY ISO-8859-1, es_PY.UTF-8 UTF-8, es_SV ISO-8859-1, es_SV.UTF-8 UTF-8, es_US ISO-8859-1, es_US.UTF-8 UTF-8, es_UY ISO-8859-1, es_UY.UTF-8 UTF-8, es_VE ISO-8859-1, es_VE.UTF-8 UTF-8, et_EE ISO-8859-1, et_EE.ISO-8859-15 ISO-8859-15, et_EE.UTF-8 UTF-8, eu_ES ISO-8859-1, eu_ES.UTF-8 UTF-8, eu_ES@euro ISO-8859-15, eu_FR ISO-8859-1, eu_FR.UTF-8 UTF-8, eu_FR@euro ISO-8859-15, fa_IR UTF-8, ff_SN UTF-8, fi_FI ISO-8859-1, fi_FI.UTF-8 UTF-8, fi_FI@euro ISO-8859-15, fil_PH UTF-8, fo_FO ISO-8859-1, fo_FO.UTF-8 UTF-8, fr_BE ISO-8859-1, fr_BE.UTF-8 UTF-8, fr_BE@euro ISO-8859-15, fr_CA ISO-8859-1, fr_CA.UTF-8 UTF-8, fr_CH ISO-8859-1, fr_CH.UTF-8 UTF-8, fr_FR ISO-8859-1, fr_FR.UTF-8 UTF-8, fr_FR@euro ISO-8859-15, fr_LU ISO-8859-1, fr_LU.UTF-8 UTF-8, fr_LU@euro ISO-8859-15, fur_IT UTF-8, fy_DE UTF-8, fy_NL UTF-8, ga_IE ISO-8859-1, ga_IE.UTF-8 UTF-8, ga_IE@euro ISO-8859-15, gd_GB ISO-8859-15, gd_GB.UTF-8 UTF-8, gez_ER UTF-8, gez_ER@abegede UTF-8, gez_ET UTF-8, gez_ET@abegede UTF-8, gl_ES ISO-8859-1, gl_ES.UTF-8 UTF-8, gl_ES@euro ISO-8859-15, gu_IN UTF-8, gv_GB ISO-8859-1, gv_GB.UTF-8 UTF-8, ha_NG UTF-8, hak_TW UTF-8, he_IL ISO-8859-8, he_IL.UTF-8 UTF-8, hi_IN UTF-8, hne_IN UTF-8, hr_HR ISO-8859-2, hr_HR.UTF-8 UTF-8, hsb_DE ISO-8859-2, hsb_DE.UTF-8 UTF-8, ht_HT UTF-8, hu_HU ISO-8859-2, hu_HU.UTF-8 UTF-8, hy_AM UTF-8, hy_AM.ARMSCII-8 ARMSCII-8, ia_FR UTF-8, id_ID ISO-8859-1, id_ID.UTF-8 UTF-8, ig_NG UTF-8, ik_CA UTF-8, is_IS ISO-8859-1, is_IS.UTF-8 UTF-8, it_CH ISO-8859-1, it_CH.UTF-8 UTF-8, it_IT ISO-8859-1, it_IT.UTF-8 UTF-8, it_IT@euro ISO-8859-15, iu_CA UTF-8, iw_IL ISO-8859-8, iw_IL.UTF-8 UTF-8, ja_JP.EUC-JP EUC-JP, ja_JP.UTF-8 UTF-8, ka_GE GEORGIAN-PS, ka_GE.UTF-8 UTF-8, kk_KZ PT154, kk_KZ RK1048, kk_KZ.UTF-8 UTF-8, kl_GL ISO-8859-1, kl_GL.UTF-8 UTF-8, km_KH UTF-8, kn_IN UTF-8, ko_KR.EUC-KR EUC-KR, ko_KR.UTF-8 UTF-8, kok_IN UTF-8, ks_IN UTF-8, ks_IN@devanagari UTF-8, ku_TR ISO-8859-9, ku_TR.UTF-8 UTF-8, kw_GB ISO-8859-1, kw_GB.UTF-8 UTF-8, ky_KG UTF-8, lb_LU UTF-8, lg_UG ISO-8859-10, lg_UG.UTF-8 UTF-8, li_BE UTF-8, li_NL UTF-8, lij_IT UTF-8, lo_LA UTF-8, lt_LT ISO-8859-13, lt_LT.UTF-8 UTF-8, lv_LV ISO-8859-13, lv_LV.UTF-8 UTF-8, lzh_TW UTF-8, mag_IN UTF-8, mai_IN UTF-8, mg_MG ISO-8859-15, mg_MG.UTF-8 UTF-8, mhr_RU UTF-8, mi_NZ ISO-8859-13, mi_NZ.UTF-8 UTF-8, mk_MK ISO-8859-5, mk_MK.UTF-8 UTF-8, ml_IN UTF-8, mn_MN UTF-8, mni_IN UTF-8, mr_IN UTF-8, ms_MY ISO-8859-1, ms_MY.UTF-8 UTF-8, mt_MT ISO-8859-3, mt_MT.UTF-8 UTF-8, my_MM UTF-8, nan_TW UTF-8, nan_TW@latin UTF-8, nb_NO ISO-8859-1, nb_NO.UTF-8 UTF-8, nds_DE UTF-8, nds_NL UTF-8, ne_NP UTF-8, nhn_MX UTF-8, niu_NU UTF-8, niu_NZ UTF-8, nl_AW UTF-8, nl_BE ISO-8859-1, nl_BE.UTF-8 UTF-8, nl_BE@euro ISO-8859-15, nl_NL ISO-8859-1, nl_NL.UTF-8 UTF-8, nl_NL@euro ISO-8859-15, nn_NO ISO-8859-1, nn_NO.UTF-8 UTF-8, nr_ZA UTF-8, nso_ZA UTF-8, oc_FR ISO-8859-1, oc_FR.UTF-8 UTF-8, om_ET UTF-8, om_KE ISO-8859-1, om_KE.UTF-8 UTF-8, or_IN UTF-8, os_RU UTF-8, pa_IN UTF-8, pa_PK UTF-8, pap_AN UTF-8, pap_AW UTF-8, pap_CW UTF-8, pl_PL ISO-8859-2, pl_PL.UTF-8 UTF-8, ps_AF UTF-8, pt_BR ISO-8859-1, pt_BR.UTF-8 UTF-8, pt_PT ISO-8859-1, pt_PT.UTF-8 UTF-8, pt_PT@euro ISO-8859-15, quz_PE UTF-8, ro_RO ISO-8859-2, ro_RO.UTF-8 UTF-8, ru_RU ISO-8859-5, ru_RU.CP1251 CP1251, ru_RU.KOI8-R KOI8-R, ru_RU.UTF-8 UTF-8, ru_UA KOI8-U, ru_UA.UTF-8 UTF-8, rw_RW UTF-8, sa_IN UTF-8, sat_IN UTF-8, sc_IT UTF-8, sd_IN UTF-8, sd_IN@devanagari UTF-8, se_NO UTF-8, shs_CA UTF-8, si_LK UTF-8, sid_ET UTF-8, sk_SK ISO-8859-2, sk_SK.UTF-8 UTF-8, sl_SI ISO-8859-2, sl_SI.UTF-8 UTF-8, so_DJ ISO-8859-1, so_DJ.UTF-8 UTF-8, so_ET UTF-8, so_KE ISO-8859-1, so_KE.UTF-8 UTF-8, so_SO ISO-8859-1, so_SO.UTF-8 UTF-8, sq_AL ISO-8859-1, sq_AL.UTF-8 UTF-8, sq_MK UTF-8, sr_ME UTF-8, sr_RS UTF-8, sr_RS@latin UTF-8, ss_ZA UTF-8, st_ZA ISO-8859-1, st_ZA.UTF-8 UTF-8, sv_FI ISO-8859-1, sv_FI.UTF-8 UTF-8, sv_FI@euro ISO-8859-15, sv_SE ISO-8859-1, sv_SE.ISO-8859-15 ISO-8859-15, sv_SE.UTF-8 UTF-8, sw_KE UTF-8, sw_TZ UTF-8, szl_PL UTF-8, ta_IN UTF-8, ta_LK UTF-8, te_IN UTF-8, tg_TJ KOI8-T, tg_TJ.UTF-8 UTF-8, th_TH TIS-620, th_TH.UTF-8 UTF-8, the_NP UTF-8, ti_ER UTF-8, ti_ET UTF-8, tig_ER UTF-8, tk_TM UTF-8, tl_PH ISO-8859-1, tl_PH.UTF-8 UTF-8, tn_ZA UTF-8, tr_CY ISO-8859-9, tr_CY.UTF-8 UTF-8, tr_TR ISO-8859-9, tr_TR.UTF-8 UTF-8, ts_ZA UTF-8, tt_RU UTF-8, tt_RU@iqtelif UTF-8, ug_CN UTF-8, uk_UA KOI8-U, uk_UA.UTF-8 UTF-8, unm_US UTF-8, ur_IN UTF-8, ur_PK UTF-8, uz_UZ ISO-8859-1, uz_UZ.UTF-8 UTF-8, uz_UZ@cyrillic UTF-8, ve_ZA UTF-8, vi_VN UTF-8, wa_BE ISO-8859-1, wa_BE.UTF-8 UTF-8, wa_BE@euro ISO-8859-15, wae_CH UTF-8, wal_ET UTF-8, wo_SN UTF-8, xh_ZA ISO-8859-1, xh_ZA.UTF-8 UTF-8, yi_US CP1255, yi_US.UTF-8 UTF-8, yo_NG UTF-8, yue_HK UTF-8, zh_CN GB2312, zh_CN.GB18030 GB18030, zh_CN.GBK GBK, zh_CN.UTF-8 UTF-8, zh_HK BIG5-HKSCS, zh_HK.UTF-8 UTF-8, zh_SG GB2312, zh_SG.GBK GBK, zh_SG.UTF-8 UTF-8, zh_TW BIG5, zh_TW.EUC-TW EUC-TW, zh_TW.UTF-8 UTF-8, zu_ZA ISO-8859-1, zu_ZA.UTF-8 UTF-8 3 | locales locales/locales_to_be_generated multiselect en_GB.UTF-8 UTF-8 4 | # Default locale for the system environment: 5 | # Choices: None, C.UTF-8, en_GB.UTF-8 6 | locales locales/default_environment_locale select en_GB.UTF-8 7 | -------------------------------------------------------------------------------- /stage0/01-locale/00-packages: -------------------------------------------------------------------------------- 1 | locales 2 | -------------------------------------------------------------------------------- /stage0/02-firmware/01-packages: -------------------------------------------------------------------------------- 1 | raspberrypi-bootloader 2 | raspberrypi-kernel 3 | -------------------------------------------------------------------------------- /stage0/files/raspberrypi.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/stage0/files/raspberrypi.gpg -------------------------------------------------------------------------------- /stage0/prerun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ ! -d "${ROOTFS_DIR}" ]; then 4 | bootstrap buster "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ 5 | fi 6 | -------------------------------------------------------------------------------- /stage1/00-boot-files/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -m 644 files/cmdline.txt "${ROOTFS_DIR}/boot/" 4 | install -m 644 files/config.txt "${ROOTFS_DIR}/boot/" 5 | -------------------------------------------------------------------------------- /stage1/00-boot-files/files/cmdline.txt: -------------------------------------------------------------------------------- 1 | dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait 2 | -------------------------------------------------------------------------------- /stage1/00-boot-files/files/config.txt: -------------------------------------------------------------------------------- 1 | # For more options and information see 2 | # http://rpf.io/configtxt 3 | # Some settings may impact device functionality. See link above for details 4 | 5 | # uncomment if you get no picture on HDMI for a default "safe" mode 6 | #hdmi_safe=1 7 | 8 | # uncomment this if your display has a black border of unused pixels visible 9 | # and your display can output without overscan 10 | #disable_overscan=1 11 | 12 | # uncomment the following to adjust overscan. Use positive numbers if console 13 | # goes off screen, and negative if there is too much border 14 | #overscan_left=16 15 | #overscan_right=16 16 | #overscan_top=16 17 | #overscan_bottom=16 18 | 19 | # uncomment to force a console size. By default it will be display's size minus 20 | # overscan. 21 | #framebuffer_width=1280 22 | #framebuffer_height=720 23 | 24 | # uncomment if hdmi display is not detected and composite is being output 25 | #hdmi_force_hotplug=1 26 | 27 | # uncomment to force a specific HDMI mode (this will force VGA) 28 | #hdmi_group=1 29 | #hdmi_mode=1 30 | 31 | # uncomment to force a HDMI mode rather than DVI. This can make audio work in 32 | # DMT (computer monitor) modes 33 | #hdmi_drive=2 34 | 35 | # uncomment to increase signal to HDMI, if you have interference, blanking, or 36 | # no display 37 | #config_hdmi_boost=4 38 | 39 | # uncomment for composite PAL 40 | #sdtv_mode=2 41 | 42 | #uncomment to overclock the arm. 700 MHz is the default. 43 | #arm_freq=800 44 | 45 | # Uncomment some or all of these to enable the optional hardware interfaces 46 | #dtparam=i2c_arm=on 47 | #dtparam=i2s=on 48 | #dtparam=spi=on 49 | 50 | # Uncomment this to enable the lirc-rpi module 51 | #dtoverlay=lirc-rpi 52 | 53 | # Additional overlays and parameters are documented /boot/overlays/README 54 | 55 | # Enable audio (loads snd_bcm2835) 56 | dtparam=audio=on 57 | -------------------------------------------------------------------------------- /stage1/01-sys-tweaks/00-patches/01-bashrc.diff: -------------------------------------------------------------------------------- 1 | --- a/rootfs/etc/skel/.bashrc 2 | +++ b/rootfs/etc/skel/.bashrc 3 | @@ -43,7 +43,7 @@ 4 | # uncomment for a colored prompt, if the terminal has the capability; turned 5 | # off by default to not distract the user: the focus in a terminal window 6 | # should be on the output of commands, not on the prompt 7 | -#force_color_prompt=yes 8 | +force_color_prompt=yes 9 | 10 | if [ -n "$force_color_prompt" ]; then 11 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 12 | @@ -57,7 +57,7 @@ 13 | fi 14 | 15 | if [ "$color_prompt" = yes ]; then 16 | - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 17 | + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] ' 18 | else 19 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 20 | fi 21 | @@ -79,9 +79,9 @@ 22 | #alias dir='dir --color=auto' 23 | #alias vdir='vdir --color=auto' 24 | 25 | - #alias grep='grep --color=auto' 26 | - #alias fgrep='fgrep --color=auto' 27 | - #alias egrep='egrep --color=auto' 28 | + alias grep='grep --color=auto' 29 | + alias fgrep='fgrep --color=auto' 30 | + alias egrep='egrep --color=auto' 31 | fi 32 | 33 | # colored GCC warnings and errors 34 | -------------------------------------------------------------------------------- /stage1/01-sys-tweaks/00-patches/series: -------------------------------------------------------------------------------- 1 | 01-bashrc.diff 2 | -------------------------------------------------------------------------------- /stage1/01-sys-tweaks/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -d "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d" 4 | install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf" 5 | install -v -m 644 files/fstab "${ROOTFS_DIR}/etc/fstab" 6 | 7 | on_chroot << EOF 8 | if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then 9 | adduser --disabled-password --gecos "" ${FIRST_USER_NAME} 10 | fi 11 | echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd 12 | echo "root:root" | chpasswd 13 | EOF 14 | 15 | 16 | -------------------------------------------------------------------------------- /stage1/01-sys-tweaks/files/fstab: -------------------------------------------------------------------------------- 1 | proc /proc proc defaults 0 0 2 | BOOTDEV /boot vfat defaults 0 2 3 | ROOTDEV / ext4 defaults,noatime 0 1 4 | -------------------------------------------------------------------------------- /stage1/01-sys-tweaks/files/noclear.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | TTYVTDisallocate=no 3 | -------------------------------------------------------------------------------- /stage1/02-net-tweaks/00-packages: -------------------------------------------------------------------------------- 1 | netbase 2 | -------------------------------------------------------------------------------- /stage1/02-net-tweaks/00-patches/01-hosts.diff: -------------------------------------------------------------------------------- 1 | Index: jessie-stage1/rootfs/etc/hosts 2 | =================================================================== 3 | --- jessie-stage1.orig/rootfs/etc/hosts 4 | +++ jessie-stage1/rootfs/etc/hosts 5 | @@ -3,3 +3,4 @@ 6 | ff02::1 ip6-allnodes 7 | ff02::2 ip6-allrouters 8 | 9 | +127.0.0.1 hassbian 10 | -------------------------------------------------------------------------------- /stage1/02-net-tweaks/00-patches/series: -------------------------------------------------------------------------------- 1 | 01-hosts.diff 2 | -------------------------------------------------------------------------------- /stage1/02-net-tweaks/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -m 644 files/ipv6.conf "${ROOTFS_DIR}/etc/modprobe.d/ipv6.conf" 4 | install -m 644 files/hostname "${ROOTFS_DIR}/etc/hostname" 5 | 6 | ln -sf /dev/null "${ROOTFS_DIR}/etc/systemd/network/99-default.link" 7 | -------------------------------------------------------------------------------- /stage1/02-net-tweaks/files/hostname: -------------------------------------------------------------------------------- 1 | hassbian 2 | -------------------------------------------------------------------------------- /stage1/02-net-tweaks/files/interfaces: -------------------------------------------------------------------------------- 1 | auto lo 2 | 3 | iface lo inet loopback 4 | iface eth0 inet dhcp 5 | -------------------------------------------------------------------------------- /stage1/02-net-tweaks/files/ipv6.conf: -------------------------------------------------------------------------------- 1 | # Don't load ipv6 by default 2 | alias net-pf-10 off 3 | #alias ipv6 off 4 | -------------------------------------------------------------------------------- /stage1/03-install-packages/00-packages: -------------------------------------------------------------------------------- 1 | libraspberrypi-bin libraspberrypi0 raspi-config 2 | -------------------------------------------------------------------------------- /stage1/prerun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ ! -d "${ROOTFS_DIR}" ]; then 4 | copy_previous 5 | fi 6 | -------------------------------------------------------------------------------- /stage2/00-copies-and-fills/01-packages: -------------------------------------------------------------------------------- 1 | raspi-copies-and-fills 2 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-debconf: -------------------------------------------------------------------------------- 1 | # Encoding to use on the console: 2 | # Choices: ARMSCII-8, CP1251, CP1255, CP1256, GEORGIAN-ACADEMY, GEORGIAN-PS, IBM1133, ISIRI-3342, ISO-8859-1, ISO-8859-10, ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, KOI8-R, KOI8-U, TIS-620, UTF-8, VISCII 3 | console-setup console-setup/charmap47 select UTF-8 4 | # Character set to support: 5 | # Choices: . Arabic, # Armenian, # Cyrillic - KOI8-R and KOI8-U, # Cyrillic - non-Slavic languages, # Cyrillic - Slavic languages (also Bosnian and Serbian Latin), . Ethiopic, # Georgian, # Greek, # Hebrew, # Lao, # Latin1 and Latin5 - western Europe and Turkic languages, # Latin2 - central Europe and Romanian, # Latin3 and Latin8 - Chichewa; Esperanto; Irish; Maltese and Welsh, # Latin7 - Lithuanian; Latvian; Maori and Marshallese, . Latin - Vietnamese, # Thai, . Combined - Latin; Slavic Cyrillic; Hebrew; basic Arabic, . Combined - Latin; Slavic Cyrillic; Greek, . Combined - Latin; Slavic and non-Slavic Cyrillic, Guess optimal character set 6 | console-setup console-setup/codeset47 select Guess optimal character set 7 | # Font for the console: 8 | # Choices: Fixed, Goha, GohaClassic, Terminus, TerminusBold, TerminusBoldVGA, VGA, Do not change the boot/kernel font, Let the system select a suitable font 9 | console-setup console-setup/fontface47 select Do not change the boot/kernel font 10 | # Key to function as AltGr: 11 | # Choices: The default for the keyboard layout, No AltGr key, Right Alt (AltGr), Right Control, Right Logo key, Menu key, Left Alt, Left Logo key, Keypad Enter key, Both Logo keys, Both Alt keys 12 | keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout 13 | # Keyboard model: 14 | # Choices: A4Tech KB-21, A4Tech KBS-8, A4Tech Wireless Desktop RFKB-23, Acer AirKey V, Acer C300, Acer Ferrari 4000, Acer Laptop, Advance Scorpius KI, Amiga, Apple, Apple Aluminium Keyboard (ANSI), Apple Aluminium Keyboard (ISO), Apple Aluminium Keyboard (JIS), Apple Laptop, Asus Laptop, Atari TT, Azona RF2300 wireless Internet Keyboard, BTC 5090, BTC 5113RF Multimedia, BTC 5126T, BTC 6301URF, BTC 9000, BTC 9000A, BTC 9001AH, BTC 9019U, BTC 9116U Mini Wireless Internet and Gaming, BenQ X-Touch, BenQ X-Touch 730, BenQ X-Touch 800, Brother Internet Keyboard, Cherry B.UNLIMITED, Cherry Blue Line CyBo@rd, Cherry Blue Line CyBo@rd (alternate option), Cherry CyBo@rd USB-Hub, Cherry CyMotion Expert, Cherry CyMotion Master Linux, Cherry CyMotion Master XPress, Chicony Internet Keyboard, Chicony KB-9885, Chicony KU-0108, Chicony KU-0420, Classmate PC, Compaq Easy Access Keyboard, Compaq Internet Keyboard (13 keys), Compaq Internet Keyboard (18 keys), Compaq Internet Keyboard (7 keys), Compaq iPaq Keyboard, Creative Desktop Wireless 7000, DTK2000, Dell, Dell 101-key PC, Dell Laptop/notebook Inspiron 6xxx/8xxx, Dell Laptop/notebook Precision M series, Dell Latitude series laptop, Dell Precision M65, Dell SK-8125, Dell SK-8135, Dell USB Multimedia Keyboard, Dexxa Wireless Desktop Keyboard, Diamond 9801 / 9802 series, Ennyah DKB-1008, Everex STEPnote, FL90, Fujitsu-Siemens Computers AMILO laptop, Generic 101-key PC, Generic 102-key (Intl) PC, Generic 104-key PC, Generic 105-key (Intl) PC, Genius Comfy KB-12e, Genius Comfy KB-16M / Genius MM Keyboard KWD-910, Genius Comfy KB-21e-Scroll, Genius KB-19e NB, Genius KKB-2050HS, Gyration, HTC Dream, Happy Hacking Keyboard, Happy Hacking Keyboard for Mac, Hewlett-Packard Internet Keyboard, Hewlett-Packard Mini 110 Notebook, Hewlett-Packard Omnibook 500 FA, Hewlett-Packard Omnibook 5xx, Hewlett-Packard Omnibook 6000/6100, Hewlett-Packard Omnibook XE3 GC, Hewlett-Packard Omnibook XE3 GF, Hewlett-Packard Omnibook XT1000, Hewlett-Packard Pavilion ZT11xx, Hewlett-Packard Pavilion dv5, Hewlett-Packard SK-250x Multimedia Keyboard, Hewlett-Packard nx9020, Honeywell Euroboard, Htc Dream phone, IBM Rapid Access, IBM Rapid Access II, IBM Space Saver, IBM ThinkPad 560Z/600/600E/A22E, IBM ThinkPad R60/T60/R61/T61, IBM ThinkPad Z60m/Z60t/Z61m/Z61t, Keytronic FlexPro, Kinesis, Laptop/notebook Compaq (eg. Armada) Laptop Keyboard, Laptop/notebook Compaq (eg. Presario) Internet Keyboard, Laptop/notebook eMachines m68xx, Logitech Access Keyboard, Logitech Cordless Desktop, Logitech Cordless Desktop (alternate option), Logitech Cordless Desktop EX110, Logitech Cordless Desktop LX-300, Logitech Cordless Desktop Navigator, Logitech Cordless Desktop Optical, Logitech Cordless Desktop Pro (alternate option 2), Logitech Cordless Desktop iTouch, Logitech Cordless Freedom/Desktop Navigator, Logitech G15 extra keys via G15daemon, Logitech Generic Keyboard, Logitech Internet 350 Keyboard, Logitech Internet Keyboard, Logitech Internet Navigator Keyboard, Logitech Media Elite Keyboard, Logitech Ultra-X Cordless Media Desktop Keyboard, Logitech Ultra-X Keyboard, Logitech diNovo Edge Keyboard, Logitech diNovo Keyboard, Logitech iTouch, Logitech iTouch Cordless Keyboard (model Y-RB6), Logitech iTouch Internet Navigator Keyboard SE, Logitech iTouch Internet Navigator Keyboard SE (USB), MacBook/MacBook Pro, MacBook/MacBook Pro (Intl), Macintosh, Macintosh Old, Memorex MX1998, Memorex MX2500 EZ-Access Keyboard, Memorex MX2750, Microsoft Comfort Curve Keyboard 2000, Microsoft Internet Keyboard, Microsoft Internet Keyboard Pro\, Swedish, Microsoft Natural, Microsoft Natural Keyboard Elite, Microsoft Natural Keyboard Pro / Microsoft Internet Keyboard Pro, Microsoft Natural Keyboard Pro OEM, Microsoft Natural Keyboard Pro USB / Microsoft Internet Keyboard Pro, Microsoft Natural Wireless Ergonomic Keyboard 4000, Microsoft Natural Wireless Ergonomic Keyboard 7000, Microsoft Office Keyboard, Microsoft Wireless Multimedia Keyboard 1.0A, Northgate OmniKey 101, OLPC, Ortek MCK-800 MM/Internet keyboard, PC-98xx Series, Propeller Voyager (KTEZ-1000), QTronix Scorpius 98N+, SILVERCREST Multimedia Wireless Keyboard, SK-1300, SK-2500, SK-6200, SK-7100, SVEN Ergonomic 2500, SVEN Slim 303, Samsung SDM 4500P, Samsung SDM 4510P, Sanwa Supply SKB-KG3, Sun Type 4, Sun Type 5, Sun Type 6 (Japanese layout), Sun Type 6 USB (Japanese layout), Sun Type 6 USB (Unix layout), Sun Type 6/7 USB, Sun Type 6/7 USB (European layout), Sun Type 7 USB, Sun Type 7 USB (European layout), Sun Type 7 USB (Japanese layout) / Japanese 106-key, Sun Type 7 USB (Unix layout), Super Power Multimedia Keyboard, Symplon PaceBook (tablet PC), Targa Visionary 811, Toshiba Satellite S3000, Trust Direct Access Keyboard, Trust Slimline, Trust Wireless Keyboard Classic, TypeMatrix EZ-Reach 2020, TypeMatrix EZ-Reach 2030 PS2, TypeMatrix EZ-Reach 2030 USB, TypeMatrix EZ-Reach 2030 USB (102/105:EU mode), TypeMatrix EZ-Reach 2030 USB (106:JP mode), Unitek KB-1925, ViewSonic KU-306 Internet Keyboard, Winbook Model XP5, Yahoo! Internet Keyboard 15 | keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC 16 | # Keymap to use: 17 | # Choices: American English, Albanian, Arabic, Asturian, Bangladesh, Belarusian, Bengali, Belgian, Bosnian, Brazilian, British English, Bulgarian, Bulgarian (phonetic layout), Burmese, Canadian French, Canadian Multilingual, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Dvorak, Dzongkha, Esperanto, Estonian, Ethiopian, Finnish, French, Georgian, German, Greek, Gujarati, Gurmukhi, Hebrew, Hindi, Hungarian, Icelandic, Irish, Italian, Japanese, Kannada, Kazakh, Khmer, Kirghiz, Korean, Kurdish (F layout), Kurdish (Q layout), Lao, Latin American, Latvian, Lithuanian, Macedonian, Malayalam, Nepali, Northern Sami, Norwegian, Persian, Philippines, Polish, Portuguese, Punjabi, Romanian, Russian, Serbian (Cyrillic), Sindhi, Sinhala, Slovak, Slovenian, Spanish, Swedish, Swiss French, Swiss German, Tajik, Tamil, Telugu, Thai, Tibetan, Turkish (F layout), Turkish (Q layout), Ukrainian, Uyghur, Vietnamese 18 | keyboard-configuration keyboard-configuration/xkb-keymap select gb 19 | # Compose key: 20 | # Choices: No compose key, Right Alt (AltGr), Right Control, Right Logo key, Menu key, Left Logo key, Caps Lock 21 | keyboard-configuration keyboard-configuration/compose select No compose key 22 | # Use Control+Alt+Backspace to terminate the X server? 23 | keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean true 24 | # Keyboard layout: 25 | # Choices: English (UK), English (UK) - English (UK\, Colemak), English (UK) - English (UK\, Dvorak with UK punctuation), English (UK) - English (UK\, Dvorak), English (UK) - English (UK\, Macintosh international), English (UK) - English (UK\, Macintosh), English (UK) - English (UK\, extended WinKeys), English (UK) - English (UK\, international with dead keys), Other 26 | keyboard-configuration keyboard-configuration/variant select English (UK) 27 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-packages: -------------------------------------------------------------------------------- 1 | ssh less fbset sudo psmisc strace ed ncdu crda 2 | console-setup keyboard-configuration debconf-utils parted unzip 3 | build-essential manpages-dev python bash-completion gdb pkg-config 4 | python-rpi.gpio v4l-utils 5 | avahi-daemon 6 | lua5.1 7 | luajit 8 | hardlink ca-certificates curl 9 | fake-hwclock nfs-common usbutils 10 | libraspberrypi-dev libraspberrypi-doc libfreetype6-dev 11 | dosfstools 12 | dphys-swapfile 13 | raspberrypi-sys-mods 14 | pi-bluetooth 15 | apt-listchanges 16 | usb-modeswitch 17 | apt-transport-https 18 | libpam-chksshpwd 19 | rpi-update 20 | libmtp-runtime 21 | rsync 22 | htop 23 | man-db 24 | policykit-1 25 | ssh-import-id 26 | rng-tools 27 | ethtool 28 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-packages-nr: -------------------------------------------------------------------------------- 1 | cifs-utils 2 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-patches/01-useradd.diff: -------------------------------------------------------------------------------- 1 | Index: jessie-stage2/rootfs/etc/default/useradd 2 | =================================================================== 3 | --- jessie-stage2.orig/rootfs/etc/default/useradd 4 | +++ jessie-stage2/rootfs/etc/default/useradd 5 | @@ -5,7 +5,7 @@ 6 | # Similar to DHSELL in adduser. However, we use "sh" here because 7 | # useradd is a low level utility and should be as general 8 | # as possible 9 | -SHELL=/bin/sh 10 | +SHELL=/bin/bash 11 | # 12 | # The default group for users 13 | # 100=users on Debian systems 14 | @@ -29,7 +29,7 @@ SHELL=/bin/sh 15 | # The SKEL variable specifies the directory containing "skeletal" user 16 | # files; in other words, files such as a sample .profile that will be 17 | # copied to the new user's home directory when it is created. 18 | -# SKEL=/etc/skel 19 | +SKEL=/etc/skel 20 | # 21 | # Defines whether the mail spool should be created while 22 | # creating the account 23 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-patches/02-swap.diff: -------------------------------------------------------------------------------- 1 | Index: jessie-stage2/rootfs/etc/dphys-swapfile 2 | =================================================================== 3 | --- jessie-stage2.orig/rootfs/etc/dphys-swapfile 4 | +++ jessie-stage2/rootfs/etc/dphys-swapfile 5 | @@ -13,7 +13,7 @@ 6 | 7 | # set size to absolute value, leaving empty (default) then uses computed value 8 | # you most likely don't want this, unless you have an special disk situation 9 | -#CONF_SWAPSIZE= 10 | +CONF_SWAPSIZE=100 11 | 12 | # set size to computed value, this times RAM size, dynamically adapts, 13 | # guarantees that there is enough swap without wasting disk space on excess 14 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-patches/04-inputrc.diff: -------------------------------------------------------------------------------- 1 | Index: jessie-stage2/rootfs/etc/inputrc 2 | =================================================================== 3 | --- jessie-stage2.orig/rootfs/etc/inputrc 4 | +++ jessie-stage2/rootfs/etc/inputrc 5 | @@ -65,3 +65,7 @@ $endif 6 | # "\e[F": end-of-line 7 | 8 | $endif 9 | + 10 | +# mappings for up and down arrows search history 11 | +# "\e[B": history-search-forward 12 | +# "\e[A": history-search-backward 13 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-patches/05-path.diff: -------------------------------------------------------------------------------- 1 | Index: jessie-stage2/rootfs/etc/login.defs 2 | =================================================================== 3 | --- jessie-stage2.orig/rootfs/etc/login.defs 4 | +++ jessie-stage2/rootfs/etc/login.defs 5 | @@ -100,7 +100,7 @@ HUSHLOGIN_FILE .hushlogin 6 | # 7 | # (they are minimal, add the rest in the shell startup files) 8 | ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 9 | -ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games 10 | +ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 11 | 12 | # 13 | # Terminal permissions 14 | Index: jessie-stage2/rootfs/etc/profile 15 | =================================================================== 16 | --- jessie-stage2.orig/rootfs/etc/profile 17 | +++ jessie-stage2/rootfs/etc/profile 18 | @@ -4,7 +4,7 @@ 19 | if [ "`id -u`" -eq 0 ]; then 20 | PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 21 | else 22 | - PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" 23 | + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games" 24 | fi 25 | export PATH 26 | 27 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-patches/07-resize-init.diff: -------------------------------------------------------------------------------- 1 | --- a/rootfs/boot/cmdline.txt 2 | +++ b/rootfs/boot/cmdline.txt 3 | @@ -1 +1 @@ 4 | -dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait 5 | +dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh 6 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/00-patches/series: -------------------------------------------------------------------------------- 1 | 01-useradd.diff 2 | 02-swap.diff 3 | 04-inputrc.diff 4 | 05-path.diff 5 | 07-resize-init.diff 6 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/01-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" 4 | 5 | install -d "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d" 6 | install -m 644 files/ttyoutput.conf "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/" 7 | 8 | install -m 644 files/50raspi "${ROOTFS_DIR}/etc/apt/apt.conf.d/" 9 | 10 | install -m 644 files/console-setup "${ROOTFS_DIR}/etc/default/" 11 | 12 | install -m 755 files/rc.local "${ROOTFS_DIR}/etc/" 13 | 14 | on_chroot << EOF 15 | systemctl disable hwclock.sh 16 | systemctl disable nfs-common 17 | systemctl disable rpcbind 18 | if [ "${ENABLE_SSH}" == "1" ]; then 19 | systemctl enable ssh 20 | else 21 | systemctl disable ssh 22 | fi 23 | systemctl enable regenerate_ssh_host_keys 24 | EOF 25 | 26 | if [ "${USE_QEMU}" = "1" ]; then 27 | echo "enter QEMU mode" 28 | install -m 644 files/90-qemu.rules "${ROOTFS_DIR}/etc/udev/rules.d/" 29 | on_chroot << EOF 30 | systemctl disable resize2fs_once 31 | EOF 32 | echo "leaving QEMU mode" 33 | else 34 | on_chroot << EOF 35 | systemctl enable resize2fs_once 36 | EOF 37 | fi 38 | 39 | on_chroot <&2 23 | exit 3 24 | ;; 25 | esac 26 | -------------------------------------------------------------------------------- /stage2/01-sys-tweaks/files/ttyoutput.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | StandardOutput=tty 3 | -------------------------------------------------------------------------------- /stage2/02-net-tweaks/00-packages: -------------------------------------------------------------------------------- 1 | wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek 2 | raspberrypi-net-mods 3 | dhcpcd5 4 | net-tools 5 | -------------------------------------------------------------------------------- /stage2/02-net-tweaks/01-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -v -d "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d" 4 | install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/" 5 | 6 | install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant" 7 | install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/" 8 | 9 | if [ -v WPA_COUNTRY ]; then 10 | echo "country=${WPA_COUNTRY}" >> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" 11 | fi 12 | 13 | if [ -v WPA_ESSID ] && [ -v WPA_PASSWORD ]; then 14 | on_chroot <> "/etc/wpa_supplicant/wpa_supplicant.conf" 16 | EOF 17 | fi 18 | -------------------------------------------------------------------------------- /stage2/02-net-tweaks/files/wait.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStart= 3 | ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w 4 | -------------------------------------------------------------------------------- /stage2/02-net-tweaks/files/wpa_supplicant.conf: -------------------------------------------------------------------------------- 1 | ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 2 | update_config=1 3 | -------------------------------------------------------------------------------- /stage2/03-set-timezone/02-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | echo "Europe/London" > "${ROOTFS_DIR}/etc/timezone" 4 | rm "${ROOTFS_DIR}/etc/localtime" 5 | 6 | on_chroot << EOF 7 | dpkg-reconfigure -f noninteractive tzdata 8 | EOF 9 | -------------------------------------------------------------------------------- /stage2/prerun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ ! -d "${ROOTFS_DIR}" ]; then 4 | copy_previous 5 | fi 6 | -------------------------------------------------------------------------------- /stage3/00-hassbian-repo/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -m 644 files/hassbian.list "${ROOTFS_DIR}/etc/apt/sources.list.d/" 4 | 5 | #on_chroot apt-key add - < files/hassbian.gpg.key 6 | 7 | on_chroot << EOF 8 | apt update 9 | EOF 10 | -------------------------------------------------------------------------------- /stage3/00-hassbian-repo/files/hassbian.list: -------------------------------------------------------------------------------- 1 | deb [trusted=yes] https://gitlab.com/hassbian/repository/raw/master buster main 2 | -------------------------------------------------------------------------------- /stage3/01-install-packages/00-packages: -------------------------------------------------------------------------------- 1 | git python3 python3-venv python3-pip bluetooth libbluetooth-dev rng-tools rpi-update htop tmux avahi-daemon libtool autoconf rfkill gvfs libssl-dev libffi-dev python-dev libudev-dev zip nodejs apt-transport-https bluez-hcidump bc figlet 2 | -------------------------------------------------------------------------------- /stage3/02-tweaks/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | on_chroot << EOF 4 | groupadd -f -r -g 1001 homeassistant 5 | useradd -u 1001 -g 1001 -rm homeassistant 6 | EOF 7 | 8 | install -v -o 1001 -g 1001 -d ${ROOTFS_DIR}/srv/homeassistant 9 | 10 | on_chroot << \EOF 11 | apt install -f hassbian-scripts 12 | EOF 13 | 14 | on_chroot << EOF 15 | systemctl enable install_homeassistant 16 | EOF 17 | 18 | on_chroot << EOF 19 | sed -i 's/PrintMotd no/PrintMotd yes/' /etc/ssh/sshd_config 20 | rm /etc/update-motd.d/10-uname 21 | rm /etc/motd 22 | EOF 23 | 24 | on_chroot << \EOF 25 | for GRP in dialout gpio i2c input netdev spi video; do 26 | adduser homeassistant $GRP 27 | done 28 | for GRP in homeassistant; do 29 | adduser pi $GRP 30 | done 31 | EOF 32 | 33 | -------------------------------------------------------------------------------- /stage3/03-cleanup/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | on_chroot << EOF 4 | apt-get clean 5 | EOF 6 | -------------------------------------------------------------------------------- /stage3/EXPORT_IMAGE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/stage3/EXPORT_IMAGE -------------------------------------------------------------------------------- /stage3/prerun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ ! -d "${ROOTFS_DIR}" ]; then 4 | copy_previous 5 | fi 6 | -------------------------------------------------------------------------------- /stage4/00-hassbian-repo/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | install -m 644 files/hassbian.list "${ROOTFS_DIR}/etc/apt/sources.list.d/" 4 | 5 | #on_chroot apt-key add - < files/hassbian.gpg.key 6 | 7 | on_chroot << EOF 8 | apt update 9 | EOF 10 | -------------------------------------------------------------------------------- /stage4/00-hassbian-repo/files/hassbian.list: -------------------------------------------------------------------------------- 1 | deb [trusted=yes] https://gitlab.com/hassbian/repository-dev/raw/master buster main 2 | 3 | -------------------------------------------------------------------------------- /stage4/01-install-packages/00-packages: -------------------------------------------------------------------------------- 1 | git python3 python3-venv python3-pip bluetooth libbluetooth-dev rng-tools rpi-update htop tmux avahi-daemon libtool autoconf rfkill gvfs libssl-dev libffi-dev python-dev libudev-dev zip nodejs apt-transport-https bluez-hcidump bc figlet 2 | -------------------------------------------------------------------------------- /stage4/02-tweaks/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | on_chroot << EOF 4 | groupadd -f -r -g 1001 homeassistant 5 | useradd -u 1001 -g 1001 -rm homeassistant 6 | EOF 7 | 8 | install -v -o 1001 -g 1001 -d ${ROOTFS_DIR}/srv/homeassistant 9 | 10 | on_chroot << \EOF 11 | apt install -f hassbian-scripts 12 | EOF 13 | 14 | on_chroot << EOF 15 | systemctl enable install_homeassistant 16 | EOF 17 | 18 | on_chroot << EOF 19 | sed -i 's/PrintMotd no/PrintMotd yes/' /etc/ssh/sshd_config 20 | rm /etc/update-motd.d/10-uname 21 | rm /etc/motd 22 | EOF 23 | 24 | on_chroot << \EOF 25 | for GRP in dialout gpio i2c input netdev spi video; do 26 | adduser homeassistant $GRP 27 | done 28 | for GRP in homeassistant; do 29 | adduser pi $GRP 30 | done 31 | EOF 32 | 33 | -------------------------------------------------------------------------------- /stage4/03-cleanup/00-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | on_chroot << EOF 4 | apt-get clean 5 | EOF 6 | -------------------------------------------------------------------------------- /stage4/EXPORT_IMAGE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/home-assistant/pi-gen/9ecf3cc2c5e2346229edccd0bba70c5701e8d79d/stage4/EXPORT_IMAGE -------------------------------------------------------------------------------- /stage4/prerun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if [ ! -d "${ROOTFS_DIR}" ]; then 4 | copy_previous 5 | fi 6 | --------------------------------------------------------------------------------