<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://buffalo.nas-central.org/w/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Survive without ppc uartd - Revision history</title>
		<link>http://buffalo.nas-central.org/w/index.php?title=Survive_without_ppc_uartd&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.1</generator>
		<lastBuildDate>Tue, 18 Jun 2013 23:43:51 GMT</lastBuildDate>
		<item>
			<title>Ramuk at 00:21, 13 July 2007</title>
			<link>http://buffalo.nas-central.org/w/index.php?title=Survive_without_ppc_uartd&amp;diff=13070&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:21, 13 July 2007&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 164:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 164:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; /sbin/reboot -idp&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; /sbin/reboot -idp&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[Category&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;HowTo]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{Template&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Articles|Kurobox}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2013-06-15 19:24:39 --&gt;
&lt;!-- diff cache key nascentral_wiki-mwiki_:diff:version:1.11a:oldid:12113:newid:13070 --&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 13 Jul 2007 00:21:10 GMT</pubDate>			<dc:creator>Ramuk</dc:creator>			<comments>http://buffalo.nas-central.org/wiki/Talk:Survive_without_ppc_uartd</comments>		</item>
		<item>
			<title>Ramuk:&amp;#32;2 revision(s)</title>
			<link>http://buffalo.nas-central.org/w/index.php?title=Survive_without_ppc_uartd&amp;diff=12113&amp;oldid=prev</link>
			<description>&lt;p&gt;2 revision(s)&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:45, 12 July 2007&lt;/td&gt;
		&lt;/tr&gt;
		&lt;!-- diff generator: internal 2013-06-15 19:24:39 --&gt;
&lt;!-- diff cache key nascentral_wiki-mwiki_:diff:version:1.11a:oldid:12112:newid:12113 --&gt;
&lt;/table&gt;</description>
			<pubDate>Thu, 12 Jul 2007 19:45:55 GMT</pubDate>			<dc:creator>Ramuk</dc:creator>			<comments>http://buffalo.nas-central.org/wiki/Talk:Survive_without_ppc_uartd</comments>		</item>
		<item>
			<title>Jkk:&amp;#32;Category:HowTo</title>
			<link>http://buffalo.nas-central.org/w/index.php?title=Survive_without_ppc_uartd&amp;diff=12112&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;a href=&quot;/w/index.php?title=Category:HowTo&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:HowTo (page does not exist)&quot;&gt;Category:HowTo&lt;/a&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:05, 10 July 2006&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 163:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 163:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; /sbin/reboot -idp&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; /sbin/reboot -idp&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:HowTo]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2013-06-15 19:24:39 --&gt;
&lt;!-- diff cache key nascentral_wiki-mwiki_:diff:version:1.11a:oldid:12111:newid:12112 --&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 10 Jul 2006 02:05:18 GMT</pubDate>			<dc:creator>Jkk</dc:creator>			<comments>http://buffalo.nas-central.org/wiki/Talk:Survive_without_ppc_uartd</comments>		</item>
		<item>
			<title>61.48.74.8 at 10:56, 17 April 2006</title>
			<link>http://buffalo.nas-central.org/w/index.php?title=Survive_without_ppc_uartd&amp;diff=12111&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==How to make a firmware free of ppc_uartd==&lt;br /&gt;
