Diffstat (limited to 'root/tmp')
21 files changed, 377 insertions, 0 deletions
diff --git a/root/tmp/DylanVanAssche/libssc b/root/tmp/DylanVanAssche/libssc new file mode 160000 +Subproject f6dfbfa5f34ef22f3d47ef346c22834e79c60df diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/anaconda/conf.d/90-surface-pro-12-inch.conf b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/anaconda/conf.d/90-surface-pro-12-inch.conf new file mode 100644 index 0000000..0b46109 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/anaconda/conf.d/90-surface-pro-12-inch.conf @@ -0,0 +1,19 @@ +# Surface Pro 12" (Snapdragon X1P-42-100): do not hide the GRUB menu. +# +# /etc/anaconda/profile.d/fedora-workstation.conf sets menu_auto_hide = True, +# and os-release here has VARIANT_ID=workstation, so anaconda selects that +# profile. Its grub2.py then writes both variables into grubenv: +# +# grub2-editenv - set menu_auto_hide=1 boot_success=1 +# +# deliberately, "so that the menu is hidden on the boot after install". On this +# firmware a hidden menu means GRUB counts down GRUB_TIMEOUT with nothing on +# screen and then crashes during the hand-off, so the very first boot of a fresh +# install always fails; it only succeeds from the second attempt, once the menu +# is drawn. Keeping the menu visible avoids that path entirely. +# +# conf.d is read after profile.d and is documented as the override location, and +# this file only needs to exist in the live installer environment -- it has no +# effect on, and is not needed by, the installed system. +[Bootloader] +menu_auto_hide = False diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dconf/db/local.d/00-power-button b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dconf/db/local.d/00-power-button new file mode 100644 index 0000000..1b69eab --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dconf/db/local.d/00-power-button @@ -0,0 +1,2 @@ +[org/gnome/settings-daemon/plugins/power] +power-button-action='interactive' diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dconf/profile/user b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dconf/profile/user new file mode 100644 index 0000000..aca0641 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dconf/profile/user @@ -0,0 +1,2 @@ +user-db:user +system-db:local diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dracut.conf.d/surface-pro-12-inch.conf b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dracut.conf.d/surface-pro-12-inch.conf new file mode 100644 index 0000000..9c7a9bd --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/dracut.conf.d/surface-pro-12-inch.conf @@ -0,0 +1,24 @@ +# Surface Pro 12" (Snapdragon X1P-42-100) +# +# Keep the ADSP/CDSP remoteproc driver out of the initramfs. +# +# qcom_q6v5_pas has auto_boot set, so it powers up the DSPs the moment it +# probes. In a hostonly initramfs it gets pulled in and probes at ~1.7s, long +# before root is mounted, and the firmware it needs lives on the root +# filesystem: +# +# remoteproc remoteproc0: adsp is available +# Direct firmware load for .../qcadsp8380.mbn failed with error -2 +# remoteproc remoteproc0: request_firmware failed: -2 +# +# remoteproc does not retry after that, so both DSPs stay offline for the whole +# boot -- which means no glink edge, no fastrpc devices, and therefore no +# sensors. Nothing in the initramfs needs the DSPs to mount root, so deferring +# the driver until after switch-root lets auto_boot find its firmware and +# succeed. The alternative, install_items with the blobs, adds ~45MB to every +# initramfs for no benefit. +# +# dracut reads this from the target's /etc/dracut.conf.d during anaconda's +# initramfs regeneration, so it survives installation (unlike /etc/default/grub, +# which anaconda rewrites from a fixed key set). +omit_drivers+=" qcom_q6v5_pas " diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/cmdline b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/cmdline new file mode 100644 index 0000000..5b92d02 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/cmdline @@ -0,0 +1 @@ +rootflags=subvol=root mem_sleep_default=s2idle clk_ignore_unused pd_ignore_unused systemd.tpm2_wait=0 rhgb quiet diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/devicetree b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/devicetree new file mode 100644 index 0000000..2acf815 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/devicetree @@ -0,0 +1 @@ +qcom/x1p42100-microsoft-sp12in.dtb diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/install.conf b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/install.conf new file mode 100644 index 0000000..03aec7d --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/install.conf @@ -0,0 +1 @@ +BOOT_ROOT=/boot diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/logind.conf.d/60-surface-power-key.conf b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/logind.conf.d/60-surface-power-key.conf new file mode 100644 index 0000000..c6fc547 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/logind.conf.d/60-surface-power-key.conf @@ -0,0 +1,2 @@ +HandlePowerKey=suspend +HandlePowerKeyLongPress=poweroff diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service new file mode 100644 index 0000000..2e3cf82 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service @@ -0,0 +1,9 @@ +[Unit] +Description=HexagonRPC Service + +[Service] +ExecStart=/usr/local/bin/hexagonrpcd -f /dev/fastrpc-adsp-secure -s +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf new file mode 100644 index 0000000..7b3cfcb --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf @@ -0,0 +1,14 @@ +# Surface Pro 12" (Snapdragon X1P-42-100) +# +# The sensors on this device are not IIO devices. They live behind the SLPI +# DSP, reached over fastrpc by hexagonrpcd, and iio-sensor-proxy only sees them +# through the SSC backend it is built with here (-Dssc-support=enabled). So it +# has to start after that daemon, and stop being useful if the daemon dies. +# +# A drop-in rather than a replacement unit: upstream's own unit is D-Bus +# activated (Type=dbus, BusName=net.hadess.SensorProxy), which is how anything +# asking for net.hadess.SensorProxy gets the service started, and overriding it +# wholesale traded that away for nothing but this ordering. +[Unit] +Requires=hexagonrpc.service +After=hexagonrpc.service diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/surface-video-firmware.service b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/surface-video-firmware.service new file mode 100644 index 0000000..5c83962 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/surface-video-firmware.service @@ -0,0 +1,12 @@ +[Unit] +Description=Install Surface Pro 12in video codec firmware from a Windows partition +ConditionPathExists=!/lib/firmware/qcom/x1p42100/Microsoft/Surface12/qcvss8380_pa.mbn +After=local-fs.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/local/bin/surface-video-firmware.sh + +[Install] +WantedBy=multi-user.target diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/udev/rules.d/61-sensors-surface-pro-12-inch.rules b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/udev/rules.d/61-sensors-surface-pro-12-inch.rules new file mode 100644 index 0000000..e6ddb1f --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/udev/rules.d/61-sensors-surface-pro-12-inch.rules @@ -0,0 +1 @@ +ACTION=="add|change", SUBSYSTEM=="misc", KERNEL=="fastrpc-adsp-secure", ENV{ACCEL_MOUNT_MATRIX}="-1, 0, 0; 0, -1, 0; 0, 0, 1" diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/yum.repos.d/kernel-sp12in.repo b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/yum.repos.d/kernel-sp12in.repo new file mode 100644 index 0000000..24fe9f3 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/yum.repos.d/kernel-sp12in.repo @@ -0,0 +1,7 @@ +[kernel-sp12in] +name=kernel-sp12in for Fedora $releasever - $basearch +baseurl=https://rpm.sayag.it/kernel-sp12in/fedora/$releasever/$basearch/ +enabled=1 +priority=1 +gpgcheck=0 +metadata_expire=6h 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..7622406 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install @@ -0,0 +1,44 @@ +#!/bin/bash +set -eu +umask 022 + +COMMAND="$1" +KVER="$2" + +DTB_NAME=x1p42100-microsoft-sp12in.dtb +DEST="/usr/lib/modules/${KVER}/dtb/qcom/${DTB_NAME}" + +# 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 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) + # 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 + echo "60-surface-dtb: no ${DTB_NAME} under /usr/lib/surface-dtb" >&2 + exit 1 + fi + 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..65b8745 --- /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,55 @@ +#!/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-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 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 + # 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 +[ -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}" + +# 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/surface-video-firmware.sh b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/local/bin/surface-video-firmware.sh new file mode 100755 index 0000000..35dfdf1 --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/local/bin/surface-video-firmware.sh @@ -0,0 +1,183 @@ +#!/bin/bash +# Surface Pro 12" (Snapdragon X1P-42-100): install the video codec firmware. +# +# The iris video codec needs firmware TrustZone will accept. linux-firmware's +# qcom/vpu/vpu30_p1_s7.mbn is the same codec signed with Qualcomm's SecTools +# *test* key chain, which a retail Surface rejects: +# +# qcom-iris aa00000.video-codec: error -22 initializing firmware qcom/vpu/vpu30_p1_s7.mbn +# +# The production-signed build ships only inside Microsoft's Surface driver +# package, which grants no redistribution right, so the image cannot carry it. +# What it can do is copy it out of a Windows install the owner already has a +# licence for, or out of a driver pack they downloaded themselves. This script +# does the copying; it never fetches anything the caller did not ask for. +# +# Usage: surface-video-firmware.sh [-m MSI] [-u URL] [-n] +# +# (no options) look for a Windows partition on this machine and copy the +# firmware out of its DriverStore. No network access. +# -m MSI extract from a Surface driver pack already on disk +# -u URL download a driver pack and extract from that +# -n say what would happen, change nothing +# +# The driver pack is a ~500 MB MSI from +# +# https://www.microsoft.com/en-us/download/details.aspx?id=108199 +# +# There is no stable direct link to hardcode: the Download Center hands out +# per-session URLs and the file name carries the driver release, so -u takes +# the URL the browser was given rather than guessing one that would rot. + +set -euo pipefail + +FW_DIR=/lib/firmware/qcom/x1p42100/Microsoft/Surface12 +BLOB=qcvss8380_pa.mbn +DRIVERSTORE=Windows/System32/DriverStore/FileRepository +PAGE=https://www.microsoft.com/en-us/download/details.aspx?id=108199 + +msi="" +url="" +dry_run=false + +while getopts ':m:u:nh' opt; do + case "${opt}" in + m) msi=${OPTARG} ;; + u) url=${OPTARG} ;; + n) dry_run=true ;; + h) sed -n '2,31p' "${BASH_SOURCE[0]}"; exit 0 ;; + *) echo "unknown option -${OPTARG}" >&2; exit 2 ;; + esac +done + +log() { printf 'surface-video-firmware: %s\n' "$*"; } +die() { printf 'surface-video-firmware: %s\n' "$*" >&2; exit 1; } + +if [[ -f "${FW_DIR}/${BLOB}" ]]; then + log "${FW_DIR}/${BLOB} is already installed" + exit 0 +fi + +[[ ${EUID} -eq 0 ]] || die "must run as root" + +cleanup_dirs=() +cleanup_mounts=() +cleanup() { + local m d + for m in ${cleanup_mounts[@]+"${cleanup_mounts[@]}"}; do + mountpoint -q "${m}" && umount "${m}" || true + done + for d in ${cleanup_dirs[@]+"${cleanup_dirs[@]}"}; do + rm -rf "${d}" || true + done +} +trap cleanup EXIT + +install_blob() { + local src=$1 + if [[ ${dry_run} == true ]]; then + log "would install ${src} as ${FW_DIR}/${BLOB}" + return 0 + fi + + install -Dm644 "${src}" "${FW_DIR}/${BLOB}" + log "installed ${FW_DIR}/${BLOB}" + + # The driver only asks for its firmware while probing, so it has to be + # reloaded to pick this up. It refuses while a decode session holds it, + # which is why a failure here is only worth a note. + if lsmod | grep -q '^qcom_iris'; then + if modprobe -r qcom_iris 2>/dev/null && modprobe qcom_iris 2>/dev/null; then + log "reloaded qcom_iris" + else + log "could not reload qcom_iris; reboot to start using the firmware" + fi + fi +} + +# Everything below hands find(1) the bare file name rather than a full path: +# the DriverStore directory carries a per-build hash, and the layout inside an +# extracted MSI is not documented anywhere worth trusting. +find_blob() { + find "$1" -type f -name "${BLOB}" -print -quit 2>/dev/null +} + +from_windows() { + local dev fstype part_mnt mnt found + + while read -r dev fstype part_mnt; do + [[ ${fstype} == ntfs* ]] || continue + + if [[ -n ${part_mnt} ]]; then + mnt=${part_mnt} + else + mnt=$(mktemp -d) + cleanup_dirs+=("${mnt}") + if ! mount -t ntfs3 -o ro,noatime "/dev/${dev}" "${mnt}" 2>/dev/null && + ! mount -o ro,noatime "/dev/${dev}" "${mnt}" 2>/dev/null; then + log "/dev/${dev}: could not mount read-only, skipping" + log "/dev/${dev}: if Windows is hibernated, shut it down fully and retry" + continue + fi + cleanup_mounts+=("${mnt}") + fi + + [[ -d "${mnt}/${DRIVERSTORE}" ]] || continue + + found=$(find_blob "${mnt}/${DRIVERSTORE}") + if [[ -n ${found} ]]; then + log "found ${BLOB} on /dev/${dev}" + install_blob "${found}" + return 0 + fi + log "/dev/${dev}: a Windows install, but no ${BLOB} in its DriverStore" + done < <(lsblk -rno NAME,FSTYPE,MOUNTPOINT) + + return 1 +} + +from_msi() { + local pack=$1 work found + + command -v msiextract >/dev/null || die "msiextract is missing; install msitools" + + work=$(mktemp -d) + cleanup_dirs+=("${work}") + + log "extracting ${pack}" + ( cd "${work}" && msiextract "${pack}" >/dev/null ) + + found=$(find_blob "${work}") + [[ -n ${found} ]] || die "no ${BLOB} inside ${pack}; is it the Surface Pro 12in driver pack?" + + log "found ${BLOB} in the driver pack" + install_blob "${found}" +} + +if [[ -n ${url} ]]; then + dl=$(mktemp -d) + cleanup_dirs+=("${dl}") + msi="${dl}/driverpack.msi" + log "downloading ${url}" + curl -fL --retry 3 --progress-bar -o "${msi}" "${url}" +fi + +if [[ -n ${msi} ]]; then + [[ -f ${msi} ]] || die "${msi} does not exist" + from_msi "${msi}" + exit 0 +fi + +if from_windows; then + exit 0 +fi + +# Nothing found, and nothing was asked for. Not an error: most of the time this +# is a machine with no Windows left on it, and the only thing left to do is say +# how to finish the job by hand. +log "no Windows install on this machine carries ${BLOB}" +log "hardware video decode stays off until it is installed. To finish by hand:" +log " 1. download the Surface Pro 12in driver pack (~500 MB) from" +log " ${PAGE}" +log " 2. sudo surface-video-firmware.sh -m /path/to/SurfacePro_12in_*.msi" +exit 0 diff --git a/root/tmp/harrisonvanderbyl/hexagonrpc b/root/tmp/harrisonvanderbyl/hexagonrpc new file mode 160000 +Subproject 78b67e2f00df0455f0c0282183b1b1b8b219447 diff --git a/root/tmp/harrisonvanderbyl/iio-sensor-proxy b/root/tmp/harrisonvanderbyl/iio-sensor-proxy new file mode 160000 +Subproject fcd5b5cf431bc053375350c57064b8b13dd961b diff --git a/root/tmp/harrisonvanderbyl/surface-pro-12-inch-linux b/root/tmp/harrisonvanderbyl/surface-pro-12-inch-linux new file mode 160000 +Subproject cab35118d7b5cf6ed88c7027e075a2564c921ea diff --git a/root/tmp/linux-msm/audioreach-topology b/root/tmp/linux-msm/audioreach-topology new file mode 160000 +Subproject d7a5e9d80ad18a7a6844eeb32cacbdeea0e7e67 |