Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d8fa555
Cleanup legacy scripts
bjordiscollaku Jul 24, 2025
b1e1ebb
Initial commit
quic-viskuma Jul 10, 2025
df4f3b3
Add build and deployment script for qcom-next Linux kernel on compute…
bjordiscollaku Jul 10, 2025
8c2c5ed
Add Ubuntu-compliant packaging script for qcom-next Linux kernel builds
bjordiscollaku Jul 10, 2025
346426c
Add tool to build EFI System Partition image for ARM64 targets
bjordiscollaku Jul 10, 2025
3b8126b
Add qcom-next kernel build and deb package generation instructions
bjordiscollaku Jul 10, 2025
f1727c1
Add tool to enable SQUASHFS config options for Ubuntu-based rootfs su…
bjordiscollaku Jul 10, 2025
2511341
Update SQUASHFS enablement to use the new automated tool
bjordiscollaku Jul 10, 2025
397026c
Add instructions to run automated tool to generate EFIESP image
bjordiscollaku Jul 11, 2025
55899c5
Add Ubuntu Noble (24.04) ARM64 image builder for kernel and rootfs to…
bjordiscollaku Jul 15, 2025
44ea9e0
Add build-ubuntu-rootfs.sh – generate Ubuntu 24.04 rootfs image using…
bjordiscollaku Jul 15, 2025
8e4496a
Add instructions to invoke build ubuntu rootfs tool and deploy final …
bjordiscollaku Jul 16, 2025
4a1cc18
Add README qcom-build-utils instructions
bjordiscollaku Jul 24, 2025
095e35f
Remove Dockerfile from qcom-build-utils
bjordiscollaku Jul 24, 2025
7f0f8c1
Update README.md
bjordiscollaku Jul 24, 2025
9c1349e
Implement label-based booting for robust EFI and rootfs
bjordiscollaku Jul 28, 2025
1d6d700
Mask systemd-networkd-wait-online and dev-disk-by-label-UEFI.device t…
bjordiscollaku Jul 28, 2025
1e615a5
Add kernel build support for Hamoa EVK platform
bjordiscollaku Aug 8, 2025
44c8b95
build-ubuntu-rootfs: Add GRUB bootloader support for X Elite EVK
bjordiscollaku Aug 8, 2025
4d3b3f3
Add license headers and update descriptions for compliance in public …
bjordiscollaku Aug 14, 2025
b306f11
Update codeowners
bjordiscollaku Aug 18, 2025
b11a9e1
Refactor rootfs build script for modular, platform- and distro-specif…
bjordiscollaku Aug 19, 2025
dda47a7
Increase ubuntu.img size to 8G for KLM
bjordiscollaku Aug 20, 2025
741179a
Add package manifest JSON support for automated custom package instal…
bjordiscollaku Aug 26, 2025
cfd9501
build-ubuntu-rootfs.sh: Add support for injecting custom apt sources …
bjordiscollaku Aug 27, 2025
c526ea4
Ensure jq is installed before processing package-manifest.json in bui…
bjordiscollaku Aug 28, 2025
faa5fcb
Merge latest and main
simonbeaudoin0935 Aug 28, 2025
28a2148
Update reviewers file to reflect new structure
simonbeaudoin0935 Aug 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
* @sjakki88 @vishwasudupa @bjordiscollaku @simonbeaudoin0935

