[yocto] Explicitly Adding Common Packages (ie Java) and Creating Users

Paul Eggleton paul.eggleton at linux.intel.com
Wed Mar 28 03:33:28 PDT 2012


Hi Andy,

On Sunday 25 March 2012 21:05:02 Andy Gikling wrote:
> I'd like to ask two specific questions:
> 
> Question 1:
> The ADT manual instructs you to install the Target Management (RSE)
> framework into Eclipse.  Presumably, one would want to use these tools to
> do remote debugging on their Yocto target.  Unfortunately, the primary
> vehicle to doing streamlined remote debugging with Target Management is to
> run the rseserver and this requires java.  Many of Yocto's base images
> don't come with java support (for example core-image-minimal).  So I set
> out to figure out how to add this into my project.  Makes sense right?
> 
> I was never able build an image that contains the meta-oracle-master layer
> using the config files only.  (The documentation on how to do this is
> sparse.  Even the readme file in the layer's download is a one-liner on how
> to use it... why?)  I was able to get an image to build using hob though. 
> When I boot the image I have two new folders now; "/usr/java/" and
> "/usr/jdk1.7.0_02/" both of which contain a "/bin" folder with "java" in
> it.
> 
> The problem is I can't seem to execute any of them what-so-ever.  I just
> need to be able to call "java -version" and I just can't get er' to go no
> matter what I do!
> 
> I've tried adding various locations to my $PATH and I've also tried
> navigating to the folder directly and calling "./java" to no avail.  What
> folder should I expect my java executable to be in?  Why can't I use it? 
> The jdk is clearly there - I must be missing something very obvious.
>
> There really should be some documentation on this because Java is so common
> as it's a requirement for the tools suggested in the ADT manual. 
> Documentation on this topic would fit really well with other common
> first-timer question of "How do I explicitly add a package to my Yocto
> image, such as OpenSSH, GDB, or Java?"

I'm afraid I don't know the answer to this, but maybe someone else can help - 
Jessica, Nitin, any ideas on this one?
 
> The brief sections about this topic in the official guides are not very
> clear to me.  It seems like explicitly adding a custom package might even
> fit in the quick start guide.
> 
> Question 2:
> I was able to get the OpenSSH package added to my Yocto build using hob
> (when I can't get things to work by editing the .conf files I try hob and
> it feels like cheating... but it seems to work much better for me.)  All I
> want to do now is set it up but I can't make new users!
> 
> The default Yocto login account on my target is "root" but I can't call
> "useradd andy" because useradd is not included in my core-image-minimal
> build.  This makes configuring sshd quite a bit harder.
> 
> Any ideas?  Is there a way to add user accounts at build time or do I have
> to add the "useradd" package?

We have useradd.bbclass as well as a few recipes that use it as examples; this 
class is typically used from a recipe to add accounts necessary for running 
daemons themselves (e.g. dbus) although in principle it could be used to add 
any account at build time.

If you want to include the useradd utility in the root filesystem, you would 
need to include the "shadow" package, which is easy to do with Hob.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list