citruz / haos-rockpi

Home Assistant OS for Rock Pi 4
Apache License 2.0
57 stars 4 forks source link

make rauc updates possible #29

Closed honsma235 closed 5 months ago

honsma235 commented 5 months ago

I was trying to have a smoother update path for the OS instead of reflashing for each release and stumbled upon this documentation of how it's supposed to work for development builds.

Unfortunately this didn't work out of the box and rauc continued to complain about "Verify error: self-signed certificate". Upon comparing your build workflow with the upstream one i noticed the missing download step of the self-signed certificate.

With the changes of this PR I was able to update my board as described in the docu mentioned above. When you publish a release you would have to upload the rauc bundles (*.raucb) and the certificate (cert.pem) too, so everybody could update his install this smooth.

Oh.. and probably the README should hint at this update possibility..

citruz commented 5 months ago

Oooh nice, thanks for making me aware of that. I thought getting OTA updates to work would require setting up some online infrastructure but I didn't realize that there was the option to upgrade from a local file. I can't promise that I get to it immediately but I will look into it before the next release.

honsma235 commented 5 months ago

Yea, this update option makes life really easier. No need to access the board, no flashing of the eMMC, no restoring from backup, ... just a smooth update.

Well, the process itself isn't meant for the regular user, and some people may have difficulties to follow the right steps.. The dream solution could be a tiny add-on, which basically just automates these steps, similar to this :) If you are willing to go this way, I can help in testing and contributing.

citruz commented 5 months ago

I started looking into it and getting rauc updates to work is way easier than I thought. Instead of self-signed certificates I will create a haos-rockpi CA that will be included in future images so that ideally updates can be installed simply by doing rauc install <github link>. Replacing the bootloader in an SSD setup where the bootloader is installed on eMMC or SD card and the rest of the system is on the SSD, doesn't work out of the box currently. However, it is possible to add custom hooks and the upstream project did that for something similar: https://github.com/home-assistant/operating-system/blob/dev/buildroot-external/ota/rauc-hook#L64 So it should be possible to get even that working. I will merge this for now and commit my changes separately once I have everything working. Thanks again for your contribution! 12.3 should have working update functionality :)

honsma235 commented 5 months ago

That sounds like a good idea and the right way to support updates.

Could you release rauc bundles starting with 12.3, please?

citruz commented 4 months ago

@honsma235 I just released 12.3 with both your PRs. I figured out how to make the OTA installation even more convenient so that after 12.3 you can directly do rauc install with the raucb link from github without modifying the keyring. Please give it a try and thanks again!

honsma235 commented 4 months ago

Works like a charm. :thumbsup: