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

fix: remove bootupd #152

Merged
merged 1 commit into from
Sep 10, 2024
Merged

fix: remove bootupd #152

merged 1 commit into from
Sep 10, 2024

Conversation

say-paul
Copy link
Member

@say-paul say-paul commented Sep 5, 2024

moved greenboot.cfg to /etc/grub.d

@miabbott
Copy link
Member

miabbott commented Sep 5, 2024

Attempting to workaround/fix - fedora-iot/iot-distro#58

@@ -90,6 +90,9 @@ install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{nam
%systemd_post greenboot-grub2-set-success.service
%systemd_post greenboot-rpm-ostree-grub2-check-fallback.service
%systemd_post redboot-auto-reboot.service
if [ -d /usr/lib/bootupd/grub2-static/configs.d ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Nope! This is not going to work.

Copy link
Member

Choose a reason for hiding this comment

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

you can't move package files around in post scripts, it means for example the rpm won't verify properly for one, and it's also extremely prone to errors and interruptions. Also if someone does custom image it may well break.

Copy link
Member

Choose a reason for hiding this comment

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

@nullr0ute do you have any suggestions for conditionalizing where the grub config lands as Sayan is trying to do?

Copy link
Member

Choose a reason for hiding this comment

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

The general rule of thumb is that you shouldn't do it. I think we need to step back and look at the actual problem.

Copy link
Member Author

@say-paul say-paul Sep 9, 2024

Choose a reason for hiding this comment

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

So I applied a hard link instead of mv also added in %postun to remove the ln post remove.

Copy link

Choose a reason for hiding this comment

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

Is there a chance that /etc would be mounted on a different flesystem?
Is symlink better for what we're trying to do?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thats a good point, hardlink will have issue between different file systems, softlink didn't work so I plan on using cp as it may not have an integrity issue as pointed out by @nullr0ute

@@ -142,7 +145,7 @@ install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{nam
%dir %{_prefix}/lib/%{name}/red.d
%{_exec_prefix}/lib/motd.d/boot-status
%{_tmpfilesdir}/greenboot-status-motd.conf
%{_prefix}/etc/grub.d/*.cfg
%{_sysconfdir}/grub.d/*.cfg
Copy link
Member

Choose a reason for hiding this comment

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

This is an unrelated fix, it should be in a different commit/PR.

Copy link
Member Author

@say-paul say-paul Sep 9, 2024

Choose a reason for hiding this comment

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

I think you saw comparison between two commits, which made it seem unrelated.
It changes the path from bootupd/static-config to grub.d:

https://github.com/fedora-iot/greenboot/pull/152/files#r1747377644

@say-paul say-paul force-pushed the remove_bootupd branch 2 times, most recently from 37908bf to bb79e03 Compare September 9, 2024 13:48
greenboot.spec Outdated
@@ -119,6 +121,9 @@ install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{nam
%systemd_postun greenboot-grub2-set-counter.service
%systemd_postun greenboot-grub2-set-success.service
%systemd_postun greenboot-rpm-ostree-grub2-check-fallback.service
if [ -f /usr/lib/bootupd/grub2-static/configs.d/greenboot.cfg ]; then
rm /usr/lib/bootupd/grub2-static/configs.d/greenboot.cfg
Copy link

Choose a reason for hiding this comment

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

Should we use -f here?

* Moved greenboot config to /etc/grub.d.
* %post symlink greenboot.cfg to bootupd if present
* %postun remove symlink from bootupd if present

Signed-off-by: saypaul <[email protected]>
@runcom runcom merged commit be1af06 into fedora-iot:main Sep 10, 2024
12 checks passed
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.

5 participants