Files
c630/overlay/usr/local/sbin/c630-firmware
rob thijssen 280874f564 Build Fedora aarch64 images for the Lenovo Yoga C630
Assembles a ready-to-write disk image via Gitea Actions. Mainline has carried
sdm850-lenovo-yoga-c630.dts since 5.5 and Fedora ships it in kernel-core, so
unlike aarch64-laptops/build there is no kernel or GRUB to compile — what is
left is producing an image that boots on firmware which hands Linux no device
tree.

The build runs in an aarch64 container under qemu-user and builds filesystems
from directory trees with mke2fs -d and mcopy rather than mounting loop
devices, so it works on runners that will not hand out /dev/loop-control.

A kernel-install hook writes the devicetree line into each BLS entry; without
it the first `dnf update kernel` would produce an unbootable system.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWRjNJMistCy6ngXH5aJLS
2026-07-27 11:24:53 +03:00

50 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/bash
#
# Pull the model-specific Qualcomm blobs off this machine's Windows partition.
#
# Fedora ships everything for the C630 that Qualcomm allows to be redistributed
# — Adreno 630 (graphics) and ath10k WCN3990 (WiFi/Bluetooth) both work out of
# the box. What it cannot ship is the per-model signed firmware: the ADSP, the
# compute DSP, and the display/UEFI blob. Those are signed against this
# machine's own keys and live only in its Windows install.
#
# Without them you lose audio, the sensor hub (lid switch, accelerometer,
# auto-rotate) and hardware video decode. Everything else still works.
set -euo pipefail
if [ "$(id -u)" -ne 0 ]; then
echo "c630-firmware: needs root — try: sudo c630-firmware" >&2
exit 1
fi
echo "Looking for a Windows installation to extract firmware from..."
echo
if ! command -v qcom-firmware-extract >/dev/null; then
echo "qcom-firmware-extract is not installed. Install it with:" >&2
echo " sudo dnf install qcom-firmware-extract" >&2
exit 1
fi
qcom-firmware-extract "$@"
echo
echo "Regenerating the initramfs so the DSP firmware is available early..."
dracut --force --regenerate-all
cat <<'EOF'
Done. Reboot to pick up the new firmware.
If qcom-firmware-extract could not find the Windows partition, mount it by hand
and point the tool at it:
sudo mkdir -p /mnt/windows
sudo mount /dev/disk/by-partlabel/Windows /mnt/windows # adjust as needed
sudo qcom-firmware-extract --windows-dir /mnt/windows
See docs/firmware.md in the c630 repo for the full file list and the manual
fallback if the tool does not recognise this model.
EOF