The ppc_uartd daemon is an esential piece of the official firmware. Unfortunately, it doesn't seem to be Free, nor even OpenSource.&lt;br /&gt;
&lt;br /&gt;
This small howto describes how to got rid of it in Gentoo beta1. I thought it might be useful for people working on a Debian firmware for instance.&lt;br /&gt;
&lt;br /&gt;
===Disabling the watchdog on startup===&lt;br /&gt;
The first thing to do if you don't launch the ppc_uartd daemon is to shut down the watchdog, otherwise, your box will reboot after ~30 seconds. This must be done early enough in the startup process. In particular, it must come before the  checkfs scripts.&lt;br /&gt;
&lt;br /&gt;
Here is the '''init.d''' script made for Gentoo.&lt;br /&gt;
&lt;br /&gt;
/etc/init.d/kuro-avr-init:&lt;br /&gt;
&lt;br /&gt;
 #!/sbin/runscript&lt;br /&gt;
 &lt;br /&gt;
 depend() {&lt;br /&gt;
       # Do it ASAP, time is critical...&lt;br /&gt;
       before localmount&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 check_device() {&lt;br /&gt;
        if [ ! -c /dev/ttyS1 ] ; then&lt;br /&gt;
               ewarn &amp;quot;/dev/ttyS1 missing, trying to create it...&amp;quot;&lt;br /&gt;
               rm -f /dev/ttyS1&lt;br /&gt;
               mknod /dev/ttyS1 c 4 65 \&lt;br /&gt;
                       || return 1&lt;br /&gt;
       fi&lt;br /&gt;
       return 0&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 start() {&lt;br /&gt;
       ebegin &amp;quot;Initializing the Kurobox AVR&amp;quot;&lt;br /&gt;
       local status&lt;br /&gt;
       check_device \&lt;br /&gt;
       &amp;amp;&amp;amp; stty -F /dev/ttyS1 10:1:9f0d:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 \&lt;br /&gt;
       &amp;amp;&amp;amp; echo -n &amp;quot;AAAAFFFFJJJJ&amp;gt;&amp;gt;&amp;gt;&amp;gt;VVVV&amp;gt;&amp;gt;&amp;gt;&amp;gt;ZZZZVVVVKKKK&amp;quot; &amp;gt; /dev/ttyS1&lt;br /&gt;
       eend $? &amp;quot;That's not good... Your system will probably shutdown soon :/&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Monitoring power/reset buttons===&lt;br /&gt;
Another task of the ppc_uartd is to allow shutdown from the Kurobox buttons. Here, it can be easily replaced by the free kuroevtd daemon. Once launched, this daemon will react to button events by launching some shell scripts.&lt;br /&gt;
&lt;br /&gt;
Here is the '''startup''' script made for Gentoo.&lt;br /&gt;
&lt;br /&gt;
/etc/init.d/kuroevtd:&lt;br /&gt;
 #!/sbin/runscript&lt;br /&gt;
 &lt;br /&gt;
 [ -z &amp;quot;${PIDFILE}&amp;quot; ] &amp;amp;&amp;amp; PIDFILE=/var/run/kuroevtd.pid&lt;br /&gt;
 &lt;br /&gt;
 depend() {&lt;br /&gt;
       need kuro-avr-init&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 start() {&lt;br /&gt;
       ebegin &amp;quot;Starting Kurobox button events monitor&amp;quot;&lt;br /&gt;
       start-stop-daemon --start --quiet --exec /usr/sbin/kuroevtd \&lt;br /&gt;
               || eend 1 \&lt;br /&gt;
               || return 1&lt;br /&gt;
       local mypid=$(pidof /usr/sbin/kuroevtd 2&amp;gt;/dev/null)&lt;br /&gt;
       [ -n &amp;quot;${mypid}&amp;quot; ] &amp;amp;&amp;amp; echo ${mypid} &amp;gt; ${PIDFILE}&lt;br /&gt;
       eend 0&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop() {&lt;br /&gt;
       ebegin &amp;quot;Stopping Kurobox button events monitor&amp;quot;&lt;br /&gt;
       start-stop-daemon --stop --quiet --pidfile=${PIDFILE}&lt;br /&gt;
       local status=$?&lt;br /&gt;
       rm -f ${PIDFILE}&lt;br /&gt;
       eend $status&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
And here is a set of event handling scripts that produce the following behavior:&lt;br /&gt;
&lt;br /&gt;
* two short pushes on the power button (in less than 3 seconds) will reset the box with &amp;quot;shutdown -r now&amp;quot;&lt;br /&gt;
* one long push one the power button (~6 seconds) do a halt the box with &amp;quot;shutdown -h now&amp;quot;&lt;br /&gt;
* one long push on the small back button will reset the box in EM mode &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/kuroevtd.d/powerdown&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 &lt;br /&gt;
 STATE_DIR=&amp;quot;/var/lib/kuroevtd&amp;quot;&lt;br /&gt;
 debug=true&lt;br /&gt;
 &lt;br /&gt;
 current=$(date +%s)&lt;br /&gt;
 &lt;br /&gt;
 if [ -f &amp;quot;${STATE_DIR}/last&amp;quot; ] ; then&lt;br /&gt;
       read last &amp;lt;&amp;lt;&amp;lt;$(cat &amp;quot;${STATE_DIR}/last&amp;quot;)&lt;br /&gt;
       rm -f ${STATE_DIR}/last&lt;br /&gt;
       if (( current &amp;lt;= (last+3) )) ; then&lt;br /&gt;
               ${debug} &amp;amp;&amp;amp; echo &amp;quot;[kuroevtd] powerdown: will reset soon...&amp;quot;&lt;br /&gt;
               touch ${STATE_DIR}/reset&lt;br /&gt;
               exit 0&lt;br /&gt;
       fi&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 ${debug} &amp;amp;&amp;amp; echo &amp;quot;[kuroevtd] powerdown: saving push date&amp;quot;&lt;br /&gt;
 echo ${current} &amp;gt; &amp;quot;${STATE_DIR}/last&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/etc/kuroevtd.d/powerup&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 STATE_DIR=&amp;quot;/var/lib/kuroevtd&amp;quot;&lt;br /&gt;
 debug=true&lt;br /&gt;
 &lt;br /&gt;
 if [ -f &amp;quot;${STATE_DIR}/reset&amp;quot; ] ; then&lt;br /&gt;
       ${debug} &amp;amp;&amp;amp; echo &amp;quot;[kuroevtd] powerup: reset now!&amp;quot;&lt;br /&gt;
       rm -f ${STATE_DIR}/*&lt;br /&gt;
       shutdown -r now&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
/etc/kuroevtd.d/powerpress&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 STATE_DIR=&amp;quot;/var/lib/kuroevtd&amp;quot;&lt;br /&gt;
 debug=true&lt;br /&gt;
 &lt;br /&gt;
 ${debug} &amp;amp;&amp;amp; echo &amp;quot;[kuroevtd] powerpress: shutdown now!&amp;quot;&lt;br /&gt;
 rm -f ${STATE_DIR}/*&lt;br /&gt;
 shutdown -h now&lt;br /&gt;
&lt;br /&gt;
/etc/kuroevtd.d/resetpress&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 &lt;br /&gt;
 STATE_DIR=&amp;quot;/var/lib/kuroevtd&amp;quot;&lt;br /&gt;
 debug=true&lt;br /&gt;
 &lt;br /&gt;
 ${debug} &amp;amp;&amp;amp; echo &amp;quot;[kuroevtd] powerpress: reset in EM mode now!&amp;quot;&lt;br /&gt;
 if grep -q started &amp;lt;&amp;lt;&amp;lt;$(/etc/init.d/em-fallback status 2&amp;gt;/dev/null) ; then&lt;br /&gt;
       /etc/init.d/em-fallback stop&lt;br /&gt;
 fi&lt;br /&gt;
 rm -f ${STATE_DIR}/*&lt;br /&gt;
 write_ng&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
===Getting shutdown to work===&lt;br /&gt;
Finally, the last thing to know is that to shutdown or reboot the box, you must inform the AVR first. For Gentoo, I've made that by modifying two init.d scripts.&lt;br /&gt;
&lt;br /&gt;
/etc/init.d/shutdown.sh&lt;br /&gt;
 # Copyright 1999-2004 Gentoo Technologies, Inc.&lt;br /&gt;
 # Distributed under the terms of the GNU General Public License v2&lt;br /&gt;
 # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/shutdown.sh,v 1.10 2004/04/21 17:09:18 vapier Exp $&lt;br /&gt;
 &lt;br /&gt;
 # kuro: tell the AVR that we are going to halt&lt;br /&gt;
 if [ -c &amp;quot;/dev/ttyS1&amp;quot; ] ; then&lt;br /&gt;
        echo -n &amp;quot;EEEE&amp;quot; &amp;gt; /dev/ttyS1&lt;br /&gt;
 else&lt;br /&gt;
       ewarn &amp;quot;No /dev/ttyS1 device found, your Kurobox may not halt correctly!&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 /sbin/halt -idp&lt;br /&gt;
&lt;br /&gt;
/etc/init.d/reboot.sh&lt;br /&gt;
 # Copyright 1999-2004 Gentoo Technologies, Inc.&lt;br /&gt;
 # Distributed under the terms of the GNU General Public License v2&lt;br /&gt;
 # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/reboot.sh,v 1.8 2004/04/21 17:09:18 vapier Exp $&lt;br /&gt;
 &lt;br /&gt;
 # kuro: tell the AVR that we are going to reboot&lt;br /&gt;
 if [ -c &amp;quot;/dev/ttyS1&amp;quot; ] ; then&lt;br /&gt;
       echo -n &amp;quot;CCCC&amp;quot; &amp;gt; /dev/ttyS1&lt;br /&gt;
 else&lt;br /&gt;
       ewarn &amp;quot;No /dev/ttyS1 device found, your Kurobox may not reboot correctly!&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 /sbin/reboot -idp&lt;/div&gt;</description>
			<pubDate>Mon, 17 Apr 2006 10:56:31 GMT</pubDate>			<dc:creator>61.48.74.8</dc:creator>			<comments>http://buffalo.nas-central.org/wiki/Talk:Survive_without_ppc_uartd</comments>		</item>
	</channel>
</rss>