main: if deactivate when already deactivated return immediately

We were trying to ignore second deactivate requests, but
were instead crashing because we're trying to use a nullified
trigger.

This commit makes sure things don't go crashy when a user
does "plymouth deactivate" on an already deactivated plymouthd.
two-step: don't update progress when idle

We've already reach a state where we aren't drawing anymore, etc,
so don't update progress and potentially fire off animations
that won't be seen.
main: make plymouth show-splash idempotent

plymouth show-splash causes hairy things, that should only happen once,
like activating renderers to happen.

This commit makes subsequent show-splash calls be no-ops.
systemd: add WantedBy snippets

This fixes systemctl enable.

https://bugs.freedesktop.org/show_bug.cgi?id=38348
Use O_CLOEXEC where adequate, simplify its use.
Use fseeko and ftello just for the sake of LFS correctness

No bug involved.
key-file: use %m instead of %a in fscanf

It's meaning is less muzzled and this fixes a compiler warning.
populate-initrd: If PLYMOUTH_THEME_NAME is set, write it into plymouthd.conf

You can set PLYMOUTH_THEME_NAME when building initramfs to get a
different theme into initramfs, but this doesn't change the default
theme, so the resulting initramfs won't actually use the theme we
installed.

This patch makes plymouth-populate-initrd rewrite the 'Theme=XXX' line
in plymouthd.conf, so plymouth will use the theme we install.
throbgress: add more debug spew

These were melded into place from two-step
text-progress-bar: fix os string parsing

If there's no newline the the end of string variable will be NULL
instead of at the end of string.
main: fix small leak
main: ensure add_consoles_from_file terminates buffer string

This isn't a real problem in practice, since the files getting
read will be much smaller than the buffer, but it looks bad.

This commit ensures the buffer always leaves room for the terminating
NUL.
utils: Add strerror(errno) to error message

So it's easier to debug why it fails.
utils: don't create pipes non-blocking

The daemonizing code depends on its pipe io being
blocking.  The other user of ply_open_unidirectional_pipe
will work with blocking or non blocking io.

This commit changes ply_open_unidirectional_pipe to create
blocking pipes.  This started causing failures with
commit 9ec69929 since it replaced broken code (passing
O_NONBLOCK to fcntl(fd, F_SETFD.. instead of F_SETFL)
with working code.
gitignore: Ignore systemd service and path files.
generate-initrd: Use pigz if available.
main: all update-root-fs for shutdown

Some distros now switch root back to the initrd at shutdown.

This commit allows plymouth to go along for the ride.
main: use correct cache file

Now that we allow switching into the initrd we shouldn't try
to load the boot cache file when shutting down.
animation,throbber: go back to frame dropping

Right now we figure out which animation frame to use
based on a static counter variable.  Since it's static
instead of per-object, if there are multiple instances
it ends up counting up too fast.

We could:
1) make it per-object state
2) drop it and use the ifdef'd out alternative implementation
that potentially drops frames if the machine is sluggish

This commit chooses 2, but we may end up going to one if the
frame dropping turns out to be problematic.

Based on deductive work from Kevin Murphy.
systemd: add plymouth-start.service to initrd-switch-root.target

<haraldh> halfline, can you add plymouth-start.service to
plymouth-populate-initrd ??
<halfline> haraldh: sure, can you give me details on the bug its fixing?
<haraldh> except, if you put yourself out of the plymouth cgroup
<haraldh> and the "@" in argv[0][0]
<haraldh> better put plymouth-start.service in the
initrd-switch-root.target
<haraldh> easier
<halfline> well we already do the "@" in argv[0][0]
<halfline> and we already put KillMode=none SendSIGKILL=no in the
service file
<halfline> but will add the change
<haraldh> hmm, ok