<div dir="ltr">can you switch on something in uname -a?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 25, 2013 at 2:29 PM, Petter Reinholdtsen <span dir="ltr"><<a href="mailto:pere@hungry.com" target="_blank">pere@hungry.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<br>
To make it easier for scripts in packages to know if the current<br>
environment is a dreamplug or not, I suggest we provide a<br>
/sbin/dreamplug-detect script for this purpose.  This script should<br>
work, but might not be robust enough:<br>
<br>
#!/bin/sh<br>
#<br>
# Return true if running on a dreamplug, and false otherwise.<br>
#<br>
# Currently look for an armel machine with USB devices with IDS<br>
# 0d8c:000c and 05e3:0726.  Perhaps a better way exist?<br>
# Based on details from <URL: <a href="https://wiki.debian.org/DreamPlugTesting" target="_blank">https://wiki.debian.org/DreamPlugTesting</a> ><br>
<br>
case $(dpkg --print-architecture) in<br>
     armel)<br>
        audiofound=false<br>
        sdcardreaderfound=false<br>
        for modalias in $(find /sys -name modalias -exec cat '{}' \;) ; do<br>
            case $modalias in<br>
                usb:v0D8Cp000Cd*) # C-Media Electronics, Inc. Audio Adapter<br>
                    audiofound=true<br>
                    ;;<br>
                usb:v05E3p0726d*) # Genesys Logic, Inc. SD Card Reader<br>
                    sdcardreaderfound=true<br>
                    ;;<br>
                esac<br>
        done<br>
        if $audiofound && $sdcardreaderfound ; then<br>
            return 0<br>
        fi<br>
        return 1<br>
        ;;<br>
    *)<br>
        return 1<br>
        ;;<br>
esac<br>
<br>
Any objections?  Suggestions for better implementation?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Happy hacking<br>
Petter Reinholdtsen<br>
<br>
_______________________________________________<br>
Freedombox-discuss mailing list<br>
<a href="mailto:Freedombox-discuss@lists.alioth.debian.org">Freedombox-discuss@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/freedombox-discuss" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/freedombox-discuss</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div><i>"Anything created must necessarily be inferior to the essence of the creator."<br>-- Claude Shouse (shouse@macomw.ARPA)<br>
"Einstein's mother must have been one heck of a physicist."<br>-- Joseph C. Wang (<a href="mailto:joe@athena.mit.edu" target="_blank">joe@athena.mit.edu</a>)<br><br></i><div><br></div>
</div></div>
</div>