There are a few files missing #include <config.h>.
That is bad since it means those files don't get debug tracing.
This commit eliminates the pitfall by making sure the file is
included implicitly
Many of the source files in tree have "vim:" lines to tell vim a
hint about our coding style.
Unfortunately, they were written when plymouth used the GNU coding
style, and it, of course, doesn't anymore.
This commit just drops them since the default vim indentation options
match pretty well with the plymouth coding style now, anyway.
I was going to fix the preexisting style issues piecewise as they're
changed, but it's actually making reviewing patchsets noisy.
This commit just bites the bullet and does a full run through
uncrustify.
commit ed7b1690f0 added an explicit
command parser free call on exit to make memory analysis tools
give better results.
That commit freed the command parser a little too early, though,
before the event loop gets freed and the event loop exit handlers
are run.
The command parser uses an exit handler to clear a weak reference
on the event loop, so freeing the command parser before the event
loop can lead to crash.
This commit moves the free call a little lower.
Related: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/175
In the event that plymouthd is not responding the plymouth client will
wait forever when sending a ping to the daemon.
This commit introduces a timeout of 30 seconds to better cope with a
hung plymouthd process.
(Some small changes to original patch by Ray Strode)
https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/130
Some themes show certain text strings to the user depending on the mode,
see e.g. the shutdown vs reboot mockups of:
https://wiki.gnome.org/Design/OS/BootProgress
Besides during shutdown vs reboot, we also want different theming for
installing offline (security) updates versus doing an offline OS upgrade.
To make this possible this commit adds new reboot and system-upgrade
modes which can be specified either when starting plymouthd, or through
plymouth change-mode --<mode>.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Move kernel commandline parsing functions to libply/ply-utils to avoid
code duplication between the daemon, the client and the plugins.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
We assume /proc/cmdline will be no more than 512 bytes (including NUL).
It can actually be 4096 bytes (excluding NUL).
This commit makes sure we allocate enough space for it and its NUL.
This is just like the previous fix for the daemon, but for the client,
now.
This patch adding support for operation log messages and updating upstart
bridge code to use it. This is usefull for verbose log output (e.g daemon
starting, stopping).
Example:
Register operation ssh:
$ plymouth register-operation --operation-id=ssh --name='Starting OpenSSH server ssh'
Set state of operation ssh to wait:
$ plymouth update --operation-id=ssh --status="wait"
Details plugin will show: 'Starting OpenSSH server ssh... [wait]'
Set state of operation ssh to done:
$ plymouth update --operation-id=ssh --status="done"
Details plugin will show: 'Starting OpenSSH server ssh... [done]'
Unregister operation ssh:
$ plymouth unregister-operation --operation-id=ssh
https://bugs.freedesktop.org/show_bug.cgi?id=77389
We used to use plymouth:debug to enable debugging in the
plymouth daemon, and changed it to plymouth.debug to be more
consistent with other users of the kernel command line.
We neglected to update the client to support the new format
though. This commit does that.
In some cases, clients may need a way to ensure that all queued
messages have been flushed and are sent to the daemon
(before, for instance, exiting).
This commit adds an API to block until the outgoing request queue is
empty.
This commit lightens the hard requirement that every
client request has to have a function handling the reply.
There's really no reason to be so strict, and it makes
life easier for none /bin/plymouth clients this way.
Currently plymouth --wait will wait forever if daemon is not
started. This does not look right - we were asked to wait for
daemon to stop and daemon is obviously stopped. So make it
exit right away in this case.
This avoids timeouts during systemd boot if plymouth happened to be
stopped (or never started) before plymouth-quit-wait had chance to
start.
Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
Commit 3ec007a482 did not
properly check for success when connecting to the fallback
socket path and instead always failed.
This commit fixes the code to properly check for success and
proceed.
Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
Before we were using
/ply-boot-protocol\0\0\0\0...\0
for our address which really uglifies /proc/net/unix
and doesn't match what a lot of other programs do.
This commit changes the address to just
/org/freedesktop/plymouthd
which is much nicer.
The socket path is currently defined to be:
#define PLY_BOOT_PROTOCOL_SOCKET_PATH "\0/ply-boot-protocol"
The \0 is because it's an abstract socket, and abstract sockets
have a leading NUL. The code always ignores the NUL though and
adds it back later, so it's not needed.
This commit just drops it.
Right now plymouth listens on an abstract socket with a name
that has a bunch of trailing NUL bytes. These zeroes uglify
the output of /proc/net/unix among other things.
This commit adds support for a new "trimmed abstract" socket
type, which drops the zeroes.
A subsequent commit will actually change plymouthd to use the
new api.
Adds an ignore-keystroke command. This does the same thing as the
ignore-keystroke option, but is migrated to a command. The option still exists
for compatibility.
The ask-for-password command has an option
to specify the maximum number of retries to
get the correct password. The default number
of retries was 3. This makes sense for /opt,
and to a lesser degree /home, but it doesn't
make sense at all for /, since failing means
the system won't boot.
The new default is "unlimited". This fixes the
/ case, but has the downside that all integration
code that was depending on the 3 default before
will need to get updated.