diff --git a/Makefile b/Makefile index b71ab96..678f4f9 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,7 @@ clean_staging: .PHONY: container container: $(CONTAINER_CMD) build -t $(CONTAINER_IMAGE_TAG) $(ROOT_DIR) + @echo "New container image is tagged as: $(CONTAINER_IMAGE_TAG)" .PHONY: .test diff --git a/README.md b/README.md new file mode 100644 index 0000000..c672d8c --- /dev/null +++ b/README.md @@ -0,0 +1,115 @@ +# 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 + - [x] yum + - [ ] ~~dpkg-based package manager~~ + - Archiving method + - [x] tar.zst +- Embedded system images for SBC-like devices + - Single disk image with all partitions inside + - [x] GUID partition table + - [x] Partition UUID + - [x] Partition GUID type and attributes + - [x] Partition name + - [ ] msdos parition table + - [ ] MTD + - [ ] Separated files for each filesystem + - Filesystems + - [x] vfat + - [x] 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: + +```shell +make container +``` + +It will be tagged and managed by docker. + +Listing all available targets: + +```shell +make list +``` + +Build a single rootfs target: + +```shell +make openEuler-24.03-LTS-SP1-base-rootfs +``` + +> Once a rootfs target is created, it will never be created again and will be used to build all related BSP targets. + +Build all rootfs targets one by one, under a different directory `/tmp/build`: + +```shell +make O=/tmp/build openEuler-24.03-LTS-SP1-base-rootfs +``` + +Build all available BSP targets, parallelly: + +```shell +make -j$(nproc) all_bsp +``` + +> BSP target will be rebuilt each time + +Cleanup: + +```shell +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`