2019-07-19 01:22:46 +01:00
|
|
|
# Raspberry Pi image specs
|
2017-10-08 21:18:48 +01:00
|
|
|
|
2019-07-19 01:22:46 +01:00
|
|
|
This repository contains the files with which the images referenced at
|
|
|
|
https://wiki.debian.org/RaspberryPiImages have been built.
|
2017-10-08 21:18:48 +01:00
|
|
|
|
|
|
|
## Option 1: Downloading an image
|
|
|
|
|
2019-08-30 15:16:27 +01:00
|
|
|
See https://wiki.debian.org/RaspberryPiImages for where to obtain the
|
2019-07-19 01:22:46 +01:00
|
|
|
latest pre-built image.
|
2017-10-08 21:18:48 +01:00
|
|
|
|
|
|
|
## Option 2: Building your own image
|
|
|
|
|
2019-07-19 01:22:46 +01:00
|
|
|
If you prefer, you can build a Debian buster Raspberry Pi image
|
2018-07-18 23:57:39 +01:00
|
|
|
yourself. If you are reading this document online, you should first
|
|
|
|
clone this repository:
|
2017-10-08 21:18:48 +01:00
|
|
|
|
|
|
|
```shell
|
2019-07-19 01:22:46 +01:00
|
|
|
git clone --recursive https://salsa.debian.org/raspi-team/image-specs.git
|
|
|
|
cd image-specs
|
2017-10-25 09:55:04 +01:00
|
|
|
```
|
|
|
|
|
2019-07-19 01:22:46 +01:00
|
|
|
For this you will first need to install the `vmdb2` package, on a
|
|
|
|
Debian Buster or higher system.
|
|
|
|
|
|
|
|
The recipes for building the images are:
|
|
|
|
|
|
|
|
- [raspi0w.yaml](raspi0w.yaml) for Raspberry Pi 0 and 0w. We believe
|
|
|
|
(but have not tested) it should also work on the 1 models.
|
|
|
|
- [raspi2.yaml](raspi2.yaml) for Raspberry Pi 2.
|
|
|
|
- [raspi3.yaml](raspi3.yaml) for all of the Raspberry Pi 3 models.
|
|
|
|
|
|
|
|
You can edit them to customize the built image. Although it could
|
|
|
|
(should!) be better documented,
|
|
|
|
[http://git.liw.fi/vmdb2/tree/README](vmdb2)'s format is very easy to
|
|
|
|
understand.
|
|
|
|
|
|
|
|
Once you have edited the recipe for your hardware, you can generate
|
|
|
|
the image by issuing the following (as root):
|
2017-10-25 09:55:04 +01:00
|
|
|
|
|
|
|
```shell
|
2019-01-15 00:02:42 +00:00
|
|
|
./vmdb2/vmdb2 --rootfs-tarball=raspi3.tar.gz --output \
|
|
|
|
raspi3.img raspi3.yaml --log raspi3.log
|
2017-10-08 21:18:48 +01:00
|
|
|
```
|
|
|
|
|
2019-07-19 01:22:46 +01:00
|
|
|
Of course, substituting `raspi3` with the actual flavor you need.
|
|
|
|
|
|
|
|
## Installing the image onto the Raspberry Pi
|
2017-10-08 21:18:48 +01:00
|
|
|
|
|
|
|
Plug an SD card which you would like to entirely overwrite into your SD card reader.
|
|
|
|
|
2019-07-19 01:22:46 +01:00
|
|
|
Assuming your SD card reader provides the device `/dev/mmcblk0`
|
2018-12-05 00:38:09 +00:00
|
|
|
(**Beware** If you choose the wrong device, you might overwrite
|
|
|
|
important parts of your system. Double check it's the correct
|
|
|
|
device!), copy the image onto the SD card:
|
2017-10-08 21:18:48 +01:00
|
|
|
|
|
|
|
```shell
|
2019-07-19 01:22:46 +01:00
|
|
|
sudo dd if=raspi3.img of=/dev/mmcblk0 bs=64k oflag=dsync status=progress
|
2017-10-08 21:18:48 +01:00
|
|
|
```
|
|
|
|
|
2019-07-19 01:22:46 +01:00
|
|
|
Then, plug the SD card into the Raspberry Pi, and power it up.
|
2017-10-08 21:18:48 +01:00
|
|
|
|
2019-07-19 01:22:46 +01:00
|
|
|
The image uses the hostname `rpi0w`, `rpi2` or `rpi3` depending on the
|
|
|
|
target build, so assuming your local network correctly resolves
|
|
|
|
hostnames communicated via DHCP, you can log into your Raspberry Pi
|
|
|
|
once it booted:
|
2017-10-08 21:18:48 +01:00
|
|
|
|
|
|
|
```shell
|
|
|
|
ssh root@rpi3
|
|
|
|
# Enter password “raspberry”
|
|
|
|
```
|
|
|
|
|
2017-12-11 07:44:34 +00:00
|
|
|
Note that the default firewall rules only allow SSH access from the local
|
|
|
|
network. If you wish to enable SSH access globally, first change your root
|
|
|
|
password using `passwd`. Next, issue the following commands as root to remove
|
|
|
|
the corresponding firewall rules:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
iptables -F INPUT
|
|
|
|
ip6tables -F INPUT
|
|
|
|
```
|
|
|
|
|
|
|
|
This will allow SSH connections globally until the next reboot. To make this
|
|
|
|
persistent, remove the lines containing "REJECT" in `/etc/iptables/rules.v4` and
|
|
|
|
`/etc/iptables/rules.v6`.
|
|
|
|
|