From 4d56c211b73a83dac770558090438cabce0cce61 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 12 May 2024 17:21:07 +0100 Subject: [PATCH 01/23] rebuild-debian-csv: Use dist names not ls-lR.gz. Get codenames from the package repository's web page, because Devuan does not have an ls-lR.gz file. Uses python3-lxml. --- metascripts/rebuild-debian-csv | 80 +++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/metascripts/rebuild-debian-csv b/metascripts/rebuild-debian-csv index 92d5b89..9295d38 100755 --- a/metascripts/rebuild-debian-csv +++ b/metascripts/rebuild-debian-csv @@ -19,11 +19,13 @@ class Release: def __init__(self, fileobj): params = {} for line in fileobj: - line = line.decode("utf-8") - if line.startswith(" ") or ": " not in line: - continue + line = line.decode('utf-8').strip() + # Header of "Release" finishes at: + # "MD5Sum:" Debian/Ubuntu + if line == "MD5Sum:": + break - k, v = line.strip().split(": ", 1) + k, v = line.split(": ", 1) params[k] = v self.label = params.get("Label") @@ -112,6 +114,13 @@ class Release: return False +""" +# Note: get_releases(url) is deprecated because it can not work with Devuan. +# Instead, use get_dist_releases(url). +# +# get_releases(url) requires the file ls-lR.gz to be present. +# This is not available in Devuan. +# def get_releases(url): dirlinepattern = re.compile( r"\.(/dists/[\w\-]+):" @@ -172,6 +181,65 @@ def get_releases(url): yield Release(u) except urllib.error.URLError as e: logger.warning("Failed to download %s: %s", relurl, e) +""" + + +def get_dist_releases(url): + + from lxml import html + + # Open the web page listurl and use an xpath to extract the dist names. + listurl = url + "/dists/" + + try: + tree = html.fromstring(urllib.request.urlopen(listurl).read()) + logger.debug("Downloaded %s", listurl) + except urllib.error.URLError as e: + logger.warning("Failed to download %s: %s", listurl, e) + else: + # Extract dist names from the web links. + """ + Finds in the web page. + + Using Xpath 1.0: + matches: buster/, daedalus/, noble/, oldstable, stable/, unstable/ + does not match: ../, /debian/, daedalus-updates/, 6.0/ + + + The chosen xpath: + + dist_path = "//a[contains(@href,'/') \ + and not(starts-with(@href,'/')) \ + and not(contains(@href,'-')) \ + and not(contains(@href,'.')) \ + ]/@href" + + will select only hrefs which are: + not, e.g., /debian/ not(starts-with(@href,'/')) + directories contains(@href,'/') + codenames not(contains(@href,'-')) + not numbers or ../ not(contains(@href,'.')) + + This excludes all "-updates", "-backports", "-security", "-proposed", etc. + """ + dist_path = "//a[contains(@href,'/') \ + and not(starts-with(@href,'/')) \ + and not(contains(@href,'-')) \ + and not(contains(@href,'.')) \ + ]/@href" + + dist_names = tree.xpath(dist_path) + + for debiandir in dist_names: + relurl = listurl + debiandir + "Release" + + try: + with urllib.request.urlopen(relurl) as u: + logger.debug("Downloaded %s", relurl) + + yield Release(u) + except urllib.error.URLError as e: + logger.warning("Failed to download %s: %s", relurl, e) def write_csv(filename, releases, archs): @@ -203,9 +271,9 @@ def write_csv(filename, releases, archs): if __name__ == "__main__": logger.info("Downloading releases...") - debianreleases = set(get_releases("http://ftp.debian.org/debian")) + debianreleases = set(get_dist_releases("http://ftp.debian.org/debian")) assert len(debianreleases) > 0 - ubuntureleases = set(get_releases("http://ftp.ubuntu.com/ubuntu")) + ubuntureleases = set(get_dist_releases("http://ftp.ubuntu.com/ubuntu")) assert len(ubuntureleases) > 0 releases = list(sorted(debianreleases | ubuntureleases)) assert len(releases) > 0 -- 2.40.1 From 13ab9f88d484cae75f885906dcb0327b798ba50a Mon Sep 17 00:00:00 2001 From: david Date: Sun, 12 May 2024 17:26:13 +0100 Subject: [PATCH 02/23] rebuild-debian-csv: Add Devuan Linux release names. Needs rebuild-debian-csv: Use dist names not ls-lR.gz. debians-arm.csv debians-x86.csv --- debians-arm.csv | 11 +++++++ debians-x86.csv | 10 +++++++ metascripts/rebuild-debian-csv | 52 +++++++++++++++++++++++++++------- 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/debians-arm.csv b/debians-arm.csv index a9cc2ca..e89c8f7 100644 --- a/debians-arm.csv +++ b/debians-arm.csv @@ -9,6 +9,16 @@ debian,sid,armhf,"Debian unstable (""sid"")",False debian,sid,arm64,"Debian unstable (""sid"")",False debian,experimental,armhf,"Debian experimental (""rc-buggy"")",True debian,experimental,arm64,"Debian experimental (""rc-buggy"")",True +devuan,ceres,armhf,"Devuan unstable/1.0.0 (""ceres"")",False +devuan,ceres,arm64,"Devuan unstable/1.0.0 (""ceres"")",False +devuan,beowulf,armhf,"Devuan oldoldstable/3.0 (""beowulf"")",False +devuan,beowulf,arm64,"Devuan oldoldstable/3.0 (""beowulf"")",False +devuan,chimaera,armhf,"Devuan oldstable/4.0 (""chimaera"")",False +devuan,chimaera,arm64,"Devuan oldstable/4.0 (""chimaera"")",False +devuan,daedalus,armhf,"Devuan stable/5.0 (""daedalus"")",False +devuan,daedalus,arm64,"Devuan stable/5.0 (""daedalus"")",False +devuan,excalibur,armhf,"Devuan testing/6.0 (""excalibur"")",False +devuan,excalibur,arm64,"Devuan testing/6.0 (""excalibur"")",False ubuntu,focal,armhf,"Ubuntu 20.04 LTS (""focal"")",False ubuntu,focal,arm64,"Ubuntu 20.04 LTS (""focal"")",False ubuntu,jammy,armhf,"Ubuntu 22.04 LTS (""jammy"")",False @@ -17,4 +27,5 @@ ubuntu,mantic,armhf,"Ubuntu 23.10 (""mantic"")",False ubuntu,mantic,arm64,"Ubuntu 23.10 (""mantic"")",False ubuntu,noble,armhf,"Ubuntu 24.04 LTS (""noble"")",False ubuntu,noble,arm64,"Ubuntu 24.04 LTS (""noble"")",False +ubuntu,oracular,armhf,"Ubuntu 24.10 (""oracular"")",True ubuntu,oracular,arm64,"Ubuntu 24.10 (""oracular"")",True diff --git a/debians-x86.csv b/debians-x86.csv index 9482f1d..075c784 100644 --- a/debians-x86.csv +++ b/debians-x86.csv @@ -9,6 +9,16 @@ debian,sid,i386,"Debian unstable (""sid"")",False debian,sid,amd64,"Debian unstable (""sid"")",False debian,experimental,i386,"Debian experimental (""rc-buggy"")",True debian,experimental,amd64,"Debian experimental (""rc-buggy"")",True +devuan,ceres,i386,"Devuan unstable/1.0.0 (""ceres"")",False +devuan,ceres,amd64,"Devuan unstable/1.0.0 (""ceres"")",False +devuan,beowulf,i386,"Devuan oldoldstable/3.0 (""beowulf"")",False +devuan,beowulf,amd64,"Devuan oldoldstable/3.0 (""beowulf"")",False +devuan,chimaera,i386,"Devuan oldstable/4.0 (""chimaera"")",False +devuan,chimaera,amd64,"Devuan oldstable/4.0 (""chimaera"")",False +devuan,daedalus,i386,"Devuan stable/5.0 (""daedalus"")",False +devuan,daedalus,amd64,"Devuan stable/5.0 (""daedalus"")",False +devuan,excalibur,i386,"Devuan testing/6.0 (""excalibur"")",False +devuan,excalibur,amd64,"Devuan testing/6.0 (""excalibur"")",False ubuntu,focal,i386,"Ubuntu 20.04 LTS (""focal"")",False ubuntu,focal,amd64,"Ubuntu 20.04 LTS (""focal"")",False ubuntu,jammy,i386,"Ubuntu 22.04 LTS (""jammy"")",False diff --git a/metascripts/rebuild-debian-csv b/metascripts/rebuild-debian-csv index 9295d38..6190c10 100755 --- a/metascripts/rebuild-debian-csv +++ b/metascripts/rebuild-debian-csv @@ -21,14 +21,26 @@ class Release: for line in fileobj: line = line.decode('utf-8').strip() # Header of "Release" finishes at: - # "MD5Sum:" Debian/Ubuntu - if line == "MD5Sum:": + # "MD5Sum:" in Debian/Ubuntu + # "SHA256:" in Devuan + if line == "MD5Sum:" or line == "SHA256:": break k, v = line.split(": ", 1) params[k] = v - self.label = params.get("Label") + # In Release files, + # e.g. https://ftp.debian.org/debian/dists/stable/Release + # "Origin" is Debian/Ubuntu/Devuan as expected. + # "Origin" = "Label" for Debian and Ubuntu, not always for Devuan. + # "Label" is "Debian"/"Ubuntu" for Debian/Ubuntu. + # "Label" is "Devuan" or "Master" for Devuan. + # "Label" of "Master" has no equivalent in Debian/Ubuntu. + # + # Where this program uses "label" it really wants "origin". + self.origin = params.get("Origin") + self.label = self.origin + self.suite = params.get("Suite") self.version = params.get("Version") self.codename = params.get("Codename") @@ -86,16 +98,29 @@ class Release: return date.today() - release_date def is_relevant(self): - if self.label not in ("Debian", "Ubuntu", ): + if self.label not in ("Debian", "Ubuntu", "Devuan", ): return False - bl1 = ("oldoldstable", "devel", ) - if self.suite in bl1: - return False + if self.label == "Debian" or self.label == "Ubuntu": + bl1 = ("oldoldstable", "devel", ) + if self.suite in bl1: + return False - bl2 = ("-updates", "-backports", "-security", "-proposed", "-sloppy", ) - if any(self.suite.endswith(suffix) for suffix in bl2): - return False + bl2 = ("-updates", "-backports", "-security", "-proposed", "-sloppy", ) + if any(self.suite.endswith(suffix) for suffix in bl2): + return False + + if self.label == "Devuan": + # "oldoldstable" is maintained in Devuan. + # These are no longer maintained. + bl_ = ("jessie", "ascii", ) + if self.suite in bl_: + return False + + # For fine-grained control: + bl_ = ("-backports", "-security", "-proposed-updates", ) + if any(self.suite.endswith(suffix) for suffix in bl_): + return False if self.label == "Ubuntu": if self.is_lts(): @@ -110,6 +135,8 @@ class Release: return True if self.label == "Ubuntu" and self.age() < timedelta(days=0): return True + if self.label == "Devuan" and self.suite == "experimental": + return True return False @@ -249,6 +276,7 @@ def write_csv(filename, releases, archs): for r in releases: if not r.is_relevant(): + logger.debug("Discarding as not relevant: %s ", repr(r)) continue for arch in archs: @@ -275,7 +303,9 @@ if __name__ == "__main__": assert len(debianreleases) > 0 ubuntureleases = set(get_dist_releases("http://ftp.ubuntu.com/ubuntu")) assert len(ubuntureleases) > 0 - releases = list(sorted(debianreleases | ubuntureleases)) + devuanreleases = set(get_dist_releases("http://deb.devuan.org/merged")) + assert len(devuanreleases) > 0 + releases = list(sorted(debianreleases | ubuntureleases | devuanreleases)) assert len(releases) > 0 logger.info("Found %d releases", len(releases)) -- 2.40.1 From aeca8502e73ed58d61b32e6968327a8a72bf5708 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 12 May 2024 17:33:04 +0100 Subject: [PATCH 03/23] build-debian: Add support for Devuan Linux images. --- scripts/build-debian | 121 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 102 insertions(+), 19 deletions(-) diff --git a/scripts/build-debian b/scripts/build-debian index 43fc91c..f7ec49b 100755 --- a/scripts/build-debian +++ b/scripts/build-debian @@ -44,6 +44,31 @@ ubuntu-armhf|ubuntu-arm64) KERNEL_URL=http://packages.ubuntu.com/"${DIST}"/"${KERNEL}" SCRIPT=/usr/share/debootstrap/scripts/gutsy ;; +devuan-armhf) + KERNEL=linux-image-armmp + URL=http://deb.devuan.org/merged + # 2024-05-01 pkginfo.devuan.org does not have info for armhf. + KERNEL_URL=https://pkginfo.devuan.org/cgi-bin/policy-query.html?c=package&q=${KERNEL} + SCRIPT=/usr/share/debootstrap/scripts/ceres + ;; +devuan-arm64) + KERNEL=linux-image-arm64 + URL=http://deb.devuan.org/merged + KERNEL_URL=https://pkginfo.devuan.org/cgi-bin/policy-query.html?c=package&q=${KERNEL} + SCRIPT=/usr/share/debootstrap/scripts/ceres + ;; +devuan-i386) + KERNEL=linux-image-686 + URL=http://deb.devuan.org/merged + KERNEL_URL=https://pkginfo.devuan.org/cgi-bin/policy-query.html?c=package&q=${KERNEL} + SCRIPT=/usr/share/debootstrap/scripts/ceres + ;; +devuan-amd64) + KERNEL=linux-image-amd64 + URL=http://deb.devuan.org/merged + KERNEL_URL=https://pkginfo.devuan.org/cgi-bin/policy-query.html?c=package&q=${KERNEL} + SCRIPT=/usr/share/debootstrap/scripts/ceres + ;; *) echo "Can't decide kernel package for \"${ARCH}\"" exit 1 @@ -67,23 +92,32 @@ trap 'rm -rf "${TMP}"' EXIT INT TERM cd "${TMP}" # Build a Debian root filesystem (first stage) -debootstrap \ - --arch="${ARCH}" \ - --verbose \ - --variant=minbase \ - --foreign \ - --include=\ -netbase,\ -net-tools,\ -systemd-sysv,\ -u-boot-tools,\ -initramfs-tools,\ -openssh-server,\ -nano \ - "${TARGET}" \ - debian \ - "${URL}" \ - "${SCRIPT}" +case ${OS} in +debian | ubuntu) + debootstrap \ + --arch="${ARCH}" \ + --verbose \ + --variant=minbase \ + --foreign \ + --include=netbase,net-tools,systemd-sysv,u-boot-tools,initramfs-tools,openssh-server,nano \ + "${TARGET}" \ + debian \ + "${URL}" \ + "${SCRIPT}" + ;; +devuan) + debootstrap \ + --arch="${ARCH}" \ + --verbose \ + --variant=minbase \ + --foreign \ + --include=netbase,net-tools,sysvinit,u-boot-tools,initramfs-tools,openssh-server,nano,vim-tiny \ + "${TARGET}" \ + debian \ + "${URL}" \ + "${SCRIPT}" + ;; +esac # Randomly generated root password PASSWORD="${PASSWORD_OVERRIDE:-$(pwgen -B -A 6 1)}" @@ -132,6 +166,23 @@ 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-*-ceres | devuan-*-unstable) + # 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-*) + tee debian/tmp/sources.list <<-EOF +deb http://deb.devuan.org/merged ${DIST} main +deb-src http://deb.devuan.org/merged ${DIST} main +deb http://deb.devuan.org/merged ${DIST}-updates main +deb-src http://deb.devuan.org/merged ${DIST}-updates main +deb http://deb.devuan.org/merged ${DIST}-security main +deb-src http://deb.devuan.org/merged ${DIST}-security main EOF ;; esac @@ -156,7 +207,10 @@ cp -rv --preserve=mode ../2nd-stage-files/pre-2nd-stage-files-${ARCH}/* debian cp -v /usr/bin/qemu-*-static debian/usr/bin || : # Build a Debian root filesystem (second stage) -chroot debian /bin/sh -ex <<- EOF +case "${OS}" in +debian | ubuntu) + # Build a Debian root filesystem (second stage) +chroot debian /bin/sh -ex <<-EOF /debootstrap/debootstrap --second-stage /bin/mv /tmp/sources.list /etc/apt/sources.list /bin/mv /tmp/priority-experimental /etc/apt/preferences.d/priority-experimental || : @@ -176,6 +230,28 @@ echo "kernel-url,${KERNEL_URL}\n" >> /tmp/versions.csv /bin/echo "root:${PASSWORD}" | /usr/sbin/chpasswd /bin/sed -i "s/#*\s*PermitRootLogin .*/PermitRootLogin yes/" /etc/ssh/sshd_config EOF + ;; +devuan) + # Build a Devuan root filesystem (second stage) +chroot debian /bin/sh -ex <<-EOF +/debootstrap/debootstrap --second-stage +/bin/mv /tmp/sources.list /etc/apt/sources.list +# /usr/bin/apt-key add /etc/apt/trusted.gpg.d/devuan_key.gpg +/usr/bin/apt-get update +/usr/bin/apt-get -y upgrade +/usr/bin/apt-get -y --no-install-recommends "${KERNELSUITE}" install "${KERNEL}" +/usr/bin/apt-get -y install connman || : +/usr/bin/apt-get -y install openntpd || : +/usr/bin/apt-get clean +/bin/rm -rf /var/lib/apt/lists/* +echo "kernel-url,${KERNEL_URL}\n" >> /tmp/versions.csv +/usr/bin/dpkg-query --showformat='kernel,\${Version}\n' --show "${KERNEL}" > /tmp/versions.csv +/bin/rm -f /var/log/*.log +/bin/echo "root:${PASSWORD}" | /usr/sbin/chpasswd +/bin/sed -i "s/#*\s*PermitRootLogin .*/PermitRootLogin yes/" /etc/ssh/sshd_config +EOF + ;; +esac # Remove ARM emulation stuff again rm -v debian/usr/bin/qemu-*-static || : @@ -186,7 +262,14 @@ cp -rv --preserve=mode ../2nd-stage-files/post-2nd-stage-files/* debian echo "${OS}" > debian/etc/hostname # Set resolv.conf -ln -sf /run/systemd/resolve/stub-resolv.conf debian/etc/resolv.conf +case "${OS}" in +debian | ubuntu) + ln -sf /run/systemd/resolve/stub-resolv.conf debian/etc/resolv.conf + ;; +devuan) + ln -sf /run/connman/resolv.conf debian/etc/resolv.conf + ;; +esac # List all files find debian ! -type d -printf "/%P\n" | sort > files.txt -- 2.40.1 From 287dd113ad0b4225e4e9955a706050fa092b82a0 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 12 May 2024 17:47:10 +0100 Subject: [PATCH 04/23] Add Dockerfile to build Devuan Linux images. Dockerfile_devuan is FROM devuan/devuan:daedalus README_devuan.md --- Dockerfile_devuan | 59 +++++++++++++++++++++++++++++++ README_devuan.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 Dockerfile_devuan create mode 100644 README_devuan.md diff --git a/Dockerfile_devuan b/Dockerfile_devuan new file mode 100644 index 0000000..32a9a57 --- /dev/null +++ b/Dockerfile_devuan @@ -0,0 +1,59 @@ +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-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 diff --git a/README_devuan.md b/README_devuan.md new file mode 100644 index 0000000..d5152d1 --- /dev/null +++ b/README_devuan.md @@ -0,0 +1,89 @@ +# Debian 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. + +## Pre-built images + +Pre-built images ready for download are availble at [sd-card-images.johang.se](https://sd-card-images.johang.se). + +## 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. + +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 + # dd if=sd-card.img of=/dev/sdXXX + +### Build your own Devuan boot image + +#### To build a boot image for Raspberry Pi 3 B: + +```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 . +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. + +#### To build a boot image for Sinovoip Banana Pi M2 Zero + +```bash +docker build -t devuan/sd-images -f ./Dockerfile.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 +``` + +The image will end up in /tmp/sd-images on the host. + +### Build your own Debian ext4 root filesystem image + +#### To build a Devuan ext4 root filesystem image for arm64: + +```bash +docker build -t devuan/sd-images -f ./Dockerfile.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: + +```bash +docker build -t devuan/sd-images -f ./Dockerfile.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 +``` + +The image will end up in /tmp/sd-images on the host. -- 2.40.1 From e475fd11ac715c3e5bdc2682cee89a3bde91618a Mon Sep 17 00:00:00 2001 From: david Date: Tue, 14 May 2024 01:39:32 +0100 Subject: [PATCH 05/23] chore: build-debian: revert layout of debootstrap commands --- scripts/build-debian | 55 ++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/scripts/build-debian b/scripts/build-debian index f7ec49b..6f66aeb 100755 --- a/scripts/build-debian +++ b/scripts/build-debian @@ -94,28 +94,43 @@ cd "${TMP}" # Build a Debian root filesystem (first stage) case ${OS} in debian | ubuntu) - debootstrap \ - --arch="${ARCH}" \ - --verbose \ - --variant=minbase \ - --foreign \ - --include=netbase,net-tools,systemd-sysv,u-boot-tools,initramfs-tools,openssh-server,nano \ - "${TARGET}" \ - debian \ - "${URL}" \ - "${SCRIPT}" +debootstrap \ + --arch="${ARCH}" \ + --verbose \ + --variant=minbase \ + --foreign \ + --include=\ +netbase,\ +net-tools,\ +systemd-sysv,\ +u-boot-tools,\ +initramfs-tools,\ +openssh-server,\ +nano \ + "${TARGET}" \ + debian \ + "${URL}" \ + "${SCRIPT}" ;; devuan) - debootstrap \ - --arch="${ARCH}" \ - --verbose \ - --variant=minbase \ - --foreign \ - --include=netbase,net-tools,sysvinit,u-boot-tools,initramfs-tools,openssh-server,nano,vim-tiny \ - "${TARGET}" \ - debian \ - "${URL}" \ - "${SCRIPT}" +debootstrap \ + --arch="${ARCH}" \ + --verbose \ + --variant=minbase \ + --foreign \ + --include=\ +netbase,\ +net-tools,\ +sysvinit,\ +u-boot-tools,\ +initramfs-tools,\ +openssh-server,\ +nano,\ +vim-tiny \ + "${TARGET}" \ + debian \ + "${URL}" \ + "${SCRIPT}" ;; esac -- 2.40.1 From 7376f178600eca16ca7b1635a50256ef4435accc Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 05:07:40 +0100 Subject: [PATCH 06/23] Fix: Dockerfile.devuan now based on Dockerfile. README_devuan.md --- Dockerfile.devuan | 79 ++++++++++++++++++++++++++++++++++ README_devuan.md | 107 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 167 insertions(+), 19 deletions(-) create mode 100644 Dockerfile.devuan diff --git a/Dockerfile.devuan b/Dockerfile.devuan new file mode 100644 index 0000000..c78181a --- /dev/null +++ b/Dockerfile.devuan @@ -0,0 +1,79 @@ +FROM public.ecr.aws/ubuntu/ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive + +# Need Devuan's debootstrap, which also supports Debian and Ubuntu. +ARG RELEASE_KEY="94532124541922FB" # ceres key - https://www.devuan.org/os/keyring +RUN echo "Adding Devuan ceres signing key (https://www.devuan.org/os/keyring):" ${RELEASE_KEY} +RUN echo 'deb http://deb.devuan.org/merged ceres main contrib non-free' > /etc/apt/sources.list.d/devuan.list && \ + echo 'deb-src http://deb.devuan.org/merged ceres main contrib non-free' >> /etc/apt/sources.list.d/devuan.list + +# Use Ubuntu's gpg to get Devuan's signing key. +RUN apt-get update && apt-get install -y -t noble gpg + +# Add Devuan's signing key. +RUN 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. +RUN apt-get --assume-yes \ + --no-install-recommends \ + install -t ceres debootstrap + +# Install everything else but debootstrap from Ubuntu. +RUN apt-get update && \ + apt-get --assume-yes \ + --no-install-recommends \ + install -t noble \ + 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-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 diff --git a/README_devuan.md b/README_devuan.md index d5152d1..aafecc6 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -1,31 +1,80 @@ -# 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. + +That project describes itself as + 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. ## 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 availble 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 + +See many appropriate values of BOARD_ID and CHIP_ID at https://sd-card-images.johang.se/. + +For any valid combination of: + | | | + | BOARD_ID | e.g. bananapi, pinebook | + | CHIP_ID | e.g. allwinner-a10, | + | CONFIG | e.g. Bananapi_defconfig | + | TUPLE | e.g. arm-linux-gnueabihf, aarch64-linux-gnu | + +Check that you have a compiler installed for the TUPLE at: +```bash +$(which "${TUPLE}-gcc") +``` +It should report something like: +``` +/usr/bin/arm-linux-gnueabihf-gcc +``` + +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-boot ${BOARD_ID} ${CHIP_ID} ${CONFIG} ${TUPLE} +``` + +The image will end up in /tmp/sd-images on the host as ${BOARD_ID}.bin.gz. #### To build a boot image for Raspberry Pi 3 B: ```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 sd-images build-boot raspberrypi_3b bcm2837 rpi_3_defconfig aarch64-linux-gnu +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. @@ -33,12 +82,15 @@ 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 ROCKPro64 \ + rk3399 \ + rockpro64-rk3399_defconfig \ + aarch64-linux-gnu ``` The image will end up in /tmp/sd-images on the host. @@ -46,27 +98,46 @@ 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 +### Build your own Devuan ext4 root filesystem image + +For any valid combination provided by the distribution: + | | | + | DISTRIBUTION | Devuan Debian Ubuntu | + | ARCH | armhf arm64 i386 amd64 | + | RELEASE | e.g. daedalus excalibur ceres bookworm trixie sid | + +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 #### 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 ``` @@ -76,12 +147,10 @@ The image will end up in /tmp/sd-images on the host. #### 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 ``` -- 2.40.1 From d93fb2763c9a1592fe8de75f3dfd9d5ee7b2050a Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 05:28:07 +0100 Subject: [PATCH 07/23] Chore: layout typos. --- README_devuan.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index aafecc6..ff3af23 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -7,7 +7,7 @@ That project describes itself as ## Pre-built images -Pre-built images for Debian are availble from the original project 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. @@ -36,7 +36,8 @@ These two images are the concatenated to a single image, which is then written t See many appropriate values of BOARD_ID and CHIP_ID at https://sd-card-images.johang.se/. For any valid combination of: - | | | + | Variable | Value | + |----------|-------------------------| | BOARD_ID | e.g. bananapi, pinebook | | CHIP_ID | e.g. allwinner-a10, | | CONFIG | e.g. Bananapi_defconfig | @@ -44,7 +45,7 @@ For any valid combination of: Check that you have a compiler installed for the TUPLE at: ```bash -$(which "${TUPLE}-gcc") +echo $(which "${TUPLE}-gcc") ``` It should report something like: ``` @@ -114,7 +115,8 @@ The image will end up in /tmp/sd-images on the host. ### Build your own Devuan ext4 root filesystem image For any valid combination provided by the distribution: - | | | + | Variable| Value | + |--------------|----------------------| | DISTRIBUTION | Devuan Debian Ubuntu | | ARCH | armhf arm64 i386 amd64 | | RELEASE | e.g. daedalus excalibur ceres bookworm trixie sid | -- 2.40.1 From 28b0d5788bb632958f2f4f97a0ec1597092ca9df Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 05:34:39 +0100 Subject: [PATCH 08/23] Fix: typos. --- README_devuan.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index ff3af23..c066e62 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -44,8 +44,8 @@ For any valid combination of: | TUPLE | e.g. arm-linux-gnueabihf, aarch64-linux-gnu | Check that you have a compiler installed for the TUPLE at: -```bash -echo $(which "${TUPLE}-gcc") +``` +ls $(which "${TUPLE}-gcc") ``` It should report something like: ``` -- 2.40.1 From 423df3b78090b2a38e0f756097a8f90f0dd1b76f Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 05:39:54 +0100 Subject: [PATCH 09/23] Fix: README_devuan.md layout. --- README_devuan.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README_devuan.md b/README_devuan.md index c066e62..121840e 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -3,7 +3,9 @@ This repository simply adds Devuan to a fork of https://github.com/johang/sd-card-images. That project describes itself as - 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. +''' +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. +''' ## Pre-built images -- 2.40.1 From 78a1d3fba448ea8a80c6dbc951d555d95c4f6e03 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 05:42:02 +0100 Subject: [PATCH 10/23] Fix: README_devuan: backtick typo. --- README_devuan.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index 121840e..3a15a34 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -3,9 +3,9 @@ This repository simply adds Devuan to a fork of https://github.com/johang/sd-card-images. That project describes itself as -''' +``` 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. -''' +``` ## Pre-built images -- 2.40.1 From d4ff2f3e880bd538d66983bd6c752256284746a5 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 05:45:05 +0100 Subject: [PATCH 11/23] Fix: README_devuan.md: Markdown typo. --- README_devuan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_devuan.md b/README_devuan.md index 3a15a34..eae1ed6 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -4,7 +4,7 @@ This repository simply adds Devuan to a fork of https://github.com/johang/sd-car That project describes itself as ``` -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. +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. ``` ## Pre-built images -- 2.40.1 From d8283e6726452471f45b17774e0a862d717d6c8f Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 11:10:09 +0100 Subject: [PATCH 12/23] Chore: README_devuan.md: Place examples together at the end. --- README_devuan.md | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index eae1ed6..8c3a25c 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -66,6 +66,31 @@ docker run --rm \ 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| Value | + |--------------|----------------------| + | DISTRIBUTION | Devuan Debian Ubuntu | + | ARCH | armhf arm64 i386 amd64 | + | RELEASE | e.g. daedalus excalibur ceres bookworm trixie sid | + +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 @@ -114,26 +139,7 @@ docker run --rm \ The image will end up in /tmp/sd-images on the host. -### Build your own Devuan ext4 root filesystem image - -For any valid combination provided by the distribution: - | Variable| Value | - |--------------|----------------------| - | DISTRIBUTION | Devuan Debian Ubuntu | - | ARCH | armhf arm64 i386 amd64 | - | RELEASE | e.g. daedalus excalibur ceres bookworm trixie sid | - -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 +### Example root filesystem image ### #### To build a Devuan ext4 root filesystem image for arm64: -- 2.40.1 From 946d0fb4515144ac5e317b42baf0dc2ffb5c4e82 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 11:21:30 +0100 Subject: [PATCH 13/23] Chore: Delete Dockerfile_devuan. We use Dockerfile.devuan. --- Dockerfile_devuan | 59 ----------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 Dockerfile_devuan diff --git a/Dockerfile_devuan b/Dockerfile_devuan deleted file mode 100644 index 32a9a57..0000000 --- a/Dockerfile_devuan +++ /dev/null @@ -1,59 +0,0 @@ -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-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 -- 2.40.1 From 0a187d22c9a83dde43fc1864be6f3c64fcf0bbce Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 11:33:17 +0100 Subject: [PATCH 14/23] Dockerfile.devuan: Use only 'ceres main' in the source list. --- Dockerfile.devuan | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.devuan b/Dockerfile.devuan index c78181a..b4f221a 100644 --- a/Dockerfile.devuan +++ b/Dockerfile.devuan @@ -4,8 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Need Devuan's debootstrap, which also supports Debian and Ubuntu. ARG RELEASE_KEY="94532124541922FB" # ceres key - https://www.devuan.org/os/keyring RUN echo "Adding Devuan ceres signing key (https://www.devuan.org/os/keyring):" ${RELEASE_KEY} -RUN echo 'deb http://deb.devuan.org/merged ceres main contrib non-free' > /etc/apt/sources.list.d/devuan.list && \ - echo 'deb-src http://deb.devuan.org/merged ceres main contrib non-free' >> /etc/apt/sources.list.d/devuan.list +RUN echo 'deb http://deb.devuan.org/merged ceres main' > /etc/apt/sources.list.d/devuan.list # Use Ubuntu's gpg to get Devuan's signing key. RUN apt-get update && apt-get install -y -t noble gpg -- 2.40.1 From 5051f51955a88c8353e517ca116b6fa8f25c8d5d Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 14:22:28 +0100 Subject: [PATCH 15/23] README_devuan.md: Added "Don't report Devuan-issues to johang". --- README_devuan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_devuan.md b/README_devuan.md index 8c3a25c..efe572f 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -1,6 +1,6 @@ # Devuan SD card images -This repository simply adds Devuan to a fork of https://github.com/johang/sd-card-images. +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 ``` -- 2.40.1 From 859ecdc7d978e81df8e45ee641b951e7f669f0be Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 14:36:05 +0100 Subject: [PATCH 16/23] README_devuan.md: Typo on image name. --- README_devuan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_devuan.md b/README_devuan.md index efe572f..ca0ef97 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -85,7 +85,7 @@ docker run --rm \ build-debian ${DISTRIBUTION} ${ARCH} ${RELEASE} ``` -The image will end up in /tmp/sd-images on the host as DISTRIBUTION-ARCH-RELEASE-PASSWORD.bin +The image will end up in /tmp/sd-images on the host as ${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin ## Examples ## -- 2.40.1 From 1d01ead61a1c71907efbf03464f31362cde89d5e Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 14:54:49 +0100 Subject: [PATCH 17/23] README_devuan.md: review markdown syntax problem. --- README_devuan.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index ca0ef97..6e9abf9 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -64,7 +64,7 @@ docker run --rm \ 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. +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 @@ -85,7 +85,11 @@ docker run --rm \ build-debian ${DISTRIBUTION} ${ARCH} ${RELEASE} ``` -The image will end up in /tmp/sd-images on the host as ${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin +The image will end up in /tmp/sd-images on the host as `${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`. + +The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`. + +The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTION} ${ARCH}-${RELEASE}-${PASSWORD}.bin`. ## Examples ## -- 2.40.1 From 7be04ca1a9547cdda333fa40d6af8fb223367e63 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 14:58:46 +0100 Subject: [PATCH 18/23] README_devuan.md: markdown syntax again. --- README_devuan.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README_devuan.md b/README_devuan.md index 6e9abf9..da0f696 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -68,6 +68,10 @@ 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 +The image will end up in /tmp/sd-images on the host as `${BOARD_ID}.bin.gz`. + +The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`. + For any valid combination provided by the distribution: | Variable| Value | |--------------|----------------------| @@ -91,6 +95,8 @@ The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTIO The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTION} ${ARCH}-${RELEASE}-${PASSWORD}.bin`. +The image will end up in /tmp/sd-images on the host as `${BOARD_ID}.bin.gz`. + ## Examples ## ### Example boot image ### -- 2.40.1 From d325765798eb04ddc69f10ba167297ffc4dcf725 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 15:01:56 +0100 Subject: [PATCH 19/23] README_devuan.md: markdown work-around. --- README_devuan.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index da0f696..03f32f4 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -68,10 +68,6 @@ 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 -The image will end up in /tmp/sd-images on the host as `${BOARD_ID}.bin.gz`. - -The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`. - For any valid combination provided by the distribution: | Variable| Value | |--------------|----------------------| @@ -91,12 +87,6 @@ docker run --rm \ The image will end up in /tmp/sd-images on the host as `${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`. -The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`. - -The image will end up in /tmp/sd-images on the host as ${BOARD_ID} ${DISTRIBUTION} ${ARCH}-${RELEASE}-${PASSWORD}.bin`. - -The image will end up in /tmp/sd-images on the host as `${BOARD_ID}.bin.gz`. - ## Examples ## ### Example boot image ### -- 2.40.1 From 703710f763a32ead7d8d59abc5b7559acc4c99e8 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 19:06:03 +0100 Subject: [PATCH 20/23] README_devuan: Complete the 'combination' tables. --- README_devuan.md | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index 03f32f4..3d34683 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -38,22 +38,13 @@ These two images are the concatenated to a single image, which is then written t See many appropriate values of BOARD_ID and CHIP_ID at https://sd-card-images.johang.se/. For any valid combination of: - | Variable | Value | + | Variable | | |----------|-------------------------| | BOARD_ID | e.g. bananapi, pinebook | - | CHIP_ID | e.g. allwinner-a10, | + | CHIP_ID | e.g. allwinner-a10, rk3399 | | CONFIG | e.g. Bananapi_defconfig | | TUPLE | e.g. arm-linux-gnueabihf, aarch64-linux-gnu | -Check that you have a compiler installed for the TUPLE at: -``` -ls $(which "${TUPLE}-gcc") -``` -It should report something like: -``` -/usr/bin/arm-linux-gnueabihf-gcc -``` - To build: ```bash docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan @@ -69,11 +60,11 @@ 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| Value | - |--------------|----------------------| - | DISTRIBUTION | Devuan Debian Ubuntu | - | ARCH | armhf arm64 i386 amd64 | - | RELEASE | e.g. daedalus excalibur ceres bookworm trixie sid | + |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 -- 2.40.1 From 03979dc523ec32bcf550a2471efdc26aa5d43afe Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 May 2024 21:44:32 +0100 Subject: [PATCH 21/23] README_devuan.md: Add TOC. --- README_devuan.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README_devuan.md b/README_devuan.md index 3d34683..3ea0156 100644 --- a/README_devuan.md +++ b/README_devuan.md @@ -4,8 +4,24 @@ This repository simply adds Devuan to a fork of https://github.com/johang/sd-car 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. +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 @@ -78,11 +94,11 @@ docker run --rm \ The image will end up in /tmp/sd-images on the host as `${DISTRIBUTION}-${ARCH}-${RELEASE}-${PASSWORD}.bin`. -## 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 ```bash docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan @@ -98,7 +114,7 @@ docker run --rm \ The image will end up in /tmp/sd-images on the host. -#### To build a boot image for Pine64 Rockpro64: +#### 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 @@ -130,9 +146,9 @@ docker run --rm \ The image will end up in /tmp/sd-images on the host. -### 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 ```bash docker build -t devuan/sd-images -f Dockerfile.devuan https://github.com/watchful-0wl/sd-card-images.git#add_devuan @@ -145,7 +161,7 @@ docker run --rm \ 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 https://github.com/watchful-0wl/sd-card-images.git#add_devuan -- 2.40.1 From a256d0d9235ce1600215ea95415545189a97663e Mon Sep 17 00:00:00 2001 From: david Date: Fri, 17 May 2024 02:55:47 +0100 Subject: [PATCH 22/23] Dockerfile.devuan: Add python3-lxml for rebuild-debian-csv. --- Dockerfile.devuan | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.devuan b/Dockerfile.devuan index b4f221a..30f505d 100644 --- a/Dockerfile.devuan +++ b/Dockerfile.devuan @@ -40,6 +40,7 @@ RUN apt-get update && \ bison \ flex \ python3-dev \ + python3-lxml \ python3-pkg-resources \ python3-pyelftools \ python3-setuptools \ -- 2.40.1 From c37d4b0a79cf1c738e4acb2662fd1945a9895c26 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 17 May 2024 03:15:45 +0100 Subject: [PATCH 23/23] Dockerfile: Add python3-lxml for rebuild-debian-csv. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 7a48876..741610b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get update && \ bison \ flex \ python3-dev \ + python3-lxml \ python3-pkg-resources \ python3-pyelftools \ python3-setuptools \ -- 2.40.1