rauc / meta-rauc

Yocto/Open Embedded meta layer for RAUC, the embedded Linux update framework
MIT License
162 stars 90 forks source link

rauc: rauc-mark-good: improve service unit #197

Closed Bastian-Krause closed 3 years ago

Bastian-Krause commented 3 years ago

Make the rauc-mark-good.service run only if bootchooser.active or rauc.slot are set in the kernel command line. During debugging/development, boot from NFS or non-bootchooser boots might be used. In these cases rauc status mark-good will fail.

RemainAfterExit=yes allows systemd to start dependencies only after rauc status mark-good has succeeded.

While at it, use the official RAUC spelling and remove the trailing empty line.

jluebbe commented 3 years ago

Good idea to utilize ConditionKernelCommandLine=|... to start the unit only if the bootloader explicitely booted one or the other slot. But then the directive WantedBy=multi-user.target should be removed at the same time.

I think WantedBy is still needed to activate the unit. Are you sure this works without it?

Bastian-Krause commented 3 years ago

The introduction of RemainAfterExit=yes makes sense as well because it ensures that this service unit is only started once (see e.g. section "Example 4. Stoppable oneshot service" in the manpage for systemd.service). Starting dependencies only after success of rauc status mark-good is already arranged by the choice of Type=oneshot compared to Type=simple, so the commit message should be adjusted in that respect.

Correct, I misread the man page regarding that option. Will adjust the commit message.

OnkelUlla commented 3 years ago

I think WantedBy is still needed to activate the unit. Are you sure this works without it?

You are right and my understanding of triggering conditions was not correct, so please forget about my suggestion to remove WantedBy=multi-user.target.

ejoerns commented 2 years ago

Cherry-picked to 'dunfell' branch.