Patchwork [1/4] update-rc.d/useradd: Add additional dependecies

login
register
mail settings
Submitter Saul Wold
Date June 6, 2014, 12:09 a.m.
Message ID <1402013345-24930-2-git-send-email-sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/73347/
State New
Headers show

Comments

Saul Wold - June 6, 2014, 12:09 a.m.
These dependcies are needed to ensure that thier packages are created
correctly since these classes have runtime dependiences in their packages
but they are not actually created yet at rootfs time.

[YOCTO #6072]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/classes/update-rc.d.bbclass | 2 ++
 meta/classes/useradd.bbclass     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
Phil Blundell - June 10, 2014, 11:57 a.m.
On Thu, 2014-06-05 at 17:09 -0700, Saul Wold wrote:
> These dependcies are needed to ensure that thier packages are created
> correctly since these classes have runtime dependiences in their packages
> but they are not actually created yet at rootfs time.

Can you be more specific about why these
dependecies/dependcies/dependiences are required?  I can't, offhand,
think of any reason why update-rc.d requires initscripts for example.

Also, what's going on with the PACKAGESPLITFUNCS_remove_class-nativesdk?

thanks

p.

> 
> [YOCTO #6072]
> 
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>  meta/classes/update-rc.d.bbclass | 2 ++
>  meta/classes/useradd.bbclass     | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
> index 56eef4e..ca9486b 100644
> --- a/meta/classes/update-rc.d.bbclass
> +++ b/meta/classes/update-rc.d.bbclass
> @@ -1,6 +1,7 @@
>  UPDATERCPN ?= "${PN}"
>  
>  DEPENDS_append = " update-rc.d-native"
> +DEPENDS_append_class-target = " initscripts"
>  UPDATERCD = "update-rc.d"
>  UPDATERCD_class-cross = ""
>  UPDATERCD_class-native = ""
> @@ -67,6 +68,7 @@ python __anonymous() {
>  }
>  
>  PACKAGESPLITFUNCS_prepend = "populate_packages_updatercd "
> +PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd "
>  
>  populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst"
Saul Wold - June 10, 2014, 2:38 p.m.
On 06/10/2014 04:57 AM, Phil Blundell wrote:
> On Thu, 2014-06-05 at 17:09 -0700, Saul Wold wrote:
>> These dependcies are needed to ensure that thier packages are created
>> correctly since these classes have runtime dependiences in their packages
>> but they are not actually created yet at rootfs time.
>
> Can you be more specific about why these
> dependecies/dependcies/dependiences are required?  I can't, offhand,
> think of any reason why update-rc.d requires initscripts for example.
>
It's more about having initscripts-funtions package built so that it's 
available for the dynamic addition to the RDEPENDS later in 
populate_pacakges_updatercd().  If initscripts is not built and we add 
initscripts-functions to the RDEPENDS, the final rootfs will fail with 
an unsatisfied dependency.

> Also, what's going on with the PACKAGESPLITFUNCS_remove_class-nativesdk?
>
We don't need to run that funtion to create the nativesdk sysroot, so 
don't run it.

Sau!

> thanks
>
> p.
>
>>
>> [YOCTO #6072]
>>
>> Signed-off-by: Saul Wold <sgw@linux.intel.com>
>> ---
>>   meta/classes/update-rc.d.bbclass | 2 ++
>>   meta/classes/useradd.bbclass     | 2 +-
>>   2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
>> index 56eef4e..ca9486b 100644
>> --- a/meta/classes/update-rc.d.bbclass
>> +++ b/meta/classes/update-rc.d.bbclass
>> @@ -1,6 +1,7 @@
>>   UPDATERCPN ?= "${PN}"
>>
>>   DEPENDS_append = " update-rc.d-native"
>> +DEPENDS_append_class-target = " initscripts"
>>   UPDATERCD = "update-rc.d"
>>   UPDATERCD_class-cross = ""
>>   UPDATERCD_class-native = ""
>> @@ -67,6 +68,7 @@ python __anonymous() {
>>   }
>>
>>   PACKAGESPLITFUNCS_prepend = "populate_packages_updatercd "
>> +PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd "
>>
>>   populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst"
>
>
>
>
Phil Blundell - June 10, 2014, 2:53 p.m.
On Tue, 2014-06-10 at 07:38 -0700, Saul Wold wrote:
> On 06/10/2014 04:57 AM, Phil Blundell wrote:
> > On Thu, 2014-06-05 at 17:09 -0700, Saul Wold wrote:
> >> These dependcies are needed to ensure that thier packages are created
> >> correctly since these classes have runtime dependiences in their packages
> >> but they are not actually created yet at rootfs time.
> >
> > Can you be more specific about why these
> > dependecies/dependcies/dependiences are required?  I can't, offhand,
> > think of any reason why update-rc.d requires initscripts for example.
> >
> It's more about having initscripts-funtions package built so that it's 
> available for the dynamic addition to the RDEPENDS later in 
> populate_pacakges_updatercd().  If initscripts is not built and we add 
> initscripts-functions to the RDEPENDS, the final rootfs will fail with 
> an unsatisfied dependency.

It seems to me that, if a given package ships an initscript which
requires /etc/init.d/functions, it ought to be the responsibility of
that package to rdepend on initscripts itself.  I'm not sure it's
entirely desirable for update-rc.d to drag that dependency in.

> > Also, what's going on with the PACKAGESPLITFUNCS_remove_class-nativesdk?
> >
> We don't need to run that funtion to create the nativesdk sysroot, so 
> don't run it.

Fair enough, but this seems like an unrelated change (and one which
isn't covered by the patch summary or description).  Shouldn't that be
in a separate commit?

p.
Paul Eggleton - June 16, 2014, 2:47 p.m.
On Tuesday 10 June 2014 15:53:19 Phil Blundell wrote:
> On Tue, 2014-06-10 at 07:38 -0700, Saul Wold wrote:
> > On 06/10/2014 04:57 AM, Phil Blundell wrote:
> > > On Thu, 2014-06-05 at 17:09 -0700, Saul Wold wrote:
> > >> These dependcies are needed to ensure that thier packages are created
> > >> correctly since these classes have runtime dependiences in their
> > >> packages
> > >> but they are not actually created yet at rootfs time.
> > > 
> > > Can you be more specific about why these
> > > dependecies/dependcies/dependiences are required?  I can't, offhand,
> > > think of any reason why update-rc.d requires initscripts for example.
> > 
> > It's more about having initscripts-funtions package built so that it's
> > available for the dynamic addition to the RDEPENDS later in
> > populate_pacakges_updatercd().  If initscripts is not built and we add
> > initscripts-functions to the RDEPENDS, the final rootfs will fail with
> > an unsatisfied dependency.
> 
> It seems to me that, if a given package ships an initscript which
> requires /etc/init.d/functions, it ought to be the responsibility of
> that package to rdepend on initscripts itself.  I'm not sure it's
> entirely desirable for update-rc.d to drag that dependency in.

It should be, however:

a) There are a bunch of recipes that don't currently do that, and you'll only 
find out there's a problem at do_rootfs time (or worse, if we went a step 
further and didn't even dynamically add the RDEPENDS, at runtime when the 
service fails to start).

b) Saul's patch adds a build-time dependency, not a runtime one, and the 
initscripts recipe only packages files so the impact is fairly trivial even if 
it's not going to be built through other dependencies anyway.

> > > Also, what's going on with the PACKAGESPLITFUNCS_remove_class-nativesdk?
> > 
> > We don't need to run that funtion to create the nativesdk sysroot, so
> > don't run it.
> 
> Fair enough, but this seems like an unrelated change (and one which
> isn't covered by the patch summary or description).  Shouldn't that be
> in a separate commit?

The patch has been merged now, but FWIW it seems like it probably should have 
been a separate one.

Cheers,
Paul
Phil Blundell - June 17, 2014, 1:18 p.m.
On Mon, 2014-06-16 at 15:47 +0100, Paul Eggleton wrote:
> a) There are a bunch of recipes that don't currently do that, and you'll only 
> find out there's a problem at do_rootfs time (or worse, if we went a step 
> further and didn't even dynamically add the RDEPENDS, at runtime when the 
> service fails to start).

