[Mageia-dev] MGA2 Installer + Bootloader stage issue: initrd regeneration not happening?

Olivier Blin mageia at blino.org
Sun Jul 15 15:16:44 CEST 2012


Colin Guthrie <mageia at colin.guthr.ie> writes:
>>> In the post of mageia-theme-Default it has:
>>>
>>> if [ "$1" == "0" ]; then
>>>   /usr/sbin/plymouth-set-default-theme -R Mageia-Default
>>> fi
>>>
>>>
>>> This causes an initrd rebuild (-R argument) and doesn't check
>>> DURING_INSTALL.
>>>
>>> That's the problem.
>> 
>> Ah, I did not see that one.
>
> Yeah I missed it the first two times I looked at it too :p
>
>> There are two calls to plymouth-set-default-theme in this %post.
>> Maybe we can just move the second one (with -R) upper to replace the
>> first one?
>
> Well I think we should just drop it completely...
>
>>From my reading, if we're not in the installer then
> /usr/share/bootsplash/scripts/switch-themes is used which takes care of
> regenerating initrd if needed.
>
> If we're in the install then plymouth-set-default-theme gets called
> anyway (without the -R). So to me it seems like this is just a redundant
> call.
>
> The only thing I'd suggest is that we add a -u argument to switch-themes
> to ensure it calls plymouth-set-default-theme internally.

It seems to be the contrary, switch-themes runs
plymouth-set-default-theme if no -u is supplied:
    if [[ -z $update ]]; then
            /usr/sbin/plymouth-set-default-theme $theme
    fi

> Although as we should likely try and phase out some of the black magic
> of these bootsplash scripts, I'd actually rather just do something like
> this in %post:
>
>
> if [ -f /usr/share/mga/backgrounds/Mageia.png -a ! -f
> /usr/share/mga/backgrounds/default.png -o -L
> /usr/share/mga/backgrounds/default.png ]; then
>   rm -f /usr/share/mga/backgrounds/default.png
>   ln -s Mageia-Default-1600x1200.png /usr/share/mga/backgrounds/default.png
> fi
>
> rm -f
> /usr/share/mga/backgrounds/Mageia-Default-{0000,0700,1300,1800}.jpg ||:
> rm -f /usr/share/mga/backgrounds/Mageia.xml ||:
> rm -f
> /usr/share/mdk/backgrounds/Mandriva-{Free,Flash,One,Powerpack}-{0000,0700,1300,1800}.jpg
> ||:
> rm -f /usr/share/mdk/backgrounds/Mandriva.xml ||:
>
> if [ -z "$DURING_INSTALL" ]; then
>   if [ -x /usr/share/bootsplash/scripts/switch-themes ]; then
>     /usr/share/bootsplash/scripts/switch-themes Mageia-Default
>   fi
> fi
> if [ -f /etc/sysconfig/bootsplash ]; then
>   perl -pi -e 's/^s*SPLASH=.*/SPLASH=auto/;
> s/^s*THEME=.*/THEME=Mageia-Default/' /etc/sysconfig/bootsplash
> fi
> /usr/sbin/plymouth-set-default-theme Mageia-Default

This %post script always looked a bit convoluted to me, couldn't we move
all this in the switch-themes script?
We could even check directly DURING_INSTALL in there, since DrakX's
bootloader is not using this script to add the splash.

That way, the %post script could be a one-liner, and reused easily in
other theme packages.

> That seems to be the right thing to do generally for now and good enough
> for an update (can you review and give your opinion?), but longer term,
> I'd rather get rid of /etc/sysconfig/bootsplash completely in favour of
> other ways to control the theme (e.g. using plymouth-set-theme directly,
> and tweaking kernel command line options to either use or not the
> plymouth support in the initrd. If users really want to strip plymouth
> from the initrd they can drop a config in /etc/dracut.conf.d/ to put a line:
>  omit_dracutmodules+=" plymouth "
>
> which will prevent plymouth support in any subsequently generated initrd
> (although if the "silent" kernel param is presented and plymouth is
> still installed then it will still kick in after the initrd is finished
> and the main system takes over.
>
> So uninstall plymouth is likely the best option for the purists (and I
> may need to tweak dracut requires on that front)!

Ok

-- 
Olivier Blin - blino


More information about the Mageia-dev mailing list