Comment 25 for bug 2060868

Revision history for this message
Jens Glathe (glathe) wrote (last edit ):

Hi @xypron,

my /etc/initramfs-tools/modules is this:

-------------------------------------------
pwm_bl
phy_qcom_qmp_pcie
pcie_qcom
phy_qcom
qmp_pcie
phy_qcom_qmp_combo
qrtr
drm-dp-aux-bus
phy_qcom_edp
gpio_sbu_mux
i2c_hid_of
i2c_qcom_geni
pmic_glink_altmode
leds_qcom_lpg
qcom_q6v5_pas
panel-edp
gpucc_sc8280xp
dispcc_sc8280xp
msm
nvme
usb_storage
uas
------------------------------

I had severe issues booting from type-c due to late-loading of qcadsp8280.mbn, therefore I experimented a little until found. I am not familiar with the installer at all, so I'm afraid I'm no help there. But the loading of the firmwares goes hand in hand with my /etc/initramfs-tools/hooks/x13s-firmware script:

-----------------------------
#!/bin/sh

set -e

PREREQ=""

prereqs()
{
 echo "$PREREQ"
}

case \\$1 in
# get pre-requisites
prereqs)
 prereqs
 exit 0
 ;;
esac

. /usr/share/initramfs-tools/hook-functions

mv /lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn.disabled /lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn

# Define a list of firmware files to be included
FIRMWARE_FILES="\
/lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn \
/lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qccdsp8280.mbn \
/lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcdxkmsuc8280.mbn \
/lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcvss8280.mbn \
/lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcslpi8280.mbn \
/lib/firmware/qcom/a660_sqe.fw.zst \
/lib/firmware/qcom/a660_gmu.bin.zst"

# Copy each firmware file to initramfs
for file in $FIRMWARE_FILES; do
    dir=$(dirname "$file")
    mkdir -p "${DESTDIR}/${dir}"
    cp "${file}" "${DESTDIR}/${dir}/"
done

mv /lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn /lib/firmware/updates/qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn.disabled

-----------------------------------

This ensures the crucial files (and some not so crucial) are in the initramfs and accessible before rootfs can be mounted. My boot tests found that you actually run into trouble occasionally when you:

- have a slow boot device, like the stick plugged in swapped condition (then it's USB-2 only)
- have qcadsp8280.mbn in the rootfs as well.

"Late" attempts to load this blob (after mounting rootfs from type-c) will lead to the [VBUS issue](https://gitlab.com/postmarketOS/pmaports/-/blob/master/device/testing/firmware-lenovo-yoga-5g/APKBUILD?ref_type=heads#L44-46) which I experienced for a few ... weeks ... and pulled my hair out. Disabling the blob in the rootfs mitigates the issue to tolerable levels.

For reference: https://github.com/jglathe/linux_ms_dev_kit/discussions/14 There is also an X13s image that boots reliably from type-c: https://drive.google.com/file/d/1e8LA6o-EKKet3_sCQqXR4lOVE_TgOVNI/view?usp=sharing But, danger. It is deliberately rooted, root pw is FsecuritY! and can be reached via ssh. It is for debug purposes.