[yocto] Proper convention for naming guest

Ken Bassford kbassford at apertussolutions.com
Thu Sep 27 05:57:12 PDT 2018


 > Hi Folks, 
 >  
 > Managed to get what I wanted via a combination of ... 
 >   my xl create image.conf file(s) ... 
 > """ 
 > # Guest name 
 > name = "<hostname here>" 
 > hostname = "<hostname here>" 
 > """ 
 >   and adding the following to my bb image recipe(s) .... 
 > """ 
 > # Set hostname 
 > run_postprocess() { 
 >     echo "<hostname here" > ${IMAGE_ROOTFS}/etc/hostname 
 > } 
 >  
 > ROOTFS_POSTPROCESS_COMMAND += " run_postprocess ; " 
 > """ 
 > Not the most elegant, but it will do. 
 >  
 > Sincerely, 
 > Ken Bassford 
 > Apertus Solutions 
 > (U) 301-490-4299 (x1292) 
 >  
 > ---- On Wed, 26 Sep 2018 09:31:34 -0400 Ken Bassford <kbassford at apertussolutions.com> wrote ---- 
 >  
 >  > Hi Folks,  
 >  >   
 >  > I'm rather new to Yocto so please forgive me (and please correct me) if I have some of the terminology wrong.  
 >  >   
 >  > I am currently building a Xen dom0 with two guest domain images running under the dom0.  These directories for building each of these images are located under the meta-virtualization directory in the build environment as recipe directories (recipe-xxx).  Dom0 and each of the images work fine.  
 >  >   
 >  > The trouble I am having is that I wanted to give each domU a unique name/hostname to make networking and management easier so I don't have to manually set them up each time one is modified.  Since each recipe only consisted of several sub-directories containing .bb files, I created a "base-files_3.0.14.bbappend" to each recipe's 'image' sub-directory (consisting of one line: hostname_pn-base-files = "<name of host>").  Now it seams that every time meta-virtualization is called bitbake "sees" the first .bbappend it comes across and tries to change the hostname regardless of which recipe I am building (i.e. If you run "bitbake -e base-files | grep ''hostname" it will always result in the same custom hostname).  Obviously this is not the proper way to set the hostname.  
 >  >   
 >  > What is the proper way to go about this?  Can I set it on the bitbake command line for building the image?  
 >  >   
 >  > I'd like for the hostname to be tied to the custom image recipe I am building.  If I don't specifically call one of my custom recipes, neither should automatically be changing the hostname.  
 >  >   
 >  > Thank you in advance for your time.  
 >  >   
 >  > Sincerely,  
 >  > Ken Bassford  
 >  > Apertus Solutions  
 >  >   
 >  >   
 >  >   
 >  > --  
 >  > _______________________________________________  
 >  > yocto mailing list  
 >  > yocto at yoctoproject.org  
 >  > https://lists.yoctoproject.org/listinfo/yocto  
 >  >  
 > 



More information about the yocto mailing list