I traced switch-themes back through a chain of perl/shell scripts and found the script that does the initrd change.
Line 102 of switch-themes is where the chain starts.
And it goes:
(shell) switch-themes > (perl) bootloader-config > (perl) bootloader > (shell) make-boot-splash > (shell) make-boot-splash-raw
None of the above scripts but make-boot-splash-raw do much more than call the next one.
This file is the last one:
Oddly, it contains this comment:
# Avoid duplicate files, adding another copy of glibc each time makes
# initrd grow fast
I don't know anything about the initrd though. (beyond that it contains startup modules)
So, I can't fix it.
I also wonder why all of that stuff going on in that script is necessary, because making a new initrd with mkinitrd takes just a few seconds.
I think Line 102 (and corresponding if statement) of switch-themes could changed to plymouth-update-initrd, but this needs testing.
I wonder if it's possible to switch plymouth themes and leave bootsplash out of it. Have you ever seen a bootsplash since using plymouth?
plymouth-set-default-theme $theme_name --rebuild-initrd
Does the same thing as "switch-themes $theme_name", but doesn't have the "increasing initrd size" problem.
Another option would be to trap a signal destroy event and restore the original initrd or something like that ?
It would prevent scaring the day lights out of our users.
I tried running switch-themes in the background originally because it is immuned to what happens afterwards in the foreground. But it's a bad thing to have to guess when it's done.
I had a similar idea of backing up the original initrd, but I didn't try trapping the destroy event.
I'm gonna try it out now.
EDIT: no dice;