Update module names for T2 MacBook profiles - #275
simiscoool-afk wants to merge 2 commits into
Conversation
Revival8697
left a comment
There was a problem hiding this comment.
Wrong module names. See https://github.com/deqrocks/t2bce#changes-compared-to-apple-bce.
|
Thanks, i am quite new to this but trying to learn. i have gotten some help from a user on the discord called several people, this should work i think, if there are any problems or anything i am happy to fix and learn. |
|
Resolves CachyOS/linux-cachyos#1004. CC: @vnepogodin. |
| mkinitcpio -P | ||
|
|
||
| echo apple-bce > /etc/modules-load.d/t2.conf | ||
| echo t2bce_core >> /etc/modules-load.d/t2.conf |
There was a problem hiding this comment.
I would like to create proper module alias configuration instead of force loading any modules.
There was a problem hiding this comment.
alias pci:v0000106Bd00001801sv*sd*bc*sc*i* t2bce_core
alias pci:v0000106Bd00001801sv*sd*bc*sc*i* t2bce_dma
alias pci:v0000106Bd00001801sv*sd*bc*sc*i* t2bce_vhci
alias pci:v0000106Bd00001801sv*sd*bc*sc*i* t2bce_audio
alias pci:v0000106Bd00001802sv*sd*bc*sc*i* t2bce_core
alias pci:v0000106Bd00001802sv*sd*bc*sc*i* t2bce_dma
alias pci:v0000106Bd00001802sv*sd*bc*sc*i* t2bce_vhci
alias pci:v0000106Bd00001802sv*sd*bc*sc*i* t2bce_audioThere was a problem hiding this comment.
I would like to create proper module alias configuration instead of force loading any modules.
Those already exist for the new t2bce modules. I think the issue to solve now is how to fix the old file for existing installs once 6.18 also gets t2bce.
There was a problem hiding this comment.
I think the issue to solve now is how to fix the old file for existing installs once 6.18 also gets t2bce.
Happy to leave this with you - I'm just a user who hit the break after 7.2 kernel upgrade...
But for what it's worth after following this, my AI suggested this for me:
a one-shot pacman hook in the chwd package that rewrites 11-chwd.conf on upgrade if it still references apple-bce. That way existing installs get fixed without users needing to do anything
If it's useful to have someone to test against, I'm on an iMac Pro
| cat <<EOF >/etc/mkinitcpio.conf.d/11-chwd.conf | ||
| # This file is automatically generated by chwd. PLEASE DO NOT EDIT IT. | ||
| MODULES+=(apple-bce) | ||
| MODULES+=(t2bce_core t2bce_dma t2bce_vhci t2bce_audio) |
There was a problem hiding this comment.
This won't fix the issue. The installer also installs the LTS kernel, which does not ship the t2bce modules. As a result, this fix would still cause mkinitcpio to fail for the LTS kernel, potentially aborting the installation.
I think MODULES needs to be an empty array as long as LTS and mainline kernels ship different bce modules. After installation, we need to do cachy-chroot, remove one incompatible kernel, and manually do mkinitcpio before reboot.
The best way of fixing this issue is having an option to choose the kernel variants.
There was a problem hiding this comment.
if the installer is the LTS kernel it should install then?
the installer is requesting Apple-BCE but cant find is which is suggesting that its not the LTS kernel or its newer than 7.1.x
There was a problem hiding this comment.
Eh, just add t2bce to LTS then, no need to complicate this.
CC: @1Naim.
There was a problem hiding this comment.
I see that the installer installs both linux-cachyos (which migrated to t2bce in 7.2) and linux-cachyos-lts (which still uses apple-bce in 6.18) by default.
Therefore, changing to MODULES+=(t2bce_core t2bce_dma t2bce_vhci t2bce_audio) would probably cause mkinitcpio to fail for the linux-cachyos-lts kernel, potentially aborting the installation—similar to what is currently happening with linux-cachyos.
|
OK I admit a lot of help from Claude/Opus on this one, but here we go... Data point from a T2 machine that isn't a MacBook — iMacPro1,1, chwd 1.24.1-1, with both @yiminyuan's concern about LTS is correct — here it is actually happening. I applied exactly the The error moves from mainline to LTS rather than going away, because There is a middle option between "empty array" and "add t2bce to LTS", though: # /etc/mkinitcpio.conf.d/11-chwd.conf
_t2dir="/usr/lib/modules/${KERNELVERSION}/kernel/drivers/staging"
if [ -n "${KERNELVERSION}" ] && [ -d "${_t2dir}/t2bce" ]; then
MODULES+=(t2bce_vhci)
elif [ -n "${KERNELVERSION}" ] && [ -d "${_t2dir}/apple-bce" ]; then
MODULES+=(apple-bce)
fi
unset _t2dirThat keeps working through the transition without requiring anyone to remove a kernel or chroot after install. On @ventureoo's alias suggestion — the aliases are already compiled into the modules, and the proposed IDs don't match them. From the 7.2.3 tree: against the actual devices: So The whole stack comes up with no configuration at all. On this machine — and until today there were no That suggests the Caveat: this is an iMac Pro, where the keyboard is external and the T2 modules aren't needed to reach a LUKS prompt, so I can't confirm the initramfs side from here. Someone on a T2 MacBook that depends on the internal keyboard at unlock should check Separately, the current |
|
I have a T2 macbook with LUKS and need to manually set the module otherwise i can't use the internal keyboard or unlock my drive. I'm running this workaround: |
|
@InsideTheVoid thanks, that closes the gap in my comment. A LUKS T2 MacBook that can't type without the modules in the image means the Also good to have One thing I'd change in the workaround: _t2dir="/usr/lib/modules/${KERNELVERSION}/kernel/drivers/staging"
if [ -n "${KERNELVERSION}" ] && [ -d "${_t2dir}/t2bce" ]; then
MODULES+=(t2bce_core t2bce_dma t2bce_vhci t2bce_audio)
elif [ -n "${KERNELVERSION}" ] && [ -d "${_t2dir}/apple-bce" ]; then
MODULES+=(apple-bce)
fi
unset _t2dirChecked against mkinitcpio itself: @simiscoool-afk if you want to fold this into the PR, one gotcha: the profile post_install = """
- cat <<EOF >/etc/mkinitcpio.conf.d/11-chwd.conf
+ cat <<'EOF' >/etc/mkinitcpio.conf.d/11-chwd.conf
# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT.
-MODULES+=(apple-bce)
+# linux-cachyos >= 7.2 ships t2bce_*, linux-cachyos-lts still ships apple-bce.
+# Pick whichever exists for the kernel being built so `mkinitcpio -P` succeeds
+# for every installed preset.
+_t2dir="/usr/lib/modules/${KERNELVERSION}/kernel/drivers/staging"
+if [ -n "${KERNELVERSION}" ] && [ -d "${_t2dir}/t2bce" ]; then
+ MODULES+=(t2bce_core t2bce_dma t2bce_vhci t2bce_audio)
+elif [ -n "${KERNELVERSION}" ] && [ -d "${_t2dir}/apple-bce" ]; then
+ MODULES+=(apple-bce)
+fi
+unset _t2dir
EOF
mkinitcpio -P
- echo apple-bce > /etc/modules-load.d/t2.conf
+ # Both drivers autoload from their PCI aliases (106b:1801 / 106b:1803);
+ # remove the stale entry that fails systemd-modules-load on every boot.
+ rm -f /etc/modules-load.d/t2.conf
kernelparams="intel_iommu=on iommu=pt pcie_ports=compat"
|
No description provided.