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

Colin Guthrie mageia at colin.guthr.ie
Sun Jul 15 00:59:22 CEST 2012


'Twas brillig, and Olivier Blin at 14/07/12 21:24 did gyre and gimble:
> Colin Guthrie <mageia at colin.guthr.ie> writes:
> 
>>> As there was a period where the symlink existed but the initrd did not,
>>> I am presuming running /sbin/install kernel exited correctly without
>>> creating the initrd.
>>>
>>> However, both plymouth and mageia-theme-Default seem to correctly honour
>>> DURING_INSTALL.
>>>
>>> I'm confused as to what is causing it to be generated... can anyone else
>>> see it?
>>
>>
>> Oh wait, I think I see it:
>>
>> 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.


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




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)!


Col
-- 

Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/




More information about the Mageia-dev mailing list