mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] systemd: use install_alternative_tree
@ 2012-11-14 20:51 George McCollister
  2012-11-16 10:47 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: George McCollister @ 2012-11-14 20:51 UTC (permalink / raw)
  To: ptxdist

The contents of the following often need to be customized:
 /etc/systemd/system
 /lib/systemd/system
 /usr/lib/tmpfiles.d

Using install_alternative_tree instead of install_tree will allow
customizations.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
---
 rules/systemd.make | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rules/systemd.make b/rules/systemd.make
index 4d3cace..0f78553 100644
--- a/rules/systemd.make
+++ b/rules/systemd.make
@@ -199,8 +199,8 @@ endif
 		/etc/systemd/journald.conf)
 	@$(call install_alternative, systemd, 0, 0, 0644, \
 		/etc/systemd/logind.conf)
-	@$(call install_tree, systemd, 0, 0, -, /etc/systemd/system/)
-	@$(call install_tree, systemd, 0, 0, -, /usr/lib/tmpfiles.d/)
+	@$(call install_alternative_tree, systemd, 0, 0, /etc/systemd/system/)
+	@$(call install_alternative_tree, systemd, 0, 0, /usr/lib/tmpfiles.d/)
 	@$(call install_copy, systemd, 0, 0, 0644, -, /lib/udev/rules.d/99-systemd.rules)
 	@$(call install_tree, systemd, 0, 0, -, /etc/dbus-1/system.d/)
 	@$(call install_tree, systemd, 0, 0, -, /usr/share/polkit-1/actions/)
@@ -209,7 +209,7 @@ endif
 	@$(call install_copy, systemd, 0, 0, 0644, -, /usr/share/systemd/kbd-model-map)
 
 #	# units
-	@$(call install_tree, systemd, 0, 0, -, /lib/systemd/system/)
+	@$(call install_alternative_tree, systemd, 0, 0, /lib/systemd/system/)
 
 	@$(call install_alternative, systemd, 0, 0, 0644, /etc/vconsole.conf)
 
-- 
1.7.11.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] systemd: use install_alternative_tree
  2012-11-14 20:51 [ptxdist] [PATCH] systemd: use install_alternative_tree George McCollister
@ 2012-11-16 10:47 ` Michael Olbrich
  2012-11-28 18:45   ` George McCollister
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2012-11-16 10:47 UTC (permalink / raw)
  To: ptxdist

On Wed, Nov 14, 2012 at 02:51:30PM -0600, George McCollister wrote:
> The contents of the following often need to be customized:
>  /etc/systemd/system

What do you need to change here?

>  /lib/systemd/system

This makes no sense. install_alternative_tree chooses the whole tree from
multiple locations, not individual files. Copying the whole tree is really
overkill. You can overwrite anything here by installing the same files in
/etc/systemd/system anyways.

>  /usr/lib/tmpfiles.d

No. These are needed and you can add your own files in a separate package.

Michael

