[OE-core] [PATCH] image.bbclass: Adding loop back for machine name in hosts file

Paul Eggleton paul.eggleton at linux.intel.com
Mon Aug 4 14:49:15 UTC 2014


On Monday 04 August 2014 20:03:09 sujith h wrote:
> Hi Paul,
> 
> 
> On Mon, Aug 4, 2014 at 7:48 PM, Paul Eggleton <paul.eggleton at linux.intel.com
> > wrote:
> > 
> > Hi Sujith,
> > 
> > On Monday 04 August 2014 19:27:08 Sujith H wrote:
> > > From: Sujith H <Sujith_Haridasan at mentor.com>
> > > 
> > > If hostname is not added to /etc/hosts file then rpcinfo
> > > command fails when hostname is passed as argument. This was
> > > observed when rpcinfo command was tested on freescale target.
> > > Below was the output observed without this change.
> > > 
> > > root at mx6q:~# rpcinfo -s mx6q
> > > rpcinfo: can't contact rpcbind: RPC: (unknown error code)
> > > 
> > > Below is the output after this change:
> > > root at mx6q:~# rpcinfo -s mx6q
> > > 
> > >    program version(s) netid(s)                         service     owner
> > >    
> > >     100000  2,3,4     local,udp,tcp,udp6,tcp6          portmapper
> >  
> >  superuser
> >  
> > > root at mx6q:~#
> > > 
> > > Signed-off-by: Sujith H <Sujith_Haridasan at mentor.com>
> > > ---
> > > 
> > >  meta/classes/image.bbclass | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> > > index 82605f2..7a5a5c1 100644
> > > --- a/meta/classes/image.bbclass
> > > +++ b/meta/classes/image.bbclass
> > > @@ -341,6 +341,14 @@ ssh_disable_dns_lookup () {
> > > 
> > >       fi
> > >  
> > >  }
> > > 
> > > +ROOTFS_POSTPROCESS_COMMAND += "add_machine_name_loop_back;"
> > > +
> > > +add_machine_name_loop_back() {
> > > +    if [ -n ${MACHINE} ]; then
> > > +         echo 127.0.1.1 "       "${MACHINE} >>
> > > ${IMAGE_ROOTFS}${sysconfdir}/hosts +    fi
> > > +}
> > > +
> > 
> > I think in the earlier discussion the conclusion was that we do not want
> > this
> > enabled by default, which the above will do.
> > 
> > The question I have is, if this isn't a good idea, is there a better
> > solution?
> 
> I totally agree with the discussion. Is it a good idea to implement like
> check made for zap_empty_root_password?
> For zap_empty_root_password there is a conditional check if debug-tweaks
> are enabled then zap_empty_root_password is
> called. So can I use debug-tweaks to handle add_machine_name_loop_back in
> the patch?

No, that would not be right - debug-tweaks is for a specific purpose which is 
unrelated to this.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list