All of lore.kernel.org
 help / color / mirror / Atom feed
* extrausers working from image file .bb but not from .bbappend
@ 2015-04-22  1:27 Chris Morgan
  2015-04-22  1:54 ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Morgan @ 2015-04-22  1:27 UTC (permalink / raw)
  To: yocto

Hello.

Based on http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-classes-extrausers
and the .bbclass file I've added this to a .bbappend,
pulseaudio_%.bbappend actually so root user can use pactl when
pulseaudio is running in system mode:

inherit extrausers
EXTRA_USERS_PARAMS = "\
        usermod -a -G audio root \
 "


From the .bbappend this isn't working. If instead I add it to our
custom image file recipe (image-blah.bb) it does work.

I'm not sure how to debug or why it isn't working from the .bbappend. Thoughts?



Also, the documentation in the .bbclass seems out of date but wanted to confirm:

http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/extrausers.bbclass

shows:

 Below is an example showing how to use this functionality.
# INHERIT += "extrausers"
# EXTRA_USERS_PARAMS = "\
# useradd -p '' tester; \
# groupadd developers; \
# userdel nobody; \
# groupdel -g video; \
# groupmod -g 1020 developers; \
# usermod -s /bin/sh tester; \
# "

This INHERIT vs. inherit seems like it could be something that changed
in bitbake in the past but was left over in the .bbclass.

Chris


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

* Re: extrausers working from image file .bb but not from .bbappend
  2015-04-22  1:27 extrausers working from image file .bb but not from .bbappend Chris Morgan
@ 2015-04-22  1:54 ` Khem Raj
  2015-04-22  8:10   ` Paul Eggleton
  2015-04-22 10:57   ` Chris Morgan
  0 siblings, 2 replies; 7+ messages in thread
From: Khem Raj @ 2015-04-22  1:54 UTC (permalink / raw)
  To: Chris Morgan; +Cc: yocto

Hi Chris

> On Apr 21, 2015, at 6:27 PM, Chris Morgan <chmorgan@gmail.com> wrote:
> 
> Hello.
> 
> Based on http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-classes-extrausers
> and the .bbclass file I've added this to a .bbappend,
> pulseaudio_%.bbappend actually so root user can use pactl when
> pulseaudio is running in system mode:
> 
> inherit extrausers
> EXTRA_USERS_PARAMS = "\
>        usermod -a -G audio root \
> "
> 
> 
> From the .bbappend this isn't working. If instead I add it to our
> custom image file recipe (image-blah.bb) it does work.

its a image level config so thats right behavior.

> 
> I'm not sure how to debug or why it isn't working from the .bbappend. Thoughts?
> 
> 
> 
> Also, the documentation in the .bbclass seems out of date but wanted to confirm:
> 
> http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/extrausers.bbclass
> 
> shows:
> 
> Below is an example showing how to use this functionality.
> # INHERIT += "extrausers"
> # EXTRA_USERS_PARAMS = "\
> # useradd -p '' tester; \
> # groupadd developers; \
> # userdel nobody; \
> # groupdel -g video; \
> # groupmod -g 1020 developers; \
> # usermod -s /bin/sh tester; \
> # "
> 
> This INHERIT vs. inherit seems like it could be something that changed
> in bitbake in the past but was left over in the .bbclass.

its correct because its assuming you are adding it to config metadata and not recipe metadata
may be location is not right. Send a patch

> 
> Chris
> -- 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



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

* Re: extrausers working from image file .bb but not from .bbappend
  2015-04-22  1:54 ` Khem Raj
