helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
805 stars 58 forks source link

Empty SD card slot prevents system from booting #390

Closed yaygya closed 11 months ago

yaygya commented 2 years ago

Describe the bug Bootup on ISOs based on FreeBSD 13 and later is prevented by a page fault in the kernel during the boot process, caused by having an empty SD card slot. Some ISOs will immediately restart as a result of the fault, while others get stuck.

To Reproduce Steps to reproduce the behavior:

  1. Boot from live USB on an affected system (such as MacBookAir4,2)

Expected behavior Boot up to continue without issue, just as it does on helloSystem 0.6.0, where the issue does not exist.

Screenshots IMG_3570 IMG_3569

Version:

Computers:

Additional context This issue has arisen since the FreeBSD 13.0 builds. Some builds (such as the 0.7.0 release) will crash and reboot, while others (such as the experimental 14.0 build linked above) will hang at the page fault. This issue will be updated if I find another computer that experiences this issue.

probonopd commented 2 years ago

Thanks for reporting @yaygya.

Strange that two of your machines fail with the same error whereas I ahve not seen this on my machines.

Are these two machines sharing any hardware, e.g., the same USB storage device?

What would be interesting would be to see how a system that is installed to hard disk behaves on those machines. Do you have a chance to install helloSystem to hard disk using another computer (where helloSystem does not crash), and then boot the resulting hard disk on one of the affected machines?

From 0.6.0 to 0.7.0 we did not just change from FreeBSD 12.x to 13.x but also reworked how the Live boot process works; possibly that is causing the issue on your machines (although it works on mine). Do you see any messages related to mount_unionfs before the crash? (Press Scroll Lock on your keyboard, then press the arrow-up key to scroll upwards. Not sure whether this still works after the crash though.)

Thank you very much.

yaygya commented 2 years ago

Okay, I figured out the issue. It turns out on some machines, having an empty SD card slot will prevent the system from booting. (I say some because I tested on another device without a card in and it booted without issue.) Here is the error directly before the kernel panic: IMG_3576

I inserted a card into the slot on my Acer desktop and it worked. I will update later to confirm if this works on the MacBook as well.

UPDATE: I have confirmed that inserting an SD card in the slot makes boot up continue normally.

probonopd commented 2 years ago

Interesting. This may or may not be related to the issue that if you remove the SD card from a USB reader after unmounting it, the system can sometimes crash; however if you remove the USB reader together with the SD card after unmounting it, the system does not crash.

Reference:

Now, does the same issue happen when you are not using helloSystem but an official FreeBSD ISO from, e.g., bootonly.iso.xz from http://ftp.freebsd.org/pub/FreeBSD/snapshots/ISO-IMAGES/14.0/? Does the same issue happen with GhostBSD?

https://github.com/helloSystem/ISO/issues/368 @vermaden have you encoutered this behavior? Could you imagine that it might be caused by automount? I am really unsure about that.

yaygya commented 2 years ago

I tried both the FreeBSD 14 ISO and the GhostBSD ISO, and while it does show up in the boot logs, boot up continues normally, without the panic.

probonopd commented 2 years ago

Do you see anything the systems on which it is not working have in common versus the systems on which it is working, e.g., the same type of SD card reader, or SD card reader via USB vs. SD card reader on other buses?

vermaden commented 2 years ago

368 @vermaden have you encoutered this behavior? Could you imagine that it might be caused by automount? I am really unsure about that.

I did not had that issue.

probonopd commented 2 years ago

Pure speculation, maybe it's the Ventoy kernel module which doesn't like empty card readers. @yaygya to test this, can you interrupt the bootloader by pressing backspace, then enter at the "OK" prompt:

unset geom_ventoy_load
unset boot_mute 
boot -v

and see what happens? Thanks!

probonopd commented 11 months ago

Seems to be unrelated to Ventoy. Most likely related:

probonopd commented 11 months ago

Following https://github.com/helloSystem/ISO/pull/521/commits/07e39aa06ecce3ce29d058e7f21d488488fcf25f by @u20230812, please retest on hello-0.9.0_0I39-FreeBSD-13.2-amd64.iso and newer.

probonopd commented 11 months ago

Added https://github.com/helloSystem/ISO/commit/b9a2d0d2ba62fb38d27df32291977c06900c0ea7.

Please retest in build 0I41 or later.

If it is still crashing, please let me know

yaygya commented 11 months ago

I will make sure to test this as soon as I can.

yaygya commented 11 months ago

I can confirm that the fix works on the MacBookAir4,2. However, on my other machine, the system does not boot for some unknown reason. I can't diagnose what it is because in the midst of testing, my USB flash drive died, and I will have to find the time to get a new one.