Compare commits

...

4 Commits

Author SHA1 Message Date
david 35089ec760 README_devuan.md: Extend description and examples.
sd-card-images CI / test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.suite }} (i386, debian, bookworm) (push) Failing after 4m14s Details
sd-card-images CI / test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.suite }} (i386, debian, sid) (push) Has been cancelled Details
sd-card-images CI / test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.suite }} (i386, debian, trixie) (push) Has been cancelled Details
sd-card-images CI / build docker images (push) Has been cancelled Details
sd-card-images CI / test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.suite }} (i386, debian, bullseye) (push) Has been cancelled Details
2024-05-18 22:20:06 +01:00
david 43b68563da Dockerfile.devuan: Add, based on Devuan image. 2024-05-18 22:18:06 +01:00
david cc9c861c0d build-debian: Add Devuan keys to fetch Devuan debootstrap on Debian. 2024-05-18 20:18:28 +01:00
david f9cc428ca9 README_devuan.md: Extend instructions. 2024-05-18 20:16:24 +01:00
4 changed files with 219 additions and 30 deletions

View File

@ -21,6 +21,7 @@ RUN apt-get update && \
bison \
flex \
python3-dev \
python3-lxml \
python3-pkg-resources \
python3-pyelftools \
python3-setuptools \

60
Dockerfile.devuan Normal file
View File

@ -0,0 +1,60 @@
FROM devuan/devuan:daedalus
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get --assume-yes \
--no-install-recommends \
install debootstrap \
debian-archive-keyring \
ca-certificates \
qemu-user \
qemu-user-static \
qemu-system-arm \
qemu-system-x86 \
device-tree-compiler \
gcc \
gcc-arm-none-eabi \
make \
git \
bc \
bzip2 \
pigz \
bison \
flex \
python3-dev \
python3-lxml \
python3-pkg-resources \
python3-pyelftools \
python3-setuptools \
swig \
parted \
e2fsprogs \
dosfstools \
mtools \
pwgen \
libssl-dev \
libgnutls28-dev \
uuid-dev \
parallel \
ssh \
sshpass \
unzip && \
([ "$(uname -m)" = "aarch64" ] && \
apt-get --assume-yes \
install gcc-arm-linux-gnueabihf \
gcc-i686-linux-gnu \
gcc-x86-64-linux-gnu || :) && \
([ "$(uname -m)" = "x86_64" ] && \
apt-get --assume-yes \
install gcc-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
gcc-i686-linux-gnu || :) && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -f /var/log/*.log
RUN wget -q "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -O "awscliv2.zip" && \
unzip -q awscliv2.zip && \
./aws/install && \
rm -rf aws
ENV PATH="/debimg/scripts:${PATH}"
COPY . /debimg
WORKDIR /debimg

View File

@ -1,44 +1,133 @@
# Debian SD card images
# Devuan SD card images
This repository is a bunch of scripts to build SD card images that various [single-board computers](https://en.wikipedia.org/wiki/Single-board_computer) (SBC) can boot. Emphasis is on pureness; pure Debian and pure mainline U-boot.
This repository simply adds Devuan to a fork of https://github.com/johang/sd-card-images. Please do not report any Devuan-issues to johang.
That project describes itself as
```
a bunch of scripts to build SD card images that various single-board computers (SBC) can boot.
Emphasis is on pureness; pure Debian and pure mainline U-boot.
```
The main implementation change is that the Dockerfile (`Dockerfile.devuan`) uses `FROM devuan/devuan:daedalus`.
## Index
- [Pre-built images](#pre-built-images)
- [Usage](#usage)
- - [Build your own boot image](#build-your-own-boot-image)
- - [Build your own Devuan ext4 root filesystem image](#build-your-own-devuan-ext4-root-filesystem-image)
- [Examples](#examples)
- - [Example boot image](#example-boot-image)
- - - [To build a boot image for Raspberry Pi 3 B](#to-build-a-boot-image-for-raspberry-pi-3-b)
- - - [To build a boot image for Pine64 Rockpro64](#to-build-a-boot-image-for-pine64-rockpro64)
- - - [To build a boot image for Sinovoip Banana Pi M2 Zero](#to-build-a-boot-image-for-sinovoip-banana-pi-m2-zero)
- - [Example root filesystem image](#example-root-filesystem-image)
- - - [To build a Devuan ext4 root filesystem image for arm64](#to-build-a-devuan-ext4-root-filesystem-image-for-arm64)
- - - [To build a Devuan ext4 root filesystem image for armhf](#to-build-a-devuan-ext4-root-filesystem-image-for-armhf)
## Pre-built images
Pre-built images ready for download are availble at [sd-card-images.johang.se](https://sd-card-images.johang.se).
Pre-built images for Debian are available from the original project at [sd-card-images.johang.se](https://sd-card-images.johang.se).
There are no pre-built images for Devuan.
## If you have problems here ##
This project is just a fork. If anything works at all, credit goes to johang.
If you have problems building a Devuan image here, please first try to build a Debian image using https://github.com/johang/sd-card-images.
Please do not report any Devuan-issues to johang, his interest is in pure Debian.
## Usage
The generated SD card images are made up of two separate images:
- **boot-BOARD.bin**: Boot image that contains partition table, U-Boot and chip-specific code. The boot image will only work on the board it's built for. The filename indicates which board it's built for.
- **debian-ARCH-VERSION-PASSWORD.bin**: Debian ext4 root filesystem image that contains a complete Debian installation, including kernel, initrd and device tree. This Debian image is generic and will work on all chips and boards with the CPU architecture it's built for. The filename indicates Debian version, CPU architecture and default root password.
- **devuan-ARCH-VERSION-PASSWORD.bin**: Devuan ext4 root filesystem image that contains a complete Devuan installation, including kernel, initrd and device tree. This Devuan image is generic and will work on all chips and boards with the CPU architecture it's built for. The filename indicates Devuan version, CPU architecture and default root password.
These two images are the concatenated to a single image, which is then written to SD card, for example like this:
$ zcat boot-raspberrypi_3b.bin.gz debian-buster-arm64-XXXXXX.bin.gz > sd-card.img
$ zcat boot-raspberrypi_3b.bin.gz devuan-daedalus-arm64-XXXXXX.bin.gz > sd-card.img
# dd if=sd-card.img of=/dev/sdXXX
### Build your own Devuan boot image
### Build your own boot image
#### To build a boot image for Raspberry Pi 3 B:
See many appropriate values of ```CHIP_ID``` at https://sd-card-images.johang.se/.
A full list of relevant ```CONFIG``` values is at https://github.com/u-boot/u-boot/tree/master/configs.
For any valid combination of:
| Variable | |
|----------|-------------------------|
| BOARD_ID | Your choice of name, e.g. bananapi, pinebook |
| CHIP_ID | e.g. allwinner-a10, rk3399 |
| CONFIG | e.g. Bananapi_defconfig, pinebook-pro-rk3399_defconfig |
| TUPLE | e.g. arm-linux-gnueabihf for armhf, aarch64-linux-gnu for arm64 |
To build:
```bash
docker build -t devuan/sd-images -f ./Dockerfile.devuan .
mkdir -p /tmp/sd-images
docker run --rm -v /tmp/sd-images:/artifacts sd-images build-boot raspberrypi_3b bcm2837 rpi_3_defconfig aarch64-linux-gnu
```
The image will end up in /tmp/sd-images on the host.
#### To build a boot image for Pine64 Rockpro64:
```bash
docker build -t devuan/sd-images -f ./Dockerfile.devuan .
docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan
mkdir -p /tmp/sd-images
docker run --rm \
-v /tmp/sd-images:/artifacts \
devuan/sd-images \
build-boot ROCKPro64 rk3399 rockpro64-rk3399_defconfig aarch64-linux-gnu
build-boot ${BOARD_ID} ${CHIP_ID} ${CONFIG} ${TUPLE}
```
The image will end up in /tmp/sd-images on the host as `${BOARD_ID}.bin.gz`.
### Build your own Devuan ext4 root filesystem image
For any valid combination provided by the distribution:
|Variable | | | |
|--------------|---|---|---|
| DISTRIBUTION | **Devuan** | Debian | Ubuntu |
| ARCH | armhf, arm64, i386, amd64 | armhf, arm64, i386, amd64 | armhf, arm64, i386, amd64 |
| RELEASE | e.g. **daedalus**, excalibur, ceres | e.g bookworm, trixie, sid | e.g. focal, jammy, noble |
To build:
```bash
docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan
mkdir -p /tmp/sd-images
docker run --rm \
-v /tmp/sd-images:/artifacts \
devuan/sd-images \
build-debian ${DISTRIBUTION} ${ARCH} ${RELEASE}
```
The image will end up in /tmp/sd-images on the host as `${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`.
## Examples
### Example boot image
#### To build a boot image for Raspberry Pi 3 B
```bash
docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan
mkdir -p /tmp/sd-images
docker run --rm \
-v /tmp/sd-images:/artifacts \
devuan/sd-images \
build-boot raspberrypi_3b \
bcm2837 \
rpi_3_defconfig \
aarch64-linux-gnu
```
The image will end up in /tmp/sd-images on the host.
#### To build a boot image for Pine64 Rockpro64
```bash
docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan
mkdir -p /tmp/sd-images
docker run --rm \
-v /tmp/sd-images:/artifacts \
devuan/sd-images \
build-boot ROCKPro64 \
rk3399 \
rockpro64-rk3399_defconfig \
aarch64-linux-gnu
```
The image will end up in /tmp/sd-images on the host.
@ -46,42 +135,41 @@ The image will end up in /tmp/sd-images on the host.
#### To build a boot image for Sinovoip Banana Pi M2 Zero
```bash
docker build -t devuan/sd-images -f ./Dockerfile.devuan .
docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan
mkdir -p /tmp/sd-images
docker run --rm \
-v /tmp/sd-images:/artifacts \
devuan/sd-images \
build-boot banana_pi_m2_zero allwinner-h2+ bananapi_m2_zero_defconfig arm-linux-gnueabihf
build-boot banana_pi_m2_zero \
allwinner-h2+ \
bananapi_m2_zero_defconfig \
arm-linux-gnueabihf
```
The image will end up in /tmp/sd-images on the host.
### Build your own Debian ext4 root filesystem image
### Example root filesystem image
#### To build a Devuan ext4 root filesystem image for arm64:
#### To build a Devuan ext4 root filesystem image for arm64
```bash
docker build -t devuan/sd-images -f ./Dockerfile.devuan .
docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan
mkdir -p /tmp/sd-images
docker run --rm \
-v /tmp/sd-images:/artifacts \
-v `pwd`:/debimg \
--privileged \
devuan/sd-images \
build-debian devuan arm64 daedalus
```
The image will end up in /tmp/sd-images on the host.
#### To build a Devuan ext4 root filesystem image for armhf:
#### To build a Devuan ext4 root filesystem image for armhf
```bash
docker build -t devuan/sd-images -f ./Dockerfile.devuan .
docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan
mkdir -p /tmp/sd-images
docker run --rm \
-v /tmp/sd-images:/artifacts \
-v `pwd`:/debimg \
--privileged \
devuan/sd-images \
build-debian devuan armhf daedalus
```

View File

@ -113,6 +113,39 @@ nano \
"${SCRIPT}"
;;
devuan)
# Need Devuan's keys and Devuan's debootstrap.
case ${DIST} in
ceres | beowulf | chimaera | daedalus)
# https://www.devuan.org/os/keyring
# Ceres, Beowulf, Chimaera and Daedalus
RELEASE_KEY="94532124541922FB"
;;
excalibur)
RELEASE_KEY="B3982868D104092C"
;;
freia)
RELEASE_KEY="55C470D57732684B"
;;
*)
echo "Can't decide release key for \"${DIST}\""
exit 1
;;
esac
# Use Ubuntu's gpg to get Devuan's signing key.
apt-get update && apt-get install -y gpg
# Add Devuan's signing key.
echo "Adding Devuan ${DIST} signing key (https://www.devuan.org/os/keyring):" ${RELEASE_KEY}
gpg --keyserver keyring.devuan.org --recv-keys ${RELEASE_KEY} && \
gpg --export ${RELEASE_KEY} >/etc/apt/trusted.gpg.d/devuan_key.gpg
# Get Devuan's debootstrap.
echo "deb http://deb.devuan.org/merged ${DIST} main" > /etc/apt/sources.list.d/devuan.list
apt-get update && apt-get --assume-yes \
--no-install-recommends \
install --force-yes -t ${DIST} debootstrap
debootstrap \
--arch="${ARCH}" \
--verbose \
@ -181,6 +214,13 @@ deb http://ports.ubuntu.com/ubuntu-ports ${DIST}-updates main universe
deb-src http://ports.ubuntu.com/ubuntu-ports ${DIST}-updates main universe
deb http://ports.ubuntu.com/ubuntu-ports ${DIST}-security main universe
deb-src http://ports.ubuntu.com/ubuntu-ports ${DIST}-security main universe
EOF
;;
devuan-*-excalibur | devuan-*-testing)
# https://pkginfo.devuan.org/sources.list.txt
tee debian/tmp/sources.list <<-EOF
deb http://deb.devuan.org/merged ${DIST} main
deb-src http://deb.devuan.org/merged ${DIST} main
EOF
;;
devuan-*-ceres | devuan-*-unstable)