-
Notifications
You must be signed in to change notification settings - Fork 16
CI: add Dockerfile and README to support image packing in CI pipeline #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yogeshlal
merged 1 commit into
qualcomm-linux:main
from
nandini-matam:ci/add-dockerfile-ci-readme
Apr 15, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| FROM ubuntu:24.04 | ||
|
|
||
| ARG USER_ID | ||
| ARG GROUP_ID | ||
| ARG USER_NAME | ||
|
|
||
| RUN if [ -n "$USER_ID" ] && [ -n "$GROUP_ID" ] && [ -n "$USER_NAME" ]; then \ | ||
| groupadd -g "$GROUP_ID" "$USER_NAME" && \ | ||
| useradd -m -u "$USER_ID" -g "$GROUP_ID" -d / "$USER_NAME" ; \ | ||
| fi | ||
|
|
||
| ENV ARCH=arm64 | ||
| ENV CROSS_COMPILE=aarch64-linux-gnu- | ||
|
|
||
| COPY generate_boot_bins.sh /usr/bin/ | ||
| COPY build.sh /usr/bin/ | ||
| COPY make_fitimage.sh /usr/bin/ | ||
|
|
||
| RUN set -eux; \ | ||
| apt-get update; \ | ||
| apt-get install -y --no-install-recommends \ | ||
| ca-certificates \ | ||
| curl \ | ||
| git \ | ||
| binutils \ | ||
| python3 \ | ||
| locales \ | ||
| kmod \ | ||
| rsync \ | ||
| systemd-ukify \ | ||
| dosfstools \ | ||
| mtools \ | ||
| cpio \ | ||
| ; \ | ||
| rm -rf /var/lib/apt/lists/*; \ | ||
| locale-gen en_US.UTF-8; \ | ||
| update-locale LANG=en_US.UTF-8; \ | ||
| \ | ||
| curl "https://android.googlesource.com/platform/system/tools/mkbootimg/+/refs/heads/android12-release/mkbootimg.py?format=TEXT" \ | ||
| | base64 --decode > /usr/bin/mkbootimg; \ | ||
| chmod +x /usr/bin/mkbootimg; \ | ||
| chmod 755 /usr/bin/generate_boot_bins.sh /usr/bin/build.sh /usr/bin/make_fitimage.sh; \ | ||
| \ | ||
| command -v ukify; \ | ||
| command -v mkfs.vfat; \ | ||
| command -v mcopy; \ | ||
| command -v rsync | ||
|
|
||
| # Fetch & unpack systemd-boot .deb | ||
| ARG SYSTEMD_BOOT_DEB_URL="http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb" | ||
| RUN set -eux; \ | ||
| mkdir -p /artifacts/systemd; \ | ||
| echo "Downloading systemd-boot from: ${SYSTEMD_BOOT_DEB_URL}"; \ | ||
| curl -fsSL "${SYSTEMD_BOOT_DEB_URL}" -o /artifacts/systemd-boot-efi.deb; \ | ||
| dpkg-deb -xv /artifacts/systemd-boot-efi.deb /artifacts/systemd; \ | ||
| test -d /artifacts/systemd/usr/lib/systemd/boot/efi | ||
|
|
||
| ENV LANG=en_US.UTF-8 | ||
| ENV LC_ALL=en_US.UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # kmake-image-packager | ||
|
|
||
| Docker image for packaging bootable Linux kernel artifacts. | ||
|
|
||
| This project focuse on generating bootable images (`efi.bin`, `dtb.bin`) from prebuilt kernel artifacts (kernel image and DTB). | ||
|
|
||
|
|
||
| # TL;DR (Step-by-Step) | ||
|
|
||
|
|
||
| ### 1. Clone kmake-image | ||
|
|
||
| ```bash | ||
| git clone git@github.com:qualcomm-linux/kmake-image.git | ||
| cd kmake-image | ||
| ``` | ||
|
|
||
| ### 2. Build the Docker Image | ||
|
|
||
| You can build the Docker image in one of the following ways. | ||
|
|
||
| #### Option A: Simple build | ||
|
|
||
| ```bash | ||
| docker build -f CI/Dockerfile.ci -t kmake-image-ci . | ||
| ``` | ||
|
|
||
| #### Option B: Build with user mapping (recommended) | ||
|
|
||
| This avoids file permission issues on generated artifacts. | ||
|
|
||
| ```bash | ||
| docker build \ | ||
| --build-arg USER_ID=$(id -u) \ | ||
| --build-arg GROUP_ID=$(id -g) \ | ||
| --build-arg USER_NAME=$(whoami) \ | ||
| -f CI/Dockerfile.ci \ | ||
| -t kmake-image-ci . | ||
| ``` | ||
|
|
||
| ### 3. Set up the alias in your `.bashrc` | ||
|
|
||
| Add the following alias: | ||
|
|
||
| ```bash | ||
| alias kmake-image-ci='docker run -it --rm \ | ||
| --user $(id -u):$(id -g) \ | ||
| --workdir="$PWD" \ | ||
| -v "$(dirname "$PWD")":"$(dirname "$PWD")" \ | ||
| kmake-image-ci' | ||
| ``` | ||
|
|
||
| Apply the change: | ||
|
|
||
| ```bash | ||
| source ~/.bashrc | ||
| ``` | ||
|
|
||
| ### Prerequisites (Required Artifacts) | ||
|
|
||
| Before generating `efi.bin`, ensure the following artifacts are available locally: | ||
|
|
||
| - **Kernel Image**: `Image` (uncompressed) | ||
| - **Ramdisk**: `initrd.cpio.gz` | ||
| - **Target DTB**: example `qcs6490-rb3gen2.dtb` | ||
|
|
||
| ### 4. Generate `efi.bin` | ||
|
|
||
| Run the EFI image generation command: | ||
|
|
||
| ```bash | ||
| kmake-image-ci generate_boot_bins.sh efi \ | ||
| --ramdisk artifacts/initrd.cpio.gz \ | ||
| --systemd-boot /artifacts/systemd/usr/lib/systemd/boot/efi/systemd-bootaa64.efi \ | ||
| --stub /artifacts/systemd/usr/lib/systemd/boot/efi/linuxaa64.efi.stub \ | ||
| --linux artifacts/Image \ | ||
| --cmdline "console=ttyMSM0,115200n8 copy-modules rootdelay=10 root=PARTLABEL=rootfs rw rootwait qcom_geni_serial.con_enabled=1" \ | ||
| --output images | ||
| ``` | ||
|
|
||
| ### 5. Generate `dtb.bin` | ||
| *(For targets supporting a DTB partition)* | ||
|
|
||
| ```bash | ||
| kmake-image-ci generate_boot_bins.sh dtb \ | ||
| --input artifacts/qcs6490-rb3gen2.dtb \ | ||
| --output images | ||
| ``` | ||
|
|
||
| ### 6. Output | ||
|
|
||
| The generated files: | ||
|
|
||
| - `efi.bin` | ||
| - `dtb.bin` | ||
|
|
||
| are available in the `images/` directory and are ready to be booted on | ||
| **QCS6490 RB3Gen2**. | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.