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

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

Closed
BatuhanBasaran opened this issue Jun 20, 2024 · 36 comments · Fixed by #3497
Closed

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

BatuhanBasaran opened this issue Jun 20, 2024 · 36 comments · Fixed by #3497
Labels
board/raspberrypi Raspberry Pi Boards bug

Comments

@BatuhanBasaran
Copy link

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
Copy link

ababij commented Jun 20, 2024

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
Copy link

Baxxy13 commented Jun 20, 2024

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
Copy link

me too.
Same picture

@SqlBenjamin
Copy link

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
Copy link

adam-jones-net commented Jun 20, 2024

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
Copy link

gokartn commented Jun 20, 2024

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
Copy link

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
Copy link

tobtobi commented Jun 21, 2024

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
Copy link

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
Copy link

Baxxy13 commented Jun 21, 2024

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
Copy link

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
Copy link

Baxxy13 commented Jun 21, 2024

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
Copy link

DonnieNarco commented Jun 21, 2024 via email

@FiftyBillion
Copy link

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
Copy link

ababij commented Jun 21, 2024

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
Copy link

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
Copy link

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
Copy link

rodpayne commented Jun 23, 2024

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
Copy link

Baxxy13 commented Jun 23, 2024

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 sairon added the board/raspberrypi Raspberry Pi Boards label Jun 24, 2024
@sairon
Copy link
Member

sairon commented Jun 24, 2024

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
Copy link

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
Copy link

DonnieNarco commented Jun 24, 2024 via email

@sairon
Copy link
Member

sairon commented Jun 24, 2024

@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
Copy link

DonnieNarco commented Jun 24, 2024 via email

@Baxxy13
Copy link

Baxxy13 commented Jun 24, 2024

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
Copy link
Member

sairon commented Jun 24, 2024

@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
Copy link

Baxxy13 commented Jun 24, 2024

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
Copy link
Member

sairon commented Jun 24, 2024

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 🤔

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
Copy link

Baxxy13 commented Jun 24, 2024

I'm using older Windows 10 Home 22H2.

@sairon sairon changed the title Home Assistant OS 12.4 does not boot with an SD card from a Rasp Pi 5 HAOS 12.4 install created on Windows 10+ fails to boot on RPi 5 Jun 25, 2024
@sairon sairon pinned this issue Jun 25, 2024
@sairon
Copy link
Member

sairon commented Jun 25, 2024

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
Copy link

Baxxy13 commented Jun 25, 2024

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.

  • Rufus 4.5 portable
  • Win32DiskImager 1.0.0
  • HDD Raw Copy Tool 1.20

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

@qemajlosmani
Copy link

qemajlosmani commented Jun 25, 2024

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
Copy link

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
Copy link

manstatt85 commented Jun 26, 2024

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

@Patches520
Copy link

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 added a commit to home-assistant/version that referenced this issue Jun 27, 2024
To avoid more people running into home-assistant/operating-system#3437,
revert HAOS to 12.3 on stable channel (mainly for the generated
documentation) and in the Raspbery Pi Imager definitions.
sairon added a commit to home-assistant/version that referenced this issue Jun 27, 2024
To avoid more people running into home-assistant/operating-system#3437,
revert HAOS to 12.3 on stable channel (mainly for the generated
documentation) and in the Raspbery Pi Imager definitions.
@sairon
Copy link
Member

sairon commented Jun 27, 2024

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.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jun 27, 2024
sairon added a commit that referenced this issue Jul 29, 2024
…sues

Genimage sets the first usable LBA to the offset of the first partition. While
it shouldn't be an issue in theory, Windows may do some nasty things with the
GPT header afterwards which breaks the Raspberry Pi bootloader, manifesting as

Before purpose of this behavior is clarified in [1], add a downstream patch
that sets the first usable LBA back to 34, which was the value that was used
before migrating to Genimage in #3388. Since changing this value (hopefully)
doesn't have any other consequences, and the images now should be closer to
pre-genimage builds, no more side-effects are expected from this change.

[1] https://www.github.com/pengutronix/genimage/issues/262

Fixes #3437
sairon added a commit that referenced this issue Jul 30, 2024
…sues (#3497)

Genimage sets the first usable LBA to the offset of the first partition. While
it shouldn't be an issue in theory, Windows may do some nasty things with the
GPT header afterwards which breaks the Raspberry Pi bootloader, manifesting as

Before purpose of this behavior is clarified in [1], add a downstream patch
that sets the first usable LBA back to 34, which was the value that was used
before migrating to Genimage in #3388. Since changing this value (hopefully)
doesn't have any other consequences, and the images now should be closer to
pre-genimage builds, no more side-effects are expected from this change.

[1] https://www.github.com/pengutronix/genimage/issues/262

Fixes #3437
@sairon sairon unpinned this issue Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
board/raspberrypi Raspberry Pi Boards bug
Projects
None yet