Bug 103424 - [Patch] scripts [plymouth-populate-initrd.in]: Add inst_recur for adding themes recursively
Summary: [Patch] scripts [plymouth-populate-initrd.in]: Add inst_recur for adding them...
Status: RESOLVED FIXED
Alias: None
Product: plymouth
Classification: Unclassified
Component: script plugin (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Charlie Brej
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-23 14:22 UTC by mike
Modified: 2017-11-09 18:25 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to plymouth-populate-initrd.in for adding themes recursively (2.06 KB, patch)
2017-10-23 14:22 UTC, mike
Details | Splinter Review

Description mike 2017-10-23 14:22:52 UTC
Created attachment 135014 [details] [review]
Patch to plymouth-populate-initrd.in for adding themes recursively

Follow up to my mailing list post that didn't manage to grab any attention: https://lists.freedesktop.org/archives/plymouth/2017-October/000855.html

In my eyes this is both a bug, because I believe it should add themes recursively already and that was perhaps an oversight, but possibly an enhancement because it adds "new functionality." I had a hard time deciding on which, so I left it at normal. 


Paste from original message:
--------------------------------------

Hi, 

I'm submitting this patch because I have encountered problems with dracut 
being able to include anything but flat themes. Some themes such as "plymouth-
theme-breeze" contain directories with images (in this case ./images) and I 
believe the script scripts/plymouth-populate-initrd.in should handle this 
better, as well as the dracut-only script `modules.d/50plymouth/plymouth-
populate-initrd.sh` for which I will be contacting that project separately.

I'm pasting the patch inline below for reading, and including it as a file for 
your convenience.

Thanks,

Mike

-----------------------------------

Please see the attached patch.
Comment 1 Ray Strode [halfline] 2017-11-09 15:04:19 UTC
i don't get it... we've never allowed subdirectories, so how are themes getting made with directories?

I mean I guess we can allow it, but it's *weird that there are themes in the wild that do something that never worked*
Comment 2 mike 2017-11-09 18:11:36 UTC
We were also confused at first why such a theme would even exist if in testing they would have never been able to use subdirectories.. as it turns out it's mostly for non-technical aesthetics:

https://bugs.kde.org/show_bug.cgi?id=371276#c20

(In reply to Harald Sitter from comment #20)
> 16bit compatibility heavily relies on the fact that all 16bit versions of
> the assets are in a different path (code-wise 16bit compat is a matter of
> switching the "root" image path from the 32bit dir to the 16bit dir).
> Without subdirs one would have to mutate the actual file names `if(16bit) {
> foo_16.png } else { foo.png }` for each file, or, well, not have 16bit
> compat (which probably doesn't affect many systems anyway).
> 
> Beyond that the non-technical downside is of course that the directory is a
> mess when flattened (there are some 80 images between 32bit and 16bit),
> which is the other reason the theme uses subdirs to begin with.


Rex and I have gone back and forth discussing whether to patch the theme or patch plymouth/dracut and there doesn't seem to be any reason *not* to. There are some compelling reasons to allow directories in themes, and no reasons that I can tell not to include them in the initramfs. (specifically because it does work)

As for the reason it works for them and not us, they don't use our tooling at all when it comes to initramfs generation, and also don't defer to the plymouth script and instead using something called libply-script?

What appears to have happened here is that while plymouth doesn't officially support non-flat themes, they discovered that it does work with them without issue when they built their tooling around this concept: i.e. update-initramfs, and the fact that this portion (https://cgit.freedesktop.org/plymouth/tree/src/plugins/splash/script) of plymouth does seem to support them. (according to Harald) 

In the end, themes with sub-directories do work, if the initramfs is loaded with those files and at present both the plymouth script that dracut defers to AND the fallback script inside of dracut itself only support bundling ./* with no recursion.

I don't know much about plymouth or dracut development, but from my overview of the scripts (both) it seemed there was a strong trend of trying to remain as pure bash as possible so that's why I wrote that patch the way I did instead of simply using find, which I guess makes sense since it's for an initrd.

So, we're at a bit of am impasse here and the "most correct" way forward seems to be to just update the scripts to bundle theme subdirs into the initramfs. Initially, I had set out only to patch dracut because it seemed at first that it was dracut's problem until I realized that dracut relies on this script first, and falls back to its own second (which I found out because I patched dracut and nothing changed)

Thanks
Comment 3 Ray Strode [halfline] 2017-11-09 18:25:09 UTC
Alright, pushed.

To ssh://git.freedesktop.org/git/plymouth

   bdfcf88..8982822  master -> master

https://cgit.freedesktop.org/plymouth/commit/?id=8982822bd8590dcebf14554ed9ce012f4ead45f9

Thanks for the patch.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.