Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grub-efi hangs when enter button not hit in grub menu on secure boot #79

Open
Dvergatal opened this issue Oct 12, 2024 · 13 comments
Open

Comments

@Dvergatal
Copy link
Contributor

As in the subject when secure boot is turned on and grub menu is showed, there is some time left for choosing the entry to boot and if enter button was not hit the highlighted entry is run automatically but actually it hangs and nothing helps to reboot.

This happens to be scarthgap related, not on kirkstone.

@Dvergatal
Copy link
Contributor Author

Dvergatal commented Oct 12, 2024

This is odd. I have left my machine for a couple of hours in that state that I have moved an arrow to disable the timer in grub menu and when came back it was hanged as well... Definitely, there must be some kind of a deadlock or something.

P.S. I have just checked it and verified that actually it happens after ~8-10 seconds.

@yizhao1
Copy link
Collaborator

yizhao1 commented Oct 14, 2024

Hello, can provide more information? Which board did you use ? Which DISTRO_FEATURES were enabled besides efi-secure-boot ? How did you deploy the image ? using wic or rootfs.tar.gz ?

@Dvergatal
Copy link
Contributor Author

Hello, can provide more information?

Hi @yizhao1 I can.

Which board did you use ?

The board is ours for x86-64 intel architecture with Insyde uefi.

Which DISTRO_FEATURES were enabled besides efi-secure-boot ?

Only the efi-secure-boot from this meta layer is set. Others are like largefile polkit acl xattr pam systemd tpm2 virtualization ipv6 usrmerge.

How did you deploy the image ? using wic or rootfs.tar.gz ?

Actually I'm using both (installer is made from wic and contains inside rootfs.tar.gz which is being extracted to target machine) and it happens on both.

When I disable secure boot in uefi than everything is fine and this does not happen.

@yizhao1
Copy link
Collaborator

yizhao1 commented Oct 14, 2024

I can not reproduce it with wic image on my intel NUC7. The default grub menu only has one entry. Did you have more than one entry in your grub menu ?

@Dvergatal
Copy link
Contributor Author

I can not reproduce it with wic image on my intel NUC7. The default grub menu only has one entry. Did you have more than one entry in your grub menu ?

Both one and more entries and still it happens.

@Dvergatal
Copy link
Contributor Author

Currently I'm reverting only the packages of shim and seloader to see if maybe they are causing the issue.

Additionally I have some suspicions that our UEFI implementation can cause it...

@Dvergatal
Copy link
Contributor Author

Currently I'm reverting only the packages of shim and seloader to see if maybe they are causing the issue.

Downgrading shim on scarthgap is a nightmare... And downgraded seloader is not working with new shim.

Additionally I have some suspicions that our UEFI implementation can cause it...

Regarding this I can test the image on qemu and see if the error also persist.

@Dvergatal
Copy link
Contributor Author

OK we have tested the image on QEMU and it is working as suppoused to so the issue is related rather to our UEFI implementation, so I'm closing the issue as solved.

@Dvergatal
Copy link
Contributor Author

OK after more digging it occurs that the issue is not related to the UEFI but to the USB connection. We have tested the image on one more different platform which has UEFI from AMI and the issue occurs as well and what we discovered that when plugging some usb device like keyboard or mouse that grub hangs.

@yizhao1 can you please verify it on your intel's NUC 7 does it occur as well?

@Dvergatal Dvergatal reopened this Oct 22, 2024
@yizhao1
Copy link
Collaborator

yizhao1 commented Oct 24, 2024

@Dvergatal I tested wic image with usb keyboard and usb mouse on my intel NUC7. It works well. I have no other platforms for testing. Can you test the original secure-core-image scarthgap image on your platform ?

@Dvergatal
Copy link
Contributor Author

Yes i can test it. I think I will get for myself this intel NUC7 to test as well...

@Dvergatal
Copy link
Contributor Author

OK a new nuc7 has came and I've tested the same image and to my surprise it has behaved like on our devices in our lab, meaning it did not hang in the grub but hanged when I have disconnected keyboard from USB and plugged it again... So on device which I have at home, it hangs always and on the other devices, even on intel NUC7 it hangs only when usb device is plugged to it when on grub stage not before power on.

@yizhao1 have you made your test in such steps?

@Dvergatal
Copy link
Contributor Author

Dvergatal commented Oct 29, 2024

OK more digging and it occured that the instant freeze is caused by USB LTE modem connected through m.2 slot. When I unplugged this modem my machine stopped to freeze after ~5-8 seconds.

Now it works but still when I will unplug USB keyboard and plug it again than grub hangs...

@Dvergatal I tested wic image with usb keyboard and usb mouse on my intel NUC7. It works well. I have no other platforms for testing. Can you test the original secure-core-image scarthgap image on your platform ?

BTW. do you have some latest SecureCore repository/implementation because building secure-core-image scarthgap image with our distro brings too many changes and SecureCore layer is too old moreover it uses poky which has only MACHINE defined for qemu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants