| author | 2026-09-07 04:50:59 +0700 | |
|---|---|---|
| committer | 2026-09-07 04:50:59 +0700 | |
| commit | 49428abac50976f943806aa2b116597328148ddc (patch) | |
| tree | e0d8a2d5fb1aa758738551345fd3c8c6d0d67fb3 /root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr | |
| parent | 1075e725492e482d826bfcf222e6f2f6644f5d4b (diff) | |
| download | kiwi-descriptions-49428abac50976f943806aa2b116597328148ddc.tar.gz kiwi-descriptions-49428abac50976f943806aa2b116597328148ddc.zip | |
DRAFT: feat: use kernel tailored for surface pro 12-inch
Diffstat (limited to 'root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr')
2 files changed, 23 insertions, 5 deletions
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 c12ff47..2dadac5 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 @@ -5,11 +5,28 @@ umask 022 COMMAND="$1" KVER="$2" -SRC="/etc/surface-dtb/x1p42100-microsoft-surface-pro-12-inch.dtb" -DEST="/usr/lib/modules/${KVER}/dtb/qcom/x1p42100-microsoft-surface-pro-12-inch.dtb" +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 +# 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="" 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. + if [ -z "${SRC}" ]; then + if [ -f "${DEST}" ]; then + exit 0 + fi + echo "60-surface-dtb: no ${DTB_NAME} in /usr/lib/surface-dtb" >&2 + exit 1 + fi mkdir -p "$(dirname ${DEST})" cp -f "${SRC}" "${DEST}" chmod 644 "${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 375b085..f0314b0 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 @@ -29,15 +29,16 @@ KVER="${2:-}" [ "$COMMAND" = "add" ] || exit 0 [ -n "$KVER" ] || exit 0 -DTB_NAME=x1p42100-microsoft-surface-pro-12-inch.dtb +DTB_NAME=x1p42100-microsoft-sp12in.dtb DTB_REL="qcom/$DTB_NAME" BOOT_ROOT="${KERNEL_INSTALL_BOOT_ROOT:-/boot}" # 60-surface-dtb.install stages the dtb into this kernel's module tree; fall -# back to the master copy if it has not run (or was removed). +# back to kernel-surface's version-independent master copy if it has not run +# (or was removed). DTB_SRC="/usr/lib/modules/${KVER}/dtb/${DTB_REL}" if [ ! -f "$DTB_SRC" ]; then - DTB_SRC="/etc/surface-dtb/$DTB_NAME" + DTB_SRC="/usr/lib/surface-dtb/$DTB_NAME" fi [ -f "$DTB_SRC" ] || exit 0 |