<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>paguilar.org</title>
	<atom:link href="http://www.paguilar.org/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.paguilar.org/blog</link>
	<description>Embedded Linux for the digital TV</description>
	<lastBuildDate>Sun, 01 Apr 2012 22:25:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Cross-compiling gnokki</title>
		<link>http://www.paguilar.org/blog/?p=201</link>
		<comments>http://www.paguilar.org/blog/?p=201#comments</comments>
		<pubDate>Sun, 01 Apr 2012 22:25:19 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[hspa-gsm]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=201</guid>
		<description><![CDATA[Recently, I needed a software that sends and recevies Short Message Services (SMS) from a Linux ARM-based embedded device. Obviously, I needed something with a small foot-print and not resource-hungry. I found three FOSS options that could fit my needs: gsm-utils Package: gsmlib_1.10.orig.tar.gz This project is quite old and unmaintained. If you compile it with [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed a software that sends and recevies Short Message Services (SMS) from a Linux ARM-based embedded device. Obviously, I needed something with a small foot-print and not resource-hungry. I found three FOSS options that could fit my needs:</p>
<p><strong>gsm-utils</strong><br />
Package: <a href="http://packages.debian.org/squeeze/gsm-utils"> gsmlib_1.10.orig.tar.gz </a><br />
This project is quite old and unmaintained. If you compile it with a recent gcc (I was using 4.3.x), you&#8217;ll need to apply this <a href="http://ftp.de.debian.org/debian/pool/main/g/gsmlib/gsmlib_1.10-13.diff.gz">patch</a> provided by Debian. The building procedure is straight-forward, but the results, at least for me, were quite disapointing because the SMS daemon crashed very often.</p>
<p><strong>gammu</strong><br />
Package: <a href="http://sourceforge.net/projects/gammu/files/gammu/1.31.0/gammu-1.31.0.tar.bz2">gammu-1.31.0.tar.bz2</a><br />
Gammu is a fork of gnokii (the third option), it&#8217;s well documented, it&#8217;s robust and more complex, and it has a lot of features making it a bit heavier than gnokii. If your hardware is a PC or a high-end ARM processor I would recommend gammu. It also depends on libdbi that implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl.<br />
Since I can only use SQLite3, I don&#8217;t need the portability to other databases making the use of libdbi redundant.</p>
<p><strong>gnokii</strong><br />
Package: <a href="http://www.gnokii.org/download/gnokii/0.6.x/gnokii-0.6.31.tar.bz2">gnokii-0.6.31.tar.bz2</a><br />
Gnokii is a set of tools, similar to gammu that allows to send/receive SMS, read/write to a phonebook and other services. I was only interested in the SMS functionality that seemed to cover quite well.<br />
gnokii&#8217;s SMS daemon, <em>smsd</em>, is quite light, making it suitable for small ARM processors like the one I have.<br />
Latest versions support SQLite3 so I could even put the two tables that  smsd uses for sending and receiving SMS inside my database.</p>
<p>The documentation is not great, but good enough to get started. The code is quite clear and easy to understand. In fact, I found a memory leak in smsd that I fixed and sent to the mailing list. The patch was applied quite fast showing the active development around this project.</p>
<p>I decided to use gnokii and document its building procedure since the cross-compilation is not straight forward. </p>
<p>This is the procedure I followed:</p>
<p>Set the following environment variables that will make our life easier:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BUILD</span>=i386-linux
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HOST</span>=arm-linux
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROJECT_PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>rootfs</pre></div></div>

<p>Configure:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">GLIB_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PROJECT_PATH</span>/usr/include/glib-2.0 -I<span style="color: #007800;">$PROJECT_PATH</span>/usr/lib/glib-2.0/include&quot;</span> \
<span style="color: #007800;">GLIB_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PROJECT_PATH</span>/usr/lib&quot;</span> \
<span style="color: #007800;">SQLITE3_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PROJECT_PATH</span>/usr/include&quot;</span> \
<span style="color: #007800;">SQLITE3_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PROJECT_PATH</span>/usr/lib&quot;</span> \
.<span style="color: #000000; font-weight: bold;">/</span>configure \
<span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> \
<span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> \
<span style="color: #660033;">--without-x</span> \
<span style="color: #660033;">--without-bluetooth</span> \
<span style="color: #660033;">--without-libical</span> \
<span style="color: #660033;">--disable-libusb</span> \
<span style="color: #660033;">--disable-phonet</span> \
<span style="color: #660033;">--enable-sqlite</span> \
<span style="color: #660033;">--disable-xdebug</span></pre></div></div>

<p>Before building, edit the following Makefiles:</p>
<ol>
<li>common/phones/Makefile</li>
<li>common/links/Makefile</li>
<li>common/devices/Makefile</li>
<li>common/data/Makefile</li>
<li>gnokii/Makefile</li>
<li>common/Makefile</li>
<li>utils/Makefile</li>
<li>gnokiid/Makefile</li>
</ol>
<p>Unset the variable <em>LIBS</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LIBS =</pre></div></div>

<p>Edit the file <em>gnokii/Makefile</em>:<br />
Set the variable <em>LIBS</em> to the following value:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LIBS =   -lgobject-<span style="color: #000000;">2.0</span> -lgmodule-<span style="color: #000000;">2.0</span> -lgthread-<span style="color: #000000;">2.0</span> -lglib-<span style="color: #000000;">2.0</span></pre></div></div>

<p>Edit the file <em>smsd/Makefile</em>:<br />
Set the variable <em>GLIB_LIBS</em> to the following value:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">GLIB_LIBS = -L<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>rootfs<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib <span style="color: #660033;">-lsqlite3</span></pre></div></div>

<p>Now you can build and install in <em>/home/projects/rootfs/usr/local</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">DESTDIR</span>=<span style="color: #007800;">$PROJECT_PATH</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Gnokii still has some rough edges that can be fixed/improved, but after  a couple of months of intensive use its behaviour has been quite stable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=201</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple C to XML serializer 0.0.2 released in GitHub</title>
		<link>http://www.paguilar.org/blog/?p=200</link>
		<comments>http://www.paguilar.org/blog/?p=200#comments</comments>
		<pubDate>Sun, 12 Feb 2012 15:57:16 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=200</guid>
		<description><![CDATA[Some while ago I wrote a simple C to XML serializer that reads C structs and unions from a header file a writes them to a XML file. You can read that post here. I&#8217;ve improved it a little bit and released it in GitHub. You can check it out here. This program is in [...]]]></description>
			<content:encoded><![CDATA[<p>Some while ago I wrote a simple C to XML serializer that reads C structs and unions from a header file a writes them to a XML file. You can read that post <a href="http://www.paguilar.org/blog/?p=121">here</a>.</p>
<p>I&#8217;ve improved it a little bit and released it in GitHub. You can check it out <a href="https://github.com/paguilar/sc2xml">here</a>.</p>
<p>This program is in its first stages and currently it only converts the most widely used C-structs constructs to XML. However, it could potentially serialize other C constructs and almost any C code since it uses an almost full-compatible C grammar.</p>
<p>The version I released in GitHub adds the support for structs/unions defined inside a macro.</p>
<p>I&#8217;ll try to explain how this feature works:<br />
Suppose you have a file,<em> test3.h</em>, with a macro that defines the following struct:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define def_struct_data(prefix,number,code_number)\
struct prefix##driver_data\
{\
    task_status_t tsk_sts;\
\
    struct buttons_platform_data pdata[number];\
    struct prefix##an_event event;\
\
    struct prefix##buttons_settings\
    {\
        uint8_t thresholds[3];\
        uint8_t pressed_threshold;\
        struct prefix##buttons_mask hash_table[code_number];\
    }__attribute__((packed)) settings;\
\
    uint8_t raw[((number) / 8) + 1];\
    uint8_t raw_mem[((number) / 8) + 1];\
\
}__attribute__((packed));</span></pre></div></div>

<p>As you probably know, the syntax of a C macro is not valid for a C compiler, that&#8217;s one of the reasons for using the C pre-compiler: it <em>converts</em> the macro to something that the compiler understands.<br />
In the SC2XML case, applies the same condition. Therefore, you have to create a very simple C file that includes the file that you want to serialize, in this case test3.h, along with the use of the macro and execute sc2xml with that file:</p>
<p>Assume that the name of your simple C file is <em>test3.stub.h</em>. It should looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &quot;test3.h&quot;</span>
def_struct_data<span style="color: #009900;">&#40;</span>prefix<span style="color: #339933;">,</span>number<span style="color: #339933;">,</span>code_number<span style="color: #009900;">&#41;</span></pre></div></div>

<p><em>def_struct_data</em> is the name of your macro.</p>
<p>Execute sc2xml:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ sc2xml test3.stub.h
&nbsp;
sc2xml 0.0.2
&nbsp;
INFO: <span style="color: #000000; font-weight: bold;">***</span> Parsing <span style="color: #c20cb9; font-weight: bold;">file</span> data<span style="color: #000000; font-weight: bold;">/</span>test3.gen.h <span style="color: #000000; font-weight: bold;">***</span></pre></div></div>

<p>The final generated XML file, <em>test3.h.xml</em>, will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sc2xml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struct<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struct_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>prefixdriver_data<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struct_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;task_status_t&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>tsk_sts<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;struct buttons_platform_data&quot;</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;number&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>pdata<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;struct prefixan_event&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>event<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struct<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struct_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>prefixbuttons_settings<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struct_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;uint8_t&quot;</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>thresholds<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;uint8_t&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>pressed_threshold<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;struct prefixbuttons_mask&quot;</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;code_number&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>hash_table<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struct_attributes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>__attribute__ ( ( packed ) ) <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struct_attributes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struct_nested_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>settings <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struct_nested_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struct<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;uint8_t&quot;</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;( ( number ) / 8 ) + 1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>raw<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;uint8_t&quot;</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;( ( number ) / 8 ) + 1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>raw_mem<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struct_attributes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>__attribute__ ( ( packed ) )<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struct_attributes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struct<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sc2xml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now you can see that the XML file shows exactly the struct defined in the macro <em>def_struct_data</em> but with nice XML tags!</p>
<p>I hope this project could be useful, specially if you want a non-trivial example that defines a parser and grammar with lex and yacc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=200</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating the Samsung Galaxy i7500 using Linux</title>
		<link>http://www.paguilar.org/blog/?p=170</link>
		<comments>http://www.paguilar.org/blog/?p=170#comments</comments>
		<pubDate>Fri, 15 Apr 2011 07:36:34 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[bootloader]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=170</guid>
		<description><![CDATA[The Galaxy i7500 was the first android phone built by Samsung. I got this phone some while ago and I wanted to update to a more recent android version (the original firmware ships version 1.6), but unfortunately, Samsung doesn&#8217;t give any support nor updates. Thus, if you want to update the firmware, you can use [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/Samsung_i7500">Galaxy i7500</a> was the first android phone built by Samsung. I got this phone some while ago and I wanted to update to a more recent android version (the original firmware ships version 1.6), but unfortunately, Samsung doesn&#8217;t give any support nor updates. Thus, if you want to update the firmware, you can use a non-official firmware.</p>
<p>In this post I try to explain how to do this when your host/PC is a Linux machine.<br />
The procedure described here is partially based in the quite uselful <a href="http://androidforums.com/i7500-all-things-root/72037-easy-guide-update-galaxo-gaosp.html">Easy guide to update to Galaxo or GAOSP!</a> written by DaSchmarotzer that explains how to update this phone but using a Windows based machine.</p>
<p><font size="3"><strong>Download</strong></font></p>
<p>Get all the needed files:</p>
<ul>
<li><a href="http://dl.google.com/android/android-sdk_r10-linux_x86.tgz">Android SDK for Linux</a></li>
<li><a href="http://dl4.htc.com/RomCode/ADP/fastboot.zip">Fastboot</a> for manipulating the flash</li>
<li><a href="http://www.drakaz.com/FILES/GALAXY/?file=RECOVERY_6.5.1.zip">Custom recovery</a></li>
<li>ROM: Choose one option. I chose Galaxo.
<ul>
<li><a href="http://gaosp.googlecode.com/files/GAOSP-2-PUBLIC-BETA-3.zip">GAOSP-2-PUBLIC-BETA-3</a> </li>
<li><a href="http://www.drakaz.com/FILES/GALAXY/?file=Galaxo_V1.6.3.4.zip">Galaxo_V1.6.3.4</a></li>
</ul>
</li>
<li>Gapps for restoring Google Applications. Choose one option. I chose Galaxo.
<ul>
<li><a href="http://obihoernchen.androidcodex.com/downloads/GAOSP%20Gapps%20Light/gapps-gaosp-light-10312010-signed.zip">gapps-gaosp-light-10312010-signed.zip</a></li>
<li><a href="http://uploading.com/files/f54288a1/gapps-galaxo-signed.zip/">gapps-galaxo-signed.zip</a></li>
</ul>
</li>
</ul>
<p><font size="3"><strong>Put everything in place</strong></font></p>
<p>First of all, create a backup of your data. The SD card (pictures, music, etc) won&#8217;t be touched, but other important info like your contacts will be erased. If you have a Gmail account you just can synchronize your contacts for uploading them to your account and once you finish the update you can synchronize it again for downloading them to the phone.</p>
<p>Unpack the android SDK wherever you want. I put all the downloaded files in <em>/home/android/</em>.</p>
<p>Decompress the android SDK. The directory <em>/home/android/android-sdk-linux_x86</em> will be created.</p>
<p>Change to the directory <em>/home/android/android-sdk-linux_x86/tools</em></p>
<p>Move the file <em>fastboot.zip</em> inside the <em>/home/android/android-sdk-linux_x86/tools</em> directory and decompress it. A new file called <em>fastboot</em> will be created.<br />
Give it execution permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x fastboot</pre></div></div>

<p>Connect your phone via USB and mount its SD card.<br />
Copy the chosen ROM and Gapps files to the phone&#8217;s SD card.<br />
Umount the SD card.<br />
Turn off the phone, but leave it connected to the PC using the USB cable.</p>
<p>Now we have all the downloaded files in the required locations.</p>
<p><font size="3"><strong>Manipulate the i7500 flash with fastboot</strong></font></p>
<p>We have to tell the phone&#8217;s bootloader how to load our files. fastboot can write a new bootloader image (recovery-6.5.1.img) that allow us to do exactly that plus several other operations.</p>
<p>Before executing fastboot, we need to tell <em>udev</em> through its rules that we&#8217;re the owner of the usb device with vendors ID 18d1 (Google Inc.) and 04e8 (Samsung Electronics Co., Ltd).<br />
You have to do these steps as root.<br />
Change <em>username</em> to the username you use for logging in your system.</p>
<p>Create the file <em>/etc/udev/rules.d/50.android.rules</em> with the following content</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">SUBSYSTEM</span>==<span style="color: #ff0000;">&quot;usb&quot;</span>, SYSFS<span style="color: #7a0874; font-weight: bold;">&#123;</span>idVendor<span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;18d1&quot;</span>, <span style="color: #007800;">MODE</span>=<span style="color: #ff0000;">&quot;0666&quot;</span>, <span style="color: #007800;">OWNER</span>=<span style="color: #ff0000;">&quot;username&quot;</span></pre></div></div>

<p>Create the file <em>/etc/udev/rules.d/90.android.rules</em> with the following content</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">SUBSYSTEM</span>==<span style="color: #ff0000;">&quot;usb&quot;</span>, SYSFS<span style="color: #7a0874; font-weight: bold;">&#123;</span>idVendor<span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;04e8&quot;</span>, <span style="color: #007800;">MODE</span>=<span style="color: #ff0000;">&quot;0666&quot;</span>, <span style="color: #007800;">OWNER</span>=<span style="color: #ff0000;">&quot;username&quot;</span></pre></div></div>

<p>Reload udev&#8217;s rules</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ reload udev</pre></div></div>

<p>As a normal user, add the <em>/tools</em> directory where fastboot is located to your <em>PATH</em> environment variable.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>android<span style="color: #000000; font-weight: bold;">/</span>android-sdk-linux_x86<span style="color: #000000; font-weight: bold;">/</span>tools</pre></div></div>

<p>Change to the <em>/home/android/android-sdk-linux_x86/tools</em> directory and write the following command <strong>without</strong> pressing enter.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ fastboot flash recovery recovery-6.5.1.img</pre></div></div>

<p>You&#8217;ll press it after booting the phone in fastboot mode. Do so by pressing and holding both the <em>Call button</em> (bottom left) and the <em>Power button</em> (bottom right) at the same time until you see on the phone that you are in fastboot mode. You’ll have about 15 seconds to press enter on the shell. If it works, you’ll see in the shell this output:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sending <span style="color: #ff0000;">'recovery'</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">3080</span> KB<span style="color: #7a0874; font-weight: bold;">&#41;</span>... OKAY
writing <span style="color: #ff0000;">'recovery'</span>... OKAY</pre></div></div>

<p>In the phone&#8217;s display you&#8217;ll see something like this:</p>
<div id="attachment_186" class="wp-caption alignnone" style="width: 310px"><a href="http://www.paguilar.org/blog/wp-content/uploads/2011/04/DSC03720.jpg"><img src="http://www.paguilar.org/blog/wp-content/uploads/2011/04/DSC03720-300x225.jpg" alt="Android fastboot" title="android_fastboot" width="300" height="225" class="size-medium wp-image-186" /></a><p class="wp-caption-text">Android fastboot</p></div>
<p>At this point we have a new bootloader image in the phone&#8217;s flash that allow us to do custom operations.</p>
<p>Turn off your phone. I had problems for turning it off, so I removed the battery and put it again.</p>
<p><font size="3"><strong>Updating to the new firmware</strong></font></p>
<p>Boot the phone, but this time in recovery mode. Do so by holding the <em>Lower volume button</em>, the <em>Call button</em> and the <em>Power button</em>. If it works, you’ll see a green menu with lots of choices:</p>
<div id="attachment_187" class="wp-caption alignnone" style="width: 235px"><a href="http://www.paguilar.org/blog/wp-content/uploads/2011/04/DSC03727-e1302851899282.jpg"><img src="http://www.paguilar.org/blog/wp-content/uploads/2011/04/DSC03727-e1302851899282-225x300.jpg" alt="Android recovery mode" title="android_recovery_mode" width="225" height="300" class="size-medium wp-image-187" /></a><p class="wp-caption-text">Android recovery mode</p></div>
<p>Select the <strong>Nandroid backup</strong> option and press the <em>Home button</em> to confirm. Then just follow the instructions on-screen. I chose slot 1 when asked which slot to use.</p>
<p>Select <strong>Wipe data/Factory reset</strong>. It’s going to erase all your applications and settings, but it shouldn’t touch anything saved on your SD card. It’s important to do so, else the phone will not work properly.</p>
<p>Select <strong>Apply any zip</strong>. Select either the GAOSP or the Galaxo zip files, depending on your choice. This will take a bit since it was to copy 60 or 49MB, respectively.</p>
<p>Select <strong>Fix package permissions</strong>.</p>
<p>Select <strong>Apply any zip</strong> again but this time pick the Gapps, which will restore the Google Applications on your phone.</p>
<p>Now you can reboot by selecting the first option <strong>Reboot system</strong>.</p>
<p><strong>Notice</strong>: It could happen that the phone freezes during the booting procedure in the android or gaosp boot screen. Wait for ~10 minutes, and then if it&#8217;s still stuck, pull out the battery and boot again.<br />
If it still doesn&#8217;t work, repeat the procedure described in this section <em>Updating to the new firmware</em>. </p>
<p>Btw, sorry for the images quality. I&#8217;ll change them with better ones.</p>
<p>That&#8217;s it!</p>
<p><font size="3"><strong>References</strong></font></p>
<ul>
<li><a href="http://www.drakaz.com/">Drakaz</a></li>
<li><a href="http://androidforums.com/samsung-i7500/91184-i7500-tutorials-list.html">Tutorials for the Samsung Galaxy i7500</a></li>
<li><a href="http://androidforums.com/i7500-all-things-root/72037-easy-guide-update-galaxo-gaosp.html">Easy guide to update to Galaxo or GAOSP!</a></li>
<li>Fastboot info
<ul>
<li><a href="http://elinux.org/Android_Fastboot">elinux</a></li>
<li><a href="http://android-dls.com/wiki/index.php?title=Fastboot">android-dls</a></li>
</ul>
</li>
<li><a href="http://androidforums.com/samsung-i7500/32481-howto-linux-adb-fastboot-mass-storage.html">Fastboot usage</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=170</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple C to XML serializer</title>
		<link>http://www.paguilar.org/blog/?p=121</link>
		<comments>http://www.paguilar.org/blog/?p=121#comments</comments>
		<pubDate>Sat, 26 Mar 2011 22:53:36 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[compiling]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=121</guid>
		<description><![CDATA[Some days ago I was asked for writing a program that could read any given C struct or union from a header file and serialize it to XML. I decided to write a program, called SC2XML: Simple C to XML serializer, flexible enough for adding later new C constructs like enums and typedefs. In order [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago I was asked for writing a program that could read any given C struct or union from a header file and serialize it to XML. </p>
<p>I decided to write a program, called <strong>SC2XML</strong>: Simple C to XML serializer, flexible enough for adding later new C constructs like enums and typedefs. </p>
<p>In order to serialize any valid C struct/union I needed a C grammar and something that could scan and parse the file following that grammar. The best tools for doing this are <strong>lex</strong> and <strong>yacc</strong>. In Linux, <a href="http://flex.sourceforge.net/">Flex</a> and <a href="http://www.gnu.org/software/bison/">Bison</a> are the Open Source implementations of these old but quite useful Unix tools.<br />
I strongly recommend these tools if you need to create a compiler, an interpreter or even a shell (you can have a look at a project called <a href="http://sourceforge.net/projects/tarasca/">tarasca</a> that I wrote some years ago as a proof of concept of a Cisco-like shell).</p>
<p>Since writing an ANSI C grammar is not a easy task, I downloaded the <a href="http://www.lysator.liu.se/c/ANSI-C-grammar-l.html">lex</a> and <a href="http://www.lysator.liu.se/c/ANSI-C-grammar-y.html">yacc</a> implementations of the ANSI C grammar written by Jutta Degener and modified it because it misses a few things like user-defined data types.</p>
<p>The first version of this program could potentially serialize other C constructs and almost any C code since it uses an almost full-compatible C grammar (see the header comment of scanner.l and parser.y for details).</p>
<p>The sc2xml package needs, as requirements, the following two standard libraries:</p>
<ul>
<li>glib-2</li>
<li>libxml2</li>
</ul>
<p>The package already provides the files generated by Flex and Bison called <em>lex.yy.c</em>, <em>parser.c</em> and <em>parser.tab.h</em>. These files are created from <em>scanner.l</em> and <em>parser.y</em>. Thus, if you modified the last two files, you will also need Flex and Bison.</p>
<p>You can configure, compile and install sc2xml using the traditional way:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>This version, as it is normal with a first alpha release, has some limitations and bugs. At them moment, it doesn&#8217;t support some constructs like</p>
<ul>
<li>Anonymous structs/unions</li>
<li>Multi-line pre-processor directives and macros </li>
</ul>
<p>You can have a look at the <em>README</em> for more details about the current limitations and bugs.</p>
<p>If I have the time or there is the interest for expanding this program, I would post it in sourceforge or gitorious. Meanwhile, you can download the source code from here: <a href="http://www.paguilar.org/projects/sc2xml-0.0.1.tar.gz">sc2xml-0.0.1.tar.gz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=121</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mounting an iPod/iPhone on a Linux device</title>
		<link>http://www.paguilar.org/blog/?p=31</link>
		<comments>http://www.paguilar.org/blog/?p=31#comments</comments>
		<pubDate>Thu, 03 Feb 2011 11:21:45 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[ipod/iphone/ipad]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=31</guid>
		<description><![CDATA[These days mounting an iPod/iPhone/iPad on a Linux PC is an automatic task and all the synchronization operations, such as the music sync with Rythmbox, are supported or at least partially supported. The communication with these devices can take place thanks to the libimobiledevice library with the help of fuse (filesystem in userspace) and several [...]]]></description>
			<content:encoded><![CDATA[<p>These days mounting an iPod/iPhone/iPad on a Linux PC is an automatic task and all the synchronization operations, such as the music sync with Rythmbox, are supported or at least partially supported.</p>
<p>The communication with these devices can take place thanks to the <a href="http://www.libimobiledevice.org/">libimobiledevice</a> library with the help of <a href="http://fuse.sourceforge.net/">fuse</a> (filesystem in userspace) and several other libraries and applications. For a clearer picture of the involved libraries you can have a look at this <a href="http://www.libimobiledevice.org/am-stack-fig-4.png">software stack diagram</a>. </p>
<p>Unfortunately, having the same functionality in a Linux embedded device such as a Set-Top-Box or a Digital Receiver is not easy because all the applications are part or depend strongly on GNOME or KDE that normally are not available in these systems.<br />
However, all the libraries can be cross-compiled allowing to mount an iPod/iPhone/iPad as a storage device.<br />
Of course, if you want to synchronize your data such as music or videos, you&#8217;ll have to develop your own application or port an existing one.</p>
<p>In this post I focus only on how to compile all the required libraries for mounting an iPod/iPhone/iPad as a storage device.<br />
If the Set-Top-Box have a media player with the required codecs, they will be able, at least, to play the content.</p>
<p><font size="3"><strong>Requirements</strong></font></p>
<p>Fuse needs a kernel driver that is already included in the mainline kernel. In the kernel configuration you find this option under the Filesystem menu. You can compile it as a module or in-kernel. If you choose the former, the module will be called fuse.ko.</p>
<p><font size="3"><strong>Environment configuration</strong></font></p>
<p>Suppose that we want to install all the libraries in <em>/mnt/target/usr/local</em>.<br />
/mnt/target is the top directory of the target&#8217;s filesystem that could be mounted via NFS.<br />
Assume that the cross-toolchain (compiler, linker…) is already in your path.</p>
<p>Set the following environment variables:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PREFIX</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HOST</span>=sh4-linux
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BUILD</span>=i386-linux
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #007800;">$PREFIX</span><span style="color: #000000; font-weight: bold;">/</span>lib
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKG_CONFIG_PATH</span>=<span style="color: #007800;">$LD_LIBRARY_PATH</span><span style="color: #000000; font-weight: bold;">/</span>pkgconfig</pre></div></div>

<p><font size="3"><br />
<strong>libusb</strong></font></p>
<p>Package: <a href="http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.8/libusb-1.0.8.tar.bz2/download">libusb-1.0.8.tar.bz2</a></p>
<p>This package is required by <em>libimobiledevice</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span> <span style="color: #660033;">--disable-static</span> <span style="color: #660033;">--disable-log</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>libplist</strong></font></p>
<p>Package: <a href="http://github.com/downloads/JonathanBeck/libplist/libplist-1.3.tar.bz2">libplist-1.3.tar.bz2</a></p>
<p>This package is required by <em>libimobiledevice</em>.</p>
<p>The compilation of libplist is different because it uses cmake.<br />
Create a file <em>toolchain.cmake</em> with the following contents. Modify the cross-compiler variables according to your path:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># this one is important</span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_SYSTEM_NAME Linux<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;">#this one not so much</span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_SYSTEM_VERSION <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># specify the cross compiler</span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_C_COMPILER   <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>STM<span style="color: #000000; font-weight: bold;">/</span>STLinux-<span style="color: #000000;">2.3</span><span style="color: #000000; font-weight: bold;">/</span>devkit<span style="color: #000000; font-weight: bold;">/</span>sh4<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>sh4-linux-gcc<span style="color: #7a0874; font-weight: bold;">&#41;</span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_CXX_COMPILER <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>STM<span style="color: #000000; font-weight: bold;">/</span>STLinux-<span style="color: #000000;">2.3</span><span style="color: #000000; font-weight: bold;">/</span>devkit<span style="color: #000000; font-weight: bold;">/</span>sh4<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>sh4-linux-g++<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># where is the target environment </span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_FIND_ROOT_PATH  <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># search for programs in the build host directories</span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;"># for libraries and headers in the target directories</span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY<span style="color: #7a0874; font-weight: bold;">&#41;</span>
SET<span style="color: #7a0874; font-weight: bold;">&#40;</span>CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Then create the build directory, compile and install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> build
$ <span style="color: #7a0874; font-weight: bold;">cd</span> build
$ cmake -DCMAKE_TOOLCHAIN_FILE=..<span style="color: #000000; font-weight: bold;">/</span>toolchain.cmake ..
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">DESTDIR</span>=<span style="color: #007800;">$PREFIX</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><br />
<strong>usbmuxd</strong></font></p>
<p>Package: <a href="http://marcansoft.com/uploads/usbmuxd/usbmuxd-1.0.4.tar.bz2">usbmuxd-1.0.4.tar.bz2</a></p>
<p>This package is needed by <em>libimobiledevice</em>.</p>
<p>usbmux uses cmake too. Therefore, the procedure is the same as liplist:</p>
<p>Create the file <em>toolchain.cmake</em> with the same contents as with <em>libplist-1.3</em> or just copy it to the current directory <em>usbmuxd-1.0.4</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> usbmuxd-1.0.4
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ..<span style="color: #000000; font-weight: bold;">/</span>libplist-<span style="color: #000000;">1.3</span><span style="color: #000000; font-weight: bold;">/</span>toolchain.cmake .</pre></div></div>

<p>Then create the build directory, compile and install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> build
$ <span style="color: #7a0874; font-weight: bold;">cd</span> build
$ cmake -DCMAKE_TOOLCHAIN_FILE=..<span style="color: #000000; font-weight: bold;">/</span>toolchain.cmake ..
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">DESTDIR</span>=<span style="color: #007800;">$PREFIX</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>libgpg-error</strong></font></p>
<p>Package: <a href="ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.gz">libgpg-error-1.7.tar.gz</a></p>
<p>This package is needed by <em>libgcrypt</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>libgcrypt</strong></font></p>
<p>Package: <a href="ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.6.tar.gz">libgcrypt-1.4.6.tar.gz</a></p>
<p>This package is needed by <em>gnutls</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span> <span style="color: #660033;">--with-gpg-error-prefix</span>=<span style="color: #007800;">$PREFIX</span></pre></div></div>

<p><strong>Note:</strong> I didn&#8217;t need to modify these Makefiles when using an updated STLinux2.3. But if you haven&#8217;t done an <em>&#8216;stmyum update&#8217;</em> lately, maybe you&#8217;ll need to modify them.<br />
Edit the <em>Makefile</em>:<br />
Remove from the variables <em>DIST_SUBDIRS</em> and <em>SUBDIRS</em> the directory &#8216;tests&#8217;</p>
<p>Edit the <em>src/Makefile</em>:<br />
Set the following variables to the given values:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">GPG_ERROR_CFLAGS = <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include
GPG_ERROR_CONFIG =
GPG_ERROR_LIBS = <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgpg-error.so.0.7.0
libgcrypt_la_LIBADD = \
	..<span style="color: #000000; font-weight: bold;">/</span>cipher<span style="color: #000000; font-weight: bold;">/</span>libcipher.la \
	..<span style="color: #000000; font-weight: bold;">/</span>random<span style="color: #000000; font-weight: bold;">/</span>librandom.la \
	..<span style="color: #000000; font-weight: bold;">/</span>mpi<span style="color: #000000; font-weight: bold;">/</span>libmpi.la \
	<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgpg-error.so.0.7.0</pre></div></div>

<p>Compile and install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>libtans1</strong></font></p>
<p>Package: <a href="ftp://ftp.gnu.org/gnu/libtasn1/libtasn1-2.7.tar.gz">libtasn1-2.7.tar.gz</a></p>
<p>This package is needed by <em>libimobiledevice</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>gnutls</strong></font></p>
<p>Package: <a href="ftp://ftp.gnupg.org/gcrypt/gnutls/gnutls-2.8.6.tar.bz2">gnutls-2.8.6.tar.bz2</a></p>
<p>This package is needed by <em>libimobiledevice</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span> \
<span style="color: #660033;">--with-libgcrypt-prefix</span>=<span style="color: #007800;">$PREFIX</span> --enable-large_files <span style="color: #660033;">--disable-gtk-doc-html</span></pre></div></div>

<p>Edit the files <em>src/Makefile</em>, <em>doc/Makefile</em> and <em>doc/examples/Makefile</em>:<br />
Set <em>LDFLAGS</em> to this value:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LDFLAGS = <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgcrypt.so <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgpg-error.so</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>libimobiledevice</strong></font></p>
<p>Package: <a href="http://www.libimobiledevice.org/downloads/libimobiledevice-1.0.2.tar.bz2">libimobiledevice-1.0.2.tar.bz2</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span> \
<span style="color: #007800;">libusbmuxd_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include&quot;</span> <span style="color: #007800;">libusbmuxd_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #007800;">libgnutls_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include&quot;</span> <span style="color: #007800;">libgnutls_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #007800;">libtasn1_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include&quot;</span> <span style="color: #007800;">libtasn1_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #007800;">libplist_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include&quot;</span> <span style="color: #007800;">libplist_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #007800;">libglib2_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include -I<span style="color: #007800;">$PREFIX</span>/lib/glib-2.0/include&quot;</span> <span style="color: #007800;">libglib2_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #660033;">--without-swig</span></pre></div></div>

<p>Edit the file <em>tools/Makefile</em>:<br />
Set <em>LDFLAGS</em> to this value:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LDFLAGS = <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgcrypt.so <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgpg-error.so <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libplist.so <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libtasn1.so <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libusbmuxd.so <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgnutls.so</pre></div></div>

<p>Compile and install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>fuse</strong></font></p>
<p>Package: <a href="http://sourceforge.net/projects/fuse/files/fuse-2.X/2.8.4/fuse-2.8.4.tar.gz/download">fuse-2.8.4</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">DESTDIR</span>=<span style="color: #007800;">$PREFIX</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>ifuse</strong></font></p>
<p>Package: <a href="http://www.libimobiledevice.org/downloads/ifuse-1.0.0.tar.bz2">ifuse-1.0.0.tar.bz2</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span> \
<span style="color: #007800;">CFLAGS</span>=-D_FILE_OFFSET_BITS=<span style="color: #000000;">64</span> \
<span style="color: #007800;">libimobiledevice_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include&quot;</span> <span style="color: #007800;">libimobiledevice_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #007800;">libglib2_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include/glib-2.0 -I<span style="color: #007800;">$PREFIX</span>/lib/glib-2.0/include&quot;</span> <span style="color: #007800;">libglib2_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #007800;">libgthread2_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include&quot;</span> <span style="color: #007800;">libgthread2_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span> \
<span style="color: #007800;">libfuse_CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$PREFIX</span>/include&quot;</span> <span style="color: #007800;">libfuse_LIBS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$PREFIX</span>/lib&quot;</span></pre></div></div>

<p>Edit the file <em>src/Makefile</em>:<br />
Set <em>libfuse_LIBS</em> to this value:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">libfuse_LIBS = -L<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib <span style="color: #660033;">-lfuse</span> <span style="color: #660033;">-limobiledevice</span> <span style="color: #660033;">-lgnutls</span> <span style="color: #660033;">-lplist</span> <span style="color: #660033;">-lusbmuxd</span></pre></div></div>

<p>Compile and install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><font size="3"><strong>Mounting the device</strong></font></p>
<p>At this point you should be able to mount your iPod/iPhone as a storage device. Some iPods can have a partition, like /dev/sda1, formatted as VFAT of HFS+, depending on where you use it. Some others, like the iPod shuffle, doesn&#8217;t have a partition, so you&#8217;ll see them as /dev/sda.</p>
<p>Assuming that you want to mount it in <em>/media/ipod</em>, that it has partition <em>/dev/sdb1</em>, and it&#8217;s formatted in VFAT, you can mount it as a normal storage device:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> vfat <span style="color: #660033;">-o</span> usefree <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>ipod</pre></div></div>

<p>For HFS+ is the same. Notice that your kernel must be compiled for supporting this filesystem:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> hfsplus <span style="color: #660033;">-o</span> ro <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>ipod</pre></div></div>

<p>Now you can browse in <em>/media/ipod</em> and you&#8217;ll see the contents of your iPod&#8217;s filesystem!</p>
<p><font size="3"><strong>References</strong></font></p>
<ul>
<li><a href="http://www.libimobiledevice.org/">libimobiledevice</a></li>
<li><a href="http://fuse.sourceforge.net/">fuse</a>
<li><a href="http://www.cmake.org/Wiki/CMake_Cross_Compiling">Cross-compiling using cmake</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=31</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Looking for new projects</title>
		<link>http://www.paguilar.org/blog/?p=35</link>
		<comments>http://www.paguilar.org/blog/?p=35#comments</comments>
		<pubDate>Thu, 20 Jan 2011 23:31:01 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=35</guid>
		<description><![CDATA[Now that the project in which I&#8217;ve been working for some time is completely functional and at the moment I&#8217;m not developing for it, I&#8217;m looking for new projects in the consumer equipment platforms field such as digital TV. If you have an embedded Linux project or know someone who has, you can contact me [...]]]></description>
			<content:encoded><![CDATA[<p>Now that the project in which I&#8217;ve been working for some time is completely functional and at the moment I&#8217;m not developing for it, I&#8217;m looking for new projects in the consumer equipment platforms field such as digital TV.</p>
<p>If you have an embedded Linux project or know someone who has, you can contact me at pedro (’dot’) aguilar (’dot’) iniestra (’at’) gmail (’dot’) com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=35</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>QBoxHD and QBoxHD-mini sources released with &#8216;SDK&#8217;</title>
		<link>http://www.paguilar.org/blog/?p=34</link>
		<comments>http://www.paguilar.org/blog/?p=34#comments</comments>
		<pubDate>Wed, 05 Jan 2011 00:54:29 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[enigma2]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[stlinux]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=34</guid>
		<description><![CDATA[Last year was a very busy year and I didn&#8217;t have much time for posting, but this year seems to be much better. In fact, the first good news is that the QBoxHD Team released the source code of almost all the software that runs in these boxes. If you want to see the sources [...]]]></description>
			<content:encoded><![CDATA[<p>Last year was a very busy year and I didn&#8217;t have much time for posting, but this year seems to be much better.<br />
In fact, the first good news is that the QBoxHD Team released the source code of almost all the software that runs in these boxes.<br />
If you want to see the sources right away, you can go the <a href="http://sourceforge.net/projects/qboxhd/">project&#8217;s homepage</a> at SourceForge.<br />
You can get the sources from the <a href="http://qboxhd.svn.sourceforge.net/viewvc/qboxhd/">SVN repository</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> https:<span style="color: #000000; font-weight: bold;">//</span>qboxhd.svn.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>svnroot<span style="color: #000000; font-weight: bold;">/</span>qboxhd<span style="color: #000000; font-weight: bold;">/</span>trunk  qboxhd</pre></div></div>

<p>Some of the most important components were already OSS such as the kernel and the application software Enigma2, so they had to be released anyway. As a matter of fact, they were released several months ago, but they were never updated, although they were in an SVN repository. This was due to the team that worked in a private repository and never sync&#8217;ed to the public one.</p>
<p>Although Duolabs is doing a great effort for opening their development process (you can see that the SourceForge&#8217;s SVN repository is actively used), not all the software is being released. Some critical parts such as everything related to the FPGA remains proprietary.</p>
<p>However, most of the sources that before were proprietary, now are OSS released under the GPLv2. And this, along with a simple mechanism for compiling these sources, are the relevant part that could mean an advantage for these decoders.</p>
<p>Let&#8217;s start with the development environment.<br />
It is a simple, yet useful system targeted for compiling the kernel, drivers and the middleware and application software. This environment is just a set of scripts that only allows to:</p>
<ul>
<li>Compile the boot loader</li>
<li>Compile the kernel</li>
<li>Compile the drivers (only the OSS)</li>
<li>Compile enigma2 (middleware and application software)</li>
<li>Work with an NFS filesystem and an TFTP server</li>
<li>Create releases using the official procedure</li>
</ul>
<p>These tools consist of a <em>Makefile</em>, a configuration file <em>config.in</em> and some other Shell and Perl scripts inside the <em>/sdk</em> directory. If you want to check the details you can have a look at the <a href="http://sourceforge.net/apps/mediawiki/qboxhd/index.php?title=Main_Page">project&#8217;s wiki</a> that is far from being complete, but at least it describes the basic procedure for compiling the mentioned sources.</p>
<p>It&#8217;s a quite simple set of tools. Thus, do not expect any development environment such as the ones used in projects like MeeGo or Android. Properly speaking, this is not an SDK, only a set of scripts that allows to build the sources and create a release almost identical to the official one.</p>
<p>These QboxHD tools were developed one bit at a time as requirements were added to the system and to fit the needs of a small team, taking into account that the development was done in a closed fashion, different from an open development that everybody can follow. I think that&#8217;s the reason why, in one hand, they have a specific and practical purpose, and in the other hand, are quite limited if compared to full-blown development environments.</p>
<p>It would be quite nice if this system was migrated to a real full-platform build tool such as <a href="http://www.yoctoproject.org/docs/poky-ref-manual/poky-ref-manual.html">Poky</a>. Unfortunately, the SH4-based processors don&#8217;t have any support of this kind. </p>
<p>Now let&#8217;s move to the source code that was released.<br />
Besides the already known OSS (U-Boot, Linux kernel and Enigma2), the relevant part is in the <em>/src/drivers</em> directory in which some of the drivers that previously were proprietary were now released under the GPLv2.<br />
Inside this directory we get the following drivers:</p>
<ul>
<li>avs</li>
<li>e2_proc</li>
<li>fpanel</li>
<li>frontends</li>
<li>includes</li>
<li>lcd</li>
<li>lpc</li>
<li>multicom</li>
<li>player2</li>
<li>qboxhd_generic</li>
<li>scart</li>
<li>stmfb</li>
</ul>
<p>The drivers avs, e2_proc, includes, multicom, player2 and stmfb were basically taken from the <a href="http://gitorious.org/open-duckbox-project-sh4">sh4 duckbox project</a> and <a href="http://stlinux.com/drupal/">STLinux</a> and modified accordingly, so these are not really new.</p>
<p>The rest of the drivers are the ones used for controlling most of the decoder&#8217;s hardware. The hardware between both boards is quite different, so you&#8217;ll see specific drivers and/or macros that differentiate them.<br />
Notice that all the drivers and applications regarding the FPGA inside these boxes remains strictly proprietary&#8230; </p>
<p>The fpanel is used for controlling the colours and behaviour of the sense-wheel and front-button of the QBoxHD and QBoxHD-mini, respectively. You can regulate the colours leds&#8230; nothing useful, but at least fun.</p>
<p>The lcd controls the front panel LCDs. Since they support at least 64k colours, you can display nice images although the data-transfer speed is not high.</p>
<p>The lpc is only present in the QBoxHD-mini and controls the Stand-By functionality.</p>
<p>The qboxhd_generic resets the tuners at boot time, boring&#8230;</p>
<p>The scart drivers controls the analog A/V outputs (SCART, components, composite and audio stereo). The digital video output (HDMI) is controlled by the stmfb driver that is part of the STLinux2.3 distribution.</p>
<p>The frontends directory contains the drivers for the DVB-S2/T/C tuners and pll&#8217;s. All of them are based on drivers taken from the mainline Linux kernel, except the DVB-S2 AVL2108 demod (with stv6306 pll) that was developed specifically for these decoders. I don&#8217;t know of any DVB-S2 PCI card or USB adapter that mounts this demod, because this driver could be re-used and maybe included in the mainline kernel.</p>
<p>Another interesting directory, specially for the people that wants to start playing around in userland, is the <em>/src/apps</em> directory in which several relatively simple applications such as <em>display_image</em> can be used as example for gaining confidence with the development for these decoders and, in general, with the embedded devices development.</p>
<p>In this directory you can find too the modified sources of <a href="http://www.busybox.net/">Busybox</a> and libdvbsi++ that are Open Source Projects.</p>
<p>As you can see, with all these sources licensed under the GPL, these decoders can be a good platform for people that want to start developing in user or kernel space with Embedded Linux and with a special focus in High Definition DVB devices.<br />
Another benefit is that these boxes could become a reference point regarding openness in the High Definition DVB decoders market since these are basically the only decoders with almost all their sources available.</p>
<p>Openness is a factor that cannot be under estimated.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=34</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Compiling and running Dropbear: a thin Secure Shell server</title>
		<link>http://www.paguilar.org/blog/?p=30</link>
		<comments>http://www.paguilar.org/blog/?p=30#comments</comments>
		<pubDate>Wed, 12 May 2010 22:58:40 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[compiling]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[cross-compiling]]></category>
		<category><![CDATA[dropbear]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=30</guid>
		<description><![CDATA[Dropbear is a thin Secure Shell 2 (SSH 2) server and client. It is a good alternative to OpenSSH when you have storage and memory restrictions, specially in embedded systems. Cross-compiling and running Dropbear in an embedded system is not a difficult task, but the documentation is not very clear for everybody. You can start [...]]]></description>
			<content:encoded><![CDATA[<p>Dropbear is a thin Secure Shell 2 (SSH 2) server and client. It is a good alternative to OpenSSH when you have storage and memory restrictions, specially in embedded systems.</p>
<p>Cross-compiling and running Dropbear in an embedded system is not a difficult task, but the documentation is not very clear for everybody. You can start by reading the README and INSTALL files contained in the package and then, if you still have questions, you can keep reading this article in which I&#8217;ll try to give a short and clear explanation:</p>
<p>As you may expect from a package of this kind that was written with embedded systems in mind, it supports uClibc. The configuration, compilation and installation are the same as for libc, but it can have some tweaks that are described in the INSTALL file.</p>
<p><strong>Download</strong><br />
<a href="http://matt.ucc.asn.au/dropbear/dropbear-0.52.tar.bz2">http://matt.ucc.asn.au/dropbear/dropbear-0.52.tar.bz2</a></p>
<p><strong>Environment configuration</strong><br />
As normal, set the environment variables that make our life easier. Change them according to your needs.<br />
I normally have an SH4 based processor in my desk at home.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PREFIX</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>STM<span style="color: #000000; font-weight: bold;">/</span>STLinux-<span style="color: #000000;">2.3</span><span style="color: #000000; font-weight: bold;">/</span>devkit<span style="color: #000000; font-weight: bold;">/</span>sh4<span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HOST</span>=sh4-linux
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BUILD</span>=i386-linux
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">COMPILER</span>=sh4-linux-gcc</pre></div></div>

<p><strong>Configuration</strong></p>
<p>Dropbear doesn&#8217;t have a configure script since it&#8217;s not based on autotools. It contains an options.h file in which you can select many parameters that vary from the keys installation paths to the supported encryption algorithms and X11 forwarding among others.<br />
I strongly suggest you to have a look at this file. This will give you a good idea of what Dropbear is capable of.<br />
In any case, I list here what I consider some of the most relevant options for embedded systems:</p>
<ul>
<li>Small footprint &#8211; A speed performance price must be paid when using some ciphers</li>
<li>Six supported ciphers &#8211; 3DES, AES128, AES256, Blowfish, Twofish128 and Twofish256</li>
<li>Adjustable size of receive window size and maximum size of transmission and reception packets</li>
</ul>
<p>Some other <em>default</em> functionality in OpenSSH are supported in Dropbear too, but are not very relevant for embedded systems such as X11 forwarding.</p>
<p>Once you have decided the options that you need, the configuration is straight-forward as many other packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #007800;">CC</span>=<span style="color: #007800;">$COMPILER</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--build</span>=<span style="color: #007800;">$BUILD</span> <span style="color: #660033;">--host</span>=<span style="color: #007800;">$HOST</span> <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$PREFIX</span></pre></div></div>

<p><strong>Compilation</strong></p>
<p>The compilation is the step that allows you to choose the services that you want in Dropbear: the generated binary is a multi-purpose executable that contains the functionality that you need. Here you can select if you want an executable that works as a server (<em>dropbear</em>), that generates keys (<em>dropbearkey</em>), that allows Secure Copy (<em>scp</em>), Secure FTP (<em>sftp</em>), and keys conversion from OpenSSH to Dropbear format (<em>dropbearconvert</em> and <em>dbclient</em>).<br />
If you want at least two of this services you need to give to  <em>make</em> the argument <em>PROGRAMS=&#8221;the programs that you want&#8221;</em> and the <em>MULTI=1</em> argument.</p>
<p>In this same step you can choose if you want a dynamically or statically &#8211; linked executable. For embedded systems is common to use a statically linked executable by adding the <em>STATIC=1</em> argument to <em>make</em>.</p>
<p>A final <em>make</em> command that contains the Dropbear server, it&#8217;s key generation and Secure Copy, looks like follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">PROGRAMS</span>=<span style="color: #ff0000;">&quot;dropbear dropbearkey scp&quot;</span> <span style="color: #007800;">STATIC</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">MULTI</span>=<span style="color: #000000;">1</span></pre></div></div>

<p><strong>Installation</strong><br />
You can use the standard method for installing Dropbear plus the same arguments used during compilation:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">PROGRAMS</span>=<span style="color: #ff0000;">&quot;dropbear dropbearkey scp&quot;</span> <span style="color: #007800;">STATIC</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">MULTI</span>=<span style="color: #000000;">1</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>But this will use the default path that some times in embedded systems is not sufficient because different paths can be used. In these cases you&#8217;ll have to copy manually the executable called <em>dropbearmulti</em> to the desired location and create symbolic links that have the name of the program that you want to use that point to this executable. If you have used Busybox, the concept of symbolic links pointing to the same executable will be familiar:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># $PREFIX/../.. is target's root filesytem: /opt/STM/STLinux-2.3/devkit/sh4/target/</span>
<span style="color: #666666; font-style: italic;"># Copy the real executable dropbearmulti to the target's root filesystem /usr/local/bin</span>
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> dropbearmulti <span style="color: #007800;">$PREFIX</span><span style="color: #000000; font-weight: bold;">/</span>bin
&nbsp;
<span style="color: #666666; font-style: italic;"># Create the symbolic links dropbearkey and dbclient</span>
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> dropbearmulti dropbearkey
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> dropbearmulti dbclient
&nbsp;
<span style="color: #666666; font-style: italic;"># Create the symbolic link scp in the target's filesytem /usr/bin</span>
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$PREFIX</span><span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>bin
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> ..<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dropbearmulti <span style="color: #c20cb9; font-weight: bold;">scp</span></pre></div></div>

<p>Stripping is quite a good thing when you need to save storage:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$PREFIX</span><span style="color: #000000; font-weight: bold;">/</span>bin
$ sh4-linux-strip dropbearmulti</pre></div></div>

<p>Dropbear 0.52 ships with an alternative standalone <em>scp</em> program that is taken from OpenSSH. If you want to use this instead of the default built-in, you need to compile it separately:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">scp</span></pre></div></div>

<p>For further compilation hints you can take a look at the SMALL and MULTI files provided in the package.</p>
<p><strong>Keys creation</strong></p>
<p>SSH uses public-key cryptography to authenticate a remote client. Thus, once you have Dropbear properly installed, but before using it, you need to create the cryptographic keys.<br />
You can read the following links for an in-depth explanation of how SSH and public-key cryptography work:<br />
SSH: <a href="http://en.wikipedia.org/wiki/Secure_Shell">http://en.wikipedia.org/wiki/Secure_Shell</a><br />
Public-key cryptography: <a href="http://en.wikipedia.org/wiki/Public-key_cryptography">http://en.wikipedia.org/wiki/Public-key_cryptography</a></p>
<p>You can create your keys using two different methods: RSA and DSS.<br />
Both kind of keys seem to be equally secure, but RSA seems to be faster for signature verification that is the most common operation when using the keys.</p>
<p>Let&#8217;s create the keys using both methods.<br />
Connect to your target via serial or telnet (at the end of this post you will, hopefully, use ssh instead of telnet):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-pv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dropbear
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dropbear
&nbsp;
<span style="color: #666666; font-style: italic;"># Generate the RSA private and public keys.</span>
$ dropbearkey <span style="color: #660033;">-t</span> rsa <span style="color: #660033;">-f</span> dropbear_rsa_host_key
Will output <span style="color: #000000;">1024</span> bit rsa secret key to <span style="color: #ff0000;">'dropbear_rsa_host_key'</span>
Generating key, this may take a while...
Public key portion is: 
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAAAgncEwjavI+PfbQ+WNDYev<span style="color: #000000; font-weight: bold;">/</span>g2f5PGTD7ZzAnauZP4dWOi0MTVFGOZXTf9<span style="color: #000000; font-weight: bold;">/</span>cWXwx12zZ2KUOS5UfWk9SdH<span style="color: #000000; font-weight: bold;">/</span>t67MPVDDptFaq0kJ5ReA6JzqhwaKguMIdNGTdM2HfwJabvSnDL4SZgpxXtOJYZhWaqMMO8OP560gE21h6O0mH75<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">IBJUak</span>=
root<span style="color: #000000; font-weight: bold;">@</span>my_target
Fingerprint: md5 0a:bb:<span style="color: #000000;">43</span>:<span style="color: #000000;">82</span>:<span style="color: #000000;">41</span>:7b:8a:8b:4d:<span style="color: #000000;">41</span>:<span style="color: #000000;">43</span>:e7:<span style="color: #000000;">71</span>:<span style="color: #000000;">54</span>:a7:ce
&nbsp;
<span style="color: #666666; font-style: italic;"># Generate the DSS private and public keys.</span>
$ dropbearkey <span style="color: #660033;">-t</span> dss <span style="color: #660033;">-f</span> dropbear_dss_host_key
Will output <span style="color: #000000;">1024</span> bit dss secret key to <span style="color: #ff0000;">'dropbear_dss_host_key'</span>
Generating key, this may take a while...
Public key portion is: 
ssh-dss
AAAAB3NzaC1kc3MAAACBALIEmhf5c65czi<span style="color: #000000; font-weight: bold;">/</span>2rq1Xu2I0Vv+DqeEUQDDmeFke4nyBqVOuQTq8JrHzuRz8SbeohqhXWx<span style="color: #000000; font-weight: bold;">//</span>546HLK<span style="color: #000000; font-weight: bold;">/</span>RwIG6Gkj5+RQ7uvcc9bcprwJtQVU+U1qmgepPsl6e0Cofldbz+LBLWE5R1sg1ExX<span style="color: #000000; font-weight: bold;">/</span>NzGNtKzIbukXUABK12<span style="color: #000000; font-weight: bold;">/</span>sveGODeWpAAAAFQCNmGPNFcQyso8x+Zc52FLuRrtTfQAAAIEAiN4pNvhdyNX0lg1nop0ei+qp7H8kmurXWhZMZmaKWVYOc8YqvELL<span style="color: #000000; font-weight: bold;">/</span>U1s9fNNPsxEBTi6ysYLM1MCHNizQ4x<span style="color: #000000; font-weight: bold;">/</span>npsC<span style="color: #000000; font-weight: bold;">/</span>1e6URaIub<span style="color: #000000; font-weight: bold;">/</span>Dtf55N5Bn1LaItdK2EO1wLemf1<span style="color: #000000; font-weight: bold;">/</span>+3yuvJvhvI2yaPEEAzIgmQatTdE38HwY3+AxXSgccqsBcAAACBAJv9gJtcu5rHGal4VCaVRcM41z+omA7agAtcpmcXOBXr719T2qSZF+GoAeLlfThndaCTchpDQXNDxwTaW6G9RxGOhrDgyKR4MgShljnBfq0wsVx06l23Ex92d8xSmXJz4E<span style="color: #000000; font-weight: bold;">/</span>BwtLhjUouAsrW<span style="color: #000000; font-weight: bold;">/</span>IJbxQlwp3stmvtik6IYP<span style="color: #000000; font-weight: bold;">/</span>BiM2kf
root<span style="color: #000000; font-weight: bold;">@</span>my_target
Fingerprint: md5 a7:ad:8e:f8:d2:<span style="color: #000000;">78</span>:<span style="color: #000000;">73</span>:ec:a7:1b:aa:ba:9b:ad:aa:2a</pre></div></div>

<p>Be sure that the private keys generated in <em>/etc/dropbear</em> remain secret!<br />
The generated public keys shown in this post are just an example.</p>
<p><strong>Connect to the server using Dropbear</strong></p>
<p>At this point you are able to connect to the target using your login/passwd. Normally in an embedded system the only user is root.</p>
<p>Start dropbear server in the target:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ dropbear</pre></div></div>

<p>Check the different execution options using the <em>&#8211;help</em> flag.<br />
Optional, but recommended, is to add in <em>/etc/hosts</em> in the target&#8217;s filesystem the hostname of the client (host).</p>
<p>Finally, you can use ssh and scp:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Connect from host (client) to target (server) using SSH.</span>
<span style="color: #666666; font-style: italic;"># It will prompt for root's passwd.</span>
$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>192.168.0.135
&nbsp;
<span style="color: #666666; font-style: italic;"># Copy the file 'hola' from the host (client) to the directory /etc in the target (server).</span>
<span style="color: #666666; font-style: italic;"># It will prompt for root's passwd.</span>
$ <span style="color: #c20cb9; font-weight: bold;">scp</span> hola root<span style="color: #000000; font-weight: bold;">@</span>192.168.0.135:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hola</pre></div></div>

<p>If you need to connect very often to the target, typing the passwd each time can be very annoying and could pose a security risk.<br />
It would be better not to send the passwd at all.</p>
<p>For this purpose you can store the public key of your host (client) in the target (server).<br />
Assuming that your host (client) is a Unix machine that has OpenSSH installed, you can easily create your keys:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Key creation in the host (client) using OpenSSH:</span>
$ <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span>
Generating public<span style="color: #000000; font-weight: bold;">/</span>private rsa key pair.
Enter <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #c20cb9; font-weight: bold;">which</span> to save the key <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa<span style="color: #7a0874; font-weight: bold;">&#41;</span>: y
Enter passphrase <span style="color: #7a0874; font-weight: bold;">&#40;</span>empty <span style="color: #000000; font-weight: bold;">for</span> no passphrase<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 
Enter same passphrase again: 
Your identification has been saved <span style="color: #000000; font-weight: bold;">in</span> y.
Your public key has been saved <span style="color: #000000; font-weight: bold;">in</span> y.pub.
The key fingerprint is:
<span style="color: #000000;">74</span>:<span style="color: #000000;">84</span>:<span style="color: #000000;">22</span>:e2:f9:6d:<span style="color: #7a0874; font-weight: bold;">fc</span>:b5:b1:<span style="color: #000000;">72</span>:<span style="color: #000000;">40</span>:<span style="color: #000000;">58</span>:e2:<span style="color: #000000;">23</span>:ff:ea user<span style="color: #000000; font-weight: bold;">@</span>my_client
The key<span style="color: #ff0000;">'s randomart image is:
+--[ RSA 2048]----+
|                 |
|         .       |
|    . . o ..     |
|   . . +o.  .    |
|    . . S..o.    |
|     . o.+..o.   |
|        . ....   |
|          o. ..  |
|         ..+B=+. |
+-----------------+</span></pre></div></div>

<p>You will end-up with the private key <em>id_rsa</em> and public key <em>id_rsa.pub</em> in <em>/home/user/.ssh/</em>.<br />
Copy the host&#8217;s (client) public key to  ~/.ssh/authorized_keys in the target&#8217;s filesystem. Notice that ~ is normally /root, but if you&#8217;re logging in with another username, change it accordingly.<br />
<em>Warning</em>: If you copy-paste the public key, check that your text editor copies-pastes it correctly, otherwise you will end-up with a broken key. You&#8217;re safe if you use vi.</p>
<p>Once you have your host&#8217;s (client) public key in your target&#8217;s (server) filesystem, you can login to your target without using a passwd speeding up your login procedure!</p>
<p><strong>Running from inetd</strong></p>
<p>If you want to use Dropbear from <em>inetd</em> you have to enable it in the <em>options.h</em> file before compiling:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#undef NON_INETD_MODE</span>
<span style="color: #339933;">#define INETD_MODE</span></pre></div></div>

<p>In the <em>inetd.conf</em> configuration file you have to add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">22</span> stream tcp nowait root <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dropbear dropbear <span style="color: #660033;">-i</span></pre></div></div>

<p>Notice that if you compile with <em>inetd</em> support, Dropbear will refuse to start from the command line. Obviously, this applies for the other way around too.</p>
<p><strong>Conclusion</strong><br />
Having a working Dropbear server is not a difficult task. You only have to pay attention at compilation time of the services you want from it, and when running it, of the location where you have to store the keys, specially if you want to use them for logging in without a passwd.<br />
Reading the INSTALL, README and other instruction files is always a good idea, no matter how extensive they are.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=30</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The OpenSource Team Ducktales Project releases all their sources</title>
		<link>http://www.paguilar.org/blog/?p=28</link>
		<comments>http://www.paguilar.org/blog/?p=28#comments</comments>
		<pubDate>Mon, 21 Dec 2009 12:11:02 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[driver]]></category>
		<category><![CDATA[enigma2]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=28</guid>
		<description><![CDATA[[Update 21/12/2009: The git repository in the link will remain alive and not as stated.] After more than two years that this project began under the The Ducktales Team (TDT) name, it now changes its name to The OpenSource Team Ducktales Project and releases all the sources along with the necessary infrastructure for creating images. [...]]]></description>
			<content:encoded><![CDATA[<p>[<strong>Update 21/12/2009</strong>: The git repository in the link will remain alive and not as stated.]</p>
<p>After more than two years that this project began under the <em>The Ducktales Team (TDT)</em> name, it now changes its name to <em>The OpenSource Team Ducktales Project</em> and releases all the sources along with the necessary infrastructure for creating images.</p>
<p>The git repository is here <a href="http://gitorious.org/open-duckbox-project-sh4">http://gitorious.org/open-duckbox-project-sh4</a>.</p>
<p>The main modules of the project are:</p>
<ul>
<li>Build environment</li>
<li>Kernel sources (patches)</li>
<li>Enigma2 source</li>
<li>Drivers sources</li>
<li>All tdt applications</li>
</ul>
<p>The big news here are the drivers sources, specially their player2 version, that takes advantage of the STi710x hardware and at the same time exports a compatible Linux DVB API. The original player2 adds an additional Linux DVB adapter that gives compatibility issues to applications such as szap and enigma2.</p>
<p>It seems that this repository will be available for cloning only for a limited time, so get it asap and clone it to an open source git hosting service as they suggest.</p>
<p>You can clone it from here:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>gitorious.org<span style="color: #000000; font-weight: bold;">/</span>open-duckbox-project-sh4<span style="color: #000000; font-weight: bold;">/</span>tdt.git</pre></div></div>

<p>Notice that all the source code in this repository is Open Source. It does not contain any proprietary video and audio firmwares and headers, nor the proprietary PTI driver.</p>
<p>I hope I can contribute to this project soon!</p>
<p>Thanks to the OpenSource Team Ducktales Project!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=28</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The QBoxHD team releases the source code of U-Boot</title>
		<link>http://www.paguilar.org/blog/?p=27</link>
		<comments>http://www.paguilar.org/blog/?p=27#comments</comments>
		<pubDate>Tue, 24 Nov 2009 11:51:58 +0000</pubDate>
		<dc:creator>paguilar</dc:creator>
				<category><![CDATA[bootloader]]></category>
		<category><![CDATA[compiling]]></category>
		<category><![CDATA[stlinux]]></category>
		<category><![CDATA[U-Boot]]></category>

		<guid isPermaLink="false">http://www.paguilar.org/blog/?p=27</guid>
		<description><![CDATA[The QBoxHD uses two bootloaders. The first-stage bootloader is read-only, it cannot be rewritten and it&#8217;s used basically for disaster recovery. The second-stage bootloader does the real job because it loads the kernel and the initramfs according to the environment variables that you can modify. With this configuration, the QBoxHD gives you the freedom to [...]]]></description>
			<content:encoded><![CDATA[<p>The QBoxHD uses two bootloaders. The first-stage bootloader is read-only, it cannot be rewritten and it&#8217;s used basically for disaster recovery. The second-stage bootloader does the real job because it loads the kernel and the initramfs according to the environment variables that you can modify.</p>
<p>With this configuration, the QBoxHD gives you the freedom to change the second-stage bootloader and obviously the initramfs and kernel. In the case that you want to do any experiment with it and later come back to the original configuration you know that the first-stage bootloader is always there.<br />
If you only want to load a different kernel and/or initramfs, you just need to change the U-Boot environment as with a vanilla U-Boot version.</p>
<p>Both bootloaders are based on U-Boot 1.1.2 that is somewhat old, but it gives the necessary functionality.<br />
The modifications were done, basically, for removing unneeded functionality and reduce their footprint in NOR flash.<br />
Of course, you are free to update it to the latest U-Boot version provided by STLinux.</p>
<p>You can get both versions from here:</p>
<p>First-stage bootloader:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> checkout https:<span style="color: #000000; font-weight: bold;">//</span>www.qboxsvn.com<span style="color: #000000; font-weight: bold;">/</span>genesis<span style="color: #000000; font-weight: bold;">/</span>trunk  genesis_trunk</pre></div></div>

<p>Second-stage bootloader:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> checkout https:<span style="color: #000000; font-weight: bold;">//</span>www.qboxsvn.com<span style="color: #000000; font-weight: bold;">/</span>uboot<span style="color: #000000; font-weight: bold;">/</span>trunk  uboot_trunk</pre></div></div>

<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paguilar.org/blog/?feed=rss2&#038;p=27</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

