[oe] update-alternatives problems

Rodrigo Vivi rodrigo.vivi at gmail.com
Thu Aug 2 23:52:22 UTC 2007


http://bugs.openembedded.org/show_bug.cgi?id=2102

Now u-a accept both ways: relative and full path, but I still believe
that the more coherent way is to change all OE to support just the
full path alternative.

Thanks,
vivijim


On 7/26/07, Rodrigo Vivi <rodrigo.vivi at gmail.com> wrote:
> Hi all,
>
> I have some doubts about the update-alternatives scheme.
>
> Why to have 2 ways to create an update-alternatives entry in the
> postinst script? One is setting ALTERNATIVES_* variables inheriting
> the update-alternatives.bbclass and the other is to write the function
>  pkg_postinst_${PN} () containing the update-alternatives commands.
> What is the big difference?
>
> For example in sysvinit_2.86.bb there are both methods.
> ALTERNATIVES_* for init
> and the function for {halt,reboot,shutdown,last,mesg,wall}
>
> I believe that there is a good reason for that, but what I believe
> that is wrong is:
>
> when using the ALTERNATIVES_* the path is ritght like in the init case
> ALTERNATIVE_PATH = ${base_sbindir}/init.sysvinit
> so this is the right update-alternatives command in postinst script:
> update-alternatives --install /sbin/init init /sbin/init.sysvinit 50
>
> But when in function the path are wrong (it aren't complete):
> update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 200
> So the line in postinst script is that:
> update-alternatives --install /sbin/halt halt halt.sysvinit 200
> instead of a complete one
> update-alternatives --install /sbin/halt halt /sbin/halt.sysvinit 200
>
> Someday in past I've noticed that all of my links of
> update-alternatives was broke  because this incomplete path so I did a
> patch to update-alternatives-dpkg package to take the begin of path
> (/sbin) for the link one (/sbin/halt) generating a path link
> /sbin/halt.sysvinit fixing all cases that I knew. It was working fine
> until today when I saw that my init link was pointing to
> /sbin//sbin/init.sysvinit and breaking my initialization.
>
> I believe that you don't have this error because update-alternatives
> of ipkg works different, right?
>
> What do you believe that is better? change all bb to have a standard?
> or code a patch of my patch to make update-alternatives-dpkg check if
> the path is right before try to get the begin of the link?
>
> Regards
>
> Rodrigo Vivi
> INdT - Instituto Nokia de Tecnologia
> Blog: http://blog.vivi.eng.br
> GPG: 0x905BE242 @ wwwkeys.pgp.net
>


-- 
Rodrigo Vivi
INdT - Instituto Nokia de Tecnologia
Blog: http://blog.vivi.eng.br
GPG: 0x905BE242 @ wwwkeys.pgp.net




More information about the Openembedded-devel mailing list