Implementing systemd-fsckd support in default plymouth themes.
Submitted by Didier Roche
Assigned to Ray Strode @halfline
Description
Created attachment 114798 Implementation example for a script theme
ey,
I've implemented recently in systemd a system-fsckd service, reporting to /dev/console and to plymouth themes the running fsck progress. There is as well a cancel message that is transmitted. The feature has been merged recently to systemd (commit http://cgit.freedesktop.org/systemd/systemd/commit/?id=ac6e2f0dfc2e800f01c79ecea2b811914110a7b9 and followings) in the to be released systemd v220. This is to mirror one feature we have in ubuntu (previously with mountall), where user can discover and cancel if one or more fsck are running.
The implementation is that we send a message telling that we support
Control+C to cancel running fsck. The form is:
"fsckd-cancel-msg:<localized_string>
".
Then, we also send update status (through the update functionality)
everytime the number of devices under fsck or the progress changes:
"fsckd:<num_devices>
:<percentage>
:<localized_string>
.
The localized_string is an string ready to be displayed for themes or scripts who either don't support i18n or just want to display the default strings. Other themes can match on the machine parsable data like prefix "fsckd-cancel-msg" or "fsckd" + num_devices and percentages.
More information about the protocole is available at http://man7.org/linux/man-pages/man8/systemd-fsckd.8.html
Here are attached 2 patches trying to do the minimum implementation for a theme to display the fsck cancel message when needed, and hiding when either the user cancel the fsck in progress or when the fsck are done. One is for the script theme and the other for one C theme. Note that if I'm correct, the C theme only support one message to be displayed, contrary to the script one. Before going on and implementing similar functionality to the other sets of default themes, I'm opened to any feedback on what can be improved .
Cheers, Didier
Attachment 114798, "Implementation example for a script theme":
implementation_for_script_theme.patch