Patchwork systemd 208: move stray /usr/lib/systemd/* into /lib/systemd

login
register
mail settings
Submitter Koen Kooi
Date Jan. 21, 2014, 11:01 a.m.
Message ID <1390302081-29499-1-git-send-email-koen.kooi@linaro.org>
Download mbox | patch
Permalink /patch/65317/
State New
Headers show

Comments

Koen Kooi - Jan. 21, 2014, 11:01 a.m.
From: Koen Kooi <koen@dominion.thruhere.net>

Apps testing for systemd config get confused when both /usr/lib/systemd and /lib/systemd exist. This fixes (among other things) dracut systemd detections.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/recipes-core/systemd/systemd_208.bb | 6 ++++++
 1 file changed, 6 insertions(+)
Martin Jansa - Jan. 21, 2014, 1:01 p.m.
On Tue, Jan 21, 2014 at 12:01:21PM +0100, Koen Kooi wrote:
> From: Koen Kooi <koen@dominion.thruhere.net>
> 
> Apps testing for systemd config get confused when both /usr/lib/systemd and /lib/systemd exist. This fixes (among other things) dracut systemd detections.
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
>  meta/recipes-core/systemd/systemd_208.bb | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
> index 6590235..710624c 100644
> --- a/meta/recipes-core/systemd/systemd_208.bb
> +++ b/meta/recipes-core/systemd/systemd_208.bb
> @@ -113,6 +113,12 @@ do_install() {
>  
>          # Delete journal README, as log can be symlinked inside volatile.
>          rm -f ${D}/${localstatedir}/log/README
> +
> +	# fix up libdir confusion
> +	if [ -d ${D}${libdir}/systemd ] ; then
> +		cp -a ${D}${libdir}/systemd/* ${D}${systemd_unitdir}
> +		rm -rf ${D}${libdir}/systemd
> +	fi

It's not your fault, but the indentation looks inconsistent with rest of
do_install()

>  }
>  
>  do_install_ptest () {
> -- 
> 1.8.4.2
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Koen Kooi - Jan. 21, 2014, 1:02 p.m.
On 01/21/2014 02:01 PM, Martin Jansa wrote:
> On Tue, Jan 21, 2014 at 12:01:21PM +0100, Koen Kooi wrote:
>> From: Koen Kooi <koen@dominion.thruhere.net>
>>
>> Apps testing for systemd config get confused when both /usr/lib/systemd and /lib/systemd exist. This fixes (among other things) dracut systemd detections.
>>
>> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
>> ---
>>   meta/recipes-core/systemd/systemd_208.bb | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
>> index 6590235..710624c 100644
>> --- a/meta/recipes-core/systemd/systemd_208.bb
>> +++ b/meta/recipes-core/systemd/systemd_208.bb
>> @@ -113,6 +113,12 @@ do_install() {
>>
>>           # Delete journal README, as log can be symlinked inside volatile.
>>           rm -f ${D}/${localstatedir}/log/README
>> +
>> +	# fix up libdir confusion
>> +	if [ -d ${D}${libdir}/systemd ] ; then
>> +		cp -a ${D}${libdir}/systemd/* ${D}${systemd_unitdir}
>> +		rm -rf ${D}${libdir}/systemd
>> +	fi
>
> It's not your fault, but the indentation looks inconsistent with rest of
> do_install()

And I did especially pay attention to use tabs after all the meta-oe 
patches I did :)
Koen Kooi - March 13, 2014, 9:09 a.m.
Op 21 jan. 2014, om 14:02 heeft Koen Kooi <koen.kooi@linaro.org> het volgende geschreven:

> On 01/21/2014 02:01 PM, Martin Jansa wrote:
>> On Tue, Jan 21, 2014 at 12:01:21PM +0100, Koen Kooi wrote:
>>> From: Koen Kooi <koen@dominion.thruhere.net>
>>> 
>>> Apps testing for systemd config get confused when both /usr/lib/systemd and /lib/systemd exist. This fixes (among other things) dracut systemd detections.
>>> 
>>> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
>>> ---
>>>  meta/recipes-core/systemd/systemd_208.bb | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>> 
>>> diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
>>> index 6590235..710624c 100644
>>> --- a/meta/recipes-core/systemd/systemd_208.bb
>>> +++ b/meta/recipes-core/systemd/systemd_208.bb
>>> @@ -113,6 +113,12 @@ do_install() {
>>> 
>>>          # Delete journal README, as log can be symlinked inside volatile.
>>>          rm -f ${D}/${localstatedir}/log/README
>>> +
>>> +	# fix up libdir confusion
>>> +	if [ -d ${D}${libdir}/systemd ] ; then
>>> +		cp -a ${D}${libdir}/systemd/* ${D}${systemd_unitdir}
>>> +		rm -rf ${D}${libdir}/systemd
>>> +	fi
>> 
>> It's not your fault, but the indentation looks inconsistent with rest of
>> do_install()
> 
> And I did especially pay attention to use tabs after all the meta-oe patches I did :)

Ping
Richard Purdie - March 14, 2014, 1:41 a.m.
On Thu, 2014-03-13 at 10:09 +0100, Koen Kooi wrote:
> Op 21 jan. 2014, om 14:02 heeft Koen Kooi <koen.kooi@linaro.org> het volgende geschreven:
> 
> > On 01/21/2014 02:01 PM, Martin Jansa wrote:
> >> On Tue, Jan 21, 2014 at 12:01:21PM +0100, Koen Kooi wrote:
> >>> From: Koen Kooi <koen@dominion.thruhere.net>
> >>> 
> >>> Apps testing for systemd config get confused when both /usr/lib/systemd and /lib/systemd exist. This fixes (among other things) dracut systemd detections.
> >>> 
> >>> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> >>> ---
> >>>  meta/recipes-core/systemd/systemd_208.bb | 6 ++++++
> >>>  1 file changed, 6 insertions(+)
> >>> 
> >>> diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
> >>> index 6590235..710624c 100644
> >>> --- a/meta/recipes-core/systemd/systemd_208.bb
> >>> +++ b/meta/recipes-core/systemd/systemd_208.bb
> >>> @@ -113,6 +113,12 @@ do_install() {
> >>> 
> >>>          # Delete journal README, as log can be symlinked inside volatile.
> >>>          rm -f ${D}/${localstatedir}/log/README
> >>> +
> >>> +	# fix up libdir confusion
> >>> +	if [ -d ${D}${libdir}/systemd ] ; then
> >>> +		cp -a ${D}${libdir}/systemd/* ${D}${systemd_unitdir}
> >>> +		rm -rf ${D}${libdir}/systemd
> >>> +	fi
> >> 
> >> It's not your fault, but the indentation looks inconsistent with rest of
> >> do_install()
> > 
> > And I did especially pay attention to use tabs after all the meta-oe patches I did :)
> 
> Ping

This kind of patch sets off all the alarm bells. Why? It becomes
impossible to know which recipes this is fixing and whether there are
other underlying issues. Once added it would be near impossible to
remove or improve upon.

I'd much rather we fix recipes to put files into the correct location
and thrown errors if they put files somewhere incorrect.

I appreciate its tempting to hack around it but I'm not keen...

Cheers,

Richard
Koen Kooi - March 14, 2014, 7:59 a.m.
Op 14 mrt. 2014, om 02:41 heeft Richard Purdie <richard.purdie@linuxfoundation.org> het volgende geschreven:

> On Thu, 2014-03-13 at 10:09 +0100, Koen Kooi wrote:
>> Op 21 jan. 2014, om 14:02 heeft Koen Kooi <koen.kooi@linaro.org> het volgende geschreven:
>> 
>>> On 01/21/2014 02:01 PM, Martin Jansa wrote:
>>>> On Tue, Jan 21, 2014 at 12:01:21PM +0100, Koen Kooi wrote:
>>>>> From: Koen Kooi <koen@dominion.thruhere.net>
>>>>> 
>>>>> Apps testing for systemd config get confused when both /usr/lib/systemd and /lib/systemd exist. This fixes (among other things) dracut systemd detections.
>>>>> 
>>>>> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
>>>>> ---
>>>>> meta/recipes-core/systemd/systemd_208.bb | 6 ++++++
>>>>> 1 file changed, 6 insertions(+)
>>>>> 
>>>>> diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
>>>>> index 6590235..710624c 100644
>>>>> --- a/meta/recipes-core/systemd/systemd_208.bb
>>>>> +++ b/meta/recipes-core/systemd/systemd_208.bb
>>>>> @@ -113,6 +113,12 @@ do_install() {
>>>>> 
>>>>>         # Delete journal README, as log can be symlinked inside volatile.
>>>>>         rm -f ${D}/${localstatedir}/log/README
>>>>> +
>>>>> +	# fix up libdir confusion
>>>>> +	if [ -d ${D}${libdir}/systemd ] ; then
>>>>> +		cp -a ${D}${libdir}/systemd/* ${D}${systemd_unitdir}
>>>>> +		rm -rf ${D}${libdir}/systemd
>>>>> +	fi
>>>> 
>>>> It's not your fault, but the indentation looks inconsistent with rest of
>>>> do_install()
>>> 
>>> And I did especially pay attention to use tabs after all the meta-oe patches I did :)
>> 
>> Ping
> 
> This kind of patch sets off all the alarm bells. Why? It becomes
> impossible to know which recipes this is fixing

It's fixing the systemd_208.bb recipe to address runtime issues with systemd itself (ignored files in the wrong dir) and issues with runtime rootlibdir detection by e.g. dracut. I'm working on a patch for dracut to check for systemd binaries instead of 'if [ -d /usr/lib/systemd/systemd ]', but I suspect there are a lot more scripts out there with similar (broken) logic.

> and whether there are
> other underlying issues.

The underlying issue is that upstream doesn't really care for rootlibdir != /usr/lib, which means bugs like this happen :(

> Once added it would be near impossible to
> remove or improve upon.
> 
> I'd much rather we fix recipes to put files into the correct location
> and thrown errors if they put files somewhere incorrect.
> 
> I appreciate its tempting to hack around it but I'm not keen...

Systemd 211 should have a partial fix for this, but you still need patching for the case where rootlibdir != /usr/lib

regards,

Koen

Patch

diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
index 6590235..710624c 100644
--- a/meta/recipes-core/systemd/systemd_208.bb
+++ b/meta/recipes-core/systemd/systemd_208.bb
@@ -113,6 +113,12 @@  do_install() {
 
         # Delete journal README, as log can be symlinked inside volatile.
         rm -f ${D}/${localstatedir}/log/README
+
+	# fix up libdir confusion
+	if [ -d ${D}${libdir}/systemd ] ; then
+		cp -a ${D}${libdir}/systemd/* ${D}${systemd_unitdir}
+		rm -rf ${D}${libdir}/systemd
+	fi
 }
 
 do_install_ptest () {