Commit graph

112 commits

Author SHA1 Message Date
Ray Strode
54fb7e1d56 Include config.h automatically
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
2023-12-04 14:04:01 -05:00
Victor Tran
6f9744cb32 Add system-reset splash mode 2023-11-24 20:11:36 +00:00
Ray Strode
a5c1ccd711 autogoo: Drop the goo
We have meson support now, get rid of the cruft.
2022-11-14 13:40:56 -05:00
Niels De Graef
95d3e3bbf9 Port build system to Meson 2022-11-14 12:21:55 -05:00
Valentin David
8d1c0e622e main: Add "reload" command
If an initramfs does not yet have all configuration, it might want
to start with a fallback theme, and re-load the correct theme is
accessible.
2022-10-15 18:02:01 +00:00
Ray Strode
b849a3c54d src: Drop vim: lines
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.
2022-08-03 15:10:20 -04:00
Ray Strode
e483f0c4fe src: Run through uncrustify
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.
2022-07-29 09:16:44 -04:00
Ray Strode
ac631853a8 client: Free command parser after event loop
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
2022-04-12 16:20:20 -04:00
Eric Curtin
ed7b1690f0 client: call cleanup functions everytime we return from main
We were not cleaning up allocated resources in many of the code
execution paths in main()
2022-03-28 15:25:50 +00:00
Brian Murray
53c83cc8d6 client: Don't wait forever for a ping reply
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
2020-10-28 10:07:27 -04:00
Ray Strode
03e7789503 Revert "Don't wait forever for a ping reply."
This reverts commit 55902cedde
2020-10-28 14:00:22 +00:00
Brian Murray
55902cedde Don't wait forever for a ping reply.
In the event that plymouthd is not responding the plymouth client will wait
forever when sending a ping to the daemon. Instead of waiting forever timeout
after a while.

https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/130
2020-10-26 20:13:20 +01:00
Richard Hughes
cd4a601094 Add a new firmware-upgrade mode for use by fwupd
This allows us to have accurate localised text, and also to use the vendor BIOS
logo when applying firmware updates.
2019-05-29 17:52:40 +00:00
Hans de Goede
a42915c972 Add new reboot and system-upgrade modes
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>
2019-02-26 17:01:03 +01:00
Hans de Goede
d253ad6238 libply: Move kernel commandline parsing functions to libply/ply-utils
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>
2018-10-31 15:25:15 +01:00
Ulrich Ölmann
2b5b27cbdc client: fix typo in help text
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
2018-05-17 15:24:43 -04:00
Ray Strode
6525ae6017 client: fix incorrectly sized buffer for /proc/cmdline
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.
2014-10-17 11:19:39 -04:00
Ray Strode
85704145ee Reindent
I don't like the GNU coding style and I'm not sure why I chose it.
This commit changes things over to use 8 space tabs and 'if () {'
style braces.
2014-05-20 15:16:48 -04:00
Ray Strode
481388968d Revert "Add support for operation log messages"
This reverts commit 52b91176ba.
2014-04-21 11:18:19 -04:00
Pali Rohár
52b91176ba Add support for operation log messages
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
2014-04-21 10:37:49 -04:00
Ray Strode
f57bb3dc1e client: support plymouth.debug on kernel command line
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.
2014-02-07 16:40:07 -05:00
Ray Strode
c1d3037858 build-goo: s/INCLUDES/AM_CPPFLAGS/
This gets rid of some build warnings.
2013-12-11 13:18:48 -05:00
Ray Strode
3a356a450f tests: drop for now
They're fairly bitrotten, don't tie into make check,
and aren't that useful.

