<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7417</bug_id>
          
          <creation_ts>2015-03-06 16:39:05 +0000</creation_ts>
          <short_desc>Add section on changing hostname</short_desc>
          <delta_ts>2015-03-20 23:24:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>9</classification_id>
          <classification>Documentation</classification>
          <product>Development Manual</product>
          <component>development</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>17 March 2015: IN PROGRESS DESIGN</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Scott Rifenbark">srifenbark</assigned_to>
          <cc>srifenbark</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>49270</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-03-06 16:39:05 +0000</bug_when>
    <thetext>We should add a section to the manuals somewhere explaining how to change the default hostname in the image.  Maybe Common Tasks in the Development Manual?

Something like this:


Changing the hostname
===

By default the configured hostname in an image is the same as the machine
name, i.e. qemux86.  This can be changed by altering the value of the variable
&quot;hostname&quot; in the base-files recipe, with either a bbappend
(hostname=&quot;myhostname&quot;) or configuration file (hostname_pn-base-files =
&quot;myhostname&quot;).

If the hostname is unset then the image will have no default hostname in the
filesystem, making it suitable for environments with dynamic hostnames such as
virtual machines.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49273</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-03-06 19:10:55 +0000</bug_when>
    <thetext>Ross, 

I don&apos;t get this.  You say that by default, the configured hostname in an image is the same as the machine name.  Then, you say you can alter that by setting &quot;hostname&quot; in the recipe or messing with the configuration file.  

But if the hostname variable is unset then the image has no default hostname in the filesystem?   

There are terms here I must not understand or assumptions being made in the text because it seems contradictary.  

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49274</commentid>
    <comment_count>2</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-03-06 19:11:34 +0000</bug_when>
    <thetext>Adding myself to cc list so I see the replies.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49301</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-03-09 14:48:19 +0000</bug_when>
    <thetext>The default value of the variable &quot;hostname&quot; which is written into the image is the machine name.  You can change the variable to any other value (I use hostname_pn-base-files=&quot;bob&quot; so all my images are called bob for ease of testing), or set it to &quot;&quot; and no hostname will be written into the image.

When I say written into the image, I mean written to /etc/hostname.

Hopefully that helps?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49499</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-03-17 17:15:22 +0000</bug_when>
    <thetext>Ross, 

I have a section in the YP Development Manual called &quot;Customizing Images&quot; (http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#usingpoky-extend-customimage).  That section has a bunch of sub-sections.  How about creating a new subsection that specifically addresses how to change the hostname written into etc/hostname of the image?  To me, this is customization of sorts.  We could use your specific debug example as rationale for doing this.  Would this work?

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49525</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-03-18 09:27:48 +0000</bug_when>
    <thetext>Yes, that sounds good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49549</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-03-18 15:34:38 +0000</bug_when>
    <thetext>Ross, 

Please look over the new section at http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#usingpoky-extend-customimage-image-name.  

I need to know if &quot;base-files&quot; in that sample command is a placeholder and not a literal.  If it is a placeholder then I need to change the formatting. 

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49614</commentid>
    <comment_count>7</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-03-20 20:54:33 +0000</bug_when>
    <thetext>First, base-files is a literal so the formatting is correct as far as I can tell.

The final paragraph implies the wrong facts:

&quot;Another point of interest is that if you leave the variable &quot;hostname&quot; unset, the image will have no default hostname in the filesystem. This condition is suitable for environments that use dynamic hostnames such as virtual machines.&quot;

You can&apos;t leave hostname unset as it has a default value.  You can unset it by assigning &quot;&quot;, as the note already mentions.  Maybe remove the note and change the paragraph to say &quot;unset the variable with =&apos;&apos;&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49615</commentid>
    <comment_count>8</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-03-20 22:28:10 +0000</bug_when>
    <thetext>Ross, 

I made some changes.  Please verify that they are okay.  Once you do that I can close the bug.  See http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#usingpoky-extend-customimage-image-name. 

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49616</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-03-20 23:24:57 +0000</bug_when>
    <thetext>Looks good, closing.  Thanks Scott!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>