Ah, true.  It doesn't seem that it should be beyond the wit of man to
add a QA check for that, though.

p.
Paul Eggleton - June 17, 2014, 5:01 p.m.
On Tuesday 17 June 2014 14:18:41 Phil Blundell wrote:
> On Mon, 2014-06-16 at 15:47 +0100, Paul Eggleton wrote:
> > a) There are a bunch of recipes that don't currently do that, and you'll
> > only find out there's a problem at do_rootfs time (or worse, if we went a
> > step further and didn't even dynamically add the RDEPENDS, at runtime
> > when the service fails to start).
> 
> Ah, true.  It doesn't seem that it should be beyond the wit of man to
> add a QA check for that, though.

I guess there are two ways of handling this:

1) Automatically add the dependency

or

2) Check for the lack of it and fail if it should be added

For better or worse we opted to go with #1. I wouldn't necessarily be totally 
opposed to changing to #2 if people feel it is cleaner (and it is, a little) 
but someone would actually have to do that work and then fix the resulting 
fallout.

Cheers,
Paul

Patch

diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 56eef4e..ca9486b 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -1,6 +1,7 @@ 
 UPDATERCPN ?= "${PN}"
 
 DEPENDS_append = " update-rc.d-native"
+DEPENDS_append_class-target = " initscripts"
 UPDATERCD = "update-rc.d"
 UPDATERCD_class-cross = ""
 UPDATERCD_class-native = ""
@@ -67,6 +68,7 @@  python __anonymous() {
 }
 
 PACKAGESPLITFUNCS_prepend = "populate_packages_updatercd "
+PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd "
 
 populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst"
 
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 3dd7a61..ea15dab 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -4,7 +4,7 @@  inherit useradd_base
 # target sysroot, and shadow -native and -sysroot provide the utilities
 # and support files needed to add and modify user and group accounts
 DEPENDS_append = "${USERADDDEPENDS}"
-USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot shadow"
+USERADDDEPENDS = " base-files base-passwd shadow-native shadow-sysroot shadow"
 USERADDDEPENDS_class-cross = ""
 USERADDDEPENDS_class-native = ""
 USERADDDEPENDS_class-nativesdk = ""