aboutsummaryrefslogtreecommitdiff
path: root/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <saya.andy@posteo.com> 2026-08-03 21:15:01 +0700
committerGravatar Saya Andy <saya.andy@posteo.com> 2026-08-03 21:15:14 +0700
commita776fe5f94c6b673498addecf2e8835de286d424 (patch)
tree6175b4ac7161bb8f8a7a34a4998a5ad575f01efc /root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr
parent6ecf2b2f21e4063df705ac7e8b385a2a50c1f89f (diff)
downloadkiwi-descriptions-a776fe5f94c6b673498addecf2e8835de286d424.tar.gz
kiwi-descriptions-a776fe5f94c6b673498addecf2e8835de286d424.zip
feat: kiwi descriptions adaptation for surface pro 12"
Diffstat (limited to 'root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr')
-rw-r--r--root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install20
-rw-r--r--root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install53
-rw-r--r--root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/local/bin/wireupcameras.sh18
3 files changed, 91 insertions, 0 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
new file mode 100644
index 0000000..c12ff47
--- /dev/null
+++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -eu
+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"
+
+case "${COMMAND}" in
+ add)
+ mkdir -p "$(dirname ${DEST})"
+ cp -f "${SRC}" "${DEST}"
+ chmod 644 "${DEST}"
+ ;;
+ remove)
+ rm -f "${DEST}"
+ ;;
+esac
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
new file mode 100644
index 0000000..375b085
--- /dev/null
+++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Surface Pro 12" (Snapdragon X1P-42-100): put a devicetree line into the BLS
+# loader entry.
+#
+# None of Fedora's built-in mechanisms can do this on their own:
+#
+# * /etc/kernel/devicetree is only read by 90-loaderentry.install, which exits
+# early unless KERNEL_INSTALL_LAYOUT=bls. Fedora has no /boot/<entry-token>
+# directory, so kernel-install always computes layout=other here and that
+# plugin never runs.
+#
+# * GRUB_DEVICETREE in /etc/default/grub does work on a running system (see
+# 20-grub.install's mkbls), but anaconda rewrites /etc/default/grub from a
+# fixed list of keys it knows during installation, and GRUB_DEVICETREE is not
+# on that list, so it is silently discarded on a fresh install.
+#
+# A kernel-install plugin survives both: anaconda runs kernel-install inside the
+# target during installation, and anything sorting after 20-grub.install sees
+# the entry it has just (re)generated. Because 20-grub.install rewrites the
+# entry from scratch on every kernel install, this must re-apply each time --
+# hence a plugin rather than a one-shot fixup.
+
+set -eu
+umask 022
+
+COMMAND="${1:-}"
+KVER="${2:-}"
+
+[ "$COMMAND" = "add" ] || exit 0
+[ -n "$KVER" ] || exit 0
+
+DTB_NAME=x1p42100-microsoft-surface-pro-12-inch.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).
+DTB_SRC="/usr/lib/modules/${KVER}/dtb/${DTB_REL}"
+if [ ! -f "$DTB_SRC" ]; then
+ DTB_SRC="/etc/surface-dtb/$DTB_NAME"
+fi
+[ -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}"
+
+# BLS entry paths are relative to the boot filesystem root, matching the
+# "linux /vmlinuz-$KVER" line 20-grub.install writes.
+for entry in "${BOOT_ROOT}"/loader/entries/*-"${KVER}".conf; do
+ [ -f "$entry" ] || continue
+ grep -q '^devicetree[[:space:]]' "$entry" && continue
+ sed -i "/initrd/i devicetree /dtb-${KVER}/${DTB_REL}" "$entry"
+done
diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/local/bin/wireupcameras.sh b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/local/bin/wireupcameras.sh
new file mode 100644
index 0000000..2e8f2d3
--- /dev/null
+++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/local/bin/wireupcameras.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -e
+
+SENSOR="ov13858 1-0010"
+
+# Tell each pad in the path what format to expect
+media-ctl -V "\"$SENSOR\":0[fmt:SGRBG10_1X10/4224x3136]"
+media-ctl -V '"msm_csiphy0":0[fmt:SGRBG10_1X10/4224x3136]'
+media-ctl -V '"msm_csiphy0":1[fmt:SGRBG10_1X10/4224x3136]'
+media-ctl -V '"msm_csid0":0[fmt:SGRBG10_1X10/4224x3136]'
+media-ctl -V '"msm_csid0":1[fmt:SGRBG10_1X10/4224x3136]'
+media-ctl -V '"msm_vfe0_rdi0":0[fmt:SGRBG10_1X10/4224x3136]'
+
+# Disable the OV02C10 path so it doesn't fight for csid0
+media-ctl -l '"msm_csiphy4":1->"msm_csid0":0[0]'
+
+# Enable the rear path
+media-ctl -l '"msm_csiphy0":1->"msm_csid0":0[1]'