Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: Embedded

Adding new users when using buildroot?

 

 

Gentoo embedded RSS feed   Index | Next | Previous | View Threaded


lists at wildgooses

Sep 4, 2009, 10:18 AM

Post #1 of 4 (982 views)
Permalink
Adding new users when using buildroot?

Hi, I am building a small buildroot using say:

ROOT=/var/embedded/builds/base1 PORTAGE_CONFIGROOT=/var/embedded/portage
emerge -v dropbear

The end result seems to be that I get my new user added to the build
system, but not to the ROOT= system. I have seen a few people report
issues when using packages, but is this just a known limitation of
recent portage or do I need some other commandline incantations?

Obviously plenty of other ways to solve this, but curious if there is a
solution within the portage build process?

Thanks

Ed W


solar at gentoo

Sep 4, 2009, 10:27 AM

Post #2 of 4 (924 views)
Permalink
Re: Adding new users when using buildroot? [In reply to]

On Fri, 2009-09-04 at 18:18 +0100, Ed W wrote:
> Hi, I am building a small buildroot using say:
>
> ROOT=/var/embedded/builds/base1 PORTAGE_CONFIGROOT=/var/embedded/portage
> emerge -v dropbear
>
> The end result seems to be that I get my new user added to the build
> system, but not to the ROOT= system. I have seen a few people report
> issues when using packages, but is this just a known limitation of
> recent portage or do I need some other commandline incantations?
>
> Obviously plenty of other ways to solve this, but curious if there is a
> solution within the portage build process?


buildroot is not the best term to use when refering to
portage/gentoo/embedded. It just confuses people.
Reason being.. http://buildroot.org/


As for users not being added in $ROOT. Yes you are right and sadly this
is a known limitation of portage/pam/and friends right now.


--
Ned Ludd <solar [at] gentoo>
Gentoo Linux


odinshorse at googlemail

Sep 4, 2009, 11:28 AM

Post #3 of 4 (924 views)
Permalink
Re: Adding new users when using buildroot? [In reply to]

2009/9/4 Ed W <lists [at] wildgooses>:
> Obviously plenty of other ways to solve this, but curious if there is a
> solution within the portage build process?

I don't know of any standard way. Portage uses 'useradd' to generate
the new user
and this command does _not_ support a ROOT. The only (non-standard) way to
add a new user is by directly writing to /etc/passwd, but I'm not sure
if this works
on all OSes supported by Gentoo.

Anyway, if you follow http://gentoo.mindzoo.de/index.cgi/wiki/Cross%20Install
you will find the command

find /var/db/pkg -name '*.ebuild' -exec grep -qF 'pkg_postinst()' {}
\; -exec ebuild {} postinst \;

which reruns all postinstall sections of your cross-compiled system on
the target
and thus also creates the users.

Have fun!

Sven


lists at wildgooses

Sep 4, 2009, 11:50 AM

Post #4 of 4 (920 views)
Permalink
Re: Adding new users when using buildroot? [In reply to]

Sven Rebhan wrote:
> Anyway, if you follow http://gentoo.mindzoo.de/index.cgi/wiki/Cross%20Install
> you will find the command
>
> find /var/db/pkg -name '*.ebuild' -exec grep -qF 'pkg_postinst()' {}
> \; -exec ebuild {} postinst \;
>
> which reruns all postinstall sections of your cross-compiled system on
> the target
> and thus also creates the users.
>


That seems like a good idea, but I think the docs say that user creation
should be in pkg_setup() and certainly this is the case with dropbear?
Seems a bit dangerous to re-run pkg_setup for every package...?

I also noticed that since I have only busybox in my final build and it's
got pretty lousy support for adduser I may need to inject directly into
/etc/

Actually the docs here
http://devmanual.gentoo.org/ebuild-writing/users-and-groups/index.html
suggest that this IS supposed to work inside the sandbox and hence we
might reasonably expect it to work with ROOT= set. However, as Ned
says, it seems not to work right now...

Oh well

Thanks

Ed W

Gentoo embedded RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.