Skip to content

Commit 6067689

Browse files
Merge branch 'qualcomm-linux:main' into feature/add_packages_openssh_server
2 parents b66dbf7 + 874cb4c commit 6067689

7 files changed

Lines changed: 63 additions & 43 deletions

File tree

.github/workflows/lava-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
9393
- name: Submit ${{ matrix.target }}
9494
timeout-minutes: 240
95-
uses: foundriesio/lava-action@v11
95+
uses: foundriesio/lava-action@v12
9696
with:
9797
lava_token: ${{ secrets.LAVATOKEN }}
9898
lava_url: 'lava.infra.foundries.io'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# for binary packages built from these source packages, score the version from
22
# Debian backports higher as to get hardware enabled or better hardware support
33

4-
Package: src:alsa-ucm-conf:any src:firmware-free:any src:firmware-nonfree:any src:linux:any src:linux-signed-arm64:any src:mesa:any src:u-boot-efi-dtb
4+
Package: src:alsa-ucm-conf:any src:fastrpc src:firmware-free:any src:firmware-nonfree:any src:hexagon-dsp-binaries src:linux:any src:linux-signed-arm64:any src:mesa:any src:u-boot-efi-dtb
55
Pin: release n=trixie-backports
66
Pin-Priority: 900

debos-recipes/qualcomm-linux-debian-flash.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ actions:
372372
rm -rf "${flash_dir}"
373373
mkdir -v "${flash_dir}"
374374
# copy platform partition files
375-
cp --preserve=all --no-dereference -v \
375+
cp --preserve=mode,timestamps -v \
376376
"build/ptool/${platform}"/* "${flash_dir}"
377377

378378
# remove BLANK_GPT, WIPE_PARTITIONS and wipe_rawprogram files as
@@ -402,18 +402,18 @@ actions:
402402
-or -name '*.fv' \
403403
-or -name '*.mbn' \
404404
\) \
405-
-exec cp --preserve=all --no-dereference -v '{}' "${flash_dir}" \;
405+
-exec cp --preserve=mode,timestamps -v '{}' "${flash_dir}" \;
406406

407407
if [ -n "${board_u_boot_file}" ]; then
408408
# copy U-Boot binary to boot.img; qcom-ptool partitions.conf
409409
# files use filename=boot.img for boot_a and boot_b partitions
410-
cp --preserve=all --no-dereference -v \
410+
cp --preserve=mode,timestamps -v \
411411
"${ARTIFACTDIR}/${board_u_boot_file}" "${flash_dir}/boot.img"
412412
fi
413413

414414
if [ -n "$board_cdt_filename" ]; then
415415
# copy just the CDT data; no partition or flashing files
416-
cp --preserve=all --no-dereference -v \
416+
cp --preserve=mode,timestamps -v \
417417
"build/${board_name}_cdt/${board_cdt_filename}" \
418418
"${flash_dir}"
419419
fi
@@ -446,13 +446,14 @@ actions:
446446
[ -f "${contents_xml}" ] || continue
447447
spinor_dir_name="$(basename "${spinor_dir}")"
448448
board="${spinor_dir_name#flash_}"; board="${board%_spinor}"
449-
xmlstarlet sel -t -m "//product_info/chipid" -v "@storage_type" -n "${contents_xml}" | \
450-
tr '[:upper:]' '[:lower:]' | sort -u | \
449+
# extract storage types to variable to avoid silent pipeline failure
450+
storage_types=$(xmlstarlet sel -t -m "//product_info/chipid" -v "@storage_type" -n "${contents_xml}")
451+
echo "$storage_types" | tr '[:upper:]' '[:lower:]' | sort -u | \
451452
while read -r storage; do
452453
[ "${storage}" = "spinor" ] && continue
453454
target_dir="${ARTIFACTDIR}/flash_${board}_${storage}"
454455
[ -d "${target_dir}" ] || continue
455-
cp --preserve=all --no-dereference -av "${spinor_dir}/." "${target_dir}/spinor/"
456+
cp --preserve=mode,timestamps -av "${spinor_dir}/." "${target_dir}/spinor/"
456457
efi_img=$("${RECIPEDIR}/../scripts/get-rawprogram-filename.py" efi "${target_dir}/rawprogram0.xml")
457458
rootfs_img=$("${RECIPEDIR}/../scripts/get-rawprogram-filename.py" rootfs "${target_dir}/rawprogram0.xml")
458459
# fix file_path (../->../../) then rename efi.bin/rootfs.img

debos-recipes/qualcomm-linux-debian-image.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ actions:
108108
# when building under debos, /sys/firmware/efi is not always present, so
109109
# the u-boot-efi-dtb postinst doesn't install an initial copy of the
110110
# DTBs; do this once here
111-
latest_kernel="$(
112-
linux-version list | linux-version sort --reverse | head -1)"
111+
# extract kernel list to variable to avoid silent pipeline failure
112+
kernel_list=$(linux-version list)
113+
latest_kernel=$(echo "$kernel_list" | linux-version sort --reverse | head -1)
113114
dtb_path="/usr/lib/linux-image-${latest_kernel}"
114115
cp -LRT "$dtb_path" "/boot/efi/dtb"
115116
@@ -147,8 +148,9 @@ actions:
147148
set -eux
148149
sector_size="{{if eq $imagetype "ufs"}}4096{{else}}512{{end}}"
149150
image="{{ $image }}"
150-
fdisk -b "${sector_size}" -l "${image}" |
151-
sed -n '1,/^Device/ d; p' |
151+
# extract fdisk output to variable to avoid silent pipeline failure
152+
fdisk_output=$(fdisk -b "${sector_size}" -l "${image}")
153+
echo "$fdisk_output" | sed -n '1,/^Device/ d; p' |
152154
while read name start end sectors rest; do
153155
dd if="${image}" of="${ARTIFACTDIR}/${name}" \
154156
bs="${sector_size}" skip="${start}" count="${sectors}"

debos-recipes/qualcomm-linux-debian-rootfs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,9 @@ actions:
388388
# this image has pulled a more recent kernel, it's probably to gain
389389
# support for new hardware which would happen through new or updated dtbs
390390
# only in that new kernel, so use the latest dtbs
391-
latest_kernel="$(
392-
ls -d "$ROOTDIR"/usr/lib/linux-image-* | sort -V | tail -1)"
391+
# list kernel directories to avoid silent pipeline failure
392+
kernel_dirs=$(ls -d "$ROOTDIR"/usr/lib/linux-image-*)
393+
latest_kernel=$(echo "$kernel_dirs" | sort -V | tail -1)
393394
# transform pathnames to strip the leading ./
394395
tar \
395396
-C "${latest_kernel}" \

scripts/build-linux-deb.py

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,25 @@
88
from pathlib import Path
99

1010
# git repo/ref to use
11-
GIT_REPO = "https://github.com/torvalds/linux"
12-
GIT_REF = "master"
13-
LINUX_NEXT_GIT_REPO = (
14-
"https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git"
15-
)
16-
LINUX_NEXT_GIT_REF = "master"
17-
QCOM_NEXT_GIT_REPO = "https://github.com/qualcomm-linux/kernel"
18-
QCOM_NEXT_GIT_REF = "qcom-next"
11+
12+
GIT_UPSTREAM = {
13+
"linux": {
14+
"repo": "https://github.com/torvalds/linux",
15+
"ref": "master",
16+
"ref_prefix": None,
17+
},
18+
"linux-next": {
19+
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git", # noqa: E501
20+
"ref": "master",
21+
"ref_prefix": "next-",
22+
},
23+
"qcom-next": {
24+
"repo": "https://github.com/qualcomm-linux/kernel",
25+
"ref": "qcom-next",
26+
"ref_prefix": "qcom-next-",
27+
},
28+
}
29+
1930
# base config to use
2031
BASE_CONFIG = "defconfig"
2132
# package set to build
@@ -144,16 +155,19 @@ def check_dependencies():
144155

145156

146157
def main():
158+
DEFAULT_REPO = GIT_UPSTREAM["linux"]["repo"]
159+
DEFAULT_REF = GIT_UPSTREAM["linux"]["ref"]
160+
147161
parser = argparse.ArgumentParser(description="Build Linux Deb")
148162
parser.add_argument(
149163
"--repo",
150-
default=GIT_REPO,
151-
help=f"Git repository to clone (default: {GIT_REPO})",
164+
default=DEFAULT_REPO,
165+
help=f"Git repository to clone (default: {DEFAULT_REPO})",
152166
)
153167
parser.add_argument(
154168
"--ref",
155-
default=GIT_REF,
156-
help=f"Git ref (branch/tag) to checkout (default: {GIT_REF})",
169+
default=DEFAULT_REF,
170+
help=f"Git ref (branch/tag) to checkout (default: {DEFAULT_REF})",
157171
)
158172
parser.add_argument(
159173
"--linux-next",
@@ -187,19 +201,19 @@ def main():
187201
args.fragments = args.fragments + unknown
188202

189203
# default settings for next trees
190-
ref_prefix = None
204+
git_upstream_key = None
191205
if args.linux_next:
192-
if args.repo == GIT_REPO:
193-
args.repo = LINUX_NEXT_GIT_REPO
194-
if args.ref == GIT_REF:
195-
args.ref = LINUX_NEXT_GIT_REF
196-
ref_prefix = "next-"
206+
git_upstream_key = "linux-next"
197207
elif args.qcom_next:
198-
if args.repo == GIT_REPO:
199-
args.repo = QCOM_NEXT_GIT_REPO
200-
if args.ref == GIT_REF:
201-
args.ref = QCOM_NEXT_GIT_REF
202-
ref_prefix = "qcom-next-"
208+
git_upstream_key = "qcom-next"
209+
210+
ref_prefix = GIT_UPSTREAM["linux"]["ref_prefix"]
211+
if git_upstream_key is not None:
212+
if args.repo == DEFAULT_REPO:
213+
args.repo = GIT_UPSTREAM[git_upstream_key]["repo"]
214+
if args.ref == DEFAULT_REF:
215+
args.ref = GIT_UPSTREAM[git_upstream_key]["ref"]
216+
ref_prefix = GIT_UPSTREAM[git_upstream_key]["ref_prefix"]
203217

204218
if ref_prefix:
205219
found_tag = get_latest_dated_tag(args.repo, ref_prefix)

scripts/get-rawprogram-filename.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
33
# SPDX-License-Identifier: BSD-3-Clause
44
#
5-
# Print the filename attribute of a <program> element by label from a
6-
# rawprogram XML file generated by qcom-ptool.
5+
# Parse a rawprogram XML file generated by qcom-ptool. Search for first
6+
# <program> element with provided label. Print its filename attribute,
7+
# stripped of a leading "../" if present.
8+
#
9+
# Returns "none" if no such element found.
710
#
811
# Usage: get-rawprogram-filename.py <label> <rawprogram0.xml>
912
#
@@ -23,9 +26,8 @@
2326
root = ET.parse(xml_file).getroot()
2427
e = root.find(f".//program[@label='{label}']")
2528
if e is None:
26-
print(f"error: no <program label='{label}'> found in {xml_file}",
27-
file=sys.stderr)
28-
sys.exit(1)
29+
print("none")
30+
sys.exit(0)
2931

3032
filename = e.get("filename")
3133
# Strip any leading ../ path components

0 commit comments

Comments
 (0)