@ 2015-04-22  8:10   ` Paul Eggleton
  2015-04-22 11:00     ` Chris Morgan
  2015-04-22 10:57   ` Chris Morgan
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Eggleton @ 2015-04-22  8:10 UTC (permalink / raw)
  To: Chris Morgan; +Cc: yocto

On Tuesday 21 April 2015 18:54:29 Khem Raj wrote:
> Hi Chris
> 
> > On Apr 21, 2015, at 6:27 PM, Chris Morgan <chmorgan@gmail.com> wrote:
> > 
> > Hello.
> > 
> > Based on
> > http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-c
> > lasses-extrausers and the .bbclass file I've added this to a .bbappend,
> > pulseaudio_%.bbappend actually so root user can use pactl when
> > pulseaudio is running in system mode:
> > 
> > inherit extrausers
> > EXTRA_USERS_PARAMS = "\
> > 
> >        usermod -a -G audio root \
> > 
> > "
> > 
> > 
> > From the .bbappend this isn't working. If instead I add it to our
> > custom image file recipe (image-blah.bb) it does work.
> 
> its a image level config so thats right behavior.
> 
> > I'm not sure how to debug or why it isn't working from the .bbappend.
> > Thoughts?
> > 
> > 
> > 
> > Also, the documentation in the .bbclass seems out of date but wanted to
> > confirm:
> > 
> > http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/extrausers.bb
> > class
> > 
> > shows:
> > 
> > Below is an example showing how to use this functionality.
> > # INHERIT += "extrausers"
> > # EXTRA_USERS_PARAMS = "\
> > # useradd -p '' tester; \
> > # groupadd developers; \
> > # userdel nobody; \
> > # groupdel -g video; \
> > # groupmod -g 1020 developers; \
> > # usermod -s /bin/sh tester; \
> > # "
> > 
> > This INHERIT vs. inherit seems like it could be something that changed
> > in bitbake in the past but was left over in the .bbclass.
> 
> its correct because its assuming you are adding it to config metadata and
> not recipe metadata may be location is not right. Send a patch

It should work either in the image recipe (with inherit) or at the 
configuration level (with INHERIT +=), but I agree extrausers not intended to 
work from individual recipes, we have useradd for that.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: extrausers working from image file .bb but not from .bbappend
  2015-04-22  1:54 ` Khem Raj
  2015-04-22  8:10   ` Paul Eggleton
@ 2015-04-22 10:57   ` Chris Morgan
  1 sibling, 0 replies; 7+ messages in thread
From: Chris Morgan @ 2015-04-22 10:57 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto

On Tue, Apr 21, 2015 at 9:54 PM, Khem Raj <raj.khem@gmail.com> wrote:
> Hi Chris
>
>> On Apr 21, 2015, at 6:27 PM, Chris Morgan <chmorgan@gmail.com> wrote:
>>
>> Hello.
>>
>> Based on http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-classes-extrausers
>> and the .bbclass file I've added this to a .bbappend,
>> pulseaudio_%.bbappend actually so root user can use pactl when
>> pulseaudio is running in system mode:
>>
>> inherit extrausers
>> EXTRA_USERS_PARAMS = "\
>>        usermod -a -G audio root \
>> "
>>
>>
>> From the .bbappend this isn't working. If instead I add it to our
>> custom image file recipe (image-blah.bb) it does work.
>
> its a image level config so thats right behavior.
>
>>
>> I'm not sure how to debug or why it isn't working from the .bbappend. Thoughts?
>>
>>
>>
>> Also, the documentation in the .bbclass seems out of date but wanted to confirm:
>>
>> http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/extrausers.bbclass
>>
>> shows:
>>
>> Below is an example showing how to use this functionality.
>> # INHERIT += "extrausers"
>> # EXTRA_USERS_PARAMS = "\
>> # useradd -p '' tester; \
>> # groupadd developers; \
>> # userdel nobody; \
>> # groupdel -g video; \
>> # groupmod -g 1020 developers; \
>> # usermod -s /bin/sh tester; \
>> # "
>>
>> This INHERIT vs. inherit seems like it could be something that changed
>> in bitbake in the past but was left over in the .bbclass.
>
> its correct because its assuming you are adding it to config metadata and not recipe metadata
> may be location is not right. Send a patch
>

Hmm. Not sure I see anything incorrect at this point, given that I was
using it incorrectly...


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

