Skip to content

Commit d9e19e7

Browse files
committed
ci: Use prebuilt rootfs to generate kbdev flatbuild
Use prebuilt rootfs from meta-qcom nightly builds to generate kbdev flatbuilds. As of now boootbins tar is used to generate flat build alongwith ptool to generate flatbuild. Instead use prebuilt rootfs from meta-qcom and replace efi.bin and dtb.bin to generate flatbuild. This will make sure we are always using updated bootbins that are consumed by meta-qcom. Signed-off-by: Salendarsingh Gaud <[email protected]>
1 parent 02ca177 commit d9e19e7

File tree

3 files changed

+47
-80
lines changed

3 files changed

+47
-80
lines changed
Lines changed: 33 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Flat Meta Generation
22

33
inputs:
4-
bootbins:
5-
description: Boot bins for Flat META
6-
type: string
7-
required: true
84
workspace_path:
95
description: Workspace path
106
required: true
@@ -14,90 +10,69 @@ inputs:
1410
docker_image:
1511
description: Docker image name
1612
required: true
13+
rootfs_matrix:
14+
description: Rootfs matrix
15+
required: true
1716

1817
runs:
1918
using: "composite"
2019
steps:
21-
- name: Clone qcom-ptool
22-
shell: bash
23-
run: |
24-
workspace="${{ inputs.workspace_path }}"
25-
cd "$workspace/.."
26-
git clone https://github.com/qualcomm-linux/qcom-ptool.git
27-
2820
- name: Create Flat META
2921
shell: bash
3022
run: |
23+
set -x
3124
workspace="${{ inputs.workspace_path }}"
32-
bootbins='${{ inputs.bootbins }}'
3325
s3_bucket="${{ inputs.s3_bucket }}"
3426
docker_image="${{ inputs.docker_image }}"
27+
rootfs_matrix='${{ inputs.rootfs_matrix }}'
3528
36-
echo "$bootbins"
37-
38-
for row in $(echo "$bootbins" | jq -c '.[]'); do
39-
target=$(echo "$row" | jq -r '.target')
40-
buildid=$(echo "$row" | jq -r '.buildid')
29+
for row in $(echo "$rootfs_matrix" | jq -c '.[]'); do
30+
machine=$(echo "$row" | jq -r '.machine')
31+
rootfs=$(echo "$row" | jq -r '.rootfs')
4132
firmwareid=$(echo "$row" | jq -r '.firmwareid')
4233
43-
echo "Target : $target"
44-
echo "Build ID : $buildid"
34+
echo "Target : $machine"
35+
echo "Rootfs ID : $rootfs"
4536
echo "Firmware ID : $firmwareid"
4637
echo "-----------------------------"
4738
48-
if [ -z "$buildid" ]; then
49-
echo "No Build Id for $target, skip generating Flat Build."
39+
if [ -z "$rootfs" ]; then
40+
echo "No Rootfs present for $target, skip generating Flat Build."
5041
continue
5142
fi
5243
53-
platform=$(echo "$buildid" | cut -d '.' -f1)
54-
build_dir="$workspace/../flatbuild-$platform"
55-
boot_dir="$build_dir/${platform}_bootbinaries"
44+
build_dir="$workspace/../flatbuild-$rootfs"
45+
meta_dir="$build_dir/qcom-multimedia-image-${rootfs}.rootfs.qcomflash"
46+
5647
artifacts_dir="$build_dir/artifacts"
5748
5849
mkdir -p "$build_dir"
5950
cd "$build_dir"
60-
61-
aws s3 cp "s3://$s3_bucket/$buildid/${platform}_bootbinaries.zip" .
62-
aws s3 cp "s3://$s3_bucket/$buildid/contents.zip" .
51+
aws s3 cp s3://$s3_bucket/qualcomm-linux/kernel/meta-qcom/artifacts/qcom-multimedia-image-${rootfs}.rootfs.qcomflash.tar.gz .
6352
64-
unzip -o "${platform}_bootbinaries.zip"
65-
unzip -o contents.zip
66-
67-
docker run -i --rm \
68-
--user "$(id -u):$(id -g)" \
69-
--workdir="$PWD" \
70-
-v "$(dirname "$PWD")":"$(dirname "$PWD")" \
71-
-e workspace="$workspace" \
72-
-e platform="$platform" \
73-
"$docker_image" bash -c "
74-
python3 \$workspace/../qcom-ptool/ptool.py \
75-
-x \${platform}_bootbinaries/partition_ufs.xml \
76-
-t \${platform}_bootbinaries/
77-
"
53+
mkdir -p $meta_dir
54+
tar -xzf qcom-multimedia-image-${rootfs}.rootfs.qcomflash.tar.gz --strip-components=1 -C $meta_dir
7855
79-
cp "$build_dir/contents/contents.xml" "${platform}_bootbinaries/"
80-
cd "$boot_dir"
81-
rm -rf rawprogram{0..5}_*
82-
sed -i '/system.img/d' rawprogram0.xml
56+
cd "$meta_dir"
57+
sed -i '/rootfs.img/d' rawprogram0.xml
8358
8459
mkdir -p "$artifacts_dir"
8560
cd "$artifacts_dir"
8661
87-
aws s3 cp "s3://$s3_bucket/meta-qcom/initramfs-kerneltest-full-image-qcom-armv8a.cpio.gz" .
62+
aws s3 cp "s3://$s3_bucket/qualcomm-linux/kernel/meta-qcom/artifacts/initramfs-kerneltest-full-image-qcom-armv8a.cpio.gz" .
8863
8964
if [ -n "$firmwareid" ]; then
9065
gunzip -c initramfs-kerneltest-full-image-qcom-armv8a.cpio.gz > kerneltest.cpio
91-
aws s3 cp "s3://$s3_bucket/meta-qcom/initramfs-firmware-$firmwareid-image-qcom-armv8a.cpio.gz" .
66+
aws s3 cp "s3://$s3_bucket/qualcomm-linux/kernel/meta-qcom/artifacts/initramfs-firmware-$firmwareid-image-qcom-armv8a.cpio.gz" .
9267
gunzip -c initramfs-firmware-$firmwareid-image-qcom-armv8a.cpio.gz > firmware.cpio
93-
cat kerneltest.cpio firmware.cpio > initramfs-$target.cpio
94-
gzip initramfs-$target.cpio
68+
cat kerneltest.cpio firmware.cpio > initramfs-$machine.cpio
69+
gzip initramfs-$machine.cpio
9570
else
96-
echo "Firmware not available for Target : $target"
97-
mv initramfs-kerneltest-full-image-qcom-armv8a.cpio.gz initramfs-$target.cpio.gz
71+
echo "Firmware not available for Target : $machine"
72+
mv initramfs-kerneltest-full-image-qcom-armv8a.cpio.gz initramfs-$machine.cpio.gz
9873
fi
9974
100-
(cd "$workspace/../kobj/tar-install" && find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> "$artifacts_dir/initramfs-$target.cpio.gz")
75+
(cd "$workspace/../kobj/tar-install" && find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> "$artifacts_dir/initramfs-$machine.cpio.gz")
10176
10277
wget -O systemd-boot-efi.deb http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb
10378
dpkg-deb -xv systemd-boot-efi.deb systemd
@@ -107,10 +82,10 @@ runs:
10782
--user "$(id -u):$(id -g)" \
10883
--workdir="$PWD" \
10984
-v "$(dirname "$PWD")":"$(dirname "$PWD")" \
110-
-e target="$target" \
85+
-e machine="$machine" \
11186
"$docker_image" bash -c '
11287
generate_boot_bins.sh efi \
113-
--ramdisk artifacts/initramfs-$target.cpio.gz \
88+
--ramdisk artifacts/initramfs-$machine.cpio.gz \
11489
--systemd-boot artifacts/systemd/usr/lib/systemd/boot/efi/systemd-bootaa64.efi \
11590
--stub artifacts/systemd/usr/lib/systemd/boot/efi/linuxaa64.efi.stub \
11691
--linux ../kobj/arch/arm64/boot/Image \
@@ -124,12 +99,11 @@ runs:
12499
-v "$(dirname "$PWD")":"$(dirname "$PWD")" \
125100
"$docker_image" bash -c "
126101
generate_boot_bins.sh dtb \
127-
--input ../kobj/arch/arm64/boot/dts/qcom/$target.dtb \
102+
--input ../kobj/arch/arm64/boot/dts/qcom/$machine.dtb \
128103
--output images
129104
"
130105
131-
cp "$build_dir/images/efi.bin" "$boot_dir"
132-
cp "$build_dir/images/dtb.bin" "$boot_dir"
133-
mv "${platform}_bootbinaries/" "${target}_bootbinaries/"
134-
tar -czvf "$workspace/${target}_bootbinaries.tar.gz" "${target}_bootbinaries/"
106+
cp "$build_dir/images/efi.bin" "$meta_dir"
107+
cp "$build_dir/images/dtb.bin" "$meta_dir"
108+
tar -czvf "$workspace/qcom-multimedia-image-${rootfs}.rootfs.qcomflash.tar.gz" "qcom-multimedia-image-${rootfs}.rootfs.qcomflash/"
135109
done