# Specific ownership for the ubuntu folder
ubuntu/* @vkraleti @sbanerjee-quic @vishwasudupa @bjordiscollaku
scripts/* @simonbeaudoin0935
bootloader/* @bjordiscollaku
kernel/* @bjordiscollaku
rootfs/* @bjordiscollaku

78 changes: 63 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,68 @@
qcom-build-utils
--------
# Clone qcom-build-utils
```
git clone git@github.com:qualcomm-linux/qcom-build-utils.git -b latest
```
```
cd qcom-build-utils
```

Overview
--------
qcom-build-utils holds set of tools which to developers to build, test and debug platform and CI/CD utilities.
# Sync and build qcom-next
```
cd kernel && export BUILD_TOP=`pwd`
```
```
git clone https://github.com/qualcomm-linux/kernel.git --single-branch -b qcom-next --depth=1 $BUILD_TOP/qcom-next
```

Branches
--------
main: Primary development branch. Contributors should develop submissions based on this branch, and submit pull requests to this branch.
### Add Kernel SQUASHFS configs required for Ubuntu
```
./scripts/enable_squashfs_configs.sh $BUILD_TOP/qcom-next/
```

Features
--------
- ubuntu/build-utils scripts helps to assist build debian package, create system image and other tools related to ubuntu.
### Run build_kernel.sh
```
./scripts/build_kernel.sh
```
At the end of kernel build, below products will be deployed in ```kernel/out/```

for more information, please refer to the README in each subdirectory.
# Generate Linux Kernel Debian Package
Run ```build-kernel-deb.sh``` and pass as argument the directory where kernel build artifacts were deployed (```out/```):
```
./scripts/build-kernel-deb.sh out/
```
```linux-kernel-<kversion>-arm64.deb``` will be generated in ```kernel/```

# Build EFI System Partition Image
```
cd ../ # Moves you into the qcom-build-utils/ directory
```
```
./bootloader/build-efi-esp.sh
```
```efiesp.bin``` will be generated and deployed in ```qcom-build-utils/```

# Download firmware debian package for X Elite CRD
```
wget "https://qli-stg-kernel-gh-artifacts.s3.amazonaws.com/kernel/ubuntu-firmware/linux-firmware-xelite_1.0-1%2Bnoble_arm64.deb?AWSAccessKeyId=AKIAXYMT55OHLXWGCTOU&Signature=TiG%2FZrnzJwhZoWK91y4qEf%2BczzA%3D&Expires=1788577277" -O "linux-firmware-xelite_1.0-1+noble_arm64.deb"
```
```linux-firmware-xelite_1.0-1+noble_arm64.deb``` will be downloaded in ```qcom-build-utils/linux-firmware-xelite_1.0-1+noble_arm64.deb```

# Build Ubuntu Rootfs
```
./rootfs/scripts/build-ubuntu-rootfs.sh kernel/linux-kernel-<kversion>-arm64.deb linux-firmware-xelite_1.0-1+noble_arm64.deb
```
```ubuntu.img``` root filesystem image will be generated in ```qcom-build-utils/ubuntu.img```

# Final Products
Kernel Debian Package:
```qcom-build-utils/kernel/```
```
-linux-kernel-<kversion>-arm64.deb
```
Bootable images:
```qcom-build-utils/```
```
- efiesp.bin
- ubuntu.img
```

License
-------
qcom-build-utils is licensed under the [BSD-3-clause-clear License](https://spdx.org/licenses/BSD-3-Clause-Clear.html). See [LICENSE](LICENSE.txt) for the full license text.
101 changes: 101 additions & 0 deletions bootloader/build-efi-esp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
#
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
# ==============================================================================
# Script: build-efi-esp.sh
# ------------------------------------------------------------------------------
# Description:
# Creates a standalone EFI System Partition image (efiesp.bin) for ARM64
# platforms.
#
# Workflow:
# 1. **Auto‑elevate** – re‑executes itself with `sudo` if not already root.
# 2. **Install tooling** – `grub-efi-arm64-bin`, `grub2-common`, `dosfstools`.
# 3. **Allocate** a 200 MB blank file and format it FAT32.
# 4. **Loop‑attach** the image and install GRUB for the arm64‑efi target
# in *removable* mode (no NVRAM writes).
# 5. **Seed** a minimal `grub.cfg` that chain‑loads the main GRUB on
# the rootfs partition (assumed GPT 13).
# 6. **Cleanup** – unmount, detach loop device, and report success.
#
# Usage:
# ./build-efi-esp.sh
#
# Output:
# efiesp.bin → flash to appropriate ESP partition
#
# Author: Bjordis Collaku <bcollaku@qti.qualcomm.com>
# ==============================================================================

set -euo pipefail

# ==============================================================================
# Step 0  Auto‑elevate if not run as root
# ==============================================================================
if [[ "$EUID" -ne 0 ]]; then
echo "[INFO] Re‑running script as root using sudo…"
exec sudo "$0" "$@"
fi

# ==============================================================================
# Step 1  Configuration
# ==============================================================================
ESP_IMG="efiesp.bin"
ESP_SIZE_MB=200
MNT_DIR="mnt"

# ==============================================================================
# Step 2  Install Required Packages
# ==============================================================================
echo "[INFO] Installing required packages…"
apt-get update -y
apt-get install -y grub2-common grub-efi-arm64-bin dosfstools

# ==============================================================================
# Step 3  Create and Format ESP Image
# ==============================================================================
echo "[INFO] Creating ${ESP_SIZE_MB} MB EFI System Partition image: ${ESP_IMG}"
dd if=/dev/zero of="${ESP_IMG}" bs=1M count="${ESP_SIZE_MB}" status=progress

LOOP_DEV=$(losetup --show -fP "${ESP_IMG}")
echo "[INFO] Loop device attached: ${LOOP_DEV}"

echo "[INFO] Formatting as FAT32…"
mkfs.vfat -F 32 "${LOOP_DEV}"

# ==============================================================================
# Step 4  Install GRUB to ESP Image
# ==============================================================================
mkdir -p "${MNT_DIR}"
mount "${LOOP_DEV}" "${MNT_DIR}"
mkdir -p "${MNT_DIR}/boot"

echo "[INFO] Installing GRUB bootloader (arm64‑efi)…"
grub-install \
--target=arm64-efi \
--efi-directory="${MNT_DIR}" \
--boot-directory="${MNT_DIR}/boot" \
--removable \
--no-nvram

# ==============================================================================
# Step 5  Write Bootstrap grub.cfg
# ==============================================================================
echo "[INFO] Writing bootstrap grub.cfg…"
cat > "${MNT_DIR}/boot/grub/grub.cfg" <<EOF
search --no-floppy --label system --set=root
set prefix=(\$root)/boot/grub
configfile /boot/grub.cfg
EOF

# ==============================================================================
# Step 6  Cleanup
# ==============================================================================
umount -l "${MNT_DIR}"
losetup -d "${LOOP_DEV}"
rm -rf "${MNT_DIR}"

echo "[SUCCESS] EFI System Partition image created: ${ESP_IMG}"

5 changes: 5 additions & 0 deletions kernel/out/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Required to host raw kernel build products:
- .config
- Image
- .dtbs
- modules/lib/modules/<kernel_version>
Loading
Loading