> Using install_alternative_tree instead of install_tree will allow
> customizations.
> 
> Signed-off-by: George McCollister <george.mccollister@gmail.com>
> ---
>  rules/systemd.make | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/rules/systemd.make b/rules/systemd.make
> index 4d3cace..0f78553 100644
> --- a/rules/systemd.make
> +++ b/rules/systemd.make
> @@ -199,8 +199,8 @@ endif
>  		/etc/systemd/journald.conf)
>  	@$(call install_alternative, systemd, 0, 0, 0644, \
>  		/etc/systemd/logind.conf)
> -	@$(call install_tree, systemd, 0, 0, -, /etc/systemd/system/)
> -	@$(call install_tree, systemd, 0, 0, -, /usr/lib/tmpfiles.d/)
> +	@$(call install_alternative_tree, systemd, 0, 0, /etc/systemd/system/)
> +	@$(call install_alternative_tree, systemd, 0, 0, /usr/lib/tmpfiles.d/)
>  	@$(call install_copy, systemd, 0, 0, 0644, -, /lib/udev/rules.d/99-systemd.rules)
>  	@$(call install_tree, systemd, 0, 0, -, /etc/dbus-1/system.d/)
>  	@$(call install_tree, systemd, 0, 0, -, /usr/share/polkit-1/actions/)
> @@ -209,7 +209,7 @@ endif
>  	@$(call install_copy, systemd, 0, 0, 0644, -, /usr/share/systemd/kbd-model-map)
>  
>  #	# units
> -	@$(call install_tree, systemd, 0, 0, -, /lib/systemd/system/)
> +	@$(call install_alternative_tree, systemd, 0, 0, /lib/systemd/system/)
>  
>  	@$(call install_alternative, systemd, 0, 0, 0644, /etc/vconsole.conf)
>  
> -- 
> 1.7.11.2
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] systemd: use install_alternative_tree
  2012-11-16 10:47 ` Michael Olbrich
@ 2012-11-28 18:45   ` George McCollister
  2012-11-29 14:37     ` George McCollister
  0 siblings, 1 reply; 4+ messages in thread
From: George McCollister @ 2012-11-28 18:45 UTC (permalink / raw)
  To: ptxdist

My solution was bad but I think there are some issues that need to be 
resolved.

The serial-getty@.service provided by systemd uses agetty instead of 
busybox getty. Like you suggested I can install a modified copy to 
/etc/systemd/system in a different package (a custom package or maybe 
busybox should have an option to install service file for getty?)

This still leaves me with the problem that systemd installs 
/etc/systemd/system/getty.target.wants/getty@tty1.service linked to 
/lib/systemd/system/getty@.service. Since this platform doesn't have 
tty1 I figured I would remove that link and instead link 
/etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service to 
/etc/systemd/system/serial-getty@.service. Maybe I'm going about this 
wrong as well, can you suggest a solution to deal with this situation?

Should any of the files installed to /lib/systemd/system by systemd be 
optional or omitted? I'm not too concerned with this although I suspect 
some space is being wasted.

Right now journald.conf, logind.conf, system.conf, user.conf are just 
place holders. Seems like it would be a good idea if these could be 
overridden by files provided in projectroot and possibly be marked as 
config files so they are preserved during package upgrade. Unless you 
decide to change it upstream I think I will probably end up changing 
everything in this directory to be installed individually with 
install_config

Another systemd related problem I see is that packages (utelnetd for 
instance) installing their unit files to /lib/systemd/system make the 
incorrect assumption that I also want the unit enabled. This is also a 
problem because if I disable the service manually it will be re-enabled 
if that package is upgraded with opkg since the symlink is not marked as 
a config file.

I agree with your suggestion for /usr/lib/tmpfiles.d.


On 11/16/2012 04:47 AM, Michael Olbrich wrote:
> On Wed, Nov 14, 2012 at 02:51:30PM -0600, George McCollister wrote:
>> The contents of the following often need to be customized:
>>   /etc/systemd/system
> What do you need to change here?
>
>>   /lib/systemd/system
> This makes no sense. install_alternative_tree chooses the whole tree from
> multiple locations, not individual files. Copying the whole tree is really
> overkill. You can overwrite anything here by installing the same files in
> /etc/systemd/system anyways.
>
>>   /usr/lib/tmpfiles.d
> No. These are needed and you can add your own files in a separate package.
>
> Michael
>
>> Using install_alternative_tree instead of install_tree will allow
>> customizations.
>>
>> Signed-off-by: George McCollister<george.mccollister@gmail.com>
>> ---
>>   rules/systemd.make | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/rules/systemd.make b/rules/systemd.make
>> index 4d3cace..0f78553 100644
>> --- a/rules/systemd.make
>> +++ b/rules/systemd.make
>> @@ -199,8 +199,8 @@ endif
>>   		/etc/systemd/journald.conf)
>>   	@$(call install_alternative, systemd, 0, 0, 0644, \
>>   		/etc/systemd/logind.conf)
>> -	@$(call install_tree, systemd, 0, 0, -, /etc/systemd/system/)
>> -	@$(call install_tree, systemd, 0, 0, -, /usr/lib/tmpfiles.d/)
>> +	@$(call install_alternative_tree, systemd, 0, 0, /etc/systemd/system/)
>> +	@$(call install_alternative_tree, systemd, 0, 0, /usr/lib/tmpfiles.d/)
>>   	@$(call install_copy, systemd, 0, 0, 0644, -, /lib/udev/rules.d/99-systemd.rules)
>>   	@$(call install_tree, systemd, 0, 0, -, /etc/dbus-1/system.d/)
>>   	@$(call install_tree, systemd, 0, 0, -, /usr/share/polkit-1/actions/)
>> @@ -209,7 +209,7 @@ endif
>>   	@$(call install_copy, systemd, 0, 0, 0644, -, /usr/share/systemd/kbd-model-map)
>>
>>   #	# units
>> -	@$(call install_tree, systemd, 0, 0, -, /lib/systemd/system/)
>> +	@$(call install_alternative_tree, systemd, 0, 0, /lib/systemd/system/)
>>
>>   	@$(call install_alternative, systemd, 0, 0, 0644, /etc/vconsole.conf)
>>
>> -- 
>> 1.7.11.2
>>
>>
>> -- 
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>>
Thanks for your feedback,
George

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] systemd: use install_alternative_tree
  2012-11-28 18:45   ` George McCollister
