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

raspberrypi: use MACHINE variable #89

Closed dwalkes closed 4 months ago

dwalkes commented 4 months ago

Instead of hard-coding RaspberryPi4, use a MACHINE variable in the update bundle and system.conf to support builds of other RPi platforms and avoiding a mismatch of configs.

dwalkes commented 4 months ago

@leon-anavi this is the PR we discussed previously.

leon-anavi commented 4 months ago

Hi @dwalkes,

After testing this GitHub pull request, I discovered a couple of minor issues:

I will merge this GitHub pull request as it is right now and shortly I will create a new GitHub pull request with fixes of the described minor issues.

Best regards, Leon

P.S. fixed with https://github.com/rauc/meta-rauc-community/pull/91

dwalkes commented 4 months ago

Hi @leon-anavi That's interesting. I tested with nanbield and kirkstone using https://github.com/Trellis-Logic/meta-aws-iot-demo/blob/main/conf/kas/rpi-rauc-aws-nanbield.yml and https://github.com/Trellis-Logic/meta-aws-iot-demo/blob/main/conf/kas/rpi-rauc-aws.yml respectively and didn't see this issue. I was able to update between releases and verified /etc/rauc/system.conf subtitution.

There is a typo in the sed command and | has to be replaced with /, aka it should be sed -i "s/@@MACHINE@@/${MACHINE}/g" ${WORKDIR}/system.conf.

Based on https://www.gnu.org/software/sed/manual/sed.html#The-_0022s_0022-Command I think the / character can be replaced with |. This logic was also copied directly from the meta-rauc-tegra implementation on the kirkstone branch at https://github.com/rauc/meta-rauc-community/blob/a24bd25bc1f871782fc956f9a3104256cac16691/meta-rauc-tegra/recipes-core/rauc/rauc_%25.bbappend#L11 and implemented with https://github.com/rauc/meta-rauc-community/commit/efca7d82edd00022034d5a4bf6a0b6bc48dd36b2

leon-anavi commented 4 months ago

Hi @leon-anavi That's interesting. I tested with nanbield and kirkstone using https://github.com/Trellis-Logic/meta-aws-iot-demo/blob/main/conf/kas/rpi-rauc-aws-nanbield.yml and https://github.com/Trellis-Logic/meta-aws-iot-demo/blob/main/conf/kas/rpi-rauc-aws.yml respectively and didn't see this issue. I was able to update between releases and verified /etc/rauc/system.conf subtitution.

There is a patch in layer meta-rauc that splits into 'rauc' for binary and 'rauc-conf' for configuration: https://github.com/rauc/meta-rauc/commit/d51bab8f760d48e082f3515606d2d1a18343f5d6. It is included in the master branch of layer meta-rauc which is compatible with Yocto releases nanbield and scarthgap (not with kirkstone): https://github.com/rauc/meta-rauc/blob/master/conf/layer.conf#L20C28-L20C46. The YAML kas configuration files are using branches kirkstone and nanbield of meta-rauc which do not include this commit. This explains why you did hit this issue.

@drewmoseley submitted a GitHub pull request for meta-rauc-community which adapts meta-rauc-raspberrypi accordingly to rauc-conf https://github.com/rauc/meta-rauc-community/pull/86 I merged it today.

There is a typo in the sed command and | has to be replaced with /, aka it should be sed -i "s/@@machine@@/${MACHINE}/g" ${WORKDIR}/system.conf.

Based on https://www.gnu.org/software/sed/manual/sed.html#The-_0022s_0022-Command I think the / character can be replaced with |. This logic was also copied directly from the meta-rauc-tegra implementation on the kirkstone branch at

https://github.com/rauc/meta-rauc-community/blob/a24bd25bc1f871782fc956f9a3104256cac16691/meta-rauc-tegra/recipes-core/rauc/rauc_%25.bbappend#L11

and implemented with efca7d8

Nice! Sorry, my bad, I forgot about this in meta-rauc-tegra.