nikp123 / minecraft-plymouth-theme

MIT License
16 stars 0 forks source link

Top line displayed in wrong font when booting #2

Open Lxtharia opened 1 month ago

Lxtharia commented 1 month ago

Hey! I finally got around to try this and I love it. (A pity my arch boots so fast, i only get to look at it for max 2 seconds).

I have an issue where, when I boot, the line that says "Booting OS" is not displayed in the Minecraft font, the messages below are though.

Thanks!

Lxtharia commented 1 month ago

Ok, the problem was, that there was no /usr/lib/plymouth/label.so but rather two seperate ones:

/usr/lib/plymouth/label-pango.so 
/usr/lib/plymouth/label-freetype.so

so I changed it in dracut/99-minecraft-plymouth.conf and it worked!

Lxtharia commented 1 month ago

Sorry for re-opening, I'm trying it with mkinitcpio and the problem's there again.

I ran the ./install.sh and put this into my /etc/mkinitcpio.conf:

FILES=( /usr/lib/plymouth/label-freetype.so
    /usr/lib/plymouth/label-pango.so
    /usr/lib/plymouth/text.so
    /usr/share/fonts/OTF/Minecraft.otf
    /etc/fonts/fonts.conf
    /etc/fonts/conf.d/00-minecraft.conf
)

Which should do the same as the dracut drop-in, but for mkinitcpio.

When running lsinitrd /boot/initramfs-linux.img i also find all of the files got included.

It's also very weird that it's only the "Booting OS" text that's in the wrong font.

nikp123 commented 1 month ago

It's also very weird that it's only the "Booting OS" text that's in the wrong font.

Could not replicate after 1 hour of trying, both texts seem to use the wrong font. The problem is that Plymouth doesn't really offer a neat way of controlling the fonts and text.

Lxtharia commented 1 month ago

So its never explicitly set? I may try it later, but what if I just remove all other fonts? Maybe it'll display nothing or crash, but might be worth the shot

nikp123 commented 1 month ago

So its never explicitly set? I may try it later, but what if I just remove all other fonts? Maybe it'll display nothing or crash, but might be worth the shot

It is, but the method relies on fontconfig actually figuring out WHAT font file I want to set as opposed to setting it directly, like you would in SDL_ttf for example.

For reference see this

Lxtharia commented 3 weeks ago

