Commit graph

160 commits

Author SHA1 Message Date
Hans de Goede
f443234585 ply-keymap-icon: Make Dvorak check case-insensitive
When using evdev support the XKB keymap name (with variant) for Dvorak
users will be e.g. "US (Dvorak)". The Dvorak layouts are not described
in /usr/share/X11/xkb/rules/evdev.xml, so these are not added to
ply-keymap-metadata.h / keymap-render.png .

For the console-keymap case dvorak is handled specially in:

keymap-render.py:normalize_keymaps()
ply-keymap-icon.c:ply_keymap_normalize_keymap()

mapping all keymap-names with a lowercase dvorak in there to "dvorak",
change this special handling to be case-insensitive so that it also works
for the xkb-keymap case.

Note the keymap-render.py change really is a no-op since keymap-render.py
only calls normalize_keymaps() on console-keymaps which are always
lower-case. normalize_keymaps() should still be updated though to keep
the 2 functions in sync.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2341810
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-02-10 14:23:58 +01:00
nerdopolis
6d5d3044fe plymouth-set-default-theme: Use a more targeted bash ini-parser function instead of sed to handle the config file 2024-01-13 00:31:19 +00:00
Adam Williamson
2fe900a4f3 Fix checks for existence of vars set by fc-match
The first line here checked for the wrong variable and is a dupe
from two lines earlier anyway, and the second line isn't guarded
at all, which seems to cause the weird failure we've been seeing
in openQA testing.

Also add a couple more existence checks for the same variables
later.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2023-12-25 14:52:54 -08:00
Ray Strode
ac6c34b9f5 plymouth-populate-initrd: More dependency softification
This commit makes lack of fc-match less noisy and makes
compose.dir from libX11 be optional as well.
2023-12-25 15:25:51 -05:00
Ray Strode
97a19552f3 plymouth-populate-initrd: Handle xkb and fontconfig not being installed
Some minimal installs won't have fontconfig or xkb. In those cases,
the script should continue to work even if the initramfs will be
less featureful.

This commit fixes that.
2023-12-25 14:42:53 -05:00
Ray Strode
2f89dc9060 plymouth-populate-initrd: Fix usage message
It currently says the scripts name is `plymouth` not
`plymouth-populate-initrd`.

This commit changes it to use $0
2023-12-25 11:07:47 -05:00
Ray Strode
93416bd5e6 generate-version: Use day number instead of week number
Right now the version is generated from week number but that
means more than one release in a week won't work.

This commit changes it to day number.
2023-12-22 11:29:12 -05:00
Ray Strode
3e76e1343b generate-version: Fix script inside of a tarball
The heuristic to check whether or not we're inside of a git checkout
or a tarball isn't working properly.

This commit changes it to use git rev-parse --is-inside-git-dir which
is pretty specifically designed for this use case.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/232
2023-12-22 10:36:40 -05:00
n3rdopolis
69e941e2d0 populate-initrd: Ensure a monospace font is in the initrd, along with fonts defined in the theme. 2023-12-02 17:44:08 -05:00
Ray Strode
f4834a4b0d check-format: Trim weird line that's getting added to output 2023-12-02 17:44:06 -05:00
Ray Strode
36cf20c6fa meson: Generate version for reproducibility
Right now we call date directly from meson.build leading to
non-reproducible builds.

This commit makes it only call date when building from git,
otherwise it extracts the version from the tarball name.

script borrowed from accountsservice.

Closes https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/188
2022-11-29 14:40:11 -05:00
Diego Augusto
6c78d01f52 populate-initrd: Ensure all xkb stuff gets moved to initramfs
Now that plymouth supports /dev/input directly, it's important
that the initramfs gains all the newly needed support files.

This commit adds the necessary changes to the script to ensure
those files get moved over.

Some contributions by n3rdopolis and Ray Strode.
2022-11-29 09:22:06 -05:00
Diego Augusto
a2f03d4b98 scripts: Update keymap-render script to handle xkb keymaps too
At the moment the keyboard-render script only generates short
names for console layouts.