.github/workflows/build.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
description: Docker image
77
type: string
88
required: true
9-
build_matrix:
10-
description: Build matrix for multi target builds
11-
type: string
12-
required: true
139
pr_number:
1410
description: PR number
1511
type: string
@@ -18,14 +14,14 @@ on:
1814
description: Branch name
1915
type: string
2016
required: false
21-
bootbins:
22-
description: Boot bins for Flat META
23-
type: string
24-
required: true
2517
repo:
2618
description: Target repository
2719
type: string
2820
required: true
21+
rootfs_matrix:
22+
description: Rootfs matrix
23+
type: string
24+
required: true
2925

3026
outputs:
3127
s3_location:
@@ -78,6 +74,7 @@ jobs:
7874
bootbins: ${{ inputs.bootbins }}
7975
workspace_path: ${{ steps.sync.outputs.workspace_path }}
8076
s3_bucket: qli-prd-kernel-gh-artifacts
77+
rootfs_matrix: ${{inputs.rootfs_matrix }}
8178

8279
- name: Create file list for artifacts upload
8380
run: |
@@ -91,21 +88,18 @@ jobs:
9188
echo "$workspace/../kobj/arch/arm64/boot/Image" >> $workspace/../artifacts/file_list.txt
9289
echo "$workspace/../kobj/vmlinux" >> $workspace/../artifacts/file_list.txt
9390
94-
# Loop through all machines from the build_matrix input
95-
machines='${{ inputs.build_matrix }}'
91+
# Loop through all machines from the rootfs_matrix input
92+
machines='${{ inputs.rootfs_matrix }}'
9693
for machine in $(echo "$machines" | jq -r '.[].machine'); do
9794
echo "$workspace/../kobj/arch/arm64/boot/dts/qcom/${machine}.dtb" >> $workspace/../artifacts/file_list.txt
9895
done
9996
100-
# Loop through all bootbins and add flat meta to the list
101-
bootbins='${{ inputs.bootbins }}'
102-
for row in $(echo "$bootbins" | jq -c '.[]'); do
103-
buildid=$(echo "$row" | jq -r '.buildid')
104-
target=$(echo "$row" | jq -r '.target')
105-
echo "target : $target"
106-
echo "BuildId : $buildid"
107-
platform=$(echo "$buildid" | cut -d '.' -f1)
108-
echo "$workspace/"$target"_bootbinaries.tar.gz" >> $workspace/../artifacts/file_list.txt
97+
# Loop through all rootfs_matrix and add flat meta to the list
98+
rootfs_matrix='${{ inputs.rootfs_matrix }}'
99+
for row in $(echo "$rootfs_matrix" | jq -c '.[]'); do
100+
machine=$(echo "$row" | jq -r '.machine')
101+
rootfs=$(echo "$row" | jq -r '.rootfs')
102+
echo $workspace/qcom-multimedia-image-${rootfs}.rootfs.qcomflash.tar.gz >> $workspace/../artifacts/file_list.txt
109103
done
110104
111105
- name: Configure AWS

.github/workflows/pre_merge.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ jobs:
4343
secrets: inherit
4444
with:
4545
docker_image: kmake-image:ver.1.0
46-
build_matrix: ${{ needs.loading.outputs.build_matrix }}
4746
pr_number: ${{ inputs.pr }}
4847
branch: ${{ inputs.ref }}
49-
bootbins: ${{ needs.loading.outputs.bootbins }}
5048
repo: ${{ inputs.repo }}
49+
rootfs_matrix: ${{ needs.loading.outputs.rootfs_matrix }}
5150

5251
check_run:
5352
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)