Initial commit.

This commit is contained in:
cyteen 2025-10-06 12:11:54 +01:00
commit 8888c9e15c
4 changed files with 135 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
# Previous component images
partition.img.gz
firmware.*.img.gz
*_combined-image.img
# Previous combined images
old_images/

View File

@ -0,0 +1,26 @@
This directory provides installer images in the form of a device-specific
part (containing the partition table and the system firmware) and a
device-independent part (containing the actual installer), which can be
unpacked and concatenated together to build a complete installer image.
The device-specific part is named firmware.<board_name>.img.gz
and the device-independent part is named partition.img.gz.
In addition to providing several firmware.<board_name>.img.gz files for
a number of devices with device-specific system firmware, we also
provide a firmware.none.img.gz file (containing the partition table but
without any system firmware) to provide generic installer images for
devices for which no firmware.<board_name>.img.gz file is provided.
To create a complete image from the two parts on Linux systems, you can
use zcat as follows:
zcat firmware.<board_name>.img.gz partition.img.gz > complete_image.img
On Windows systems, you have to first decompress the two parts separately,
which can be done e.g. by using 7-Zip, and then concatenate the decompressed
parts together by running the command
copy /b firmware.<board_name>.img + partition.img complete_image.img
in a Windows CMD.exe window.

76
README.md Normal file
View File

@ -0,0 +1,76 @@
# Debian Installer Image Builder for RockPro64 RK3399
A shell script that automates downloading and combining Debian installer images for arm64 boards, supporting both release and daily builds.
## Table of Contents
- [Features](#features)
- [Requirements](#requirements)
- [Usage](#usage)
- [Configuration](#configuration)
- [Output Files](#output-files)
- [License](#license)
## Features
- Downloads firmware and partition images from official Debian repositories
- Supports both release and daily build versions
- Automatically combines downloaded images
- Timestamp-based naming for daily builds
- Cleans up old image files
## Requirements
- Bash shell
- wget utility
- zcat utility (part of gzip package)
## Usage
Save the script as `debian-image-builder.sh`, make it executable, and run:
```bash
chmod +x debian-image-builder.sh
./debian-image-builder.sh
```
## Configuration
The script uses the following variables:
```bash
BOARD=rockpro64-rk3399 # Hardware board identifier
RELEASE=forky # Debian release (bookworm/trixie/forky)
IMAGE_TYPE=daily # Type of image (daily/release)
TIMESTAMP=$(date "+%Y%m%d%H%M%S")
```
```
Where BOARD can be:
* a64-olinuxino
* firefly-rk3399
* nanopi_neo2
* none
* orangepi_one_plus
* orangepi_zero_plus2
* pine64_plus
* pinebook-pro-rk3399
* pinebook
* puma-rk3399
* rock-pi-4-rk3399
* rock64-rk3328
* rockpro64-rk3399
* teres_i
## Output Files
Based on the
:
- Release builds: `${BOARD}-${RELEASE}_combined-image.img`
- Daily builds: `${BOARD}-${TIMESTAMP}-${RELEASE}_combined-image.img`
Old combined images are moved to the
directory.
## License
[MIT License](LICENSE)
```

26
debian-image-builder.sh Normal file
View File

@ -0,0 +1,26 @@
BOARD=rockpro64-rk3399
# RELEASE=bookworm
# RELEASE=trixie
RELEASE=forky
IMAGE_TYPE=daily # or release
TIMESTAMP=$(date "+%Y%m%d%H%M%S")
# remove the old image
rm partition.img.gz
rm firmware."${BOARD}".img.gz
mv *_combined-image.img old_images
# if statement to set urls based on IMAGE_TYPE
if [ "${IMAGE_TYPE}" = "release" ]; then
BOARD_URL=http://ftp.debian.org/debian/dists/"${RELEASE}"/main/installer-arm64/current/images/netboot/SD-card-images/firmware."${BOARD}".img.gz
PARTITION_URL=http://ftp.debian.org/debian/dists/"${RELEASE}"/main/installer-arm64/current/images/netboot/SD-card-images/partition.img.gz
wget "${BOARD_URL}"
wget "${PARTITION_URL}"
zcat firmware."${BOARD}".img.gz partition.img.gz >"${BOARD}-${RELEASE}"_combined-image.img
else
PARTITION_URL=https://d-i.debian.org/daily-images/arm64/daily/netboot/SD-card-images/partition.img.gz
BOARD_URL=https://d-i.debian.org/daily-images/arm64/daily/netboot/SD-card-images/firmware.${BOARD}.img.gz
wget "${PARTITION_URL}"
wget "${BOARD_URL}"
zcat firmware."${BOARD}".img.gz partition.img.gz >"${BOARD}-${TIMESTAMP}-${RELEASE}"_combined-image.img
fi