leifliddy / asahi-fedora-builder

Builds a minimal Fedora image to run on Apple M-series systems
MIT License
242 stars 12 forks source link

Grub does not respond to USB keyboard #3

Closed ericcurtin closed 2 years ago

ericcurtin commented 2 years ago

While compiling and testing a different kernel, my kernel went into an unbootable state. I thought this was ok but grub does not recognise or allow my keyboard to change the kernel selected, it ignores my keyboard.

Very unofficial (but very true) news, fedora is likely moving away from grub to something like sd-boot. Wonder is it worth switching to sd-boot here?

ericcurtin commented 2 years ago

We don't need the legacy features grub provides, just an EFI loader I think, sd-boot is much cleaner.

leifliddy commented 2 years ago

u-boot should be providing the usb keyboard driver during the boot process -- you're on a mac mini right? https://github.com/AsahiLinux/u-boot

Can you interrupt u-boot via a usb keyboard?

Judging by the latest commit, there's some sort of issue with keyboard detection on the mac mini https://github.com/AsahiLinux/u-boot/commit/68fe142b4e10afaf5076a75f0d6125a78a21b789

Just ensure you're using the latest u-boot version. It was recently updated here for asahi linux: https://github.com/AsahiLinux/PKGBUILDs/blob/main/uboot-asahi/PKGBUILD

And I updated the Fedora uboot-asahi rpm to reflect that change.

> Wonder is it worth switching to sd-boot here? The Linux M1 boot process is pretty convoluted. It's not using a standard EFI boot implementation so I doubt that using systemd-boot is going to work at the moment. I mean you would have to modify u-boot to be compatible with that. We'll probably get there eventually though.

ericcurtin commented 2 years ago

Thanks for all that info, I just reflashed the whole thing, still can't detect keyboard even on u-boot... Maybe https://github.com/AsahiLinux/u-boot is the right place to report this. I'm on Mac Mini alright.

leifliddy commented 2 years ago

Did it work before? If so I can add the previous uboot-asahi rpm to the repo.

ericcurtin commented 2 years ago

I'm unsure to be honest if it worked before

leifliddy commented 2 years ago

I added the previous rpm back https://www.leifliddy.com/asahi-linux/36/aarch64/uboot-asahi-20220319-1.fc36.aarch64.rpm

Can you try downgrading to that package and see if that works?

ericcurtin commented 2 years ago

I did a rpm -Uvh --oldpackage of this package and it didn't seem to work (rebooted twice just in case), thanks so much for sharing though, I appreciate it.

leifliddy commented 2 years ago

If you downgraded the package with rpm then /etc/dnf/plugins/post-transaction-actions.d/m1n1-install.action will never be triggered. In that case, just manually run update-m1n1 to update /boot/efi/m1n1/boot.bin

ericcurtin commented 2 years ago

Ran update-m1n1 and made no difference :'(

ericcurtin commented 2 years ago

It's a pity, it makes it hard test new kernels, because if they don't boot first time, you're kind bricked and have to reimage :sweat_smile:

leifliddy commented 2 years ago

That sucks. I don't have a mac mini to test on, but I'll let you know if I find something.

ericcurtin commented 2 years ago

Thanks for your help!

leifliddy commented 2 years ago

No worries. Hey, if you have a usb type-c hub -- something like this https://www.amazon.de/-/en/gp/product/B07GJPB1CV Try using that to plug your keyboard into and see if that works. That works for me on the macbook M1 air. I suspect the issue you're having might be specifically related to the usb type-a ports.

leifliddy commented 2 years ago

So the boot process isn't as convoluted as I thought. https://github.com/AsahiLinux/docs/wiki/Open-OS-Ecosystem-on-Apple-Silicon-Macs

I think I could probably get systemd-boot working. I just need to familiarize myself with it. The one thing I suspect will be an issue is that the /boot partition is a btrfs subvolume. I only did that because the installer only creates a single physical partition for linux -- and I wanted to segregate things a bit. I'll play around with that when I have time.

boris-kolpackov commented 2 years ago

Hey, if you have a usb type-c hub [...] Try using that to plug your keyboard into and see if that works.

I can confirm plugging the keyboard into the USB-C port (via an adapter) on Mac Mini M1 works in U-Boot (i.e., I can type) at least with the uefi-only-20220717-1.zip release.

Lewiscowles1986 commented 2 years ago

Can confirm I have this issue with asahi on M1 mini. Doesn't matter if I plug keyboard in direct, via USB-A or USB-C / Thunderbolt, or using an adapter. I've tried old u-boots, new ones. I think it could be grub itself needing configuring maybe, more than anything else.

leifliddy commented 2 years ago

If the keyboard doesn't work in the u-boot shell, then it's not an issue with grub.

leifliddy commented 2 years ago

The type-c port should be working, I would try a different adapter. https://github.com/leifliddy/asahi-fedora-builder/issues/7#issuecomment-1309059938

No need to try older versions of uboot, just use the latest asahi one https://github.com/AsahiLinux/u-boot/archive/asahi-v2022.07-4.tar.gz