Hangfan Li b58334b71c script: support custom sector-size for disk image
This adds support for 4kn storage such as UFS.

By now, the only possible method to populate 4kn
image is losetup. No partition tools supports
that yet.
2026-01-30 16:02:32 +08:00
2025-08-22 16:51:27 +08:00
2025-12-30 15:33:36 +08:00
2025-12-29 18:17:10 +08:00
2025-09-08 11:00:50 +08:00

ImageBuilder

Brought to you by OERV team.

Overview

It is driven by GNU Makefile for target management.

It will produce:

  • RootFS tarball
    • rpm-based package manager
      • yum
    • dpkg-based package manager
    • Archiving method
      • tar.zst
  • Embedded system images for SBC-like devices
    • Single disk image with all partitions inside
      • GUID partition table
        • Partition UUID
        • Partition GUID type and attributes
        • Partition name
      • msdos parition table
      • MTD
    • Separated files for each filesystem
    • Filesystems
      • vfat
      • ext4
  • Post-process for specific usage
    • qcow2 format
    • Vendor-defined package format

It can be interrupted at any time, without harming your host OS.

Prerequirements

  • Root-mode docker with --priviledged option available
    • May not be necessary in the future
  • rsync
  • GNU Makefile
  • And other basic shell utils

Usage

Build New Images

Bash tab completition will print all available targets

Firstly, let it build a container image for later use:

make container

It will be tagged and managed by docker.

Listing all available targets:

make list

Build a single rootfs target:

make openEuler-24.03-LTS-SP1-base-rootfs

Build all rootfs targets one by one, under a different directory /tmp/build:

make O=/tmp/build openEuler-24.03-LTS-SP1-base-rootfs

Build all available BSP targets, parallelly:

make -j$(nproc) all_bsp

BSP target will be rebuilt each time even if no configuration is changed

Cleanup:

make clean

Add New Targets

Add RootFS Targets

  1. Creating a directory for your distro under receipes
  2. Filling receipes/${DISTRO_NAME}/distro.mk, taking existing ones as reference
  3. Creating a directory for the distro release, under receipes/${DISTRO_NAME}
  4. Filling receipes/${DISTRO_NAME}/${DISTRO_RELEASE}/release.mk
  5. Creating a directory for rootfs receipe (such as minimal, base or desktop), under receipes/${DISTRO_NAME}/${DISTRO_RELEASE}/userspace
  6. Filling receipes/${DISTRO_NAME}/${DISTRO_RELEASE}/userspace/${receipe}/receipe.mk
  7. Listing required packages under receipes/${DISTRO_NAME}/${DISTRO_RELEASE}/userspace/${receipe}/packages.d
  8. Listing repo URLs required to install those packages under receipes/${DISTRO_NAME}/${DISTRO_RELEASE}/userspace/${receipe}/repos.d
  9. Listing scripts to be run after all package installation under receipes/${DISTRO_NAME}/${DISTRO_RELEASE}/userspace/${receipe}/post.d

Add BSP Targets

TBD

Common Usage

packages.d
post.d
repos.d
Description
No description provided
Readme 396 KiB
Languages
Shell 75.2%
Makefile 23.1%
Dockerfile 1.7%