rauc / meta-rauc-community

Yocto/OpenEmbedded meta layer with examples for integration of RAUC, the embedded Linux A/B update framework
MIT License
46 stars 51 forks source link

rpi: Auto grow the actual /home partition. #86

Closed drewmoseley closed 4 months ago

drewmoseley commented 5 months ago

With the current service, only the extended partition is expanded to fill the space. This also extends partition 6 which is the current /home and the last partition on the disk.

drewmoseley commented 5 months ago

I added a commit to add "scarthgap" to LAYERSERIES_COMPAT. This works for expanding the filesystem but the actual rauc service fails with:

root@raspberrypi4-64:~# systemctl status rauc --no-pager -l
x rauc.service - RAUC Update Service
     Loaded: loaded (/usr/lib/systemd/system/rauc.service; static)
     Active: failed (Result: exit-code) since Tue 2024-02-27 17:26:10 UTC; 3 weeks 0 days ago
       Docs: https://rauc.readthedocs.io
    Process: 465 ExecStart=/usr/bin/rauc --mount=/run/rauc service (code=exited, status=1/FAILURE)
   Main PID: 465 (code=exited, status=1/FAILURE)
        CPU: 32ms

Feb 27 17:26:10 raspberrypi4-64 systemd[1]: Starting RAUC Update Service...
Feb 27 17:26:10 raspberrypi4-64 rauc[465]: Failed to initialize context: Failed to load system config (/etc/rauc/system.conf): Key file does not have group ?system?
Feb 27 17:26:10 raspberrypi4-64 systemd[1]: rauc.service: Main process exited, code=exited, status=1/FAILURE
Feb 27 17:26:10 raspberrypi4-64 systemd[1]: rauc.service: Failed with result 'exit-code'.
Feb 27 17:26:10 raspberrypi4-64 systemd[1]: Failed to start RAUC Update Service.
moto-timo commented 5 months ago

I have been working on scarthgap, so I will give this a try and see if I can replicate the issue.

leon-anavi commented 5 months ago

@drewmoseley is system.conf part of your image?

I see an error related to it in the shared by you log:

Failed to load system config (/etc/rauc/system.conf): Key file does not have group ?system?
drewmoseley commented 5 months ago

Yes, the file exists. I don't have a group named "system" though.

jluebbe commented 5 months ago

Yes, the file exists. I don't have a group named "system" though.

The system.conf in the layer looks good. Do you have local changes that could explain the missing [system] section?

drewmoseley commented 5 months ago

It seems that meta-rauc now puts system.conf in the rauc-conf package but meta-rauc-community has not been updated to match. I'll test a fix for rpi and push it to this PR.

drewmoseley commented 5 months ago

OK. The system.conf file is now properly packaged in rauc-conf. It all seems to be working on my end now. A similar change likely needs to be med in meta-rauc-community for all the other supported machines.

leon-anavi commented 5 months ago

@drewmoseley thank you for figuring that out and sharing it with the community. The patches look good me. We should sort this out for other boards. If there are no objections by tomorrow I will merge the GitHub pull request.

leon-anavi commented 4 months ago

@drewmoseley thank you. I confirm this issues fixes the described RAUC issues.

While testing this GitHub pull request I experienced issues with U-Boot on Raspberry Pi 4 (both 32-bit and 64-bit) due to the following error:

U-Boot 2023.10 (Oct 02 2023 - 14:39:59 +0000)

DRAM:  948 MiB (effective 3.9 GiB)
RPI 4 Model B (0xc03111)
Core:  212 devices, 16 uclasses, devicetree: board
MMC:   mmcnr@7e300000: 1, mmc@7e340000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1...
In:    serial,usbkbd
Out:   serial,vidconsole
Err:   serial,vidconsole
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
Card did not respond to voltage select! : -110
ethernet@7d580000 Waiting for PHY auto negotiation to complete. done
BOOTP broadcast 1
BOOTP broadcast 2

This is a U-Boot problem that appears without RAUC too. As far as I see there was a fix https://github.com/u-boot/u-boot/commit/7a790f018a812b5897fc144c46291de8df633429 but it was later on reverted because of other issues https://github.com/u-boot/u-boot/commit/abd1e94f70c9a2828d5ebec05013b055fb33c21d Temporary, to test RAUC locally I set U-Boot version to SRCREV:rpi = "7a790f018a812b5897fc144c46291de8df633429". I am sharing these technical details as they might be useful to someone else working with meta-raspberrypi and U-Boot on Raspberry Pi.

Best regards, Leon