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

raspberrypi: use MACHINE variable #89

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

dwalkes
Copy link
Contributor

@dwalkes dwalkes commented Mar 31, 2024

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.

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.

Signed-off-by: Dan Walkes <[email protected]>
@dwalkes
Copy link
Contributor Author

dwalkes commented Mar 31, 2024

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

Copy link
Collaborator

@leon-anavi leon-anavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you for the contribution.

@leon-anavi
Copy link
Collaborator

leon-anavi commented Apr 2, 2024

Hi @dwalkes,

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

  • 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. Otherwise the generated system.conf in the image is corrupted:
root@raspberrypi4-64:~# grep compatible /etc/rauc/system.conf 
compatible=@@MACHINE@@
  • do_install:prepend with the sed command has to be moved from rauc_%.bbappend to rauc-conf.bbappend. This is required to be compatible with meta-rauc for Yocto releases Nanbield and Scarthgap. It is a follow-up from the merged rpi: Auto grow the actual /home partition. #86 Btw, due to things like this, moving on forward master branch of meta-rauc-community will not be compatible with Yocto release Kirkstone.

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 #91

@leon-anavi leon-anavi merged commit 85b4aaa into rauc:master Apr 2, 2024
1 check passed
@dwalkes
Copy link
Contributor Author

dwalkes commented Apr 2, 2024

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

sed -i "s|@@MACHINE@@|${MACHINE}|g" ${WORKDIR}/system.conf
and implemented with efca7d8

@leon-anavi
Copy link
Collaborator

leon-anavi commented Apr 2, 2024

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: rauc/meta-rauc@d51bab8. 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 #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

sed -i "s|@@MACHINE@@|${MACHINE}|g" ${WORKDIR}/system.conf

and implemented with efca7d8

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants