1. Please describe the problem: During boot, the keyboard does not work. The keyboard works during the live image and anaconda. If you choose to encrypt the disk, upon rebooting you are unable to enter your luks passphrase. https://ask.fedoraproject.org/t/cannot-enter-luks-password-on-macbook-pro-2017-the-built-in-keyboard-does-not-work/20343/4 2. What is the Version-Release number of the kernel: 6.0.16-300.fc37.x86_64 3. Did it work previously in Fedora? If so, what kernel version did the issue *first* appear? Old kernels are available for download at https://koji.fedoraproject.org/koji/packageinfo?packageID=8 : I had the issue in F36 and waited for the F37 release to test further. Based on the Ask Fedora, this has been an issue since F35 or earlier. 4. Can you reproduce this issue? If so, please provide the steps to reproduce the issue below: Install F37 Workstation and configure full disk encryption. Unable to use keyboard input when luks passphrase is required using the laptop hardware. 5. Does this problem occur with the latest Rawhide kernel? To install the Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by ``sudo dnf update --enablerepo=rawhide kernel``: Yes, kernel-6.2.0-0.rc6.44.fc38.x86_64 has the same issue. 6. Are you running any modules that not shipped with directly Fedora's kernel?: No. 7. Please attach the kernel logs. You can get the complete kernel log for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the issue occurred on a previous boot, use the journalctl ``-b`` flag. N/A To debug, I attached an USB connected keyboard to input the luks passphrase. I've been able to get the keyboard working by enabling the spi_pxa2xx_platform driver. It's currently being built as a module, but is not available during boot. 1) If you can attach an external keyboard and boot, update the initramfs using dracut: ``` # echo 'add_drivers+=" spi_pxa2xx_platform "' > /etc/dracut.conf.d/spi_pxa2xx_platform.conf # dracut -f /boot/initramfs-`uname -r`.img `uname -r` ``` Reboot and the keyboard works. 2) Build a custom kernel with the following patch: ``` diff --git a/kernel-x86_64-fedora.config b/kernel-x86_64-fedora.config index 94bfe19ba..9aced94dd 100644 --- a/kernel-x86_64-fedora.config +++ b/kernel-x86_64-fedora.config @@ -6828,7 +6828,7 @@ CONFIG_SPI_MUX=m # CONFIG_SPI_MXIC is not set # CONFIG_SPI_NXP_FLEXSPI is not set # CONFIG_SPI_OC_TINY is not set -CONFIG_SPI_PXA2XX=m +CONFIG_SPI_PXA2XX=y # CONFIG_SPI_ROCKCHIP is not set # CONFIG_SPI_SC18IS602 is not set # CONFIG_SPI_SIFIVE is not set ``` Install and boot the kernel, then the keyboard works for luks passphrase input.
Created attachment 1941475 [details] hardware specifics `lshw` running the rawhide kernel
Thank you for your detailed bugreport. I see that you have already found the dracut.conf workaround yourself. I believe that the right fix for this is to make dracut treat the spi_pxa2xx_platform module the same as the i8042 driver for ps2 keyboards and make dracut include it in the initrd when either hostonly=n, or when it is loaded on the machine. I'll attach a quick test patch for this, to apply run: cd / sudo patch -p0 < dracut-test-patch Drop your custom /etc/dracut.conf.d./spi_pxa2xx_platform.conf file and then regenerate an initrd, and see if that initrd still works. If you can confirm that this change works, then I'll submit it to upstream dracut and coordinate with the Fedora dracut maintainer about getting this change into Fedora.
Created attachment 1941480 [details] dracut patch which should fix this
Hans, Thanks for the quick reply. I'm currently re-installing the hardware with the release live image, but unfortunately I don't have access to the patch you are suggesting.
(In reply to Jonathan Steffan from comment #4) > Thanks for the quick reply. I'm currently re-installing the hardware with > the release live image, but unfortunately I don't have access to the patch > you are suggesting. The patch is attached to this bug, see the attachment list near the top of the bugzilla page.
Hans, I get the following message when accessing https://bugzilla.redhat.com/attachment.cgi?id=1941480 ``` Sorry, you are not authorized to access attachment #1941480 [details]. ```
My bad, bugzilla has new defaults where it marks attachments as private by default and I remove the private mark from the comment assuming that would make the attachment non private, but it has its own private flag... You should be able to access it now.
Hans, It works as expected. Thanks.
(In reply to Jonathan Steffan from comment #8) > Hans, > > It works as expected. Thanks. Sorry if it was not clear. The patch to /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh does fix the keyboard input issues.
Thank you for testing. When I can make some time for this I'll submit a pull-request to dracut upstream and see if I can get this included as a downstream Fedora patch for now.
Changing component to dracut. Fedora dracut maintainers see the attached patch (which directly patches an installed dracut) for a fix for this. The logic behind the patch is that just like the i8042 module which is needed for ps/2 keyboards found on many PCs on some MacBooks the spi_pxa2xx_platform module is necessary because it is the driver for the bus (SPI in this case) to the keyboard. The patched section honors the hostonly flag, so the module will only be included when necessary. I think it would be good to add this as a downstream patch to Fedora for now. I plan to submit a pull-req for this upstream, but I'm quite swamped with work. So if you have time I would not mind if you submit it upstream instead :)
Dracut maintainers, I tried applying this as a patch and have not yet understood how %autosetup works. %autosetup -S git_am seems to not like my patch. ``` diff --git a/dracut.spec b/dracut.spec index 0f89845..f0c31c0 100644 --- a/dracut.spec +++ b/dracut.spec @@ -7,7 +7,7 @@ %global __requires_exclude pkg-config # rpmdev-bumpspec and releng automation compatible variable -%global baserelease 6 +%global baserelease 7 Name: dracut Version: 057 @@ -45,6 +45,10 @@ Patch2: 1991-feat-dmsquash-live-add-new-dmsquash-live-autooverlay.patch # https://github.com/dracutdevs/dracut/pull/2037 Patch3: 2037-Add-sysctl-to-initramfs-to-handle-modprobe-files.patch +# Add spi-pxa2xx-platform for luks unlock input support for apple hardware +# https://bugzilla.redhat.com/show_bug.cgi?id=2166209 +Patch4: rhbz-attachment-1941480-add-spi-pxa2xx-platform.patch + BuildRequires: bash BuildRequires: git-core BuildRequires: pkgconfig(libkmod) >= 23 @@ -444,6 +448,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Fri Feb 17 2023 Jonathan Steffan <jsteffan> - 057-7 +- Add spi-pxa2xx-platform for luks unlock input support for apple hardware + * Thu Jan 19 2023 Fedora Release Engineering <releng> - 057-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild ```
Created attachment 1944926 [details] gendiff dracut-057 against rawhide source
Checking patch test/container/Dockerfile-Fedora-latest... Checking patch test/container/Dockerfile-OpenSuse-latest... Applied patch man/dracut.cmdline.7.asc cleanly. Applied patch modules.d/90dmsquash-live-autooverlay/create-overlay-genrules.sh cleanly. Applied patch modules.d/90dmsquash-live-autooverlay/create-overlay.sh cleanly. Applied patch modules.d/90dmsquash-live-autooverlay/module-setup.sh cleanly. Applied patch pkgbuild/dracut.spec cleanly. Applied patch test/TEST-16-DMSQUASH/create-root.sh cleanly. Applied patch test/TEST-16-DMSQUASH/test-init.sh cleanly. Applied patch test/TEST-16-DMSQUASH/test.sh cleanly. Applied patch test/container/Dockerfile-Arch cleanly. Applied patch test/container/Dockerfile-Debian cleanly. Applied patch test/container/Dockerfile-Fedora-latest cleanly. Applied patch test/container/Dockerfile-OpenSuse-latest cleanly. + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/2037-Add-sysctl-to-initramfs-to-handle-modprobe-files.patch + /usr/bin/git am --reject -q Checking patch modules.d/90kernel-modules/module-setup.sh... Hunk #1 succeeded at 156 (offset 9 lines). Applied patch modules.d/90kernel-modules/module-setup.sh cleanly. + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/rhbz-attachment-1941480-add-spi-pxa2xx-platform.patch + /usr/bin/git am --reject -q Checking patch modules.d/90kernel-modules/module-setup.sh... Applied patch modules.d/90kernel-modules/module-setup.sh cleanly. fatal: empty ident name (for <>) not allowed error: Bad exit status from /var/tmp/rpm-tmp.fdnlur (%prep) Bad exit status from /var/tmp/rpm-tmp.fdnlur (%prep) RPM build errors: DEBUG: Child return code was: 1
Hello, I've created an upstream PR: https://github.com/dracutdevs/dracut/pull/2218 as well as prepared upgrade with the change for Rawhide: https://src.fedoraproject.org/rpms/dracut/pull-request/29 (Note: MODIFIED usually means the change is commited in dist-git) With the merge for Rawhide I'll build for F38 as well as for F37 (& will inform in devel ML).
Pavel, I can confirm the rawhide build fixes the issue with this hardware. Testing process was: 1) usb boot rawhide live on the affected hardware https://koji.fedoraproject.org/koji/taskinfo?taskID=97742383 2) install w/enabling luks full disk encryption 3) first boot, no keyboard working; add usb external keyboard and finish boot 4) add copr pvalena/dracut and update dracut, dracut -f [...], reboot 5) keyboard is working as expected. lsinitrd confirms spi-pxa2xx-platform is included
Thanks for checking! There were further questions in the upstream PR: https://github.com/dracutdevs/dracut/pull/2218
Pavel, dracut-059-3 has landed in the Rawhide live composes. I can report that Fedora-Workstation-Live-Rawhide-20230225.n.0 (https://koji.fedoraproject.org/koji/buildinfo?buildID=2159709) installs and the keyboard works for LUKS passphrase input. Fedora-Workstation-Live-38-20230225.n.0 (https://koji.fedoraproject.org/koji/buildinfo?buildID=2159762) still has the issue, but dracut was not yet listed in the Fedora 38 compose report. I'll keep an eye on the F38 compose for when dracut-059-3+ lands and report back. I'm also glad to see upstream merged the change.
Pavel, I'm glad to report that Fedora-Workstation-Live-38-20230326.n.1 (https://koji.fedoraproject.org/koji/buildinfo?buildID=2175839) installs and the keyboard works for LUKS passphrase input.
Thanks for the verification!
It still doesn't work for me (I have to use an external usb keyboard). Macbook Pro 16"(2019), 6.7.6-201.fsync.fc39.x86_67