@ 2012-11-29 14:37     ` George McCollister
  0 siblings, 0 replies; 4+ messages in thread
From: George McCollister @ 2012-11-29 14:37 UTC (permalink / raw)
  To: ptxdist

Oops...

On 11/28/2012 12:45 PM, George McCollister wrote:
>
> Right now journald.conf, logind.conf, system.conf, user.conf are just 
> place holders. Seems like it would be a good idea if these could be 
> overridden by files provided in projectroot and possibly be marked as 
> config files so they are preserved during package upgrade. Unless you 
> decide to change it upstream I think I will probably end up changing 
> everything in this directory to be installed individually with 
> install_config
I was just looking through systemd.make again and realized I was 
mistaken and you do have these installed with install_alternative. Using 
install_config instead would preserve user changes during upgrades but I 
doubt users will be changing these files so its not that much of an issue.
>
> Another systemd related problem I see is that packages (utelnetd for 
> instance) installing their unit files to /lib/systemd/system make the 
> incorrect assumption that I also want the unit enabled. This is also a 
> problem because if I disable the service manually it will be 
> re-enabled if that package is upgraded with opkg since the symlink is 
> not marked as a config file.
>
> I agree with your suggestion for /usr/lib/tmpfiles.d.
>
>
> On 11/16/2012 04:47 AM, Michael Olbrich wrote:
>> On Wed, Nov 14, 2012 at 02:51:30PM -0600, George McCollister wrote:
>>> The contents of the following often need to be customized:
>>>   /etc/systemd/system
>> What do you need to change here?
>>
>>>   /lib/systemd/system
>> This makes no sense. install_alternative_tree chooses the whole tree 
>> from
>> multiple locations, not individual files. Copying the whole tree is 
>> really
>> overkill. You can overwrite anything here by installing the same 
>> files in
>> /etc/systemd/system anyways.
>>
>>>   /usr/lib/tmpfiles.d
>> No. These are needed and you can add your own files in a separate 
>> package.
>>
>> Michael
>>
>>> Using install_alternative_tree instead of install_tree will allow
>>> customizations.
>>>
>>> Signed-off-by: George McCollister<george.mccollister@gmail.com>
>>> ---
>>>   rules/systemd.make | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/rules/systemd.make b/rules/systemd.make
>>> index 4d3cace..0f78553 100644
>>> --- a/rules/systemd.make
>>> +++ b/rules/systemd.make
>>> @@ -199,8 +199,8 @@ endif
>>>           /etc/systemd/journald.conf)
>>>       @$(call install_alternative, systemd, 0, 0, 0644, \
>>>           /etc/systemd/logind.conf)
>>> -    @$(call install_tree, systemd, 0, 0, -, /etc/systemd/system/)
>>> -    @$(call install_tree, systemd, 0, 0, -, /usr/lib/tmpfiles.d/)
>>> +    @$(call install_alternative_tree, systemd, 0, 0, 
>>> /etc/systemd/system/)
>>> +    @$(call install_alternative_tree, systemd, 0, 0, 
>>> /usr/lib/tmpfiles.d/)
>>>       @$(call install_copy, systemd, 0, 0, 0644, -, 
>>> /lib/udev/rules.d/99-systemd.rules)
>>>       @$(call install_tree, systemd, 0, 0, -, /etc/dbus-1/system.d/)
>>>       @$(call install_tree, systemd, 0, 0, -, 
>>> /usr/share/polkit-1/actions/)
>>> @@ -209,7 +209,7 @@ endif
>>>       @$(call install_copy, systemd, 0, 0, 0644, -, 
>>> /usr/share/systemd/kbd-model-map)
>>>
>>>   #    # units
>>> -    @$(call install_tree, systemd, 0, 0, -, /lib/systemd/system/)
>>> +    @$(call install_alternative_tree, systemd, 0, 0, 
>>> /lib/systemd/system/)
>>>
>>>       @$(call install_alternative, systemd, 0, 0, 0644, 
>>> /etc/vconsole.conf)
>>>
>>> -- 
>>> 1.7.11.2
>>>
>>>
>>> -- 
>>> ptxdist mailing list
>>> ptxdist@pengutronix.de
>>>
> Thanks for your feedback,
> George


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-29 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14 20:51 [ptxdist] [PATCH] systemd: use install_alternative_tree George McCollister
2012-11-16 10:47 ` Michael Olbrich
2012-11-28 18:45   ` George McCollister
2012-11-29 14:37     ` George McCollister

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox