Hello all,<br><br>The guys from Rpath seem to have uncover the pesky bug that makes directfb &quot;hang&quot; the system while booting from initramfs. It seems that allowing DirectFB to use tty8 (instead of 2) would definitely fix this issue.
<br><br>Read more from this page:<br><a href="https://issues.rpath.com/browse/RPL-1593">https://issues.rpath.com/browse/RPL-1593</a><br><br><span style="font-weight: bold;">Quote</span><br><br><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">
Elliot Peele</a> - <span class="subText"><span class="date">22/Aug/07 11:38 AM</span></span>  
    <div class="action-body">At
this point I am running into issues getting splashy to compile. It
fails with several unresolved symbol errors when linking. This are
symbols that should be provided by the libs that splashy is link to. </div>




<div id="comment-45886-closed" style="display: none;">
    <div style="background: rgb(240, 240, 240) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
    <div class="action-links subText smallgrey">
    [ <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-45886-open&#39;, &#39;comment-45886-closed&#39;); return false;" class="smallgrey">Show »</a> ]
    </div>
    <div class="action-details" style="overflow: hidden; height: 1em;">
                <a name="action_45886">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">Elliot Peele</a> - <span class="subText"><span class="date">22/Aug/07 11:38 AM</span></span>
At this point I am running into issues getting splashy to compile. It
fails with several unresolved symbol errors when linking. This are
symbols that should be provided by the libs that splashy is link to. </div>
    </div>
</div>
<br clear="all">


            
        
            
            <div id="comment-46100-open">
<div class="actionContainer">
    <div class="action-links subText smallgrey">
    [
        <a href="https://issues.rpath.com/browse/RPL-1593#action_46100" title="A permanent link to this comment." class="smallgrey">Permlink</a>
                      | <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-46100-closed&#39;, &#39;comment-46100-open&#39;); return false;" class="smallgrey">« Hide</a>
    ]
    </div>
    <div class="action-details">    <a name="action_46100">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">Elliot Peele</a> - <span class="subText"><span class="date">24/Aug/07 10:23 AM</span></span>  </div>
    <div class="action-body">Splshy builds and works, now it is just a matter of porting the patches for mkinitrd and initscripts from usplash to splashy. </div>
</div>
</div>


<div id="comment-46100-closed" style="display: none;">
    <div style="background: rgb(240, 240, 240) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
    <div class="action-links subText smallgrey">
    [ <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-46100-open&#39;, &#39;comment-46100-closed&#39;); return false;" class="smallgrey">Show »</a> ]
    </div>
    <div class="action-details" style="overflow: hidden; height: 1em;">
                <a name="action_46100">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">Elliot Peele</a> - <span class="subText"><span class="date">24/Aug/07 10:23 AM</span></span>
Splshy builds and works, now it is just a matter of porting the patches
for mkinitrd and initscripts from usplash to splashy. </div>
    </div>
</div>
<br clear="all">


            
        
            
            <div id="comment-48839-open">
<div class="actionContainer">
    <div class="action-links subText smallgrey">
    [
        <a href="https://issues.rpath.com/browse/RPL-1593#action_48839" title="A permanent link to this comment." class="smallgrey">Permlink</a>
                      | <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-48839-closed&#39;, &#39;comment-48839-open&#39;); return false;" class="smallgrey">« Hide</a>
    ]
    </div>
    <div class="action-details">    <a name="action_48839">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">Elliot Peele</a> - <span class="subText"><span class="date">20/Sep/07 05:46 PM</span></span>  </div>
    <div class="action-body">Current Status:

<p>We are going to be shipping splashy in rPath Linux 2 Alpha 4. uSplash has been abandoned as it is too hard to create themes for.</p>

<p>Three packages are required splashy, DirectFB, and initscripts from <tt>usplash.rb.rpath.com@rpl:devel</tt>. These are only available as x86.</p>

<p>Splashy is being started from <tt>/etc/rc.sysinit</tt> by calling <tt>splash_boot</tt> which is a function implemented in <tt>/etc/init.d/functions</tt>. There are several splash related functions near the end of <tt>
/etc/init.d/functions</tt>.</p>

<p>When running in run level 3 splashy seems to work rather well,
however in run level 5 splashy starts using 100% of the CPU when init
switches from <tt>rc.sysinit</tt> to <tt>rc</tt>. At this point init
detaches the controlling terminal from splashy which seems to make it
freak out. I have tried stracing the splashy process, but splashy
behaves differently in this case because the controlling terminal
changes differently.</p> </div>
</div>
</div>


<div id="comment-48839-closed" style="display: none;">
    <div style="background: rgb(240, 240, 240) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
    <div class="action-links subText smallgrey">
    [ <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-48839-open&#39;, &#39;comment-48839-closed&#39;); return false;" class="smallgrey">Show »</a> ]
    </div>
    <div class="action-details" style="overflow: hidden; height: 1em;">
                <a name="action_48839">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">Elliot Peele</a> - <span class="subText"><span class="date">20/Sep/07 05:46 PM</span></span>               Current Status:

We are going to be shipping splashy in rPath Linux 2 Alpha 4. uSplash has been abandoned as it is too hard to create themes for.

Three packages are required splashy, DirectFB, and initscripts from <tt>usplash.rb.rpath.com@rpl:devel</tt>. These are only available as x86.

Splashy is being started from <tt>/etc/rc.sysinit</tt> by calling <tt>splash_boot</tt> which is a function implemented in <tt>/etc/init.d/functions</tt>. There are several splash related functions near the end of <tt>/etc/init.d/functions
</tt>.
When running in run level 3 splashy seems to work rather well, however
in run level 5 splashy starts using 100% of the CPU when init switches
from <tt>rc.sysinit</tt> to <tt>rc</tt>.
At this point init detaches the controlling terminal from splashy which
seems to make it freak out. I have tried stracing the splashy process,
but splashy behaves differently in this case because the controlling
terminal changes differently. </div>
    </div>
</div>
<br clear="all">


            
        
            
            <div id="comment-49142-open">
<div class="actionContainer">
    <div class="action-links subText smallgrey">
    [
        <a href="https://issues.rpath.com/browse/RPL-1593#action_49142" title="A permanent link to this comment." class="smallgrey">Permlink</a>
                      | <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-49142-closed&#39;, &#39;comment-49142-open&#39;); return false;" class="smallgrey">« Hide</a>
    ]
    </div>
    <div class="action-details">    <a name="action_49142">
                        
    
                                                
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=stas">Stas Kysel</a> - <span class="subText"><span class="date">25/Sep/07 01:09 PM</span></span>   - <span class="redText subText" title="Elliot Peele - 25/Sep/07 04:30 PM">
edited</span> </div>
    <div class="action-body">Splashy is cycling in the following function in DirectFB, in &quot;while&quot;:
<div class="preformatted"><div class="preformattedContent">
<pre>static void*<br>keyboardEventThread( DirectThread *thread, void *driver_data )<br>{<br>     int            readlen;<br>     unsigned char  buf[64];<br>     KeyboardData  *data = (KeyboardData*) driver_data;<br><br>     /* Read keyboard data */
<br>     while ((readlen = read (data-&gt;vt-&gt;fd, buf, 64)) &gt;= 0 || errno == EINTR) {<br>          int i;<br><br>          direct_thread_testcancel( thread );<br><br>          for (i = 0; i &lt; readlen; i++) {<br>               DFBInputEvent evt;
<br><br>               evt.type     = ((buf[i] &amp; 0x80) ?<br>                               DIET_KEYRELEASE : DIET_KEYPRESS);<br>               evt.flags    = DIEF_KEYCODE;<br>               evt.key_code = buf[i] &amp; 0x7f;
<br><br>               dfb_input_dispatch( data-&gt;device, &amp;evt );<br><br>               keyboard_set_lights( data, evt.locks );<br>          }<br>     }<br></pre>
</div></div>

<p>readlen = 0, errno = 0</p>

<p>Probably &quot;sleep(1)&quot; workaround would fix 100% load and may be considered a quick fix.<br>
I don&#39;t know yet why it is not cycling when started from command line
or on shutdown - the cycle looks quite endless and 100%-consuming one,
if keys are not pressed and file descriptor is non-blocking.<br>
Debugger doesn&#39;t work very well when program is cycling (it shows
data=0 and exits program on pthread_testcancel()), so I use debug
prints.</p> </div>
</div>
</div>


<div id="comment-49142-closed" style="display: none;">
    <div style="background: rgb(240, 240, 240) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
    <div class="action-links subText smallgrey">
    [ <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-49142-open&#39;, &#39;comment-49142-closed&#39;); return false;" class="smallgrey">Show »</a> ]
    </div>
    <div class="action-details" style="overflow: hidden; height: 1em;">
                <a name="action_49142">
                        
    
                                                
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=stas">Stas Kysel</a> - <span class="subText"><span class="date">25/Sep/07 01:09 PM</span></span>   - <span class="redText subText" title="Elliot Peele - 25/Sep/07 04:30 PM">
edited</span>              Splashy is cycling in the following function in DirectFB, in &quot;while&quot;:
<div class="preformatted"><div class="preformattedContent">
<pre>static void*
keyboardEventThread( DirectThread *thread, void *driver_data )
{
     int            readlen;
     unsigned char  buf[64];
     KeyboardData  *data = (KeyboardData*) driver_data;

     /* Read keyboard data */
     while ((readlen = read (data-&gt;vt-&gt;fd, buf, 64)) &gt;= 0 || errno == EINTR) {
          int i;

          direct_thread_testcancel( thread );

          for (i = 0; i &lt; readlen; i++) {
               DFBInputEvent evt;

               evt.type     = ((buf[i] &amp; 0x80) ?
                               DIET_KEYRELEASE : DIET_KEYPRESS);
               evt.flags    = DIEF_KEYCODE;
               evt.key_code = buf[i] &amp; 0x7f;

               dfb_input_dispatch( data-&gt;device, &amp;evt );

               keyboard_set_lights( data, evt.locks );
          }
     }
</pre>
</div></div>
readlen = 0, errno = 0
Probably &quot;sleep(1)&quot; workaround would fix 100% load and may be
considered a quick fix.
I don&#39;t know yet why it is not cycling when started from command line
or on shutdown - the cycle looks quite endless and 100%-consuming one,
if keys are not pressed and file descriptor is non-blocking.
Debugger doesn&#39;t work very well when program is cycling (it shows
data=0 and exits program on pthread_testcancel()), so I use debug
prints. </div>
    </div>
</div>
<br clear="all">


            
        
            
            <div id="comment-49217-open">
<div class="actionContainer">
    <div class="action-links subText smallgrey">
    [
        <a href="https://issues.rpath.com/browse/RPL-1593#action_49217" title="A permanent link to this comment." class="smallgrey">Permlink</a>
                      | <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-49217-closed&#39;, &#39;comment-49217-open&#39;); return false;" class="smallgrey">« Hide</a>
    ]
    </div>
    <div class="action-details">    <a name="action_49217">
                        
    
                                                
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">Elliot Peele</a> - <span class="subText"><span class="date">25/Sep/07 04:36 PM</span></span>   - <span class="redText subText" title="Michael K. Johnson - 25/Sep/07 04:41 PM">
edited</span> </div>
    <div class="action-body">Adding a usleep(200) to the above function if readlen == 0 seems to have alleviated the 100% CPU problem. </div>
</div>
</div>


<div id="comment-49217-closed" style="display: none;">
    <div style="background: rgb(240, 240, 240) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
    <div class="action-links subText smallgrey">
    [ <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-49217-open&#39;, &#39;comment-49217-closed&#39;); return false;" class="smallgrey">Show »</a> ]
    </div>
    <div class="action-details" style="overflow: hidden; height: 1em;">
                <a name="action_49217">
                        
    
                                                
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=elliot">Elliot Peele</a> - <span class="subText"><span class="date">25/Sep/07 04:36 PM</span></span>   - <span class="redText subText" title="Michael K. Johnson - 25/Sep/07 04:41 PM">
edited</span>              Adding a usleep(200) to the above function if readlen == 0 seems to have alleviated the 100% CPU problem.     </div>
    </div>
</div>
<br clear="all">


            
        
            
            <div id="comment-49305-open">
<div class="actionContainer">
    <div class="action-links subText smallgrey">
    [
        <a href="https://issues.rpath.com/browse/RPL-1593#action_49305" title="A permanent link to this comment." class="smallgrey">Permlink</a>
                      | <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-49305-closed&#39;, &#39;comment-49305-open&#39;); return false;" class="smallgrey">« Hide</a>
    ]
    </div>
    <div class="action-details">    <a name="action_49305">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=stas">Stas Kysel</a> - <span class="subText"><span class="date">26/Sep/07 10:20 AM</span></span>  </div>
    <div class="action-body">The trouble is:<br>
  DirectFB is using VT_OPENQRY ioctl to get the next unused tty.<br>
  It gets /dev/tty2 this way because gettys are not started by init yet.<br>
  Later, when getty on /dev/tty2 is started, it uses it and interfere with DirectFB.

<p>Resolutions may include:<br>
  Patching DirectFB to use /dev/tty7 or any other device - patch is ready, I&#39;ve used it during investigation.<br>
  Disabling tty2 in inittab (looks weird)<br>
Making ttys up to 6 busy during splashy startup somehow - start gettys
on it (maybe put splashy to inittab, after getty entries), or use some
other program to open all ttys mentioned in inittab, or maybe just find
proper switch in init.<br>
  Look how it&#39;s resolved in other distros.<br>
  Ask splashy developers.<br>
  Try to modify DirectFB so that it doesn&#39;t rely on tty modes (or in other way interfere with getty).</p>

<p>If anybody has any idea on clean resolution of this, please add comment.</p>

<p>Some details which may be interesting if above is not understood fully:</p>

<p>1. When started from initscripts, DirectFB opens 2 ttys - /dev/tty0 and /dev/tty2.<br>
When started from command line after boot - /dev/tty7.</p>

<p>2.  /dev/tty2(7) is used by buggy thread for keyboard input.<br>
DirectFB uses termios to change it&#39;s mode:</p>
<div class="preformatted"><div class="preformattedContent">
<pre>     ts.c_cc[VTIME] = 0;<br>     ts.c_cc[VMIN] = 1;<br>     ts.c_lflag &amp;= ~(ICANON|ECHO|ISIG);<br>     ts.c_iflag = 0;<br></pre>
</div></div>

<p>3. But somewhere in boot up tty mode is changed back. I can&#39;t find
&quot;stty&quot; in /etc scripts, I&#39;m not sure where it&#39;s done, most probably in
gettys. I suspect that this triggers cycling bug in DirectFB.</p>

<p>4. Ttys up to tty6 (but excluding tty7) are mentioned in<br>
  kde3/kdm/kdmrc:ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br>
  inittab</p>

<p>5. When I change mode back, cycling doesn&#39;t stop.</p>

<p>6. When I patch DirectFB to open tty7 instead of tty2, or when I disable tty2 getty in inittab, bug is not triggered.</p> </div>
</div>
</div>


<div id="comment-49305-closed" style="display: none;">
    <div style="background: rgb(240, 240, 240) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
    <div class="action-links subText smallgrey">
    [ <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-49305-open&#39;, &#39;comment-49305-closed&#39;); return false;" class="smallgrey">Show »</a> ]
    </div>
    <div class="action-details" style="overflow: hidden; height: 1em;">
                <a name="action_49305">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=stas">Stas Kysel</a> - <span class="subText"><span class="date">26/Sep/07 10:20 AM</span></span>
The trouble is: DirectFB is using VT_OPENQRY ioctl to get the next
unused tty. It gets /dev/tty2 this way because gettys are not started
by init yet. Later, when getty on /dev/tty2 is started, it uses it and
interfere with DirectFB.
Resolutions may include: Patching DirectFB to use /dev/tty7 or any
other device - patch is ready, I&#39;ve used it during investigation.
Disabling tty2 in inittab (looks weird) Making ttys up to 6 busy during
splashy startup somehow - start gettys on it (maybe put splashy to
inittab, after getty entries), or use some other program to open all
ttys mentioned in inittab, or maybe just find proper switch in init.
Look how it&#39;s resolved in other distros. Ask splashy developers. Try to
modify DirectFB so that it doesn&#39;t rely on tty modes (or in other way
interfere with getty).
If anybody has any idea on clean resolution of this, please add
comment.
Some details which may be interesting if above is not understood fully:
1. When started from initscripts, DirectFB opens 2 ttys - /dev/tty0 and
/dev/tty2.
When started from command line after boot - /dev/tty7.
2. /dev/tty2(7) is used by buggy thread for keyboard input.
DirectFB uses termios to change it&#39;s mode:
<div class="preformatted"><div class="preformattedContent">
<pre>     ts.c_cc[VTIME] = 0;
     ts.c_cc[VMIN] = 1;
     ts.c_lflag &amp;= ~(ICANON|ECHO|ISIG);
     ts.c_iflag = 0;
</pre>
</div></div>3. But somewhere in boot up tty mode is changed back. I
can&#39;t find &quot;stty&quot; in /etc scripts, I&#39;m not sure where it&#39;s done, most
probably in gettys. I suspect that this triggers cycling bug in
DirectFB.
4. Ttys up to tty6 (but excluding tty7) are mentioned in
kde3/kdm/kdmrc:ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6 inittab
5. When I change mode back, cycling doesn&#39;t stop.
6. When I patch DirectFB to open tty7 instead of tty2, or when I
disable tty2 getty in inittab, bug is not triggered. </div>
    </div>
</div>
<br clear="all">


            
        
            
            <div id="comment-49358-open">
<div class="actionContainer">
    <div class="action-links subText smallgrey">
    [
        <a href="https://issues.rpath.com/browse/RPL-1593#action_49358" title="A permanent link to this comment." class="smallgrey">Permlink</a>
                      | <a href="https://issues.rpath.com/browse/RPL-1593" onclick="toggleDivsWithCookie(&#39;comment-49358-closed&#39;, &#39;comment-49358-open&#39;); return false;" class="smallgrey">« Hide</a>
    ]
    </div>
    <div class="action-details">    <a name="action_49358">
                        
    
    
    
        </a><a href="https://issues.rpath.com/secure/ViewProfile.jspa?name=johnsonm">Michael K. Johnson</a> - <span class="subText"><span class="date">26/Sep/07 02:13 PM</span></span>  </div>
    <div class="action-body">tty7 gets used by the first X in runlevel 5, and that&#39;s a default configuration in some cases.

<p>As a workaround, we could be very sneaky in the initrd and mknod
tty2 with the right minor number for tty8 – or tty16, or whatever. <img class="emoticon" src="https://issues.rpath.com/images/icons/emoticons/smile.gif" alt="" align="absmiddle" border="0" height="20" width="20"></p>

<p>getty does change the mode.  I wonder if we could possibly make use of this this?  That is, in the thread, if <tt>readlen == 0</tt>, then see if termios settings have been changed, and if so, re-use <tt>VT_OPENQRY</tt>
 to open up a new vt and use that.</p>

<p>I&#39;d think that enhancing DirectFB to allow specifying what tty to
use would be a good idea in general – we know, for instance, that vt8
will always be available in our normal setups, but that&#39;s quite
flexible in the general case.</p> </div>
</div>
</div><br><span style="font-weight: bold;">End Quote</span><br clear="all"><br>This is very very good news!<br><br>-- <br>----)(----- <br>Luis Mondesi<br>Maestro Debiano<br><br>----- START ENCRYPTED BLOCK (Triple-ROT13) ------
<br>Gur Hohagh [Yvahk] qvfgevohgvba oevatf gur fcvevg bs Hohagh gb gur fbsgjner jbeyq.<br>----- END ENCRYPTED BLOCK (Triple-ROT13) ------