home-assistant / operating-system

:beginner: Home Assistant Operating System
Apache License 2.0
4.83k stars 965 forks source link

HAOS 12.4 install created on Windows 10+ fails to boot on RPi 5 #3437

Closed BatuhanBasaran closed 2 months ago

BatuhanBasaran commented 3 months ago

Describe the issue you are experiencing

The SD card was flashed with the RaspberryPi Imager 1.8.5 and for test purposes with BalenaEtcher. I used the following image with BalenaEtcher: https://github.com/home-assistant/operating-system/releases/download/12.4/haos_rpi5-64-12.4.img.xz

Unfortunately the Pi5 is stuck in the boot menu. No matter if with the RaspberryPi Imager or with BalenaEtcher.

IMG_0072

Finally I downloaded haos_rpi5-64-11.5.img and flashed it. This works perfectly on the Pi5.

What operating system image do you use?

rpi5-64 (Raspberry Pi 5 64-bit OS)

What version of Home Assistant Operating System is installed?

12.4

Did the problem occur after upgrading the Operating System?

Yes

Hardware details

Raspberry Pi 5 with 8GB Ram

Steps to reproduce the issue

1.Flash HAOS 12.4 on SD-Card 2.Boot the Pi5 with the SD-Card 3. ...

Anything in the Supervisor logs that might be useful for us?

-

Anything in the Host logs that might be useful for us?

-

System information

No response

Additional information

No response

ababij commented 3 months ago

I'm having the same issue with a Pi 5/8GB. I attempted to run the update in HA but when it restarted it got stuck in the boot menu. I then attempted a new install using RaspberryPi Imager 1.8.5 and had the same result. Tried a couple SD cards but still the same. Downloaded a 12.3 image and everything worked again.

Baxxy13 commented 3 months ago

Can confirm that booting freshly flashed haos_rpi5-64-12.4.img.xz isn't possible with SD-Card or USB-SSD. (NVME not tested) (Pi5B-8GB)

Kitekater commented 3 months ago

me too. Same picture

SqlBenjamin commented 3 months ago

I'm getting the same issue...came to create a bug but this one was already created. It just continues to restart over and over. I also have a Pi 5 8GB (using an A2 128GB SD card).

adam-jones-net commented 3 months ago

Not sure if this is the same issue but I ran the latest update when prompted to install on my mobile app. I swear it was 2024.6.4 even though today checking on github the latest version is listed as 2024.6.3. I'm also now with a dead system stuck in a boot loop.

gokartn commented 3 months ago

I had the same issue.
Thought my Raspberry Pi 5 was broken, the only thing keeping me going was the boot screen Switching from "Detected" to "not detected" when pluggin in and taking out the SD Card. As well as Raspberry Pi Os Lite working.

Used the Imager to get the latet 12.4 and it gave the exact same image as OP. Downloaded 12.3 from Here and flashed it using the imager, and it worked on first boot.

DonnieNarco commented 3 months ago

Yes, exact same issue with a brand new Pi5. I thought I was going crazy because no one seemed to have same issue, until I found this. So, I will use 12.3 for now.......Does anyone know if I should then avoid any and all updates until an official statement comes out that says it's fixed??

tobtobi commented 3 months ago

Exactly the same issue here also on a Pi5 4GB BalenaEtecher and Pi Imager both same problem Only Solution was running the older 12.3 Version

UF-Elektron commented 3 months ago

Same issue! Brand new Raspberry Pi 5, Home Assistant OS 12.4 does not boot. SD Card: SanDisk Extreme PRO 32GB SD Card is detected, but boot process keeps looping.

Tried if my raspi works by inserting SD Card with Raspberry Pi OS and it booted without any issues.

Baxxy13 commented 3 months ago

The problem only occurs with fresh flashed haos_rpi5-64-12.4.img.xz. If you start with haos_rpi5-64-12.3.img.xz you can safely update to 12.4 from within HA-UI.

Just tested this and it works without problems.

DonnieNarco commented 3 months ago

The problem only occurs with fresh flashed haos_rpi5-64-12.4.img.xz. If you start with haos_rpi5-64-12.3.img.xz you can safely update to 12.4 from within HA-UI.

