aboutsummaryrefslogtreecommitdiffci
diff options
from:
to:
context:
space:
mode:
-rw-r--r--Jenkinsfile2
-rwxr-xr-xconfig.sh15
-rw-r--r--root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install31
-rw-r--r--root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install5
-rwxr-xr-xsurface-editbootconfig.sh12
5 files changed, 38 insertions, 27 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 62357ff..9662632 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -150,7 +150,7 @@ spec:
mv "${src}" "${dst}"
ls -lh
- s5cmd --endpoint-url "${B2_ENDPOINT}" cp \\
+ /s5cmd --endpoint-url "${B2_ENDPOINT}" cp \\
"${dst}" \\
"s3://${ISO_BUCKET}/fedora/${IMAGE_VERSION}/aarch64/${dst}"
'''
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/<kver>/. 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 <ignore>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"
diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install
index 2dadac5..7622406 100644
--- a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install
+++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install
@@ -8,23 +8,30 @@ KVER="$2"
DTB_NAME=x1p42100-microsoft-sp12in.dtb
DEST="/usr/lib/modules/${KVER}/dtb/qcom/${DTB_NAME}"
-# The master copy comes from kernel-surface: it builds the dtb in-tree from the
+# The master copies come from kernel-surface: it builds the dtb in-tree from the
# patched dts and installs it under /usr/lib/surface-dtb, deliberately outside
-# any /usr/lib/modules/<kver>, so it can be re-staged into any kernel installed
-# alongside it.
-SRC="/usr/lib/surface-dtb/${DTB_NAME}"
-[ -f "${SRC}" ] || SRC=""
+# any /usr/lib/modules/<kver>, so it can be re-staged into a kernel that ships
+# no device tree of its own -- a stock Fedora one.
+#
+# One directory per kernel version, because kernel-surface is installonly and
+# rpm will not let two installed releases own one unqualified path once the file
+# differs. They are all the same board, so the highest version is as good a
+# choice as any, and is the one most likely to carry recent fixes.
+SRC=$(ls -1 /usr/lib/surface-dtb/*/"${DTB_NAME}" 2>/dev/null | sort -V | tail -n1)
case "${COMMAND}" in
add)
- # No master and no dtb already in this kernel's tree means there is
- # nothing this board can boot with, so say so rather than failing
- # silently three steps later in the boot loader.
+ # kernel-surface ships its own dtb through dtbs_install, and that
+ # one is the release-matched copy. Leave it alone; the master is
+ # only for kernels that arrived without one.
+ if [ -f "${DEST}" ]; then
+ exit 0
+ fi
+ # Neither means there is nothing this board can boot with, so say
+ # so rather than failing silently three steps later in the boot
+ # loader.
if [ -z "${SRC}" ]; then
- if [ -f "${DEST}" ]; then
- exit 0
- fi
- echo "60-surface-dtb: no ${DTB_NAME} in /usr/lib/surface-dtb" >&2
+ echo "60-surface-dtb: no ${DTB_NAME} under /usr/lib/surface-dtb" >&2
exit 1
fi
mkdir -p "$(dirname ${DEST})"
diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install
index f0314b0..65b8745 100644
--- a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install
+++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install
@@ -38,9 +38,10 @@ BOOT_ROOT="${KERNEL_INSTALL_BOOT_ROOT:-/boot}"
# (or was removed).
DTB_SRC="/usr/lib/modules/${KVER}/dtb/${DTB_REL}"
if [ ! -f "$DTB_SRC" ]; then
- DTB_SRC="/usr/lib/surface-dtb/$DTB_NAME"
+ # One directory per kernel version under here; see 60-surface-dtb.install.
+ DTB_SRC=$(ls -1 /usr/lib/surface-dtb/*/"$DTB_NAME" 2>/dev/null | sort -V | tail -n1)
fi
-[ -f "$DTB_SRC" ] || exit 0
+[ -n "$DTB_SRC" ] && [ -f "$DTB_SRC" ] || exit 0
# The boot loader reads the dtb from the boot filesystem, not the module tree
install -Dm644 "$DTB_SRC" "${BOOT_ROOT}/dtb-${KVER}/${DTB_REL}"
diff --git a/surface-editbootconfig.sh b/surface-editbootconfig.sh
index a426645..e6cc67c 100755
--- a/surface-editbootconfig.sh
+++ b/surface-editbootconfig.sh
@@ -27,12 +27,12 @@ esac
dtb_name=x1p42100-microsoft-sp12in.dtb
-# The working directory is the image root, so this is kernel-surface's own
-# version-independent copy. config.sh has already failed the build if the
-# package did not provide it.
-dtb_src="usr/lib/surface-dtb/${dtb_name}"
-if [[ ! -f "${dtb_src}" ]]; then
- echo "surface-editbootconfig: ${dtb_src} not found in the image root" >&2
+# The working directory is the image root, so this is kernel-surface's own copy,
+# under a directory named for the kernel version because that package is
+# installonly. config.sh has already failed the build if it is not there.
+dtb_src=$(ls -1 usr/lib/surface-dtb/*/"${dtb_name}" 2>/dev/null | sort -V | tail -n1)
+if [[ -z "${dtb_src}" ]]; then
+ echo "surface-editbootconfig: no ${dtb_name} under usr/lib/surface-dtb/ in the image root" >&2
exit 1
fi