* Re: extrausers working from image file .bb but not from .bbappend
  2015-04-22  8:10   ` Paul Eggleton
@ 2015-04-22 11:00     ` Chris Morgan
  2015-04-22 11:03       ` Paul Eggleton
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Morgan @ 2015-04-22 11:00 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: yocto

On Wed, Apr 22, 2015 at 4:10 AM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> On Tuesday 21 April 2015 18:54:29 Khem Raj wrote:
>> Hi Chris
>>
>> > On Apr 21, 2015, at 6:27 PM, Chris Morgan <chmorgan@gmail.com> wrote:
>> >
>> > Hello.
>> >
>> > Based on
>> > http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-c
>> > lasses-extrausers and the .bbclass file I've added this to a .bbappend,
>> > pulseaudio_%.bbappend actually so root user can use pactl when
>> > pulseaudio is running in system mode:
>> >
>> > inherit extrausers
>> > EXTRA_USERS_PARAMS = "\
>> >
>> >        usermod -a -G audio root \
>> >
>> > "
>> >
>> >
>> > From the .bbappend this isn't working. If instead I add it to our
>> > custom image file recipe (image-blah.bb) it does work.
>>
>> its a image level config so thats right behavior.
>>
>> > I'm not sure how to debug or why it isn't working from the .bbappend.
>> > Thoughts?
>> >
>> >
>> >
>> > Also, the documentation in the .bbclass seems out of date but wanted to
>> > confirm:
>> >
>> > http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/extrausers.bb
>> > class
>> >
>> > shows:
>> >
>> > Below is an example showing how to use this functionality.
>> > # INHERIT += "extrausers"
>> > # EXTRA_USERS_PARAMS = "\
>> > # useradd -p '' tester; \
>> > # groupadd developers; \
>> > # userdel nobody; \
>> > # groupdel -g video; \
>> > # groupmod -g 1020 developers; \
>> > # usermod -s /bin/sh tester; \
>> > # "
>> >
>> > This INHERIT vs. inherit seems like it could be something that changed
>> > in bitbake in the past but was left over in the .bbclass.
>>
>> its correct because its assuming you are adding it to config metadata and
>> not recipe metadata may be location is not right. Send a patch
>
> It should work either in the image recipe (with inherit) or at the
> configuration level (with INHERIT +=), but I agree extrausers not intended to
> work from individual recipes, we have useradd for that.
>

Looked at useradd source and documentation and skeleton example but I
don't see a way to add another specific user to a group.

I had been looking to use extrausers with 'usermod' in the
pulseaudio_%.bbappend because the pulseaudio.inc base recipe file is
the one creating the 'audio' group and adding the 'pulse' user to it.
So it seemed like an appropriate recipe to add to to also add root to
the 'audio' group.

Am I missing some way of doing this with useradd or should I just be
modifying the top level image recipe to resolve this issue?

Chris


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

* Re: extrausers working from image file .bb but not from .bbappend
  2015-04-22 11:00     ` Chris Morgan
@ 2015-04-22 11:03       ` Paul Eggleton
  2015-04-22 12:12         ` Chris Morgan
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Eggleton @ 2015-04-22 11:03 UTC (permalink / raw)
  To: Chris Morgan; +Cc: yocto

On Wednesday 22 April 2015 07:00:50 Chris Morgan wrote:
> On Wed, Apr 22, 2015 at 4:10 AM, Paul Eggleton
> 
> <paul.eggleton@linux.intel.com> wrote:
> > On Tuesday 21 April 2015 18:54:29 Khem Raj wrote:
> >> Hi Chris
> >> 
> >> > On Apr 21, 2015, at 6:27 PM, Chris Morgan <chmorgan@gmail.com> wrote:
> >> > 
> >> > Hello.
> >> > 
> >> > Based on
> >> > http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref
> >> > -c
> >> > lasses-extrausers and the .bbclass file I've added this to a .bbappend,
> >> > pulseaudio_%.bbappend actually so root user can use pactl when
> >> > pulseaudio is running in system mode:
> >> > 
> >> > inherit extrausers
> >> > EXTRA_USERS_PARAMS = "\
> >> > 
> >> >        usermod -a -G audio root \
> >> > 
> >> > "
> >> > 
> >> > 
> >> > From the .bbappend this isn't working. If instead I add it to our
> >> > custom image file recipe (image-blah.bb) it does work.
> >> 
> >> its a image level config so thats right behavior.
> >> 
> >> > I'm not sure how to debug or why it isn't working from the .bbappend.
> >> > Thoughts?
> >> > 
> >> > 
> >> > 
> >> > Also, the documentation in the .bbclass seems out of date but wanted to
> >> > confirm:
> >> > 
> >> > http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/extrausers
> >> > .bb
> >> > class
> >> > 
> >> > shows:
> >> > 
> >> > Below is an example showing how to use this functionality.
> >> > # INHERIT += "extrausers"
> >> > # EXTRA_USERS_PARAMS = "\
> >> > # useradd -p '' tester; \
> >> > # groupadd developers; \
> >> > # userdel nobody; \
> >> > # groupdel -g video; \
> >> > # groupmod -g 1020 developers; \
> >> > # usermod -s /bin/sh tester; \
> >> > # "
> >> > 
> >> > This INHERIT vs. inherit seems like it could be something that changed
> >> > in bitbake in the past but was left over in the .bbclass.
> >> 
> >> its correct because its assuming you are adding it to config metadata and
> >> not recipe metadata may be location is not right. Send a patch
> > 
> > It should work either in the image recipe (with inherit) or at the
> > configuration level (with INHERIT +=), but I agree extrausers not intended
> > to work from individual recipes, we have useradd for that.
> 
> Looked at useradd source and documentation and skeleton example but I
> don't see a way to add another specific user to a group.
> 
> I had been looking to use extrausers with 'usermod' in the
> pulseaudio_%.bbappend because the pulseaudio.inc base recipe file is
> the one creating the 'audio' group and adding the 'pulse' user to it.
> So it seemed like an appropriate recipe to add to to also add root to
> the 'audio' group.
> 
> Am I missing some way of doing this with useradd or should I just be
> modifying the top level image recipe to resolve this issue?