Just tested this and it works without problems.

I have read from others that upgrading to 12.4 from within HA also makes this get stuck in a boot loop.....

Baxxy13 commented 3 months ago

Hmm, are those readings Pi5B related? I flashed OS 12.3 to new SD-Card, booted and doing the onboarding. After that the 12.4 Update was announced in the UI and i installed it. Now i'm on 12.4 with my Pi5B8G.

DonnieNarco commented 3 months ago

I do recall a few people saying RPi5, but I will give that a shot once I get this in place. I have successfully installed 12.3 now and restored from a backup. I am at work now, but once I get home, I will put this in and see how it goes.

On Fri, Jun 21, 2024 at 7:58 AM Baxxy13 @.***> wrote:

Hmm, are those readings Pi5B related? I flashed OS 12.3 to new SD-Card, booted and doing the onboarding. After that the 12.4 Update was announced in the UI and i installed it. Now i'm on 12.4 with my Pi5B8G.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/operating-system/issues/3437#issuecomment-2182810026, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVCBCTJO6WIGRVJZEQQDVTZIQWR5AVCNFSM6AAAAABJUIBNN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBSHAYTAMBSGY . You are receiving this because you commented.Message ID: @.***>

FiftyBillion commented 3 months ago

Exactly the same issue and error I got. I just got the new Raspberry pi 5 and a whole new SD card yesterday. I have tried both Raspberry pi imager and Balena etcher, same issue.

ababij commented 3 months ago

I'm having the same issue with a Pi 5/8GB. I attempted to run the update in HA but when it restarted it got stuck in the boot menu. I then attempted a new install using RaspberryPi Imager 1.8.5 and had the same result. Tried a couple SD cards but still the same. Downloaded a 12.3 image and everything worked again.

After reading Baxxy13's comments, I tried to run the 12.4 update again from the HA UI and it worked this time. Maybe it was cause I had a fresh 12.3 install on the SD?
Whatever it was, when I started with a new 12.3 install and then used the HA UI to do the update to 12.4, it worked.

GlobierH commented 3 months ago

I have the exact same issue. Installed 12.4 via Imager 1.8.5 and have the same boot issue Installed 12.3 via img download then via imager and boots fine. Havent tried the update from 12.3 yet as just want to get things restored and back running. Will monitor this issue for when the issue is fixed.

TomMarks commented 3 months ago

Exactly same issue with Raspberry Pi 5, Pi Imager, and HA installation 12.4. Downloading 12.3 image from here and installing with Pi Imager seems to work.

rodpayne commented 3 months ago

I received a new Raspberry Pi today, and it had the same issue with hanging up booting the HA OS 12.4 image from SD. It turns on the red LED momentarily and then switches to solid green, with no flashing indicating activity. Same results with both Balena Etcher and The RPi imager, running on Windows.

It tried it with the 12.3 image, and it seemed to get past the initial boot. The amber and green LEDs on the ethernet port are on solid, with no flashing indicating network activity, so I initially thought that it was not connecting, but I later figured out what IP address it ended up using.

Baxxy13 commented 3 months ago

The issue here is that the downloadable, or directly via Pi-Imager flashable, 12.4 image (for Pi5B) is somehow faulty. The issue is not about 12.3 image or any other problems, ist just "Pi5B doesn't boot with freshly flashed OS 12.4".

And of course, to prevent others to get into this issue, the faulty image should be removed from downloads and Pi-Imager till a fixed image is available.

But it's weekend and it seems nobody cares... 😉

sairon commented 3 months ago

And of course, to prevent others to get into this issue, the faulty image should be removed from downloads and Pi-Imager till a fixed image is available.

I quickly verified on my Pi5/8G to check if we should take this measure, and I'm not able to reproduce it here, so there are some other factors at play (very likely the EEPROM firmware). I will look into it deeper, but at this point it's clear that not everyone is affected and there will be likely also a different way to address it.

MrKlacker commented 3 months ago

And of course, to prevent others to get into this issue, the faulty image should be removed from downloads and Pi-Imager till a fixed image is available.

I quickly verified on my Pi5/8G to check if we should take this measure, and I'm not able to reproduce it here, so there are some other factors at play (very likely the EEPROM firmware). I will look into it deeper, but at this point it's clear that not everyone is affected and there will be likely also a different way to address it.