I figured out how to get debug messages. It looks like it fails to find one shared object because this happens before a newroot is set. I tried setting ShowDelay=2 in the config and it seems the font gets loaded then. Only for a split second though, because the OS boots too quickly :(

Is there a way to set the font just after this newroot? Or put the font somewhere it is always found?

Thanks.

...
129   │ 00:00:04.475 ../plymouth-24.004.60/src/libply-splash-core/ply-boot-splash.c: adding 1920x1080 pixel display
 130   │ 00:00:04.475 ../plymouth-24.004.60/src/libply-splash-core/ply-device-manage: activating renderers
 131   │ 00:00:04.475 ../plymouth-24.004.60/src/libply-splash-core/ply-boot-splash.c: showing splash screen
 132   │ 00:00:04.475 ../plymouth-24.004.60/src/plugins/splash/script/plugin.c:434:s: starting boot animation
 133   │ 00:00:04.475 ../plymouth-24.004.60/src/plugins/splash/script/plugin.c:303:s: parsing script file
 134   │ 00:00:04.479 ../plymouth-24.004.60/src/plugins/splash/script/plugin.c:280:s: executing script file
 135   │ 00:00:04.489 ../plymouth-24.004.60/src/libply/ply-utils.c:549:ply_open_modu: Could not load module "/usr/lib/plymouth/label-pango.so": libcairo.so.2: cannot open 
       │ shared object file: No such file or directory
 136   │ 00:00:04.492 ../plymouth-24.004.60/src/plugins/controls/label-freetype/plug: Text 'Booting OS' has dimensions 211x55
 137   │ 00:00:04.492 ../plymouth-24.004.60/src/libply-splash-graphics/ply-label.c:8: Unloading label control plugin
 138   │ 00:00:04.492 ../plymouth-24.004.60/src/libply/ply-utils.c:549:ply_open_modu: Could not load module "/usr/lib/plymouth/label-pango.so": libcairo.so.2: cannot open 
       │ shared object file: No such file or directory
 139   │ 00:00:04.493 ../plymouth-24.004.60/src/plugins/controls/label-freetype/plug: Text 'Booting OS' has dimensions 211x55
 140   │ 00:00:04.493 ../plymouth-24.004.60/src/libply-splash-graphics/ply-label.c:8: Unloading label control plugin
 141   │ 00:00:04.499 ../plymouth-24.004.60/src/plugins/renderers/drm/plugin.c:749:p: Creating buffer for 1920x1080 renderer head
 142   │ 00:00:04.499 ../plymouth-24.004.60/src/plugins/renderers/drm/plugin.c:253:p: returning 1920x1080 buffer with stride 7680
 143   │ 00:00:04.499 ../plymouth-24.004.60/src/plugins/renderers/drm/plugin.c:757:p: Mapping buffer for 1920x1080 renderer head
 144   │ 00:00:04.499 ../plymouth-24.004.60/src/plugins/renderers/drm/plugin.c:938:a: taking master and scanning out
 145   │ 00:00:04.502 ../plymouth-24.004.60/src/plugins/renderers/drm/plugin.c:711:p: Setting scan out buffer of 1920x1080 head to our buffer
 146   │ 00:00:04.536 ../plymouth-24.004.60/src/plugins/renderers/drm/plugin.c:1758:: Needed to reset scan out buffer on 1920x1080 renderer head
 147   │ 00:00:04.536 ../plymouth-24.004.60/src/libply-splash-core/ply-boot-splash.c: (this is an initial showing)
 148   │ 00:00:04.536 ../plymouth-24.004.60/src/libply-splash-core/ply-boot-splash.c: Pausing 1 already added displays
 149   │ 00:00:04.536 ../plymouth-24.004.60/src/libply-splash-core/ply-device-manage: activating keyboards
 150   │ 00:00:04.536 ../plymouth-24.004.60/src/libply-splash-core/ply-keyboard.c:37: Watching for keyboard input from renderer
 151   │ 00:00:04.537 ../plymouth-24.004.60/src/libply/ply-event-loop.c:1142:ply_eve: freeing destination (1, 0x5f50168ad310, 0x5f50168b0ea0) of fd 13
 152   │ 00:00:04.700 ../plymouth-24.004.60/src/ply-boot-server.c:395:print_connecti: connection is from pid 319 (plymouth update-root-fs --new-root-dir=/new_root) with pa
       │ rent pid 1 (/usr/bin/ash /init splash)
 153   │ 00:00:04.700 ../plymouth-24.004.60/src/ply-boot-server.c:714:ply_boot_conne: got newroot request
 154   │ 00:00:04.700 ../plymouth-24.004.60/src/main.c:668:on_newroot               : new root mounted at "/new_root", switching to it
 155   │ 00:00:04.700 ../plymouth-24.004.60/src/main.c:711:get_cache_file_for_mode  : returning cache file '/var/lib/plymouth/boot-duration'
 156   │ 00:00:04.702 ../plymouth-24.004.60/src/libply/ply-event-loop.c:1142:ply_eve: freeing destination (1, 0x5f50168ad310, 0x5f50168b0ea0) of fd 13
 157   │ 00:00:05.357 ../plymouth-24.004.60/src/ply-boot-server.c:391:print_connecti: connection is from toplevel init process (/sbin/init splash)
 158   │ 00:00:05.357 ../plymouth-24.004.60/src/ply-boot-server.c:446:ply_boot_conne: got update request
 159   │ 00:00:05.357 ../plymouth-24.004.60/src/main.c:192:on_update                : updating status to '-.mount'
 160   │ 00:00:05.436 ../plymouth-24.004.60/src/plugins/controls/label-pango/plugin.: Text '-.mount' has dimensions 176x42
 161   │ 00:00:05.436 ../plymouth-24.004.60/src/plugins/controls/label-pango/plugin.: Text '-.mount' has dimensions 176x42
 162   │ 00:00:05.436 ../plymouth-24.004.60/src/plugins/controls/label-pango/plugin.: Text '-.mount' has dimensions 176x42
 163   │ 00:00:05.437 ../plymouth-24.004.60/src/libply-splash-graphics/ply-label.c:8: Unloading label control plugin
 164   │ 00:00:05.437 ../plymouth-24.004.60/src/plugins/controls/label-pango/plugin.: Text '-.mount' has dimensions 176x42
 165   │ 00:00:05.437 ../plymouth-24.004.60/src/plugins/controls/label-pango/plugin.: Text '-.mount' has dimensions 176x42
 166   │ 00:00:05.437 ../plymouth-24.004.60/src/plugins/controls/label-pango/plugin.: Text '-.mount' has dimensions 176x42
 167   │ 00:00:05.437 ../plymouth-24.004.60/src/libply-splash-graphics/ply-label.c:8: Unloading label control plugin...
...
nikp123 commented 3 weeks ago

@Lxtharia where is the log displayed, in the console=whatever or in some log file?

nikp123 commented 3 weeks ago

I tried setting ShowDelay=2 in the config and it seems the font gets loaded then. Only for a split second though, because the OS boots too quickly :(

My guess that it's still missing a so file which fails to load before root gets mounted, after which when it gets mounted it's able to load in the font just fine when you add the delay.

Lxtharia commented 3 weeks ago

The logs are in /var/log/plymouth-debug.log when booting with plymouth.debug kernel parameters.

It seems this is a packaging issue on Arch (which I use btw) after I found this upstream issue: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/248

nikp123 commented 3 weeks ago

It seems this is a packaging issue on Arch (which I use btw) after I found this upstream issue: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/248

Well in that case I am fine with a workaround, because I don't want to needlessly bog down people with doing things the right way and waiting for upstream to wake from its slumber (people have more important stuff to do).

nikp123 commented 3 weeks ago

But sadly distrobox broke again so I couldn't test this anymore without reinstalling arch on bare metal.