<?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>11061</bug_id>
          
          <creation_ts>2017-02-16 19:48:26 +0000</creation_ts>
          <short_desc>RMC DB: qemu virtual machines need serial console settings (or default?)</short_desc>
          <delta_ts>2017-04-25 10:32:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BSPs</product>
          <component>bsps-meta-intel</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3</target_milestone>
          <dependson>11068</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Dmitry Rozhkov">dmitry.rojkov</assigned_to>
          <cc>mikko.ylinen</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70771</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-16 19:48:26 +0000</bug_when>
    <thetext>When running with RMC under qemu (for example, runqemu refkit-image-common wic intel-corei7-64), there is no output to the serial console because the boot parameters contain no console=ttyS0.

This might be a IoT Refkit specific thing, because refkit.conf currently removes console=ttyS0,115200 from APPEND. I&apos;m not sure what the log-term plan is regarding ttyS0 (always enable it, enable it only when RMC is not active with/without default in RMC database).

Besides adding ttyS0 for this kind of virtual machine it might also be necessary (or even useful) to also add ttyS1, because if I&apos;m not mistaken, automated testing with imagetest.bbclass relies on a console prompt on the second serial console.

If someone happens to look at that in the context of refkit, perhaps also check whether we use correct SERIAL_CONSOLE settings. We currently have:
/lib/systemd/system/getty.target.wants:
serial-getty@ttyS0.service  serial-getty@ttyS1.service  serial-getty@ttyS2.service

I think that&apos;s causing problems (like restarts of getty and noise in the log) when there aren&apos;t that many serial devices - not sure, haven&apos;t investigated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70772</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-16 19:54:56 +0000</bug_when>
    <thetext>There&apos;s one additional, potentially related issue: debug output and the interactive shell prompt from the initramfs are never (?) connected to the serial console.

To reproduce, add APPEND_append = &quot; shell-debug&quot; to local.conf, rebuild, and &quot;runqemu nographic serial refkit-image-common wic intel-corei7-64&quot;. One should see debug output from the initramfs, but it is only visible when running with graphic and connecting to the VNC graphical console.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71391</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry Rozhkov">dmitry.rojkov</who>
    <bug_when>2017-03-17 14:45:33 +0000</bug_when>
    <thetext>I&apos;ve submitted

https://github.com/intel/intel-iot-refkit/pull/80

adding qemu v2.6 and v2.8 to RMC DB. With the patch applied initramfs&apos;s debug output becomes visible as well as kernel and systemd&apos;s startup output.

The issue with restarting getty deserves a separate bug IMHO. SERIAL_CONSOLES is defined in meta-intel for all intel-corei7-64 builds as

&gt; SERIAL_CONSOLES = &quot;115200;ttyS0 115200;ttyS1 115200;ttyS2&quot;

whereas the qemux86-64 machine defines (in meta/conf/machine/qemux86-64.conf)

&gt; SERIAL_CONSOLES ?= &quot;115200;ttyS0 115200;ttyS1&quot;.

If we want to get rid of the unneeded console for intel-corei7-64 under QEMU we need to make RMC not ignore POSTINSTALL.sh for QEMU &quot;boards&quot;. For that, I guess, we need either to switch from initramfs-framework to initramfs-live-install-efi (RMC extends it to accommodate POSTINSTALL.sh and some other quirks) or to update RMC to use initramfs-framework.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71512</commentid>
    <comment_count>3</comment_count>
    <who name="Mikko Ylinen">mikko.ylinen</who>
    <bug_when>2017-03-21 11:27:04 +0000</bug_when>
    <thetext>(In reply to comment #0)


&gt; This might be a IoT Refkit specific thing, because refkit.conf currently
&gt; removes console=ttyS0,115200 from APPEND. I&apos;m not sure what the log-term
&gt; plan is regarding ttyS0 (always enable it, enable it only when RMC is not
&gt; active with/without default in RMC database).

ttyS0 has to be removed because with &apos;console=ttyS0,115200&apos; we&apos;d loose boot logs on 570x that has serial console in ttyS2 (two ttySx in console= is not possible). This is important from CI (and also from debugging) perspective. 

&gt; If someone happens to look at that in the context of refkit, perhaps also
&gt; check whether we use correct SERIAL_CONSOLE settings. We currently have:
&gt; /lib/systemd/system/getty.target.wants:
&gt; serial-getty@ttyS0.service  serial-getty@ttyS1.service 
&gt; serial-getty@ttyS2.service

These come from refkit_image_system_serialgetty; and SERIAL_CONSOLES in meta-intel. 

With this bug fixed, could we set ttyS0 and ttyS1 for qemu boards in the RMC db, rely on systemd-getty-generator and not use refkit_image_system_serialgetty; anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71514</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-03-21 12:36:31 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; &gt; If someone happens to look at that in the context of refkit, perhaps also
&gt; &gt; check whether we use correct SERIAL_CONSOLE settings. We currently have:
&gt; &gt; /lib/systemd/system/getty.target.wants:
&gt; &gt; serial-getty@ttyS0.service  serial-getty@ttyS1.service 
&gt; &gt; serial-getty@ttyS2.service
&gt; 
&gt; These come from refkit_image_system_serialgetty; and SERIAL_CONSOLES in
&gt; meta-intel. 

Thanks for reminding me. I wrote that and already forgot that I had ;-}

&gt; With this bug fixed, could we set ttyS0 and ttyS1 for qemu boards in the RMC
&gt; db, rely on systemd-getty-generator and not use
&gt; refkit_image_system_serialgetty; anymore.

It&apos;s worth trying. However, I left a comment above refkit_image_system_serialgetty saying:

# Defining serial consoles via the &quot;console&quot; boot parameter only works
# for at most one console. Documentation/serial-console.txt explicitly
# says &quot;Note that you can only define one console per device type
# (serial, video)&quot;.
#
# So for images where we need more than one console, we have to
# configure systemd explicitly. We cover all consoles, just to be
# on the safe side (can&apos;t know for sure which of these are also
# given via &quot;console&quot; boot parameter).

That sounds like the systemd generator looks at what the kernel uses, not what was specified in the boot parameters.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71534</commentid>
    <comment_count>5</comment_count>
    <who name="Mikko Ylinen">mikko.ylinen</who>
    <bug_when>2017-03-21 20:26:16 +0000</bug_when>
    <thetext>(In reply to comment #4)


&gt; 
&gt; That sounds like the systemd generator looks at what the kernel uses, not
&gt; what was specified in the boot parameters.

Yes, now I remember. It reads from /sys/class/tty/console/active.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72760</commentid>
    <comment_count>6</comment_count>
    <who name="Dmitry Rozhkov">dmitry.rojkov</who>
    <bug_when>2017-04-21 10:35:19 +0000</bug_when>
    <thetext>I guess this bug can be closed now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72821</commentid>
    <comment_count>7</comment_count>
    <who name="Dmitry Rozhkov">dmitry.rojkov</who>
    <bug_when>2017-04-25 10:32:48 +0000</bug_when>
    <thetext>RMC DB has got records needed for QEMU and the output is visible in the serial console.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>