We're going to add /dev/input support to plymouth using
libxkbcommon, so we're going to need a list of of those keymaps
too.

This commit adds that.

Some contributions by n3rdopolis and Ray Strode.
2022-11-29 09:22:06 -05:00
Ray Strode
0902c25eb6 Revert "Add input device support"
Apparently the:

[x] Squash commits

box was checked when merge request plymouth/plymouth!177 was merged.
Oops.

We want good commit messages for such a big change, though, so people
doing code spelunking later have a fighting chance of following what's
going on.

This reverts commit dacfb36b57.

Subsequents commits will bring it back, peicemeal.
2022-11-29 09:14:37 -05:00
Diego Augusto
dacfb36b57 Add input device support 2022-11-27 01:38:00 +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
Fabian Vogt
c9a03c17d7 populate-initrd: Install label-freetype plugin into initrd if available
Now that there's a freetype plugin available, it should be installed in
the initramfs.

This commit adds the changes to plymout-populate-initrd to make that
happen.

Some contributions by Petr Vorel and Nathan Pratta Teodosio.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
2022-10-17 13:04:02 -04:00
Ray Strode
eb6d33782d scripts: Add -B to interdiff in check-format
It's currently complaining about an extra blank line in each file.
That's a little extreme.  Add -B.
2022-08-03 15:32:04 -04:00
Ray Strode
cd809faf9d scripts: Update uncrustify config
It looks like I forgot to merge the latest uncrustify config last
time I did an uncrustify run.

This commit puts it in place.
2022-08-01 14:32:08 +00:00
Ray Strode
26fde15195 scripts: Diff less
I think check-format.sh might get into trouble in some cases when
a non source file gets changed.

This commit makes the diffing more targeted
2022-07-29 15:03:43 -04:00
Ray Strode
25523a2f87 .gitlab-ci: Don't regress formatting
The formatting in the codebase isn't perfect, but there's no
reason to make it worse.

This commit adds a CI check to make sure new code is styled
right.
2022-04-04 20:24:06 -04:00
Ray Strode
36f451f4f1 script: Enforce separate lines for function parameters
The moment it's possible to sneak in functions like:

static void
foo (int param1, int param2)
{
}

when the style requires parameters on separate lines.

This updates the uncrustify config to account for that.
2022-04-04 15:44:20 -04:00
Eric Curtin
123ca59cf2 scripts: plymouth-set-default-theme reporting missing right brace
Fixes issue:

/usr/sbin/plymouth-set-default-theme: line 199: [: missing `]'

when executed as plymouth-set-default-theme spinner
2022-04-01 14:13:23 +01:00
Ray Strode
fd961ef391 scripts: Support -R with -r and standalone for plymouth-set-default-theme
Right now plymouth-set-default-theme only supports rebuilding the initrd if a theme
is passed explicitly.

This commit improves the script to also work for --reset and even in a
standalone mode where no theme is passed at all.

Closes https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/174
2022-03-28 16:24:06 +00:00
Ray Strode
63cfc4eff5 scripts: Support short options being squished togethers for plymouth-set-default-theme
People expect to be able to squish short options together, so
this commit adds some glob matching to support that feature.
2022-03-28 16:24:06 +00:00
Alfonso Sánchez-Beato
3003cabf96 scripts: support populating from configurable theme dir
Support populating initramfs with themes from the configurable theme
directory.
2021-09-27 10:03:53 +00:00
Ray Strode
2a7755febb systemd: Add plymouth-switch-root-initramfs.service to switch back to initramfs on shutdown
Add a plymouth-switch-root-initramfs.service, which will call
"plymouth update-root-fs --new-root-dir=/run/initramfs" to switch back
to the initramfs (when applicable).

Systemd will run this service before plymouthd receives the SIGTERM on
shutdown, so this will cause the plymouthd-fd-escrow helper to run
from the initramfs.

This avoids the plymouthd-fd-escrow helper keeping the rootfs busy.

Changes by Hans de Goede:
- Fix a couple of typos
- Add Conflicts=dracut-shutdown.service to plymouth-switch-root-initramfs.service
  dracut-shutdown.service restores the initramfs when it is _stopped_
  use Conflicts to make sure its ExecStop has run before we do
- Add a check for switching back to the initramfs to on_newroot () and dump
  the debug-buffer before the switch (while we still have access to /var/log).
- Also add plymouth-switch-root-initramfs.service to kexec.target.wants.
  kexec.target.wants uses --mode=shutdown, so the plymouthd-fd-escrow helper
  will run, so we need to switch to the initramfs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-06 13:45:41 +02:00
Hans de Goede
ba1a1e28d3 scripts: Remove new-object.sh
Remove new-object.sh. As discussed in:

https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/113

It is not used (and may very well have never been used?).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-03-06 10:40:36 +01:00
Zhao Qiang
6844c84704 build-goo: Remove vestigial remnants of old GDM integration code.
commit 04102125 removed a feature, only several versions of
GDM relied on for doing the splash to login screen transition.
but it missed a few spots in the build goo and documentation. So
this commit does another pass to fully clean up any lingering
references to obsolete GDM transition code.
2020-03-07 00:36:54 +08:00
Böszörményi Zoltán
19f3885d3e Allow running plymouth-populate-initrd in a cross-compiler environment
Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-30 19:36:52 +00:00
Hans de Goede
8e811f8f88 themes: spinner/bgrt: Modify password dialog to match gnome 3.34 changes
There have been some small tweaks to the gnome lockscreen password
entry filed which we use as template for the diskcrypt password dialog,
adjust our dialog to match these tweaks.

Also move the keyboard indicator to be close to the entry, so that it
is clear it belongs to the entry.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-15 11:33:55 +02:00
Hans de Goede
5409977505 scripts: Add a logrotate file for /var/log/boot.log
Since plymouth concatenates boot logs one after the other in
/var/log/boot.log, causing it to grow endlessly. we need to logrotrate it.

Fixes #31

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-13 16:46:42 +02:00
Alberto Ruiz
b26a956a11 scripts: Add keymap-render.py script
Add a script for generating a png with the short-name (ignoring variants)
of all keymaps listed by "localectl list-keymaps" pre-generated.

This scripts also generates a ply-keymap-metadata.h file with info on
which pre-generated keymap name is where in the png.

This will be used in a follow-up commit to add support for a new
keyboard-keymap-icon control to libply-splash-graphics.

Note that this commit does not add the generated keymap-render.png file,
this file will be added to each themes image-dir separately as the color
of the pre-generated text may differ per theme.

Changes by Hans de Goede:
- Change generated metadata into a C header file
- Drop drawing of curved corners, we just want the text
- Add special handling for dvorak

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
zhaoqiang
8e578dce5b scripts: update file plymouth.spec to integrate recent fixes. 2019-09-04 07:25:15 +00:00
Hans de Goede
6117fe683b plymouth-populate-initrd: Don't assume the ImageDir is the theme-dir
Before this commit plymouth-populate-initrd was only recursively copying the
/usr/share/plymouth/themes/$PLYMOUTH_THEME_NAME to the initrd, assuming
that ImageDir will point there.

This makes it impossible for 2 themes to share their ImageDir, which is
desirable for example for the spinner and bgrt themes, which use the same
images with slightly different settings.

This commit also makes plymouth-populate-initrd also copy the ImageDir
if it is different from the theme-dir, making it possible for ImageDir
to point to a different dir.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-01-16 09:29:32 +01:00
Ray Strode
4ff6d59d10 populate-initrd: drop unused local variable
the inst_library function declares a variable `_lib`
that's completely unused.

This commit removes the declaration.
2018-10-15 21:02:50 -04:00
mike@mgoodwin.net
8982822bd8 populate-initrd: handle themes with subdirs
Not all distros use the upstream plymouth-populate-initrd
script to populate their initramfs.  As a consequence,
some themes have been developed that use subdirectories,
(which is not supported by plymouth-populate-initrd).

This commit adds support for that feature, so that
preexisting themes get properly installed.

https://bugs.freedesktop.org/show_bug.cgi?id=103424
2017-11-09 13:23:24 -05:00
Daniel Baumann
f9425978e1 scripts: Use >&2 instead of /dev/stderr
/dev/stderr isn't always available in chroots, so use
>&2 instead.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581649
https://bugs.freedesktop.org/show_bug.cgi?id=102388
2017-08-24 11:42:24 -04:00
Will Woods
22e0596c3f plymouth-populate-initrd: fix THEME_OVERRIDE with empty conf
If you set PLYMOUTH_THEME_NAME to override the theme in an initrd
(as e.g. lorax does when building upgrade.img), plymouth-populate-initrd
tries to edit plymouthd.conf to enable that theme.

Unfortunately, the existing `sed` line doesn't work if your
plymouthd.conf is empty or all commented out - which is how we currently
ship it.

So before modifying the config, make sure it has a [Daemon] section
header, and a Theme=[placeholder] line for us to modify.

Resolves: RHBZ#1223344
2016-05-20 16:31:01 -04:00
Ray Strode
9a58de52dd Revert "populate-initrd: support theme subfolders"
This reverts commit 3a60023f26.
2016-05-16 12:13:19 -04:00
Ray Strode
3a60023f26 populate-initrd: support theme subfolders
Some themes like to keep their content in subfolders,
but plymouth-populate-initrd currently fails to copy
those subfolders over to the initrd.

This commit fixes that.

https://bugzilla.gnome.org/show_bug.cgi?id=94883
2016-04-11 07:48:40 -04:00
Ray Strode
5e55bdb33e scripts: change out uncrustify config
I'm going to be updating the coding style of plymouth, so
this is the new uncrustify config.
2014-05-20 15:16:47 -04:00
Enrico Tagliavini
2d85c8d0a3 populate-initrd: install binaries to their configured location
If plymouth is configured --with-system-root-install=no then the
systemd unitd files will write the paths of plymouth and plymouthd
relative to /usr .  The script currently hardcodes installing them
to the initrd's /

This commit makes sure they get placed on the same part of the of
the initrd filesystem as systemd expects to find them.

https://bugs.freedesktop.org/show_bug.cgi?id=74174
2014-01-29 09:18:22 -05:00
Ray Strode
293e37ed93 scripts: plymouth-update-initrd should call dracut -f with no args
dracut -f does the right thing on it's own, so we shouldn't try
to overspecify it
2014-01-10 15:55:20 -05:00
Ray Strode
319448f651 scripts: make plymouth-update-initrd somewhat more useful
plymouth-update-initrd is a script that should probably be eventually
dropped.  It was originally created to unpack and initrd and graft
plymouth in.  Later, it just became a thin wrapper around mkinitrd.

These days, very few (any?) distros use mkinitrd.  Change it to call
dracut instead.

Relevant irc log:

<newfo> this is SO WRONG:
http://cgit.freedesktop.org/plymouth/tree/scripts/plymouth-update-initrd
<newfo> it won't work on any distro
<newfo> would you mind updating that please?
<newfo> replace the mkinitrd line in
/usr/libexec/plymouth/plymouth-update-initrd to  dracut -f
/boot/initramfs-$(uname -r).img $(uname -r)
<-- newfo has quit (Client Quit)
2013-10-15 09:52:46 -04:00
Ray Strode
8be792a5a7 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
2013-03-13 10:24:14 -04:00
Ville Skyttä
5ee5644f6c generate-initrd: Use pigz if available. 2013-02-12 17:33:19 -05:00
Will Woods
a9703fb6e3 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.
2012-11-29 17:14:44 -05:00
Ray Strode
c8e548d5e4 systemd: don't run read-write service from initrd
the initrd hits the local-fs.target as part of its normal
boot process.  We used to use local-fs.target as a way of
knowing the system / is read-write.  This no longer is a
valid mechanism.

This commit:

1) Stops installing plymouth-read-write service in the initrd
2) Makes it so if it does end up in the initrd it won't be
used

Related to fedora bug 830482
2012-07-26 13:05:22 -04:00