From cd45abe68eec0d00e6b51d765db273a424352529 Mon Sep 17 00:00:00 2001 From: Saya Andy Date: Mon, 7 Sep 2026 12:33:58 +0700 Subject: fix: release-split dtb copies --- config.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'config.sh') diff --git a/config.sh b/config.sh index ef17771..0ab8a88 100755 --- a/config.sh +++ b/config.sh @@ -437,9 +437,9 @@ fi #-------------------------------------- # Device tree. kernel-surface compiles the patched dts in-tree and installs the -# result twice: into its own module tree (dtb/qcom, from dtbs_install) and -# version-independently into /usr/lib/surface-dtb. The latter is the master copy -# 60-surface-dtb.install re-stages into each new kernel's module tree on update, +# result twice: into its own module tree (dtb/qcom, from dtbs_install) and into +# /usr/lib/surface-dtb//. The latter is the master copy +# 60-surface-dtb.install re-stages into a kernel that shipped without one, # which is the only reason the image no longer carries a prebuilt blob of its # own -- the description installs kernel-surface by name and s Fedora's # kernel packages, so the package is always there. @@ -453,9 +453,12 @@ fi # module-tree copy, anything keyed off /usr/lib/modules/$kver/dtb (including the # anaconda post-script) finds nothing and silently does nothing. dtb_name=x1p42100-microsoft-sp12in.dtb -dtb_src="/usr/lib/surface-dtb/$dtb_name" -if [[ ! -f "$dtb_src" ]]; then - printf 'Error: %s is missing, so kernel-surface (built from ../kernel-surface) is not installed.\n' "$dtb_src" >&2 +# One directory per kernel version under /usr/lib/surface-dtb: kernel-surface is +# installonly, so nothing it owns can be version-unqualified. Only one release is +# ever installed at this point in the build, but glob anyway rather than assume. +dtb_src=$(ls -1 /usr/lib/surface-dtb/*/"$dtb_name" 2>/dev/null | sort -V | tail -n1) +if [[ -z "$dtb_src" ]]; then + printf 'Error: no %s under /usr/lib/surface-dtb/, so kernel-surface (built from ../kernel-surface) is not installed.\n' "$dtb_name" >&2 exit 1 fi install -Dm644 "$dtb_src" "/usr/lib/modules/$kver/dtb/qcom/$dtb_name" -- cgit v1.3.1+17