I don't believe useradd.bbclass can be used to solve this, no. You probably 
need to use extrausers.bbclass from the image recipe.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: extrausers working from image file .bb but not from .bbappend
  2015-04-22 11:03       ` Paul Eggleton
@ 2015-04-22 12:12         ` Chris Morgan
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Morgan @ 2015-04-22 12:12 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: yocto

On Wed, Apr 22, 2015 at 7:03 AM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> On Wednesday 22 April 2015 07:00:50 Chris Morgan wrote:
>> On Wed, Apr 22, 2015 at 4:10 AM, Paul Eggleton
>>
>> <paul.eggleton@linux.intel.com> wrote:
>> > On Tuesday 21 April 2015 18:54:29 Khem Raj wrote:
>> >> Hi Chris
>> >>
>> >> > On Apr 21, 2015, at 6:27 PM, Chris Morgan <chmorgan@gmail.com> wrote:
>> >> >
>> >> > Hello.
>> >> >
>> >> > Based on
>> >> > http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref
>> >> > -c
>> >> > lasses-extrausers and the .bbclass file I've added this to a .bbappend,
>> >> > pulseaudio_%.bbappend actually so root user can use pactl when
>> >> > pulseaudio is running in system mode:
>> >> >
>> >> > inherit extrausers
>> >> > EXTRA_USERS_PARAMS = "\
>> >> >
>> >> >        usermod -a -G audio root \
>> >> >
>> >> > "
>> >> >
>> >> >
>> >> > From the .bbappend this isn't working. If instead I add it to our
>> >> > custom image file recipe (image-blah.bb) it does work.
>> >>
>> >> its a image level config so thats right behavior.
>> >>
>> >> > I'm not sure how to debug or why it isn't working from the .bbappend.
>> >> > Thoughts?
>> >> >
>> >> >
>> >> >
>> >> > Also, the documentation in the .bbclass seems out of date but wanted to
>> >> > confirm:
>> >> >
>> >> > http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/extrausers
>> >> > .bb
>> >> > class
>> >> >
>> >> > shows:
>> >> >
>> >> > Below is an example showing how to use this functionality.
>> >> > # INHERIT += "extrausers"
>> >> > # EXTRA_USERS_PARAMS = "\
>> >> > # useradd -p '' tester; \
>> >> > # groupadd developers; \
>> >> > # userdel nobody; \
>> >> > # groupdel -g video; \
>> >> > # groupmod -g 1020 developers; \
>> >> > # usermod -s /bin/sh tester; \
>> >> > # "
>> >> >
>> >> > This INHERIT vs. inherit seems like it could be something that changed
>> >> > in bitbake in the past but was left over in the .bbclass.
>> >>
>> >> its correct because its assuming you are adding it to config metadata and
>> >> not recipe metadata may be location is not right. Send a patch
>> >
>> > It should work either in the image recipe (with inherit) or at the
>> > configuration level (with INHERIT +=), but I agree extrausers not intended
>> > to work from individual recipes, we have useradd for that.
>>
>> Looked at useradd source and documentation and skeleton example but I
>> don't see a way to add another specific user to a group.
>>
>> I had been looking to use extrausers with 'usermod' in the
>> pulseaudio_%.bbappend because the pulseaudio.inc base recipe file is
>> the one creating the 'audio' group and adding the 'pulse' user to it.
>> So it seemed like an appropriate recipe to add to to also add root to
>> the 'audio' group.
>>
>> Am I missing some way of doing this with useradd or should I just be
>> modifying the top level image recipe to resolve this issue?
>
> I don't believe useradd.bbclass can be used to solve this, no. You probably
> need to use extrausers.bbclass from the image recipe.


Hmm. Alright. Appreciate the help Paul, and you too Khem.

For pulseaudio as a system service it would be handy if root could use
pactl. While I'm not working on adding support like this upstream at
the moment, I'm not sure how one might do so if each image had to add
the extrausers entries to adjust groups. It looks like the group
approach isn't the correct one in this case but I'm also not sure what
other approaches would work.

Chris


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

end of thread, other threads:[~2015-04-22 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-22  1:27 extrausers working from image file .bb but not from .bbappend Chris Morgan
2015-04-22  1:54 ` Khem Raj
2015-04-22  8:10   ` Paul Eggleton
2015-04-22 11:00     ` Chris Morgan
2015-04-22 11:03       ` Paul Eggleton
2015-04-22 12:12         ` Chris Morgan
2015-04-22 10:57   ` Chris Morgan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.