I can confirm I had the same. Purchased a fresh RPI5 with a fresh microSD and tried to flash 12.4. with balenaEtcher and RPI Imager. Both failed. Tried 12.3 and booted on first try.

DonnieNarco commented 3 months ago

I'm not sure how you aren't able to reproduce it, when everyone here has the same issue. Unless you are running some custom Pi Firmware or something?

On Mon, Jun 24, 2024 at 1:32 AM Jan Čermák @.***> wrote:

And of course, to prevent others to get into this issue, the faulty image should be removed from downloads and Pi-Imager till a fixed image is available.

I quickly verified on my Pi5/8G to check if we should take this measure, and I'm not able to reproduce it here, so there are some other factors at play (very likely the EEPROM firmware). I will look into it deeper, but at this point it's clear that not everyone is affected and there will be likely also a different way to address it.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/operating-system/issues/3437#issuecomment-2185806636, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVCBCUTMY7F6DCKNKYF5KTZI7DPPAVCNFSM6AAAAABJUIBNN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVHAYDMNRTGY . You are receiving this because you commented.Message ID: @.***>

sairon commented 3 months ago

@DonnieNarco That's the one million dollar question right now. Here's a screenshot of my RPi hanging in the bootloader (by adjusting the path to the kernel to prevent it from booting). You can see the version is the same as in the (so far only) image posted here: image

DonnieNarco commented 3 months ago

That is indeed interesting....I hope this gets fixed soon!

On Mon, Jun 24, 2024 at 7:32 AM Jan Čermák @.***> wrote:

@DonnieNarco https://github.com/DonnieNarco That's the one million dollar question right now. Here's a screenshot of my RPi hanging in the bootloader (by adjusting the path to the kernel to prevent it from booting). You can see the version is the same as in the (so far only) image posted here: image.png (view on web) https://github.com/home-assistant/operating-system/assets/211416/898f40b1-d9c4-4938-ae1b-323c98e8e258

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/operating-system/issues/3437#issuecomment-2186594543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVCBCVQUH3KIWJFJBUYXWLZJANXXAVCNFSM6AAAAABJUIBNN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBWGU4TINJUGM . You are receiving this because you were mentioned.Message ID: @.***>

Baxxy13 commented 3 months ago

and I'm not able to reproduce it here

Ok, and sorry for my comment about the faulty image.

It looks like the problem is with the imager programs (RPI imager / Etcher) or the underlaying os of those programs, and has nothing to do with the provided image itself or the bootloader. I normally use the RPI imager under Windows. For a test, I started Raspbian-OS Lite on the Pi5, downloaded the Pi5B HA-OS 12.4 image and flashed it to an SD card. With this SD card, the Pi5B boots HA-OS 12.4 without any problems.

I used the following to flash the SD card: sudo dcfldd bs=1M if=haos_rpi5-64-12.4.img of=/dev/sdb

I hope this helps with troubleshooting.

Translated with DeepL.com (free version)

Addendum: Pi5B-8GB

# sudo rpi-eeprom-update
BOOTLOADER: up to date
   CURRENT: Mi 5. Jun 15:41:49 UTC 2024 (1717602109)
    LATEST: Mi 5. Jun 15:41:49 UTC 2024 (1717602109)
   RELEASE: latest (/lib/firmware/raspberrypi/bootloader-2712/latest)
            Use raspi-config to change the release.

Have I perhaps answered the one million dollar question? 😉

sairon commented 3 months ago

@Baxxy13 Thank you very much, that's really helpful, at least I know I (probably) don't need to chase ghosts in HAOS anymore.

That doesn't exactly answer the $1M question but gives a major clue. In my testing I tried using both RPi Imager and balenaEtcher (both on Linux though) and it worked for me as well, so either it affects these utilities only on Windows, or, more likely, for some reason the 12.4 image you (and the remaining people here) downloaded was corrupted somehow. For example balenaEtcher verifies the integrity of the written data, but it uses the original file on your PC as the reference, so it can't determine if the source file isn't faulty. Maybe Github had some trouble at the time, maybe some antivirus software interferes there, it's hard to tell at this point.

