Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1e63f14
Delete redondant .gitignore in scripts
bjordiscollaku Aug 28, 2025
f43d3a7
Modify readme
bjordiscollaku Aug 28, 2025
de840c2
Add build and deployment script for qcom-next Linux kernel on compute…
bjordiscollaku Jul 10, 2025
cb1723f
Add Ubuntu-compliant packaging script for qcom-next Linux kernel builds
bjordiscollaku Jul 10, 2025
697eadc
Add tool to build EFI System Partition image for ARM64 targets
bjordiscollaku Jul 10, 2025
4bc37bd
Add tool to enable SQUASHFS config options for Ubuntu-based rootfs su…
bjordiscollaku Jul 10, 2025
28b5b47
fix readme
simonbeaudoin0935 Aug 28, 2025
25e10d9
Add Ubuntu Noble (24.04) ARM64 image builder for kernel and rootfs to…
bjordiscollaku Jul 15, 2025
0fee740
Add build-ubuntu-rootfs.sh – generate Ubuntu 24.04 rootfs image using…
bjordiscollaku Jul 15, 2025
57750fc
Remove Dockerfile from qcom-build-utils
bjordiscollaku Jul 24, 2025
7ab99ec
Implement label-based booting for robust EFI and rootfs
bjordiscollaku Jul 28, 2025
1ca0c92
Mask systemd-networkd-wait-online and dev-disk-by-label-UEFI.device t…
bjordiscollaku Jul 28, 2025
90d8e75
Add kernel build support for Hamoa EVK platform
bjordiscollaku Aug 8, 2025
58cc9e9
build-ubuntu-rootfs: Add GRUB bootloader support for X Elite EVK
bjordiscollaku Aug 8, 2025
2e512b7
Add license headers and update descriptions for compliance in public …
bjordiscollaku Aug 14, 2025
529ce6c
Update codeowners
bjordiscollaku Aug 18, 2025
09af512
Refactor rootfs build script for modular, platform- and distro-specif…
bjordiscollaku Aug 19, 2025
4461211
Increase ubuntu.img size to 8G for KLM
bjordiscollaku Aug 20, 2025
705c2aa
Add package manifest JSON support for automated custom package instal…
bjordiscollaku Aug 26, 2025
dd90a1a
build-ubuntu-rootfs.sh: Add support for injecting custom apt sources …
bjordiscollaku Aug 27, 2025
20d9bed
Ensure jq is installed before processing package-manifest.json in bui…
bjordiscollaku Aug 28, 2025
4cfafa7
fix code ownders
simonbeaudoin0935 Aug 28, 2025
b11b47c
Added support for qcs8300 and qcs9100 dt
quic-khuzuri Sep 9, 2025
5d9caf1
Merge pull request #21 from quic-khuzuri/latest
vishwasudupa Sep 9, 2025
1ca2384
Update build-ubuntu-rootfs.sh
quic-khuzuri Sep 12, 2025
47be43d
Merge pull request #22 from quic-khuzuri/latest
vishwasudupa Sep 15, 2025
0fd652d
Extract kernel version from generated deb package
sgaud-quic Oct 3, 2025
18b3e8d
Merge pull request #25 from sgaud-quic/latest
vishwasudupa Oct 6, 2025
9b8b275
Fix : Extract kernel version from debian package
sgaud-quic Oct 8, 2025
70c4fb2
Merge pull request #30 from sgaud-quic/latest
vishwasudupa Oct 8, 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
6 changes: 4 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
* @sjakki88 @vishwasudupa @bjordiscollaku @simonbeaudoin0935

# Specific ownership for the ubuntu folder
ubuntu/* @vkraleti @sbanerjee-quic @vishwasudupa @bjordiscollaku

scripts/* @vishwasudupa @bjordiscollaku @simonbeaudoin0935
rootfs/* @bjordiscollaku
kernel/* @bjordiscollaku
bootloader/* @bjordiscollaku
77 changes: 62 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,67 @@
qcom-build-utils
--------
# Clone qcom-build-utils
```
git clone [email protected]: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/```

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.
# 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
```
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 <[email protected]>
# ==============================================================================

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