Drop them for now, until we can come up with a better
story.
2013-12-03 13:50:34 -05:00
Richard Hughes
cef67c3f5d main: add a system-update command that can pass update progress to the daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50876
2012-06-08 18:47:41 -04:00
Richard Hughes
0880f04eab main: add a change-mode command to be able to switch the splash mode at runtime
https://bugs.freedesktop.org/show_bug.cgi?id=50847
2012-06-08 18:14:40 -04:00
Steve Langasek
e274cda1ee client: add new flush api
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.
2012-05-11 08:48:02 -04:00
Per Øyvind Karlsen
3f0cf34885 ulibc: Change the link order + add -ldl
ulibc linking is a bit more particular than regular glibc
2012-03-21 10:35:37 -04:00
James Hunt
9fffcda4c5 client: fix fd leak
This plugs an fd leak in an error path
2011-10-11 22:01:07 -04:00
Ray Strode
b7701d690a Revert "Add --nowait option."
This reverts commit c926bccd83.

It was an in-progress patch that I carelessly and erroneously
pushed.
2011-08-03 14:00:25 -04:00
cee1
c926bccd83 Add --nowait option.
With --nowait option, plymouth will not wait for reply from plymouthd.
2011-07-15 10:14:16 -04:00
Ray Strode
a116eafc57 client: small leak fix 2011-03-26 01:02:49 -04:00
Colin Watson
852c016e0d client: allow reply handlers to be optional.
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.
2011-03-12 16:37:52 -05:00
Andrey Borzenkov
32a214337b client: do not wait forever if daemon is not started
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>
2011-03-02 20:51:32 -05:00
Ray Strode
005699a6f5 client: clean up warnings 2011-02-09 15:28:00 -05:00
Andrey Borzenkov
a4c7cbafd3 boot-client: fix fallback socket support
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>
2010-11-19 10:33:49 -05:00
Ray Strode
3ec007a482 protocol: change socket path
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.
2010-10-06 18:03:25 -04:00
Ray Strode
f0da04ca88 protocol: drop leading \0 from socket path
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.
2010-10-06 17:57:34 -04:00
Ray Strode
9de731ed29 utils: add support for "trimmed abstract" sockets
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.
2010-10-06 17:43:50 -04:00
Charlie Brej
c418d0aa83 client: Alias display-message command to message for backward compatibility 2010-09-07 23:45:31 +01:00
Charlie Brej
c21bc99eee boot-client: Add hide-message client command
This renames "message" command to "display-message".
2010-09-07 21:23:14 +01:00
Charlie Brej
0331ff6102 protocol: Add "hide message" command to the protocol
This also renames the "message" command to "show message".
2010-09-07 20:35:28 +01:00
Colin Watson
41646ad9dd client: Open /proc/cmdline by absolute path
Open /proc/cmdline, not proc/cmdline.
2010-09-07 15:18:00 +01:00
Ray Strode
66980c331b [client] Update top line of help output
It said "Boot splash control client" before, but we do
boot and shutdown splashes.
2010-08-22 15:49:41 -04:00
Ray Strode
c9dda9295e [array] Support integer elements
Right now all array elements must be pointer values, or
at least pointer sized values.

This commit allows 32-bit integers as elements as well.
2010-08-19 19:59:37 -04:00
Ray Strode
3875c30854 [client] Fix watch-keystroke cancellation
If someone calls --ignore-keystroke then
the watch-keystroke command shouldn't get
run and the exit code should be different
than if it does get run.
2010-06-30 16:04:14 -04:00
Charlie Brej
ce884c5ca2 [client] Add ignore-keystroke command
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.
2010-06-03 15:45:36 +01:00
Ray Strode
790f6d4401 [client] Allow unlimited unlock attempts
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.
2010-04-05 10:14:47 -04:00
Ray Strode
f119e8a047 [client] add update subcommand
This is to replace the old style --update option.
2010-03-24 16:57:40 -04:00
Ray Strode
544f5bae0a [client] add hide-splash and show-splash subcommands
This is to replace the old style --hide-splash and --show-splash
options.
2010-03-24 16:43:19 -04:00
Ray Strode
c0637bd800 [client] add new update-root-fs command
This supercedes --newroot and --sysinit into one
command following the newer subcommand method of
using the plymouth client.
2010-03-24 16:38:40 -04:00