The simplest (but not completely reliable) method is to check the filesize of the image - it should be exactly 282171876 bytes in size. Uncompressed it's 2147483648 bytes, but I assume that corruption of the archive would result in file that can't be extracted.

More reliable way is to check the checksum of the files, which is following for SHA-256 algorithm:

d3c779c1af62300a689cb9f6db72c8bada1a4e02649c63922f0c8db9495f2a56  haos_rpi5-64-12.4.img
019a662e8898cc957cc9614f60782526de3675b6def6b148bcd7ef57184acd13  haos_rpi5-64-12.4.img.xz

For example here is a guide how to check it on all major operating systems.

Baxxy13 commented 3 months ago

Hmm, the checksum for the downloaded haos_rpi5-64-12.4.img.xz is correct, so no download problems.

C:\WINDOWS\system32>certutil -hashfile F:\haos_rpi5-64-12.4.img.xz sha256
SHA256-Hash von F:\haos_rpi5-64-12.4.img.xz:
019a662e8898cc957cc9614f60782526de3675b6def6b148bcd7ef57184acd13
CertUtil: -hashfile-Befehl wurde erfolgreich ausgeführt.

If i unpack the image (using WinRar) the checksum of the haos_rpi5-64-12.4.img is also correct, so no interference from os or antivirus.

C:\WINDOWS\system32>certutil -hashfile F:\haos_rpi5-64-12.4.img sha256
SHA256-Hash von F:\haos_rpi5-64-12.4.img:
d3c779c1af62300a689cb9f6db72c8bada1a4e02649c63922f0c8db9495f2a56
CertUtil: -hashfile-Befehl wurde erfolgreich ausgeführt.

But the Pi5B won't boot if i flash the haos_rpi5-64-12.4.img with PI-Imager via "use custom".

sairon commented 3 months ago

Thanks again, with the Windows version of the RPi Imager I was able to reproduce it. It shows that for some reason the partition table is altered in a way that the RPi bootloader is not able to read the boot partition. Moreover, I get exactly the same output with balenaEtcher and Rufus, so it's like if the GPT header was altered by Windows itself :thinking:

I was testing on a laptop with Windows 11, I am curious if someone could try with an older Windows version and tell if it also generates unbootable images.

Baxxy13 commented 3 months ago

I'm using older Windows 10 Home 22H2.

sairon commented 3 months ago

I tried using Raspberry Pi Imager on Windows 7 and it doesn't have the same flaw - the SD card is byte-to-byte identical with the source image, which makes me believe that the tools themselves aren't to blame. I'll continue looking into that but it seems Windows is doing something nasty and unexpected when it encounters the slightly changed GPT header that HAOS 12.4 has :( I have updated the issue title accordingly and pinned it for visibility.

Currently the only workaround is either to use the older HAOS version and do an OS upgrade afterwards, or not use Windows 10+ (not sure about Windows 8) for creating the bootable device for RPi 5.

Baxxy13 commented 3 months ago

Really strange. I did some test's yesterday with other "windows-imaging-programs" (besides Etcher and Pi-Imager), but all fail to create a bootable 12.4 sd-card.

So ist seems that really Windows is the issue... 😟

qemajlosmani commented 3 months ago

I had the exact same issue. Was trying for 3 Hours to install HAOS. Tried different SD Cards, SSD Drives and then after flashing my SD Card with the version 12.3, installed and running without any problem. Raspberry PI with 8GB

MikeFalcor commented 3 months ago

Same thing as everyone else, above. I let it boot loop for about an hour before I simply shook my head, said "Nice QA...", and flashed 12.3 to the MicroSD card. Works now!

manstatt85 commented 3 months ago

Same for me - 12.4 stuck while booting, after installing 12.3 everything is fine. I was using Raspberry pi imager

Patches520 commented 3 months ago

I have the same issue as everyone, but I'm stuck in a bad loop trying to download the updated supervisor and cant get install to boot. Any suggestions?

sairon commented 3 months ago

There's not much more information to gather at this point, so I'm locking this issue to prevent spamming all the people who contributed with their findings. For general discussion please use Home Assistant Community forums or GH discussions.