<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-183431720687819497</id><updated>2011-09-05T15:53:32.692+02:00</updated><category term='WL-5460AP with e11 fw'/><category term='Cooperative Linux with Debian 4.0'/><category term='Development'/><category term='WRT54GL with DD-WRT 2.4 fw'/><category term='ThinkPad R61 with Ubuntu 8.04'/><category term='WMU-6500FS box with JoKeR&apos;s fw'/><category term='Networking'/><title type='text'>Filodej's Linux groping</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-7539032733614159605</id><published>2009-11-19T09:35:00.033+01:00</published><updated>2009-11-26T20:56:59.153+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Print server installation</title><content type='html'>&lt;h3&gt;Introduction&lt;/h3&gt;

Since I have one LPT printer and several computers at home I considered buing a print server for a long time. What reliably discouraged me however was the price - for example &lt;a href="http://h10010.www1.hp.com/wwpc/us/en/sm/WF02d/18972-18972-236253.html"&gt;HP print server&lt;/a&gt; price starts at around 140$. 
&lt;br/&gt;
Unfortunately I haven't bought a router with USB ports like &lt;a href="http://reviews.cnet.com/routers/asus-wl-500w-802/4505-3319_7-32076385.html"&gt;Asus WL-500W&lt;/a&gt;, but rather &lt;a href="http://www.linksysbycisco.com/US/en/products/WRT54GL"&gt;Linksys WRT54GL&lt;/a&gt; and so the printer sharing as described at &lt;a href="http://www.dd-wrt.com/wiki/index.php/USB_printer_sharing"&gt;DD-WRT wiki&lt;/a&gt; was not applicable in my case.
&lt;br/&gt;
Then I noticed that there is a &lt;a href="http://p910nd.sourceforge.net"&gt;p910nd&lt;/a&gt; print daemon 
&lt;a href="http://mgb111.pradnik.net/addons/servers-print/p910nd-0.92-081017.tar"&gt;package&lt;/a&gt; available at the JoKer's site.
&lt;br/&gt;
There was not much information about the installation on the Web and so I was pretty unsure but I decided to give it a try. 
&lt;br/&gt;
&lt;br/&gt;
&lt;i&gt;Note: Before you follow the steps I describe here, please, make sure your printer is compliant with the &lt;a href="http://en.wikipedia.org/wiki/JetDirect"&gt;JetDirect&lt;/a&gt; technology.&lt;/i&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;

&lt;h3&gt;Hardware installation&lt;/h3&gt;

My &lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl05920&amp;prodTypeId=18972&amp;prodSeriesId=25470"&gt;HP LaserJet 1100&lt;/a&gt; 
printer is not USB but LPT, so there is some USB to LPT reduction necessary.
&lt;br/&gt;
I also realized that there is not a &lt;a href="http://sewelldirect.com/ParallelCable15Foot.asp"&gt;standard printer cable&lt;/a&gt; 
but rather a &lt;a href="http://sewelldirect.com/ParallelCableMiniCentronics10Foot.asp"&gt;Mini Centronics cable&lt;/a&gt; 
used for the printer connection.
&lt;br/&gt;
&lt;br/&gt;
So it seemed that besides something like the &lt;a href="http://sewelldirect.com/usbtoparallel.asp"&gt;USB to Parallel port adapter&lt;/a&gt; (14$)
also another reduction like &lt;a href="http://sewelldirect.com/centronicstomini.asp"&gt;Centronics to Mini Centronics adapter&lt;/a&gt; (11$) 
was necessary (there is also &lt;a href="http://sewelldirect.com/USB-to-Mini-Centronics-Combo-Cable-Set.asp"&gt;a combo&lt;/a&gt; for 24$ 
so you can spare a buck ;).
&lt;br/&gt;
&lt;br/&gt;
Since I already had a standard printer cable the best choice for me was the &lt;a href="http://www.sunrichtech.com.hk/assign.asp?keyid=ba13"&gt;ST Lab U-370 Dongle&lt;/a&gt;.
For only 11$ does the job very well.
&lt;br/&gt;
So that's it regarding to hardware installation.
&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Software installation&lt;/h3&gt;

We download and install the &lt;i&gt;p910nd&lt;/i&gt; print daemon (I use &lt;a href="http://mgb111.pradnik.net/addons/servers-print/p910nd-0.92-081017.tar"&gt;0.92 version&lt;/a&gt;, I had no luck with the latest &lt;a href="http://mgb111.pradnik.net/addons/servers-print/p910nd-0.93%2BminiLpd-0.4-090618.tar"&gt;0.93 version&lt;/a&gt;, I got &lt;i&gt;/var/lock/subsys/p9100d&lt;/i&gt; file not found error). 
&lt;br/&gt;
&lt;b&gt;&lt;i&gt;Edit:&lt;/i&gt; now the problem with 0.93 is solved, see the discussion below&lt;/b&gt;
&lt;br/&gt;
&lt;pre class="code"&gt;
box# cd /mnt/C
box# &lt;b&gt;wget&lt;/b&gt; &lt;a href="http://mgb111.pradnik.net/addons/servers-print/p910nd-0.92-081017.tar"&gt;http://mgb111.pradnik.net/addons/servers-print/p910nd-0.92-081017.tar&lt;/a&gt;
box# &lt;b&gt;tar xvf p910nd-0.92-081017.tar&lt;/b&gt;
./sys/
./sys/etc/
./sys/man/
./sys/man/man8/
./sys/man/man8/p910nd.8
./sys/sbin/
./sys/sbin/p910nd
&lt;/pre&gt;
Now we are ready to plug the printer to USB port (suppose you use the USB1 port specifically) and run the daemon:
&lt;pre class="code"&gt;
box# &lt;b&gt;/mnt/C/sys/sbin/p910nd -b -f /dev/usblp0&lt;/b&gt;
&lt;/pre&gt;
We can see that the process is now up and running. The fact that it is named p910&lt;b&gt;0&lt;/b&gt;d (instead of original p910&lt;b&gt;n&lt;/b&gt;d) 
means that it is listening at port &lt;i&gt;9100&lt;/i&gt;.
&lt;pre class="code"&gt;
box# &lt;b&gt;ps | grep p910&lt;/b&gt;
  271 root        284 S   /mnt/C/sys/sbin/p9100d -b -f /dev/usblp0
 1863 root        216 S   grep p910
&lt;/pre&gt;
We can make sure it is actually listening at the port; when we run the &lt;a href="http://en.wikipedia.org/wiki/Netstat"&gt;network statistics&lt;/a&gt; 
to list all the ports all the processes are are listening for, newly we can see the 
&lt;a href="http://en.wikipedia.org/wiki/JetDirect"&gt;jetdirect&lt;/a&gt; port.
&lt;pre class="code"&gt;
box# &lt;b&gt;netstat -l&lt;/b&gt;
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
...
tcp        0      0 *:&lt;b&gt;jetdirect&lt;/b&gt;             *:*                     LISTEN      
...
&lt;/pre&gt;
We can also look at the &lt;a href="http://en.wikipedia.org/wiki/Syslog"&gt;system log&lt;/a&gt; 
(with help of the &lt;a href="http://en.wikipedia.org/wiki/Dmesg"&gt;dmesg command&lt;/a&gt;).
There we can find something similar to the following:
&lt;pre class="code"&gt;
box# &lt;b&gt;dmesg&lt;/b&gt;
...
hub.c: new USB device 00:0a.0-2, assigned address 2
printer.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 1 proto 2 vid 0x067B pid 0x2305
...
&lt;/pre&gt;
When we retrieve the description string of the USB device, we get that there is a 
&lt;a href="http://en.wikipedia.org/wiki/IEEE_1284"&gt;IEEE-1284 (parallel communication) controller&lt;/a&gt; 
made by the &lt;a href="http://www.prolific.com.tw/eng/product.asp"&gt;Prolific Technology Inc.&lt;/a&gt;.
&lt;pre class="code"&gt;
box# &lt;b&gt;cat /proc/printer/usblp0&lt;/b&gt;
Prolific Technology Inc. IEEE-1284 Controller
0x18
&lt;/pre&gt;
Note that in case you have a USB printer you should probably expect somewhat more meaningful string like 
&lt;pre class="code"&gt;
Hewlett-Packard HP LaserJet 1005 series
&lt;/pre&gt;
Now we are ready to try some printing:
&lt;pre class="code"&gt;
box# &lt;b&gt;echo "printer test" &amp;gt; /dev/usblp0&lt;/b&gt; 
...
&lt;/pre&gt;
Initially I got the following error message:
&lt;pre class="code"&gt;
bash: /dev/usblp0: Device or resource busy
&lt;/pre&gt;
... then I realized that there is a &lt;i&gt;mini-lpd&lt;/i&gt; process running holding the device. 
&lt;a href="http://nico.schotteli.us/papers/linux/cconfig/cconfig/node14.html"&gt;mini-lpd&lt;/a&gt;
is a small, non-queueing &lt;a href="http://en.wikipedia.org/wiki/Line_Printer_Daemon_protocol"&gt;LPD&lt;/a&gt; 
implementation. I do not know why there is &lt;i&gt;mini-lpd&lt;/i&gt; active on the box, I have not tried 
to make it work, I just killed it and used &lt;i&gt;p910nd&lt;/i&gt; daemon instead:
&lt;pre class="code"&gt;
box# &lt;b&gt;killall mini-lpd&lt;/b&gt;
&lt;/pre&gt;
After that everything started to work.
&lt;br/&gt;
To make the changes permanent, I have added add the following lines:
&lt;pre class="code"&gt;
### printserv
killall mini-lpd
/mnt/C/sys/sbin/p910nd -b -f /dev/usblp0 &amp;
&lt;/pre&gt;
to the &lt;i&gt;/mnt/C/sys/etc/rc-local&lt;/i&gt; file.
&lt;br/&gt;
&lt;br/&gt;
Ok, that's it on the server side, let's look at the clients...
&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Client installation&lt;/h3&gt;
Now it is time to install the print clients:
&lt;br/&gt;
&lt;b&gt;Windows XP&lt;/b&gt;
&lt;br/&gt;
I presume you already have the printer installed locally, and so the only thing you need is to create a new port and set it up as a &lt;i&gt;Standard TCP/IP Port&lt;/i&gt;:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SwUkXHBhkQI/AAAAAAAADXk/z3jzSXoj_JM/s1600/AddPort.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 367px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SwUkXHBhkQI/AAAAAAAADXk/z3jzSXoj_JM/s400/AddPort.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405766907169181954" /&gt;&lt;/a&gt;
Now you select the box IP or network name:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SwUkXfBtjxI/AAAAAAAADXs/Ois8pkBCuqg/s1600/AddPort2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 312px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SwUkXfBtjxI/AAAAAAAADXs/Ois8pkBCuqg/s400/AddPort2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405766913612418834" /&gt;&lt;/a&gt;
As a device type you choose the &lt;i&gt;Hewlett Pacjkard Jet Direct&lt;/i&gt;:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUkXvWS70I/AAAAAAAADX0/gwfbpkaLmxY/s1600/DeviceType.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 295px; height: 400px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUkXvWS70I/AAAAAAAADX0/gwfbpkaLmxY/s400/DeviceType.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405766917993721666" /&gt;&lt;/a&gt;
Here is a result page(&lt;a href="http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol"&gt;SNMP&lt;/a&gt; not supported, RAW protocol, port 9100):
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUkX7PF0BI/AAAAAAAADX8/ZIDoMIS6Sh4/s1600/Result.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 311px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUkX7PF0BI/AAAAAAAADX8/ZIDoMIS6Sh4/s400/Result.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405766921184727058" /&gt;&lt;/a&gt;
Here we see the newly created port:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SwUkYFnzTsI/AAAAAAAADYE/Y3BP6N_I2JA/s1600/Ports.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 362px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SwUkYFnzTsI/AAAAAAAADYE/Y3BP6N_I2JA/s400/Ports.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405766923972726466" /&gt;&lt;/a&gt;
And finally we are ready to print test page:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SwUkuTlgpPI/AAAAAAAADYM/-JNOc1gd_sM/s1600/PrintTestPage.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 362px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SwUkuTlgpPI/AAAAAAAADYM/-JNOc1gd_sM/s400/PrintTestPage.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405767305678333170" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Ubuntu 9.10&lt;/b&gt;
&lt;br/&gt;
In menu &lt;i&gt;System/Administration/Printing&lt;/i&gt; we choose to create a new printer and 
in device selection choose &lt;i&gt;Network Printer&lt;/i&gt; and &lt;i&gt;AppSocket/HP JetDirect&lt;/i&gt;.In &lt;i&gt;Host&lt;/i&gt; and &lt;i&gt;Port&lt;/i&gt; fields we fill the box IP or network name and as port we use 9100:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUm69kdNVI/AAAAAAAADYs/NKrfdJIfWGA/s1600/NewPrinter.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 388px; height: 400px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUm69kdNVI/AAAAAAAADYs/NKrfdJIfWGA/s400/NewPrinter.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405769722129888594" /&gt;&lt;/a&gt;
The next step is the Printer model and driver selection:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SwUm6kOACyI/AAAAAAAADYk/hkbpQyoygBU/s1600/PrinterDriver.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 357px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SwUm6kOACyI/AAAAAAAADYk/hkbpQyoygBU/s400/PrinterDriver.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405769715324816162" /&gt;&lt;/a&gt;
Now we can specify the printer name and description:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUm6Z5TxjI/AAAAAAAADYc/MREPBvVeA74/s1600/DescribePrinter.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 357px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SwUm6Z5TxjI/AAAAAAAADYc/MREPBvVeA74/s400/DescribePrinter.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405769712553674290" /&gt;&lt;/a&gt;
And finally we are ready to print test page:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SwUm6Nhm1QI/AAAAAAAADYU/O37QpA5nahk/s1600/PrintTestPage.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 357px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SwUm6Nhm1QI/AAAAAAAADYU/O37QpA5nahk/s400/PrintTestPage.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5405769709233034498" /&gt;&lt;/a&gt;

&lt;h3&gt;Links&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;For those who interested in a variety of connectors, here is a link to a 
&lt;a href="http://www.systemconnection.com/downloads/PDFs/connector_guide.pdf"&gt;Connector guide PDF&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Here is a &lt;a href="http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1258624587582+28353475&amp;threadId=778999"&gt;forum regarding HP LaserJet 1100 USB connection&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Here is a document regarding
&lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpj05999"&gt;Making HP Jetdirect Print Servers Secure on a Network&lt;/a&gt;.
I do not know whether it has any relevance, I did not look at it so far.&lt;/li&gt;
&lt;li&gt;Here is an &lt;a href="ftp://airliveftp.dyndns.org/Multimedia/WMU-6000FS/AirLive_WMU-6000FS_Manual.pdf"&gt;AirLive WMU-6000FS installation manual (PDF)&lt;/a&gt; containing print server installation.&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-7539032733614159605?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/7539032733614159605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=7539032733614159605' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7539032733614159605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7539032733614159605'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2009/11/print-server.html' title='WMU-6500FS - Print server installation'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xFBIBcRhwFQ/SwUkXHBhkQI/AAAAAAAADXk/z3jzSXoj_JM/s72-c/AddPort.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-5212281547295664072</id><published>2009-04-13T22:35:00.011+02:00</published><updated>2009-04-14T01:09:22.860+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Deluge 1.1.5</title><content type='html'>I just finished a build of the deluge 1.1.5. It is bit outdated (the 1.1.6 version is out now) but I had to solve some problems along the way which taken more time than expected. Once it was finished I did not find a morale to step one bugfix version further. 

&lt;h3&gt;Build result&lt;/h3&gt;
&lt;a href="http://filodej.ic.cz/filopack/deluge-1.1.5.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/deluge-1.1.5.lst"&gt;[file list]&lt;/a&gt;
&lt;h3&gt;Prerequisites&lt;/h3&gt;
The same as for the &lt;a href="http://filodej.blogspot.com/2009/01/wmu-6500fs-deluge-110.html"&gt;previous version&lt;/a&gt; plus:
&lt;br/&gt;
&lt;a href="http://filodej.ic.cz/filopack/_socket.so"&gt;[patched python socket module]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/tar-1.22.tar.bz2"&gt;[tar 1.22]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/bzip2-1.0.5.tar.bz2"&gt;[bzip2 lib]&lt;/a&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;h3&gt;Uninstall&lt;/h3&gt;
If you have the &lt;i&gt;deluge-1.1.0&lt;/i&gt; installed, you have to clean it up first (while preserve all the dependencies).
&lt;br/&gt;
Stop the deluge daemon if it is running. You can do it via console:
&lt;pre class="code"&gt;
box# &lt;b&gt;deluge --ui=null&lt;/b&gt;
&amp;gt;&amp;gt;&amp;gt; &lt;b&gt;halt&lt;/b&gt;
&amp;gt;&amp;gt;&amp;gt; quit
Thanks!

&lt;/pre&gt;

or forcibly:

&lt;pre class="code"&gt;
box# &lt;b&gt;killall deluged&lt;/b&gt;
&lt;/pre&gt;

Now uninstall the previous version:
&lt;pre class="code"&gt;
dev# cd /mnt/C/
dev# &lt;b&gt;./filopack.sh --remove deluge-1.1.0&lt;/b&gt;
Configuration file .filopack/.config file found and used
Sure to remove deluge-1.1.0 locally at /mnt/C (y/n)?&lt;b&gt;y&lt;/b&gt;
...
&lt;/pre&gt;
If you are not using the &lt;a href="http://filodej.blogspot.com/2008/11/simple-packaging-sysetm.html"&gt;filopack packaging system&lt;/a&gt;, you can remove the previous version as follows:
&lt;pre class="code"&gt;
box# cd /mnt/C/
box# wget &lt;a href="http://filodej.ic.cz/filopack/.filopack/deluge-1.1.0.lst"&gt;http://filodej.ic.cz/filopack/.filopack/deluge-1.1.0.lst&lt;/a&gt;
box# xargs rm -f &lt; deluge-1.1.0.lst
&lt;/pre&gt;
&lt;h3&gt;Update the system&lt;/h3&gt;
Before we start installing the new version, we have to update the &lt;i&gt;tar archiver&lt;/i&gt;. The one which is part of the &lt;i&gt;busybox&lt;/i&gt; has an ugly bug corrupting file names in long paths.
&lt;pre class="code"&gt;
box# &lt;b&gt;./filopack.sh --download bzip2-1.0.5&lt;/b&gt;
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package bzip2-1.0.5 from http://filodej.ic.cz ...
connected!

Length: 191 [text/plain]
connected!

Length: 40,244 [application/x-tar]

box# &lt;b&gt;./filopack.sh --install bzip2-1.0.5&lt;/b&gt;
...
box# &lt;b&gt;./filopack.sh --download tar-1.22&lt;/b&gt;
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package tar-1.22 from http://filodej.ic.cz ...
connected!

Length: 1,523 [text/plain]
connected!

Length: 625,455 [application/x-tar]

box# &lt;b&gt;./filopack.sh --install tar-1.22&lt;/b&gt;
...

&lt;/pre&gt;
For details about the bug see &lt;a href="#busybox-tar"&gt;this section&lt;/a&gt;.
&lt;br/&gt;
Also it may be necessary to download a patched version of python socket library, you can test your system as follows:
&lt;pre class="code"&gt;
box# &lt;b&gt;python -c 'import socket; print socket.gethostbyaddr("80.68.88.204")[2];'&lt;/b&gt;
Segmentation fault
&lt;/pre&gt;
... if you encounter the segfault, it is better to download and install the patched python socket library:
&lt;pre class="code"&gt;
box# &lt;b&gt;wget &lt;a href="http://filodej.ic.cz/filopack/_socket.so"&gt;http://filodej.ic.cz/filopack/_socket.so&lt;/a&gt;&lt;/b&gt;
connected!

Length: 116,767 [text/plain]

box# &lt;b&gt;mv sys/lib/python2.5/lib-dynload/_socket.so{,.backup}&lt;/b&gt;
box# &lt;b&gt;mv _socket.so sys/lib/python2.5/lib-dynload/&lt;/b&gt;
&lt;/pre&gt;
Now the problem should be fixed:
&lt;pre class="code"&gt;
box# &lt;b&gt;python -c 'import socket; print socket.gethostbyaddr("80.68.88.204")[2];'&lt;/b&gt;
['80.68.88.204']
&lt;/pre&gt;
For details about this issue see &lt;a href="#socket-crash"&gt;this section&lt;/a&gt;.
&lt;br/&gt;  
&lt;h3&gt;Install&lt;/h3&gt;
After we updated the system we are ready to install the new version:
&lt;pre class="code"&gt;
box# &lt;b&gt;./filopack.sh --download deluge-1.1.5&lt;/b&gt;
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package deluge-1.1.5 from http://filodej.ic.cz ...
connected!

Length: 89,430 [text/plain]
connected!

Length: 16,084,717 [application/x-tar]

box# &lt;b&gt;./filopack.sh --install deluge-1.1.5&lt;/b&gt;
Sure to unpack deluge-1.1.5 locally at /mnt/C (y/n)? &lt;b&gt;y&lt;/b&gt;
...
&lt;/pre&gt;
&lt;h3&gt;Run daemon&lt;/h3&gt;
Now we are ready to try the daemon, still it is necessary to use the &lt;i&gt;LD_PRELOAD&lt;/i&gt; prefix or &lt;i&gt;deluged.sh&lt;/i&gt; script:
&lt;pre class="code"&gt;
box# &lt;b&gt;deluged.sh&lt;/b&gt;
&lt;/pre&gt;
That's all. Following text just describes details related to the issues I solved. Nothing for ordinary users ;-)
&lt;a name="busybox-tar"&gt;&lt;/a&gt;
&lt;h3&gt;Busybox tar bug&lt;/h3&gt;
When I run the deluge client (console version) some commands was not properly interpreted:
&lt;pre class="code"&gt;
box# deluge
&gt;&gt;&gt; info
 * unknown command: info
&gt;&gt;&gt; help
 * unknown command: help
&lt;/pre&gt;
I found out that any command is implemented in a separate python file:
&lt;pre class="code"&gt;
box# cd sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg
box# ls deluge/ui/console/commands/
add.py          config.pyc   debug.pyc       help.pyc        __init__.pyc    quit.pyc    rm.pyc
add.pyc         connect.py   halt.py0000755  info.py0000755  pause.py        resume.py
add.pyc0000644  connect.pyc  halt.pyc        info.pyc        pause.pyc       resume.pyc
config.py       debug.py     help.py0000755  __init__.py     quit.py0000755  rm.py
&lt;/pre&gt;
... it seems there are some ill-named files in the command directory, and so the console does not know the commands at all.
&lt;br/&gt;
Let's find all such corrupted files:
&lt;pre class="code"&gt;
box# find . -name *0000*
./deluge/core/preferencesmanager.pyc0000644
./deluge/ui/console/commands/quit.py0000755
./deluge/ui/console/commands/help.py0000755
./deluge/ui/console/commands/halt.py0000755
./deluge/ui/console/commands/info.py0000755
./deluge/ui/console/commands/add.pyc0000644
./deluge/ui/gtkui/torrentdetails.pyc0000644
./deluge/ui/gtkui/queuedtorrents.pyc0000644
./deluge/ui/gtkui/filtertreeview.pyc0000644
./deluge/ui/webui/page_decorators.py0000755
./deluge/ui/webui/torrent_options.py0000755
./deluge/ui/webui/lib/egg_handler.py0000755
./deluge/ui/webui/lib/egg_render.pyc0000644
./deluge/ui/webui/lib/webpy022/db.py0000755
./deluge/plugins/Label-0.1-py2.5.egg0000644
./deluge/plugins/webuipluginbase.pyc0000644
./deluge/data/pixmaps/checking16.png0000644
./deluge/data/pixmaps/inactive16.png0000644
&lt;/pre&gt;
Let's look also in the deluge tar archive:
&lt;pre class="code"&gt;
box# tar tjvf deluge-1.1.5.tar.bz2 | grep 0000
-rw-r--r-- 0/0     21100 2009-04-01 12:22:09 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/core/preferencesmanager.pyc0000644
-rwxr-xr-x 0/0      1079 2009-04-01 12:22:09 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/console/commands/quit.py0000755
-rwxr-xr-x 0/0      2299 2009-04-01 12:22:09 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/console/commands/help.py0000755
-rwxr-xr-x 0/0      1125 2009-04-01 12:22:09 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/console/commands/halt.py0000755
-rwxr-xr-x 0/0      5296 2009-04-01 12:22:09 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/console/commands/info.py0000755
-rw-r--r-- 0/0      2036 2009-04-01 12:22:09 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/console/commands/add.pyc0000644
-rw-r--r-- 0/0     13688 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/gtkui/torrentdetails.pyc0000644
-rw-r--r-- 0/0      7346 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/gtkui/queuedtorrents.pyc0000644
-rw-r--r-- 0/0     13073 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/gtkui/filtertreeview.pyc0000644
-rwxr-xr-x 0/0      5062 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py0000755
-rwxr-xr-x 0/0      3233 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/webui/torrent_options.py0000755
-rwxr-xr-x 0/0      1553 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/webui/lib/egg_handler.py0000755
-rw-r--r-- 0/0      1522 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/webui/lib/egg_render.pyc0000644
-rwxr-xr-x 0/0     20480 2009-04-01 12:22:10 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/db.py0000755
-rw-r--r-- 0/0     38041 2009-04-01 12:22:11 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/plugins/Label-0.1-py2.5.egg0000644
-rw-r--r-- 0/0      2982 2009-04-01 12:22:11 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/plugins/webuipluginbase.pyc0000644
-rw-r--r-- 0/0       699 2009-04-01 12:22:11 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/data/pixmaps/checking16.png0000644
-rw-r--r-- 0/0       595 2009-04-01 12:22:11 sys/lib/python2.5/site-packages/deluge-1.1.5-py2.5-linux-i686.egg/deluge/data/pixmaps/inactive16.png0000644
&lt;/pre&gt;
At a first glance it seem that the archive is corrupted but when I tried the same operation on my mirror system (on the PC) no corrupted file appeared in the archive.
&lt;br/&gt;
The difference was that while on the mirror system I have the GNU tar 1.20 installed, on the box there is a busybox version containing tar utility:
&lt;pre class="code"&gt;
box# which tar
/bin/tar
box# ls -l /bin/tar
lrwxrwxrwx 1 root root 7 2008-05-21 13:40 /bin/tar -&gt; busybox
&lt;/pre&gt;
I decided to build the newest GNU tar version (1.22) and install it to the box. A new post containing the build procedure will follow. After the installation the problem disappeared.
&lt;a name="socket-crash"&gt;&lt;/a&gt;
&lt;h3&gt;Socket related crash&lt;/h3&gt;
I am not sure whether it was new to this version, but after the installation from time to time I have experienced a weird crash of the deluge daemon. Also the Windows client did not respond for long time when was connected to the daemon running on the box. After some experimenting with the deluge log I decided to debug the daemon to find out what is going on.
&lt;br/&gt;
I was running the gdbserver on the box:
&lt;pre class="code"&gt;
box# &lt;b&gt;LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" gdbserver colinux:2345 `which python` `which deluged` -d&lt;/b&gt;
Process /usr/bin/python created; pid = 31831
Listening on port 2345
Remote debugging from host 192.168.1.102
...
&lt;/pre&gt;
Then I was ready to connect to the gdbserver from my mirror system:
&lt;pre class="code"&gt;
deb# &lt;b&gt;gdb `which python`&lt;/b&gt;
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux-uclibc"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) &lt;b&gt;target remote storage:2345&lt;/b&gt;
Remote debugging using storage:2345
0x40000c90 in ?? ()
(gdb) &lt;b&gt;cont&lt;/b&gt;
Continuing.
...
&lt;/pre&gt;
After some time when I was connecting and disconnectiong the windows client to the daemon the problem appeared:
&lt;pre class="code"&gt;
[New Thread 32801]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 32801]
0x400a0fb0 in PyString_FromString (str=0xc7c3815b &amp;lt;Address 0xc7c3815b out of bounds&amp;gt;) at Objects/stringobject.c:108
108             size = strlen(str);
(gdb)
&lt;/pre&gt;
It was at the following stack:
&lt;pre class="code"&gt;
(gdb) where
#0  0x400a0fb0 in PyString_FromString (str=0xc7c3815b &amp;lt;Address 0xc7c3815b out of bounds&amp;gt;) at Objects/stringobject.c:108
#1  0x407e8154 in gethost_common (h=0xbb9fdae8, addr=0xbb9fdb08, alen=128, af=2) at /usr/local/src/Python-2.5.2/Modules/socketmodule.c:3048
#2  0x407e5825 in &lt;b&gt;socket_gethostbyaddr&lt;/b&gt; (self=0x0, args=0x40f2f48c) at /usr/local/src/Python-2.5.2/Modules/socketmodule.c:3273
#3  0x40094bd2 in PyCFunction_Call (func=0x405ac70c, arg=0x40f2f48c, kw=0x0) at Objects/methodobject.c:108
#4  0x400dcf1a in PyEval_EvalFrameEx (f=0x81f8624, throwflag=0) at Python/ceval.c:3573
#5  0x400de1e6 in PyEval_EvalCodeEx (co=0x405b94e8, globals=0x405b624c, locals=0x0, args=0x820022c, argcount=1, kws=0x8200230, kwcount=0, defs=0x405be518, defcount=1,
    closure=0x0) at Python/ceval.c:2836
#6  0x400dd6d0 in PyEval_EvalFrameEx (f=0x82000e4, throwflag=0) at Python/ceval.c:3669
#7  0x400dda59 in PyEval_EvalFrameEx (f=0x81e77d4, throwflag=0) at Python/ceval.c:3659
#8  0x400de1e6 in PyEval_EvalCodeEx (co=0x405c13c8, globals=0x405b602c, locals=0x0, args=0x406200b0, argcount=4, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
    at Python/ceval.c:2836
...
&lt;/pre&gt;
a crash in &lt;i&gt;PyString_FromString&lt;/i&gt; seems to be just a consequence, let's look up a bit:
&lt;pre class="code"&gt;
(gdb) up
#1  0x407e8154 in gethost_common (h=0xbb9fdae8, addr=0xbb9fdb08, alen=128, af=2) at /usr/local/src/Python-2.5.2/Modules/socketmodule.c:3048
3048                            tmp = PyString_FromString(*pch);
(gdb) list
3043
3044            /* SF #1511317: h_aliases can be NULL */
3045            if (h-&amp;gt;h_aliases) {
3046                    for (pch = h-&amp;gt;h_aliases; *pch != NULL; pch++) {
3047                            int status;
3048                            tmp = PyString_FromString(*pch);
3049                            if (tmp == NULL)
3050                                    goto err;
3051
3052                            status = PyList_Append(name_list, tmp);
(gdb) print h
$1 = (struct hostent *) 0xbb9fdae8
(gdb) print *h
$2 = {h_name = 0xbb9f9b00 "filodej.doma", h_aliases = 0x40172891, h_addrtype = 2, h_length = 4, h_addr_list = 0xbb9f9aec}
(gdb) print h-&amp;gt;h_aliases
$3 = (char **) 0x40172891
(gdb) print *h-&amp;gt;h_aliases
$4 = 0xc7c3815b &amp;lt;Address 0xc7c3815b out of bounds&amp;gt;
&lt;/pre&gt;
... It seems that a host entry should contain an array of strings - aliases - but this array is apparently corrupted - it causes a crash of the C string -&amp;gt; Python string conversion routine. Let's look who is responsible for filling the array:
&lt;pre class="code"&gt;
(gdb) up
#2  0x407e5825 in socket_gethostbyaddr (self=0x0, args=0x40f2f48c) at /usr/local/src/Python-2.5.2/Modules/socketmodule.c:3273
3273            ret = gethost_common(h, (struct sockaddr *)&amp;addr, sizeof(addr), af);
(gdb) list
3268            PyThread_acquire_lock(netdb_lock, 1);
3269    #endif
3270            h = gethostbyaddr(ap, al, af);
3271    #endif /* HAVE_GETHOSTBYNAME_R */
3272            Py_END_ALLOW_THREADS
3273            ret = gethost_common(h, (struct sockaddr *)&amp;addr, sizeof(addr), af);
3274    #ifdef USE_GETHOSTBYNAME_LOCK
3275            PyThread_release_lock(netdb_lock);
3276    #endif
3277            return ret;
&lt;/pre&gt;
The &lt;a href="http://linux.die.net/man/3/gethostbyaddr"&gt;gethostbyaddr&lt;/a&gt; seems as a good candidate. At first I wondered whether the function is thread safe (see the &lt;a href="http://sources.busybox.net/index.py/trunk/uClibc/docs/threads.txt?r1=4924&amp;r2=5191"&gt;following text&lt;/a&gt; about uClibc thread safety), but after further debugging I have found out that the apparently thread safe variant &lt;i&gt;gethostbyaddr_r&lt;/i&gt; is called in my case, so there should be not threading issue there.
&lt;pre class="code"&gt;
(gdb) cont
Continuing.
[New Thread 1024]
Breakpoint 2 at 0x407e574c: file /usr/local/src/Python-2.5.2/Modules/socketmodule.c, li
Pending breakpoint "socket_gethostbyaddr" resolved
[New Thread 19476]
[Switching to Thread 19476]

Breakpoint 2, socket_gethostbyaddr (self=0x0, args=0x40f27ccc) at /usr/local/src/Python
3229            if (!PyArg_ParseTuple(args, "s:gethostbyaddr", &amp;ip_num))
...
(gdb) next
3252            Py_BEGIN_ALLOW_THREADS
(gdb) next
3255            result = gethostbyaddr_r(ap, al, af,
(gdb) next
3272            Py_END_ALLOW_THREADS
(gdb) print buf
$12 = "À¨\001eè\232?½", '\0' &amp;lt;repeats 16 times&amp;gt;, "filodej.doma\000.in-addr.arpa", '\0' &amp;lt;repeats 16333 times&amp;gt;, "@"
(gdb) next
3273            ret = gethost_common(h, (struct sockaddr *)&amp;addr, sizeof(addr), af);
(gdb) print *h
$14 = {h_name = 0xbd3f9b00 "filodej.doma", h_aliases = 0x40172891, h_addrtype = 2, h_length = 4, h_addr_list = 0xbd3f9aec}
(gdb) print h-&amp;gt;h_aliases
$15 = (char **) 0x40172891
(gdb) print *h-&amp;gt;h_aliases
$16 = 0xc7c3815b &amp;lt;Address 0xc7c3815b out of bounds&amp;gt;
&lt;/pre&gt;
... after some googling I found some hints in the &lt;a href="http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&amp;forum_id=39&amp;_forum_thread_total=100&amp;_forum_thread_page=3&amp;forum_threadsort_by=created_by&amp;forum_threadsort_order=asc&amp;_forum_action=ForumMessageBrowse&amp;thread_id=2601
"&gt;following forum&lt;/a&gt;.
&lt;br/&gt;
Actually it seem there were two related bugs: &lt;a href="http://lists.uclibc.org/pipermail/uclibc/2004-August/009527.html
"&gt;the first&lt;/a&gt; in &lt;i&gt;gethostbyname_r&lt;/i&gt; seems to be fixed now, steps to simply reproduce the problem:
&lt;pre class="code"&gt;
box# python -c 'import socket; print socket.gethostbyname_ex("wh0rd.org")[2];'
['80.68.88.204']
&lt;/pre&gt; 
... it was ok in my case, it seems to be fixed in 0.9.27 version.
&lt;br/&gt;
The &lt;a href="http://sources.uclibc.org/index.py?view=rev&amp;revision=15759"&gt;second bug&lt;/a&gt; is in &lt;i&gt;gethostbyaddr_r&lt;/i&gt; function. The step to reproduce is following:
&lt;pre class="code"&gt;
box# python -c 'import socket; print socket.gethostbyaddr("80.68.88.204")[2];'
Segmentation fault
&lt;/pre&gt;
... it crashes on my box. Given you have the Python installed, you can test your configuration the same way.
&lt;br/&gt;
For the solution I decided not to patch or upgrade the uClibc but rather make a workaround in the python socket library. Zeroing the structure prior to the &lt;i&gt;gethostbyaddr_r&lt;/i&gt; call should be enough. Let's modify the python &lt;a href="http://www.koders.com/c/fid643141F4EB2CF58F4C46682D5B577E52369E1A36.aspx?s=ftp"&gt;Modules/socketmodule.c&lt;/a&gt; file. In the &lt;a href="http://www.koders.com/c/fid643141F4EB2CF58F4C46682D5B577E52369E1A36.aspx?s=ftp#L1374"&gt;PySocket_gethostbyaddr&lt;/a&gt; functon there is a &lt;a href="http://www.koders.com/c/fid643141F4EB2CF58F4C46682D5B577E52369E1A36.aspx?s=ftp#L1381"&gt;hp_allocated&lt;/a&gt; structure we are going to reset to zeroes. Just before the &lt;a href="http://www.koders.com/c/fid643141F4EB2CF58F4C46682D5B577E52369E1A36.aspx?s=ftp#L1401"&gt;gethostbyaddr_r&lt;/a&gt; call we add the following code:
&lt;pre class="code"&gt;
#if   defined(HAVE_GETHOSTBYNAME_R_6_ARG)
        &lt;b&gt;memset((void *) &amp;hp_allocated, '\0', sizeof(hp_allocated));&lt;/b&gt;
        result = gethostbyaddr_r(ap, al, af,
                &amp;hp_allocated, buf, buf_len,
                &amp;h, &amp;errnop);
&lt;/pre&gt;
... and rebuild and re-pack the python package:
&lt;pre class="code"&gt;
deb# cd /usr/local/src/Python-2.5.2
deb# make
case $MAKEFLAGS in \
*-s*) LD_LIBRARY_PATH=/usr/local/src/Python-2.5.2::/mnt/C/sys/lib:/mnt/C/sys/X11/lib CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build;; \
*) LD_LIBRARY_PATH=/usr/local/src/Python-2.5.2::/mnt/C/sys/lib:/mnt/C/sys/X11/lib CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build;; \
esac
running build
running build_ext
db.h: found (4, 3) in /mnt/C/sys/include
db lib: using (4, 3) db-4.3
/mnt/C/sys/include/sqlite3.h: version 3.5.8
INFO: Can't locate Tcl/Tk libs and/or headers
building '_socket' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/usr/local/src/Python-2.5.2/./Include -I/mnt/C/sys/include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/src/Python-2.5.2/Include -I/usr/local/src/Python-2.5.2 -c /usr/local/src/Python-2.5.2/Modules/socketmodule.c -o build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/socketmodule.o
gcc -pthread -shared -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/socketmodule.o -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -L/usr/local/lib -L. -lpython2.5 -o build/lib.linux-i686-2.5/_socket.so
building 'nis' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/usr/local/src/Python-2.5.2/./Include -I/mnt/C/sys/include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/src/Python-2.5.2/Include -I/usr/local/src/Python-2.5.2 -c /usr/local/src/Python-2.5.2/Modules/nismodule.c -o build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/nismodule.o
gcc -pthread -shared -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/nismodule.o -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -L/usr/local/lib -L. -lnsl -lpython2.5 -o build/lib.linux-i686-2.5/nis.so
*** WARNING: renaming "nis" since importing it failed: dynamic module does not define init function (initnis)
running build_scripts
box# make install
...
deb# cd /mnt/C/
deb# ./filopack.sh -R --pack python-2.5.2
...
&lt;/pre&gt;
&lt;h3&gt;Build process&lt;/h3&gt;
The build process was identical to 1.1.0 version, I just had to create .pth link file in order to be able to remove the duplicate directories:
&lt;pre class="code"&gt; 
dev# cd /mnt/C/sys/lib/python2.5/site-packages
dev# echo "./deluge-1.1.5-py2.5-linux-i686.egg" &gt; deluge.pth

dev# cd /mnt/C/
dev# ./filopack.sh --pack deluge-1.1.5
&lt;/pre&gt;
Remove all the "site-packages/deluge/" sub-paths (they seem to be redundant) and re-pack the package once more.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-5212281547295664072?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/5212281547295664072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=5212281547295664072' title='29 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5212281547295664072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5212281547295664072'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2009/04/wmu-6500fs-deluge-115.html' title='WMU-6500FS - Deluge 1.1.5'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>29</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-7092835517381876974</id><published>2009-03-26T20:37:00.004+01:00</published><updated>2009-03-27T16:58:21.104+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WRT54GL with DD-WRT 2.4 fw'/><category scheme='http://www.blogger.com/atom/ns#' term='Networking'/><title type='text'>Port forwarding &amp; Remote desktop connection (updated)</title><content type='html'>&lt;h3&gt;Overview&lt;/h3&gt;

In the company I am working as a developer we have relatively flexible rules how to organize working time (some workdays we can work from home assuming we are online and easily accessible by other team members). On the other side there are strict IT rules and firewall settings complicating the remote access.&lt;br/&gt; 
The e-mail access and even the remote desktop access is officially possible just via a web portal provided that you withstand a tedious login process and unbearable refresh rate (not speaking of an odd interference with skype).
&lt;br/&gt;
Thus we faced a challenge how to overcome the strict firewall settings and open up a direct (and swift) remote desktop access. Finally we succeeded, and in this post I am going to share the method with you, having possibly similar problems.

&lt;h3&gt;Info sources&lt;/h3&gt;
&lt;a href="http://theillustratednetwork.mvps.org/Ssh/RemoteDesktopSSH.html"&gt;[Secure remote access of a private network]&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://theillustratednetwork.mvps.org/RemoteDesktop/RemoteDesktopSetupandTroubleshooting.html#Port_forwarding"&gt;[Port forwarding for Remote Desktop]&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1"&gt;[Unix man pages: ssh(1)]&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://sig9.com/articles/concurrent-remote-desktop"&gt;[Concurrent Remote Desktop Sessions in Windows XP SP2]&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.miscdebris.net/blog/2007/06/01/speed-up-ssh-x11-forwarding"&gt;[Speed up SSH X11 forwarding]&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://staff.washington.edu/corey/fw/ssh-port-forwarding.html"&gt;[SSH port forwarding]&lt;/a&gt;
&lt;h3&gt;Configuration&lt;/h3&gt;
At home I have a PC workstation with Windows XP and laptop with Linux Ubuntu 8.04, both computers behind 
the Linksys router WRT54GL with DD-WRT firmware version 2.4. 
&lt;br/&gt;
In the office I have a PC workstation with Windows XP behind a firewall. The firewall is administered 
by the IT department (residing abroad) and developers have no way of configuring it. 
&lt;br/&gt;
The office firewall is configured that there are no incoming ports open and there are just a few outgoing:
80 (http), 119 (nntp), 1863 (msnp) and maybe few others I do not know of.
&lt;br/&gt;
The goal is to find a way how to enable Remote desktop connection across the Internet in both directions.
&lt;br/&gt;
We decided to use SSH port forwarding feature. Since the port 22 standardly used for SSH access is not forwarded 
on the firewall even for outgoing connections we had to use another port - 119 was our choice.
&lt;br/&gt;
In following text I use port &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt;, actually it is specific to this 
specific scenario, given there is another firewall configuration, port selection has to be done correspondingly.

&lt;h3&gt;Homeward connection&lt;/h3&gt;
This direction is a simpler one, since there are at least some ports open on the firewall for outgoing connections.
&lt;br/&gt;
&lt;b&gt;We have the following:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;Home internet connection with public IP address&lt;/li&gt;
    &lt;ul&gt;&lt;li&gt;as an alternative you can use a dynamic DNS service (like &lt;a href="http://www.dyndns.com/"&gt;dynDNS&lt;/a&gt; 
    or similar) but also need a port forwarding for at least port &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt; activated by your ISP&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;Home router with SSH access activated, but configured to listen on port &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt;
    &lt;ul&gt;&lt;li&gt;In case you have no router you can have SSH service/daemon (configured for port 
        &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt;) running directly on your computer&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Home PC with OS Windows (XP Professional version, the Home version has a limited remote access) - Terminal services listening standardly on port 
    &lt;span style="color: #3300ff"&gt;&lt;b&gt;3389&lt;/b&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;Home Laptop with OS Linux (Ubuntu Hardy 8.04) - VNC server screen 1 listening on port &lt;span
    style="color: #cc00ff"&gt;&lt;b&gt;5901&lt;/b&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;Office PC with OS Windows XP (not sure if the Professional version is necessary for the Terminal Serveces client) with 
&lt;a href="http://www.realvnc.com/products/free/4.1/download.html"&gt;VNC viewer&lt;/a&gt; installed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;b&gt;Steps to establish the remote desktop connection:&lt;/b&gt;
&lt;ol&gt;
  &lt;li&gt;
    Launch SSH client configured with following command line:
    &lt;br/&gt;
    &lt;b&gt;ssh.exe -L &lt;span style="color: #ff0000"&gt;3391&lt;/span&gt;:workstation:&lt;span style="color: #3300ff"&gt;3389&lt;/span&gt; 
    -L &lt;span style="color: #ff9900"&gt;5951&lt;/span&gt;:laptop:&lt;span style="color: #cc00ff"&gt;5901&lt;/span&gt; 
    -i .ssh\id_rsa &amp;lt;user&amp;gt;@&amp;lt;home-ip&amp;gt; -p &lt;span style="color: #009900"&gt;119&lt;/span&gt;&lt;/b&gt;
    &lt;br/&gt;
    ... which means:
    &lt;ul&gt;
    &lt;li&gt;Connect to the remote host with IP &amp;lt;home-ip&amp;gt; (our Home public IP or DNS name) via port &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt; as a user &amp;lt;user&amp;gt;&lt;/li&gt;
    &lt;li&gt;Forwarding local port &lt;span style="color: #ff0000"&gt;&lt;b&gt;3391&lt;/b&gt;&lt;/span&gt; to port &lt;span style="color: #3300ff"&gt;&lt;b&gt;3389&lt;/b&gt;&lt;/span&gt; of remote host &lt;i&gt;"workstation"&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;Forwarding local port &lt;span style="color: #ff9900"&gt;&lt;b&gt;5951&lt;/b&gt;&lt;/span&gt; to port &lt;span style="color: #cc00ff"&gt;&lt;b&gt;5901&lt;/b&gt;&lt;/span&gt; of remote host &lt;i&gt;"laptop"&lt;/i&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
  In order to connect to the Windows machine launch the Terminal services client: &lt;br /&gt;
  &lt;b&gt;mstsc.exe /v:localhost:&lt;span style="color: #ff0000"&gt;3391&lt;/span&gt;&lt;/b&gt;
  &lt;/li&gt;
  &lt;li&gt;
  In order to connect to the Linux machine launch the VNC viewer: &lt;br /&gt;
  &lt;b&gt;vncviewer.exe localhost:&lt;span style="color: #ff9900"&gt;5951&lt;/span&gt;&lt;/b&gt;
  &lt;/li&gt;
&lt;/ol&gt;
And that's it. Following schema demonstrates the whole situation:
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SKYeOYTLpUI/AAAAAAAABpA/uXxXY1sCIZ8/s1600-h/RemoteDesktop2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SKYeOYTLpUI/AAAAAAAABpA/uXxXY1sCIZ8/s400/RemoteDesktop2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5234904849254688066" /&gt;&lt;/a&gt;
&lt;br/&gt;
This was a simpler direction (according to the firewall configuration). The more complicated one follows...

&lt;span class="fullpost"&gt;

&lt;h3&gt;Connection towards Office&lt;/h3&gt;
This direction is a more intricate one, simply because we are trying to go "against" the firewall, it is configured to disallow any 
incoming connection. So if we cannot connect to the office computer (sitting behind the firewall) what about turning over the problem
to the previous (already solved) one? We could possibly &lt;i&gt;be contacted&lt;/i&gt; by our office computer instead of trying contact it ourself.
&lt;br /&gt;
But we still need some way to initiate the whole connection process. After all must be at least some how to pass through the firewall.
If there is such facility, we could use it as our trigger (Surely there is such a facility - a good old e-mail ;-).
&lt;br /&gt;
&lt;b&gt;Now we have the following:&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;Office PC with OS Windows XP (XP Professional version, the Home version has a limited remote access) - Terminal services listening 
    standardly on port &lt;span style="color: #3300ff"&gt;&lt;b&gt;3389&lt;/b&gt;&lt;/span&gt; and Outlook client running with a custom e-mail rule starting the 
    connection (we can define a rule for specific sender address, subject or body containing some "magic" string etc). 
    &lt;ul&gt;&lt;li&gt;Obviously any other e-mail client (with e-mail rules) can be used. Or it is possible to use another utility running as an OS service
     - this way it would be possible to contact the computer even when no user was previously logged in.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;We still need an internet connection with public IP address or at least &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt; 
    incomming port forwarding (remember, even when we are connecting to the office - actually our ofice is contacting us ;)&lt;/li&gt;
&lt;li&gt;Home router with SSH access activated, but configured to listen on port &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt;.
    Also we need to have the Office Workstation's rsa key added to the list of router's &lt;i&gt;Authorized keys&lt;/i&gt;.
&lt;/li&gt;
&lt;li&gt;Home PC with OS Windows XP (not sure if the Professional version is necessary for the Terminal Serveces client). 
    We can send the initiating e-mail by hand or prepare a script automating the whole connection process 
    (I am using a python script since it can be used on Linux machine as well).
&lt;/li&gt;
&lt;li&gt;Home Laptop with OS Linux (Ubuntu Hardy 8.04) - can be used as a Terminal services client as well.
&lt;/li&gt;
&lt;/ul&gt;

&lt;b&gt;Steps to establish the remote desktop connection:&lt;/b&gt;
&lt;ol&gt;
  &lt;li&gt;
    From either &lt;i&gt;workstation&lt;/i&gt; or &lt;i&gt;laptop&lt;/i&gt; we send an initiating e-mail (containing a "magic" pattern)
  &lt;/li&gt;
  &lt;li&gt;
    Outlook client running on the Office Workstation receives the e-mail, recognizes the pattern and initiates the 
    actual connection with Home router with following command line:
    &lt;br/&gt;
    &lt;b&gt;ssh.exe -R &lt;span style="color: #ff0000"&gt;3393&lt;/span&gt;:localhost:&lt;span style="color: #3300ff"&gt;3389&lt;/span&gt; 
    -i .ssh\id_rsa &amp;lt;user&amp;gt;@&amp;lt;home-ip&amp;gt; -p &lt;span style="color: #009900"&gt;119&lt;/span&gt;&lt;/b&gt;
    &lt;br/&gt;
    ... which means:
    &lt;ul&gt;
    &lt;li&gt;Connect to the remote host with IP &amp;lt;home-ip&amp;gt; (our Home public IP or DNS name) via port &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt; as a user &amp;lt;user&amp;gt;&lt;/li&gt;
    &lt;li&gt;Use the specified identity file (private key) for RSA authentication (this can be used for all ssh sessions but in this case it is necessary 
    - we cannot use the interactive password authentication method in this case ;)&lt;/li&gt;
    &lt;li&gt;Forwarding port &lt;span style="color: #ff0000"&gt;&lt;b&gt;3391&lt;/b&gt;&lt;/span&gt; of the remote host (Home router) to local port &lt;span style="color: #3300ff"&gt;&lt;b&gt;3389&lt;/b&gt;&lt;/span&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    On either &lt;i&gt;workstation&lt;/i&gt; or &lt;i&gt;laptop&lt;/i&gt; we connect to the router with following command line:
    &lt;br/&gt;
      &lt;b&gt;ssh.exe -L &lt;span style="color: #cc00ff"&gt;3391&lt;/span&gt;:localhost:&lt;span style="color: #ff0000"&gt;3393&lt;/span&gt; &amp;lt;user&amp;gt;@router&lt;/b&gt;
    &lt;br/&gt;
    ... which means: 
    &lt;br/&gt;
    &lt;ul&gt;
    &lt;li&gt;Connect to the router (via standard port 22) as a user &amp;lt;user&amp;gt;&lt;/li&gt;
    &lt;li&gt;Forwarding local port &lt;span style="color: #cc00ff"&gt;&lt;b&gt;3391&lt;/b&gt;&lt;/span&gt; to router's &lt;span style="color: #ff0000"&gt;&lt;b&gt;3393&lt;/b&gt;&lt;/span&gt; port&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Establish the remote desktop connection to the Office Workstation.
    &lt;ul&gt;
    &lt;li&gt;From Windows: &lt;b&gt;MSTSC.EXE /v:localhost:&lt;span style="color: #cc00ff"&gt;3391&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
    &lt;li&gt;From Linux: &lt;b&gt;rdesktop localhost:&lt;span style="color: #cc00ff"&gt;3391&lt;/span&gt; -u &amp;lt;user&amp;gt; -d &amp;lt;domain&amp;gt; -p -&lt;/b&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

Following schema demonstrates the whole sequence of events:
&lt;br/&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SKYdU2Eil9I/AAAAAAAABow/j1RZygzxPfk/s1600-h/RemoteDesktop.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SKYdU2Eil9I/AAAAAAAABow/j1RZygzxPfk/s400/RemoteDesktop.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5234903860813928402" /&gt;&lt;/a&gt;

&lt;i&gt;Note:&lt;/i&gt; not all steps are always necessary. The tunnel between &lt;i&gt;Office Workstation&lt;/i&gt; and &lt;i&gt;Home router&lt;/i&gt; can sometimes last for several days 
(while sometimes is spontaneously interrupted - it probably depends on a quality of Internet connection) and so it is not necessary to send 
the initiating e-mail anytime we want to connect to the office. So usually the first thing I do is to open the 
SSH connection to the router (&lt;i&gt;step 3&lt;/i&gt;), determine whether there is the existing office connection (e.g. via &lt;i&gt;ps&lt;/i&gt; command I look at the number of 
&lt;i&gt;dropbear&lt;/i&gt; and &lt;i&gt;sh&lt;/i&gt; instances) and if so proceed directly to the &lt;i&gt;step 4&lt;/i&gt;.
&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Update - significant simplification&lt;/h3&gt;
&lt;br/&gt;
At the time I initially wrote this post I did not know why it was not possible to connect to the router's forwarded port from another host. That was why I created actually two tunnels (Office PC -&amp;gt; Router&amp;lt;- Home PC) when I was connecting remotely to the office.
&lt;br/&gt;
After some time I have found some &lt;a href="http://staff.washington.edu/corey/fw/ssh-port-forwarding.html"&gt;more info&lt;/a&gt; in this regard:
Client side:
&lt;blockquote&gt;&lt;i&gt;
As a security precaution, modern versions of ssh forbid other computers on the internet from connecting to the forwarded port (...) unless you explicitly allow it with the "ssh -g" flag
&lt;/i&gt;&lt;/blockquote&gt;
Server side:
&lt;blockquote&gt;&lt;i&gt;
If the client is not configured to accept inbound SSH connections, this can be done with remote port forwarding on an outbound connection. (For OpenSSH, note that you may need to set "GatewayPorts yes" in "sshd_config" to achieve on the server what "ssh -g" would do on the client (allow any host to connect to the forwarded port).
&lt;/i&gt;&lt;/blockquote&gt;
Then I found some more info indicating that it does not work for DropBear even when properly configured (&lt;a href="http://wl500g.info/showthread.php?t=4389"&gt;here&lt;/a&gt; and &lt;a href="http://www.infosecwriters.com/text_resources/pdf/ssh_tunneling.pdf"&gt;here&lt;/a&gt;):
&lt;blockquote&gt;&lt;i&gt;
The reason that the direct login to remote forwarded port doesn't work is - "dropbear binds remote port forwardings to
the loopback address. This prevents other remote hosts from connecting to forwarded ports."
To fix it, you can recompile dropbear for your router.
&lt;/i&gt;&lt;/blockquote&gt;
I did not want to rebuild &lt;i&gt;dropbear&lt;/i&gt; for my router (I do not even have a build toolchain for it) so I kept trying. Finally I realized that when I explicitly use the actual hostname for my router (&lt;i&gt;router&lt;/i&gt; in my configuration) instead of &lt;i&gt;localhost&lt;/i&gt; (as used by default) on the remote port forwarding command line, it does the trick:
&lt;br/&gt;
So - on the &lt;i&gt;Office PC&lt;/i&gt; command line - instead of former:
&lt;pre class="code"&gt;
ssh.exe -R 3393:localhost:3389 -i .ssh\id_rsa &lt;user&gt;@&lt;home-ip&gt; -p 119 
&lt;/pre&gt;
Now I am using:
&lt;pre class="code"&gt;
ssh.exe -R router:3389:localhost:3389 -i .ssh\id_rsa &lt;user&gt;@&lt;home-ip&gt; -p 119 
&lt;/pre&gt;
... and after this change it is possible to connect to the tunnel not only from the router itself but from any other machine in the network.
&lt;br/&gt;
I did not consider possible security implications, after all I am just a simple user in this regard, so it is up to you to decide which approach better fits your needs, please, don't blame me then.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Steps to establish the remote desktop connection:&lt;/b&gt;
&lt;ol&gt;
  &lt;li&gt;
    From either &lt;i&gt;workstation&lt;/i&gt; or &lt;i&gt;laptop&lt;/i&gt; we send an initiating e-mail (containing a "magic" pattern)
  &lt;/li&gt;
  &lt;li&gt;
    Outlook client running on the Office Workstation receives the e-mail, recognizes the pattern and initiates the actual connection with Home router with following command line:
    &lt;br/&gt;
    &lt;b&gt;ssh.exe -R router:&lt;span style="color: #ff0000"&gt;3389&lt;/span&gt;:localhost:&lt;span style="color: #3300ff"&gt;3389&lt;/span&gt; 
    -i .ssh\id_rsa &amp;lt;user&amp;gt;@&amp;lt;home-ip&amp;gt; -p &lt;span style="color: #009900"&gt;119&lt;/span&gt;&lt;/b&gt;
    &lt;br/&gt;
    ... which means:
    &lt;ul&gt;
    &lt;li&gt;Connect to the remote host with IP &amp;lt;home-ip&amp;gt; (our Home public IP or DNS name) via port &lt;span style="color: #009900"&gt;&lt;b&gt;119&lt;/b&gt;&lt;/span&gt; as a user &amp;lt;user&amp;gt;&lt;/li&gt;
    &lt;li&gt;Use the specified identity file (private key) for RSA authentication (this can be used for all ssh sessions but in this case it is necessary 
    - we cannot use the interactive password authentication method in this case ;)&lt;/li&gt;
    &lt;li&gt;Forwarding port &lt;span style="color: #ff0000"&gt;&lt;b&gt;3389&lt;/b&gt;&lt;/span&gt; of the remote host with hostname &lt;i&gt;router"&lt;/i&gt; (Home router) to local port &lt;span style="color: #3300ff"&gt;&lt;b&gt;3389&lt;/b&gt;&lt;/span&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    On either &lt;i&gt;workstation&lt;/i&gt; or &lt;i&gt;laptop&lt;/i&gt; we establish the remote desktop connection to the Office Workstation as follows:
    &lt;ul&gt;
    &lt;li&gt;From Windows: &lt;pre class="code"&gt;MSTSC.EXE /v:router&lt;/pre&gt;&lt;/li&gt;
    &lt;li&gt;From Linux: &lt;pre class="code"&gt;rdesktop router -u &amp;lt;user&amp;gt; -d &amp;lt;domain&amp;gt; -p -&lt;/pre&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

Following schema demonstrates the whole sequence of events:
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SczcdWo1YkI/AAAAAAAACz8/e8Ric3izvQk/s1600-h/RemoteDesktop3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 261px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SczcdWo1YkI/AAAAAAAACz8/e8Ric3izvQk/s400/RemoteDesktop3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317867656868880962" /&gt;&lt;/a&gt;

&lt;h3&gt;NX accelerated RDP&lt;/h3&gt;
@TBD
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/Scz3erOAHGI/AAAAAAAAC0M/XcMl7KFS_wI/s1600-h/NX-RDP.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 179px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/Scz3erOAHGI/AAAAAAAAC0M/XcMl7KFS_wI/s400/NX-RDP.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317897366387301474" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/Scz13GvVS6I/AAAAAAAAC0E/dt-cDrrHmOA/s1600-h/RemoteDesktop4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 262px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/Scz13GvVS6I/AAAAAAAAC0E/dt-cDrrHmOA/s400/RemoteDesktop4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317895587068464034" /&gt;&lt;/a&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-7092835517381876974?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/7092835517381876974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=7092835517381876974' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7092835517381876974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7092835517381876974'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/08/port-forwarding-remote-desktop.html' title='Port forwarding &amp; Remote desktop connection (updated)'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xFBIBcRhwFQ/SKYeOYTLpUI/AAAAAAAABpA/uXxXY1sCIZ8/s72-c/RemoteDesktop2.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-3428560276724848481</id><published>2009-01-18T00:32:00.019+01:00</published><updated>2009-01-18T22:27:18.829+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Deluge 1.1.0</title><content type='html'>The new deluge version is here!

&lt;h3&gt;Build result&lt;/h3&gt;
&lt;a href="http://filodej.ic.cz/filopack/deluge-1.1.0.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/deluge-1.1.0.lst"&gt;[file list]&lt;/a&gt;
&lt;br/&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SXJr5W8TlDI/AAAAAAAACd8/G78RzkxDhsE/s1600-h/gtkui.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 342px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SXJr5W8TlDI/AAAAAAAACd8/G78RzkxDhsE/s400/gtkui.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5292411145268991026" /&gt;&lt;/a&gt;

If you don't have the previous version (deluge-1.0.5) installed, follow the previous &lt;a href="http://filodej.blogspot.com/2008/11/wmu-6500fs-deluge-torrent-part-iv.html"&gt;deluge post&lt;/a&gt;, install all the prerequisites and dependencies and come back here for the rest. Note that the &lt;a href="http://filodej.ic.cz/filopack/deluge-1.0.5-gcclibs.tar.bz2"&gt;deluge-1.0.5-gcclibs package&lt;/a&gt; is valid even for deluge-1.1.0, so don't get confused with its misleading name.&lt;br/&gt;
On the other hand if you have the &lt;i&gt;deluge-1.0.5&lt;/i&gt; installed, you have to clean it up first (while preserve all the already installed dependencies).
&lt;span class="fullpost"&gt;
&lt;br/&gt;
&lt;br/&gt;
Stop the deluge daemon if it is running. You can do it via console:
&lt;pre class="code"&gt;
box# &lt;b&gt;deluge --ui=null&lt;/b&gt;
&amp;gt;&amp;gt;&amp;gt; &lt;b&gt;halt&lt;/b&gt;
&amp;gt;&amp;gt;&amp;gt; quit
Thanks!

&lt;/pre&gt;

or forcibly:

&lt;pre class="code"&gt;
box# &lt;b&gt;killall deluged&lt;/b&gt;
&lt;/pre&gt;

Now uninstall the previous version:
&lt;pre class="code"&gt;
dev# cd /mnt/C/
dev# &lt;b&gt;./filopack.sh --remove deluge-1.0.5&lt;/b&gt;
Configuration file .filopack/.config file found and used
Sure to remove deluge-1.0.5 locally at /mnt/C (y/n)?&lt;b&gt;y&lt;/b&gt;
...
&lt;/pre&gt;
If you are not using the &lt;a href="http://filodej.blogspot.com/2008/11/simple-packaging-sysetm.html"&gt;filopack packaging system&lt;/a&gt;, you can remove the previous version as follows:
&lt;pre class="code"&gt;
box# cd /mnt/C/
box# wget &lt;a href="http://filodej.ic.cz/filopack/.filopack/deluge-1.0.5.lst"&gt;http://filodej.ic.cz/filopack/.filopack/deluge-1.0.5.lst&lt;/a&gt;
box# xargs rm -f &lt; deluge-1.0.5.lst
&lt;/pre&gt;

It is likely that deluge developers preserved the compatibility of configuration and the following step is not necessary, I just to be sure delete the configuration as well: 
&lt;pre class="code"&gt;
box# &lt;b&gt;mv ~/.config/deluge{,.del}&lt;/b&gt;
&lt;/pre&gt;
Now we are ready to install the new version:
&lt;pre class="code"&gt;
box# &lt;b&gt;./filopack.sh --install deluge-1.1.0&lt;/b&gt;
Sure to unpack deluge-1.1.0 locally at /mnt/C (y/n)? &lt;b&gt;y&lt;/b&gt;
...
&lt;/pre&gt;
Now we are ready to try the daemon, still it is necessary to use the &lt;i&gt;LD_PRELOAD&lt;/i&gt; prefix or &lt;i&gt;deluged.sh&lt;/i&gt; script - now updated in order to support parameters (like &lt;i&gt;-d&lt;/i&gt; for example) - see &lt;a href="http://www.macsat.com/macsat/component/option,com_smf/Itemid,50/topic,690.msg4808/#msg4808"&gt;this 
post on mascat&lt;/a&gt; for details - if we are lucky, everything runs smoothly:
&lt;pre class="code"&gt;
box# &lt;b&gt;deluged.sh&lt;/b&gt;
&lt;/pre&gt;
&lt;h3&gt;Default GUI&lt;/h3&gt;
It is possible to set a default GUI (if you prefer other than predefined GTK GUI):
&lt;pre class="code"&gt;
box# &lt;b&gt;deluge --set-default-ui=console&lt;/b&gt;
The default UI has been changed to console
&lt;/pre&gt;
It is nice that now it is not necessary to modify the configuration by hand (like it is described &lt;a href="http://www.macsat.com/macsat/component/option,com_smf/Itemid,50/topic,690.msg4808/#msg4808"&gt;here&lt;/a&gt;).
&lt;h3&gt;Remote access&lt;/h3&gt;
The CLI ui has been renamed from &lt;i&gt;null&lt;/i&gt; to &lt;i&gt;console&lt;/i&gt;. Notice that it is necessary to use LD_PRELOAD prefix just for daemon and GTK GUI, there is no need to use it for the console UI).&lt;br/&gt;
We can use it for enabling the remote access (we have to restart the daemon in order to make the change active):
&lt;pre class="code"&gt;
box# deluge --ui=&lt;b&gt;console&lt;/b&gt;
&amp;gt;&amp;gt;&amp;gt; &lt;b&gt;config --set allow_remote True&lt;/b&gt;
&amp;gt;&amp;gt;&amp;gt; halt
&amp;gt;&amp;gt;&amp;gt; quit
Thanks!

box# deluged.sh
&lt;/pre&gt;
&lt;h3&gt;Authentication&lt;/h3&gt;
Another new feature is the user authentication. For details see &lt;a href="http://dev.deluge-torrent.org/wiki/Authentication"&gt;[Authentication]&lt;/a&gt; and &lt;a href="http://dev.deluge-torrent.org/wiki/ThinClient"&gt;[ThinClient settings]&lt;/a&gt;. Without adding a username and password to &lt;i&gt;~/.config/deluge/auth&lt;/i&gt; configuration file you won't be able to remotely connect to the daemon nor event see whether the daemon is running (which is a nice). 
&lt;br/&gt;
&lt;br/&gt;
&lt;i&gt;Edit: since the ~/.config/deluge/auth file initially does not contain trailing newline the instructions did not work, now it is updated appropriately&lt;/i&gt;
&lt;pre class="code"&gt;
box# &lt;b&gt;echo -n -e "\n&lt;i&gt;&amp;lt;username&amp;gt;:&amp;lt;password&amp;gt;&lt;/i&gt;" &amp;gt;&amp;gt; ~/.config/deluge/auth&lt;/b&gt;
&lt;/pre&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SXJr5HUMQLI/AAAAAAAACd0/Q1MOgt62h-Q/s1600-h/auth.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 264px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SXJr5HUMQLI/AAAAAAAACd0/Q1MOgt62h-Q/s400/auth.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5292411141074206898" /&gt;&lt;/a&gt;

Be sure to &lt;b&gt;append&lt;/b&gt; to the file, in case you rewrote the file you won't have been able to connect to it locally, since it initially contains a &lt;i&gt;localclient&lt;/i&gt; record. If you accidentally rewrite the file, you can just delete it, restart the daemon and a ui (e.g. the console) and the default file containing &lt;i&gt;localclient&lt;/i&gt; authentication info is created for you.
&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Web GUI&lt;/h3&gt;
If you want to use the Web GUI (and new Ajax UI seems pretty good to me), now it is not necessary to run the web client on the same machine as daemon. 

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SXJr4u1Kg1I/AAAAAAAACds/gffLePEFt5I/s1600-h/ajaxui.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 309px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SXJr4u1Kg1I/AAAAAAAACds/gffLePEFt5I/s400/ajaxui.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5292411134501618514" /&gt;&lt;/a&gt;

Via the Web GUI you can connect to any daemon you want (not just &lt;i&gt;localhost&lt;/i&gt;). 

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SXJr5UywyvI/AAAAAAAACeE/jc7iZrZ86mE/s1600-h/webui.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 320px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SXJr5UywyvI/AAAAAAAACeE/jc7iZrZ86mE/s400/webui.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5292411144692091634" /&gt;&lt;/a&gt;

Not sure whether I personally utilize it, but it seems to me like a nice feature.
&lt;br/&gt;
&lt;br/&gt;
That's all folks.
&lt;br/&gt;
(The following text is just a (boring) build protocol, totally unnecessary for ordinary users ;-)
&lt;h3&gt;Build sequence&lt;/h3&gt;
It was about the same like in previous version so just in short:
&lt;br/&gt;
&lt;br/&gt;
Remove the previous version:
&lt;pre class="code"&gt;
dev# cd /mnt/C/
dev# ./filopack.sh --remove deluge-1.0.5
Configuration file .filopack/.config file found and used
Sure to remove deluge-1.0.5 locally at /mnt/C (y/n)?y
...
&lt;/pre&gt;
Init the timestamp for the new one:
&lt;pre class="code"&gt;
dev# ./filopack.sh --init  deluge-1.1.0
Configuration file .filopack/.config file found and used
Timestamp written to file .filopack/deluge-1.1.0.ts
&lt;/pre&gt;
Download and extract the source:
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://download.deluge-torrent.org/source/1.1.0/deluge-1.1.0.tar.bz2"&gt;http://download.deluge-torrent.org/source/1.1.0/deluge-1.1.0.tar.bz2&lt;/a&gt;
...
04:37:59 (55.28 KB/s) - `deluge-1.1.0.tar.bz2' saved [2196924/2196924]

dev# tar xjvf deluge-1.1.0.tar.bz2
dev# cd deluge-1.1.0
&lt;/pre&gt;
Setup the include and library paths:
&lt;pre class="code"&gt;
dev# export CFLAGS=-I/mnt/C/sys/include/boost-1_35
dev# export LDFLAGS=-L/mnt/C/sys/lib
&lt;/pre&gt;
Add the missing define:
&lt;pre class="code"&gt;
nano libtorrent/include/libtorrent/socket.hpp
&lt;i&gt;
      #ifndef IPV6_V6ONLY
      #define IPV6_V6ONLY 26
      #endif
&lt;/i&gt;
&lt;/pre&gt;
I did not find the &lt;i&gt;libtorrent/src/memdebug.cpp&lt;/i&gt;, so undefining the content of this file is not necessary anymore.
&lt;br/&gt;
&lt;br/&gt;
Build the code and install the binaries:
&lt;pre class="code"&gt;
dev# python setup.py build
...
dev# python setup.py install --prefix=/mnt/C/sys/
...
&lt;/pre&gt;
Try to run the daemon:
&lt;pre class="code"&gt;
dev# deluged
dev# /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
&lt;/pre&gt;
... issue wit h unresolved symbol is still the same. As a workaround the &lt;i&gt;LD_PRELOAD&lt;/i&gt; prefix can be used. Let;s create scripts for it:
&lt;pre class="code"&gt;
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" deluged \"\$@\" &gt; /mnt/C/sys/bin/deluged.sh
dev# chmod +x /mnt/C/sys/bin/deluged.sh 
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" deluge \"\$@\" &gt; /mnt/C/sys/bin/deluge.sh
dev# chmod +x /mnt/C/sys/bin/deluge.sh 
&lt;/pre&gt;
Now the daemon runs ok:
&lt;pre class="code"&gt;
dev# deluged.sh
&lt;/pre&gt;
Let's try the GTK client:
&lt;pre class="code"&gt;
dev# deluge --version
1.1.0
dev# deluge
...
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.1.0-py2.5-linux-i686.egg/deluge/ui/gtkui/common.py", line 

45, in get_logo
    size, size)
gobject.GError: Unrecognized image file format
&lt;/pre&gt;
ChangeAs a fix we can change the extension:
&lt;pre class="code"&gt;
dev# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/lib/python2.5/site-packages/deluge/ui/gtkui/common.py
dev# deluge
&lt;/pre&gt;
Touch related files with older timestamps (in order to include them to the package):
&lt;pre class="code"&gt;
dev# find /mnt/C/sys -path "*deluge*" -type f -exec touch {} \;
&lt;/pre&gt;
Then we are ready to create the package:
&lt;pre class="code"&gt;
dev# cd /mnt/C/sys
dev# ./filopack.sh --pack deluge-1.1.0
...
&lt;/pre&gt;
I noticed that there was duplicity after the installation which made the package twice as big as was necessary:
It seems to me that whole directory tree &lt;i&gt;/mnt/C/sys/lib/python2.5/site-packages/deluge-1.1.0-py2.5-linux-i686.egg/deluge&lt;/i&gt; was redundant - directory &lt;i&gt;/mnt/C/sys/lib/python2.5/site-packages/deluge&lt;/i&gt; had a similar content (including the huge &lt;i&gt;libtorrent.so&lt;/i&gt;). I just dropped the former one and everything seems ok and package has 16MB (compared to 31MB).

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-3428560276724848481?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/3428560276724848481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=3428560276724848481' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3428560276724848481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3428560276724848481'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2009/01/wmu-6500fs-deluge-110.html' title='WMU-6500FS - Deluge 1.1.0'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xFBIBcRhwFQ/SXJr5W8TlDI/AAAAAAAACd8/G78RzkxDhsE/s72-c/gtkui.png' height='72' width='72'/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-7789968982796645108</id><published>2009-01-06T23:33:00.027+01:00</published><updated>2009-11-02T10:38:27.636+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cooperative Linux with Debian 4.0'/><title type='text'>Cooperative Linux step by step</title><content type='html'>&lt;b&gt;Introduction:&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
This post provides a step by step tutorial how to download, install and configure &lt;a href="http://en.wikipedia.org/wiki/Colinux"&gt;CoLinux&lt;/a&gt; with &lt;a href="http://en.wikipedia.org/wiki/Debian"&gt;Debian 4.0&lt;/a&gt; file system image. Also the installation of &lt;a href="http://en.wikipedia.org/wiki/GNOME"&gt;GNOME&lt;/a&gt; desktop environment and &lt;a href="http://en.wikipedia.org/wiki/NX_technology"&gt;NX server&lt;/a&gt; is covered. As a result we get a graphic Linux environment cooperatively running on the Windows hosting system. It can be seen as an alternative to a conventional "dual boot" configuration - but with both systems running at the same time. 
&lt;br/&gt;
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPMJynrivI/AAAAAAAACc8/HZNBWsmzPg4/s1600-h/06-gnome-session-gimp.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 320px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPMJynrivI/AAAAAAAACc8/HZNBWsmzPg4/s400/06-gnome-session-gimp.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5288294856042187506" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Info sources:&lt;/b&gt;
&lt;br/&gt;
&lt;a href="http://www.colinux.org"&gt;[CoLinux Homepage]&lt;/a&gt;
&lt;a href="http://colinux.wikia.com/wiki/Main_Page"&gt;[CoLinux Wiki]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;a href="http://sourceforge.net/project/shownotes.php?release_id=248895&amp;group_id=98788"&gt;[Debian notes]&lt;/a&gt;
&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=98788&amp;package_id=289363"&gt;[Debian filesystem image]&lt;/a&gt;
&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=98788"&gt;[More available filesystem images]&lt;/a&gt;
&lt;a href="http://www.saltycrane.com/blog/2008/04/install-colinux-and-ubuntu-gutsy-on-win/"&gt;[Howto install coLinux (and Ubuntu Hardy) on Win XP]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;h3&gt;Download and installation&lt;/h3&gt;
&lt;br /&gt;
&lt;b&gt;CoLinux binary&lt;/b&gt;
&lt;br/&gt;
You can download binary &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=98788&amp;package_id=107317"&gt;here&lt;/a&gt;.
&lt;br/&gt;
In my case it was the &lt;i&gt;stable version 0.7.3 (kernel 2.6.22.18)&lt;/i&gt; ... &lt;a href="http://downloads.sourceforge.net/colinux/coLinux-0.7.3.exe?modtime=1212921944&amp;big_mirror=0"&gt;coLinux-0.7.3.exe&lt;/a&gt;
&lt;br/&gt;
(an alternative could be the &lt;i&gt;development version 8.0 (kernel 2.6.22.18)&lt;/i&gt; ...
&lt;a href="http://www.colinux.org/snapshots/devel-coLinux-20081130.exe"&gt;devel-coLinux-20081130.exe&lt;/a&gt;, see &lt;a href="http://www.colinux.org/snapshots/"&gt;this page&lt;/a&gt; for details).
&lt;br/&gt;
&lt;br/&gt;
Selected components:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPHeVt09OI/AAAAAAAACbE/Q5BzCgtyt0Q/s1600-h/01-colinux-install1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 313px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPHeVt09OI/AAAAAAAACbE/Q5BzCgtyt0Q/s400/01-colinux-install1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288289711502456034" /&gt;&lt;/a&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPHfK0rweI/AAAAAAAACbM/gTreHbvu8AM/s1600-h/01-colinux-install2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 313px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPHfK0rweI/AAAAAAAACbM/gTreHbvu8AM/s400/01-colinux-install2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288289725758292450" /&gt;&lt;/a&gt;

During the installation the &lt;a href="http://www.winpcap.org/"&gt;WinPcap&lt;/a&gt; (The Windows Packet Capture Library) is installed. It can be downloaded &lt;a href="http://www.winpcap.org/install/"&gt;here&lt;/a&gt;.
&lt;br/&gt;
&lt;br/&gt;
I choose stable &lt;a href="http://www.winpcap.org/install/bin/WinPcap_4_0_2.exe"&gt;WinPcap 4.0.2&lt;/a&gt; (an alternative could be &lt;a href="http://www.winpcap.org/install/bin/WinPcap_4_1_beta4.exe"&gt;WinPcap 4.1 beta4&lt;/a&gt;).
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPHfSDmLAI/AAAAAAAACbU/XbhNL-h8JFo/s1600-h/01-colinux-install3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 313px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPHfSDmLAI/AAAAAAAACbU/XbhNL-h8JFo/s400/01-colinux-install3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288289727699889154" /&gt;&lt;/a&gt;
We can download (some of) available filesystem images directly during the installation:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPHfXNdcgI/AAAAAAAACbc/ANu5gwzJKVw/s1600-h/01-colinux-install4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 313px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPHfXNdcgI/AAAAAAAACbc/ANu5gwzJKVw/s400/01-colinux-install4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288289729083437570" /&gt;&lt;/a&gt;
TAP network adapter is installed (dear Microsoft, sure we want to continue the installation ;-)
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPHgHbyDzI/AAAAAAAACbk/DrOqneZInOA/s1600-h/01-colinux-install5.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 260px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPHgHbyDzI/AAAAAAAACbk/DrOqneZInOA/s400/01-colinux-install5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288289742028410674" /&gt;&lt;/a&gt;
Now the TAP adapter is installed (but not connected):
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPH6xKmdaI/AAAAAAAACbs/gM_iL4LFd_k/s1600-h/02-tap-adapter.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 334px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPH6xKmdaI/AAAAAAAACbs/gM_iL4LFd_k/s400/02-tap-adapter.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290199907235234" /&gt;&lt;/a&gt;
We have to configure the private IP address of the host system (windows):  
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPH7E2lOqI/AAAAAAAACb0/RUM_YgjylEQ/s1600-h/02-tap-adapter2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 355px; height: 400px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPH7E2lOqI/AAAAAAAACb0/RUM_YgjylEQ/s400/02-tap-adapter2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290205191977634" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Installation paths:&lt;/b&gt;
&lt;br /&gt;
CoLinux binary: &lt;i&gt;c:\programs\coLinux&lt;/i&gt;&lt;br /&gt;
Filesystem images: &lt;i&gt;c:\programs\coLinux\images&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Configure (Windows side)&lt;/h3&gt;
&lt;br /&gt;
&lt;b&gt;Config file&lt;/b&gt;
&lt;br /&gt;
We create a new configuration file (just modify the installed &lt;i&gt;example.conf&lt;/i&gt;):
&lt;pre class="code"&gt;
C:\&amp;gt; cd programs\coLinux
C:\programs\coLinux&amp;gt; copy example.conf debian.conf
        1 file(s) copied.
C:\programs\coLinux&amp;gt; notepad debian.conf
&lt;/pre&gt;
Now we can specify root image, swap file and possibly other mount points and also define two ethernet devices - one for pcap bridge and second for TAP adapter:
&lt;pre class="code"&gt;
...

# File contains the root file system.
# Download and extract preconfigured file from SF "Images for 2.6".
&lt;b&gt;cobd0="C:\programs\coLinux\images\Debian-4.0r0-etch.ext3.1gb"
cofs1=c:\
cofs2=d:\
&lt;/b&gt;
# Swap device, should be an empty file with 128..512MB.
&lt;b&gt;cobd1="C:\programs\coLinux\images\swap_file.1gb"&lt;/b&gt;

# Tell kernel the name of root device (mostly /dev/cobd0,
# /dev/cobd/0 on Gentoo)
# This parameter will be forward to Linux kernel.
root=/dev/cobd0

# Additional kernel parameters (ro = rootfs mount read only)
ro

# Initrd installs modules into the root file system.
# Need only on first boot.
initrd=initrd.gz

# Maximal memory for linux guest
#mem=64

# Slirp for internet connection (outgoing)
# Inside running coLinux configure eth0 with this static settings:
# ipaddress 10.0.2.15   broadcast  10.0.2.255   netmask 255.255.255.0
# gateway   10.0.2.2    nameserver 10.0.2.3
#eth0=slirp

# pcap bridge for internet connection (outgoing)
&lt;b&gt;eth0=pcap-bridge,"Local Area Connection",&lt;i&gt;&amp;lt;an-artificial-mac-address&amp;gt;&lt;/i&gt;&lt;/b&gt;

# Tuntap as private network between guest and host on second linux device
&lt;b&gt;eth1=tuntap&lt;/b&gt;

# Setup for serial device
#ttys0=COM1,"BAUD=115200 PARITY=n DATA=8 STOP=1 dtr=on rts=on"

# Run an application on colinux start (Sample Xming, a Xserver)
# exec0=C:\Programs\Xming\Xming.exe,":0 -clipboard -multiwindow -ac"
&lt;/pre&gt;
&lt;b&gt;Swap file&lt;/b&gt;
&lt;br /&gt;
Also you have to create a swap file, &lt;a href="http://colinux.wikia.com/wiki/HowtoCreateSwapFile"&gt;here&lt;/a&gt; is how to create it, or if you are lazy like me, you can download one from &lt;a href="http://gniarf.nerim.net/colinux/swap/"&gt;this site&lt;/a&gt; (user &lt;a href="http://colinux.wikia.com/wiki/User:Gniarf"&gt;Gniarf&lt;/a&gt; provides also other interesting info).
&lt;br/&gt;
&lt;h3&gt;Configure (Linux side)&lt;/h3&gt;
Start colinux daemon:
&lt;pre class="code"&gt;
C:\programs\coLinux&amp;gt; &lt;b&gt;colinux-daemon.exe @debian.conf&lt;/b&gt;
Cooperative Linux Daemon, 0.7.3
Daemon compiled on Sat May 24 22:36:07 2008

PID: 3268
error 0x2 in execution
error launching console
daemon: exit code 8200c401
daemon: error - CO_RC_ERROR_ERROR, line 49, file src/colinux/os/winnt/user/exec.c (16)
&lt;/pre&gt;
We did not install the generic console so we have to explicitly say we want to launch the NT console:
&lt;pre class="code"&gt;
C:\programs\coLinux&amp;gt; &lt;b&gt;colinux-daemon.exe -t nt @debian.conf&lt;/b&gt;
...
&lt;/pre&gt;
Login as root (a default password is &lt;i&gt;"root"&lt;/i&gt;):
&lt;pre class="code"&gt;
login as: root
root@10.0.2.2's password:
Linux debian 2.6.22.18-co-0.7.3 #1 PREEMPT Sat May 24 22:27:30 UTC 2008 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
&lt;/pre&gt;
Change the root password
&lt;pre class="code"&gt;deb# &lt;b&gt;passwd&lt;/b&gt;
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
&lt;/pre&gt;
&lt;b&gt;Network&lt;/b&gt;
&lt;br /&gt;
For easy to use the network is pre-configured for "slirp":
&lt;pre class="code"&gt;
deb# &lt;b&gt;ifconfig&lt;/b&gt;
eth0      Link encap:Ethernet  HWaddr 22:01:76:23:42:12
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:59 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20682 (20.1 KiB)  TX bytes:0 (0.0 b)
          Interrupt:2

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
&lt;/pre&gt;
We change it to dual-ethernet mode (one for uoutide world connection and other for private network between guest and host system):
&lt;pre class="code"&gt;
deb# &lt;b&gt;nano /etc/network/interfaces&lt;/b&gt;

&lt;i&gt;Comment out the following:&lt;/i&gt;

    # The primary network interface (slirp)
    auto eth0
    iface eth0 inet static
       address 10.0.2.15
       broadcast 10.0.2.255
       netmask 255.255.255.0
       gateway 10.0.2.2

&lt;i&gt;And replace it with following:&lt;/i&gt;

    # The primary network interface
    auto eth0
    iface eth0 inet dhcp

&lt;i&gt;Then there is the following:&lt;/i&gt;

    # Second network (tap-win32)
    #auto eth1
    #iface eth1 inet static
    #   address 192.168.0.40
    #   netmask 255.255.255.0

&lt;i&gt;... leave it as is (or remove it) and add the following:&lt;/i&gt;

    auto eth1
    iface eth1 inet static
       address 10.0.2.2
       network 10.0.2.0
       netmask 255.255.255.0
       broadcast 10.0.2.255
&lt;/pre&gt;
Now save the file and reboot:
&lt;pre class="code"&gt;
deb# &lt;b&gt;reboot&lt;/b&gt;
...
&lt;/pre&gt;
We should see now on the Windows side that the TAP adapter is connected:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPH7TI2pAI/AAAAAAAACb8/itF6IfKkoHY/s1600-h/02-tap-adapter3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 334px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPH7TI2pAI/AAAAAAAACb8/itF6IfKkoHY/s400/02-tap-adapter3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290209026712578" /&gt;&lt;/a&gt;
After we login to linux, we can examine the new network configuration:
&lt;pre class="code"&gt;
deb# &lt;b&gt;ifconfig&lt;/b&gt;
eth0      Link encap:Ethernet  HWaddr &lt;i&gt;&amp;lt;an-artificial-mac-address&amp;gt;&lt;/i&gt;
          inet addr:192.168.1.196  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17220 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11031 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24760203 (23.6 MiB)  TX bytes:770417 (752.3 KiB)
          Interrupt:2

eth1      Link encap:Ethernet  HWaddr 00:FF:68:B7:70:00
          inet addr:10.0.2.2  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2238 (2.1 KiB)  TX bytes:0 (0.0 b)
          Interrupt:2

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
&lt;/pre&gt;
&lt;b&gt;Packaging system&lt;/b&gt;
&lt;br /&gt;
Now (we are connected to the internet) it is time to update the package system and upgrade installed packages:
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get update&lt;/b&gt;
...
deb# &lt;b&gt;apt-get upgrade&lt;/b&gt;
The following packages will be upgraded:
  bsdutils cpio debconf debconf-i18n debian-archive-keyring dpkg e2fslibs
  e2fsprogs findutils initscripts libblkid1 libc6 libcomerr2 libgnutls13
  libpam-modules libpam-runtime libpam0g libss2 libuuid1 lsb-base mount nano
  perl-base sysv-rc sysvinit sysvinit-utils tar tzdata util-linux
29 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.3MB of archives.
After unpacking 1786kB disk space will be freed.
Do you want to continue [Y/n]? Y
...
&lt;/pre&gt;
&lt;b&gt;Mount table&lt;/b&gt;
&lt;br /&gt;
Now we can modify the mount table:
&lt;pre class="code"&gt;
deb# &lt;b&gt;nano /etc/fstab&lt;/b&gt;
&lt;/pre&gt;
... add the following if you want to mount C: and D: windows drives (we made it available as cofs devices in &lt;i&gt;debian.conf&lt;/i&gt; file):
&lt;pre class="code"&gt;
cofs1            /mnt/c         cofs    defaults,noatime  0      0
cofs2            /mnt/d         cofs    defaults,noatime  0      0
&lt;/pre&gt;
Of course you can add anything you want, for example I wanted to make a cifs mount to a NAS directory:
&lt;pre class="code"&gt;
//storage/filodej   /mnt/storage/filodej   cifs defaults,credentials=/etc/storage.smbpass 0 0
&lt;/pre&gt;
The &lt;i&gt;storage-filodej.smbpass&lt;/i&gt; is a file readable just by root and containing a username and his password:
&lt;pre class="code"&gt;
deb# cd /etc
deb# echo "username=filodej" &amp;gt; storage.smbpass
deb# chmod 600 storage.smbpass
deb# echo "password=&lt;i&gt;&amp;lt;filodej-password&amp;gt;&lt;/i&gt;" &amp;gt;&amp;gt; storage.smbpass
deb# cat storage.smbpass
username=filodej
password=&lt;i&gt;&amp;lt;filodej-password&amp;gt;&lt;/i&gt;
&lt;/pre&gt;
Now we have to create corresponding mount point directories:
&lt;pre class="code"&gt;
deb# cd /mnt
deb# mkdir c
deb# mkdir d
deb# mkdir --parents storage/filodej
&lt;/pre&gt;
Test the mount table:
&lt;pre class="code"&gt;
deb# &lt;b&gt;mount -a&lt;/b&gt;
mount: wrong fs type, bad option, bad superblock on //storage/filodej,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
&lt;/pre&gt;
It seems I forgot to to install the samba file system:
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get install smbfs&lt;/b&gt;

Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  libkrb53 libpopt0 samba-common
Suggested packages:
  krb5-doc krb5-user smbclient
The following NEW packages will be installed:
  libkrb53 libpopt0 samba-common smbfs
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 3232kB of archives.
After unpacking 7827kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
...
&lt;/pre&gt;
During the installation we have to specify the Domain/Workgroup name and decide whether to use WINS settings from DHCP (and install dhcp3-client package).
&lt;br /&gt;
&lt;br /&gt;
Now the command:
&lt;pre class="code"&gt;
deb# &lt;b&gt;mount -a&lt;/b&gt;
&lt;/pre&gt;
... works as expected.
&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Install CoLinux as a Windows Service&lt;/h3&gt;
We need to be able to access the running linux system somehow. I am using mostly the SSH for that purpose. 
&lt;br /&gt;
First we have to install ssh daemon it on the linux system:
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get install ssh&lt;/b&gt;
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  libedit2 libssl0.9.8 openssh-blacklist openssh-client openssh-server
Suggested packages:
  ssh-askpass xbase-clients rssh molly-guard
The following NEW packages will be installed:
  libedit2 libssl0.9.8 openssh-blacklist openssh-client openssh-server ssh
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 5779kB of archives.
After unpacking 12.7MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
...
Setting up ssh (4.3p2-9etch3) ...

deb# eth0: duplicate address detected!
&lt;/pre&gt;
The &lt;i&gt;duplicate address detected!&lt;/i&gt; issue is described &lt;a href="http://colinux.wikia.com/wiki/Network#DHCP_problems_.2F_duplicate_address"&gt;here&lt;/a&gt;. 
&lt;br /&gt;
I have associated the &lt;i&gt;&amp;lt;an-artificial-mac-address&amp;gt;&lt;/i&gt; with static-DHCP assigned IP but the warning stil does persist. If anyone knows the solution, please let me know!
&lt;br /&gt;
&lt;br /&gt;
Anyway the ssh daemon is now up and running and we are able to connect to the linux system via ssh (on the host machine we can use either eth0 public IP or better the eth1 private IP). 
Now we are ready to create a windows service and run the colinux as a service.
&lt;br /&gt;
&lt;br /&gt;
The detailed guide for the service creation can be seen &lt;a href="http://colinux.wikia.com/wiki/Running_as_a_Service"&gt;here&lt;/a&gt;.
The following command does the job:
&lt;pre class="code"&gt;
C:\programs\coLinux&amp;gt; &lt;b&gt;colinux-daemon @debian.conf --install-service "coLinux-Debian"&lt;/b&gt;
Cooperative Linux Daemon, 0.7.3
Daemon compiled on Sat May 24 22:36:07 2008

daemon: installing service 'coLinux-Debian'
daemon: service command line: "c:\programs\coLinux\colinux-daemon.exe" @debian.conf --run-service "coLinux-Debian"
daemon: setting restart options
daemon: service installed.
&lt;/pre&gt;
Now we can start colinux daemon as a service:
&lt;pre class="code"&gt;
C:\programs\coLinux&amp;gt; &lt;b&gt;net start "coLinux-Debian"&lt;/b&gt;

The coLinux-Debian service was started successfully.
&lt;/pre&gt;
&lt;br /&gt;
&lt;h3&gt;Linux administration&lt;/h3&gt;
&lt;br /&gt;
&lt;b&gt;Create a new user&lt;/b&gt;
&lt;br /&gt;
&lt;a href="http://www.linuxheadquarters.com/howto/basic/adduser.shtml"&gt;[Add user howto]&lt;/a&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;
deb# &lt;b&gt;adduser --home /home/filodej --ingroup users filodej&lt;/b&gt;
Adding user `filodej' ...
Adding new user `filodej' (1001) with group `users' ...
Creating home directory `/home/filodej' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for filodej
Enter the new value, or press ENTER for the default
        Full Name []: Filodej
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [y/N] y
&lt;/pre&gt;
&lt;b&gt;Install sudo&lt;/b&gt;
&lt;br /&gt;
&lt;a href="http://linux.about.com/od/commands/l/blcmdl8_sudo.htm"&gt;[linux sudo command]&lt;/a&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get install sudo&lt;/b&gt;
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  sudo
0 upgraded, 1 newly installed, 0 to remove and 36 not upgraded.
Need to get 162kB of archives.
After unpacking 406kB of additional disk space will be used.
Get:1 http://ftp.debian.org etch/main sudo 1.6.8p12-4 [162kB]
Fetched 162kB in 1s (95.8kB/s)
Selecting previously deselected package sudo.
(Reading database ... 25225 files and directories currently installed.)
Unpacking sudo (from .../sudo_1.6.8p12-4_i386.deb) ...
Setting up sudo (1.6.8p12-4) ...
No /etc/sudoers found... creating one for you.
&lt;/pre&gt;
Let's look at the sudoers definition file:
&lt;pre class="code"&gt;deb# &lt;b&gt;cat /etc/sudoers&lt;/b&gt;
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults        env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL
&lt;/pre&gt;
Now we can make the new user sudoer:
&lt;pre class="code"&gt;
deb# &lt;b&gt;visudo&lt;/b&gt;
...
&lt;/pre&gt;
Let's look at the result:
&lt;pre class="code"&gt;deb# &lt;b&gt;cat /etc/sudoers&lt;/b&gt;
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults        env_reset

# Host alias specification

# User alias specification
&lt;i&gt;filodej    ALL=(ALL) ALL&lt;/i&gt;

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL
&lt;/pre&gt;
&lt;br /&gt;
&lt;h3&gt;Resize the root filesystem&lt;/h3&gt;
&lt;a href="http://colinux.wikia.com/wiki/ExpandingRoot"&gt;[Expanding root filesystem howto]&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
I decided for the &lt;a href="http://colinux.wikia.com/wiki/ExpandingRoot#The_most_reliable_way_to_enlarge_the_root_partition"&gt;most reliable way&lt;/a&gt;.
&lt;br /&gt;
First we look at the current filesystem:
&lt;pre class="code"&gt;deb# &lt;b&gt;df&lt;/b&gt;
Filesystem           1K-blocks      Used Available Use% Mounted on
&lt;i&gt;/dev/cobd0             1031064    197876    780812  21% /&lt;/i&gt;
tmpfs                   387996         0    387996   0% /lib/init/rw
udev                     10240        16     10224   1% /dev
tmpfs                   387996         0    387996   0% /dev/shm
cofs1                156280288  44298800 111981488  29% /mnt/c
cofs2                156280288    240400 156039888   1% /mnt/d
//storage/filodej     10175328   2711828   7463500  27% /mnt/storage/filodej
&lt;/pre&gt;
Now we halt the system (if we are logged as a normal user, we have to use &lt;i&gt;sudo&lt;/i&gt;):
&lt;pre class="code"&gt;
deb# &lt;b&gt;sudo halt&lt;/b&gt;
...
Broadcast message from root@debian (pts/2) (Wed Dec 10 05:11:48 2008):

The system is going down for system halt NOW!
&lt;/pre&gt;
On windows we now go to the &lt;i&gt;images&lt;/i&gt; directory:
&lt;pre class="code"&gt;
C:\&amp;gt; cd programs\coLinux\images

C:\programs\coLinux\images&amp;gt; &lt;b&gt;dir&lt;/b&gt;
 Volume in drive C has no label.
 Volume Serial Number is F488-7A65

 Directory of C:\programs\coLinux\images

01/06/2009  21:49    &amp;lt;DIR&amp;gt;          .
01/06/2009  21:49    &amp;lt;DIR&amp;gt;          ..
01/06/2009  20:29     1,072,693,248 Debian-4.0r0-etch.ext3.1gb
03/27/2008  19:59        40,795,971 Debian-clean.1gb.bz2
12/22/2008  22:32     1,073,741,824 swap_file.1gb
               3 File(s)  2,187,231,043 bytes
               2 Dir(s)  124,332,199,936 bytes free
&lt;/pre&gt;
Now make a backup copy of the old filesystem:
&lt;pre class="code"&gt;
C:\programs\coLinux\images&amp;gt; &lt;b&gt;copy Debian-4.0r0-etch.ext3.1gb Debian-4.0r0-etch.ext3.1gb.tmp&lt;/b&gt;
        1 file(s) copied.
&lt;/pre&gt;
Create a new (empty) file (e.g. 8GB in this case):
&lt;pre class="code"&gt;
C:\programs\coLinux\images&amp;gt; &lt;b&gt;fsutil file createnew Debian-4.0r0-etch.ext3.8gb 8589934592&lt;/b&gt;
File C:\programs\coLinux\images\Debian-4.0r0-etch.ext3.8gb is created
&lt;/pre&gt;
Let's list the images directory again:'
&lt;pre class="code"&gt;
C:\programs\coLinux\images&amp;gt; &lt;b&gt;dir&lt;/b&gt;
 Volume in drive C has no label.
 Volume Serial Number is F488-7A65

 Directory of C:\programs\coLinux\images

01/06/2009  22:02    &amp;lt;DIR&amp;gt;          .
01/06/2009  22:02    &amp;lt;DIR&amp;gt;          ..
01/06/2009  13:07     1,072,693,248 Debian-4.0r0-etch.ext3.1gb
01/06/2009  20:29     1,072,693,248 Debian-4.0r0-etch.ext3.1gb.tmp
01/06/2009  22:02     8,589,934,592 &lt;i&gt;Debian-4.0r0-etch.ext3.8gb&lt;/i&gt;
03/27/2008  20:59        40,795,971 Debian-clean.1gb.bz2
01/06/2009  22:02                 0 fsutil
12/22/2008  22:32     1,073,741,824 swap_file.1gb
               6 File(s) 11,849,858,883 bytes
               2 Dir(s)  114,669,043,712 bytes free
&lt;/pre&gt;
Now we can modify the &lt;i&gt;debian.conf&lt;/i&gt; configuration file as follows:
&lt;pre class="code"&gt;
C:\programs\coLinux\images&amp;gt; cd ..

C:\programs\coLinux&amp;gt; &lt;b&gt;notepad debian.conf&lt;/b&gt;
&lt;/pre&gt;
Add the two newly created file images as block devices:
&lt;pre class="code"&gt;# File contains the root file system.
# Download and extract preconfigured file from SF "Images for 2.6".
cobd0="C:\programs\coLinux\images\Debian-4.0r0-etch.ext3.1gb"
&lt;b&gt;cobd3="C:\programs\coLinux\images\Debian-4.0r0-etch.ext3.1gb.tmp"
cobd4="C:\programs\coLinux\images\Debian-4.0r0-etch.ext3.8gb"&lt;/b&gt;
cofs1=c:\
cofs2=d:\
&lt;/pre&gt;
Now we can boot the colinux up and login as root:
&lt;pre class="code"&gt;
C:\programs\coLinux&amp;gt; &lt;b&gt;colinux-daemon.exe -t nt @debian.conf&lt;/b&gt;
...
debian login: root
Password:
...
deb#
&lt;/pre&gt;
Now we check if the the copy of the old filesystem is clean:
&lt;pre class="code"&gt;
deb# &lt;b&gt;e2fsck /dev/cobd3&lt;/b&gt;
e2fsck 1.40-WIP (14-Nov-2006)
/dev/cobd3: clean, 8967/131072 files, 53582/261888 blocks
&lt;/pre&gt;
If we now try to check the empty image, we (presumably) get the error:
&lt;pre class="code"&gt;
deb# &lt;b&gt;e2fsck /dev/cobd4&lt;/b&gt;
e2fsck 1.40-WIP (14-Nov-2006)
Couldn't find ext2 superblock, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/cobd4

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 &amp;lt;device&amp;gt;
&lt;/pre&gt;
Let's copy the raw data from the old image to the new:
&lt;pre class="code"&gt;
deb# &lt;b&gt;dd if=/dev/cobd3 of=/dev/cobd4&lt;/b&gt;
2095104+0 records in
2095104+0 records out
1072693248 bytes (1.1 GB) copied, 110.632 seconds, 9.7 MB/s
&lt;/pre&gt;
Now we can check the filesystem (-f will force checking even if filesystem is marked clean):
&lt;pre class="code"&gt;
deb# &lt;b&gt;e2fsck -f /dev/cobd4&lt;/b&gt;
e2fsck 1.40-WIP (14-Nov-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/cobd4: 8967/131072 files (0.6% non-contiguous), 53582/261888 blocks
&lt;/pre&gt;
Let's resize the filesystem from 1GB to 8GB:
&lt;pre class="code"&gt;
deb# &lt;b&gt;resize2fs -p /dev/cobd4&lt;/b&gt;
resize2fs 1.40-WIP (14-Nov-2006)
Resizing the filesystem on /dev/cobd4 to 2097152 (4k) blocks.
Begin pass 1 (max = 56)
Extending the inode table     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/cobd4 is now 2097152 blocks long.
&lt;/pre&gt;
... and check it again:
&lt;pre class="code"&gt;
deb# &lt;b&gt;e2fsck -f /dev/cobd4&lt;/b&gt;
e2fsck 1.40-WIP (14-Nov-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/cobd4: 8967/1048576 files (0.6% non-contiguous), 82374/2097152 blocks
&lt;/pre&gt;
Now we are almost done and can halt the system:
&lt;pre class="code"&gt;
deb# &lt;b&gt;halt&lt;/b&gt;
&lt;/pre&gt;
In windows we can modify the &lt;i&gt;debian.conf&lt;/i&gt; configuration file again:
&lt;pre class="code"&gt;
C:\programs\coLinux&amp;gt; &lt;b&gt;notepad debian.conf&lt;/b&gt;
&lt;/pre&gt;
Remove the two newly block devices and change the root file system to &lt;i&gt;Debian-4.0r0-etch.ext3.8gb&lt;/i&gt;:
&lt;pre class="code"&gt;# File contains the root file system.
# Download and extract preconfigured file from SF "Images for 2.6".
#cobd0="C:\programs\coLinux\images\Debian-4.0r0-etch.ext3.1gb"
&lt;b&gt;cobd0="C:\programs\coLinux\images\Debian-4.0r0-etch.ext3.8gb"&lt;/b&gt;
cofs1=c:\
cofs2=d:\
&lt;/pre&gt;
Now we can boot the colinux up and login:
&lt;pre class="code"&gt;
C:\programs\coLinux&amp;gt; &lt;b&gt;colinux-daemon.exe -t nt @debian.conf&lt;/b&gt;
...
debian login: root
Password:
...
deb#
&lt;/pre&gt;
Now we can inspect the free space we have:
&lt;pre class="code"&gt;deb# &lt;b&gt;df&lt;/b&gt;
Filesystem           1K-blocks      Used Available Use% Mounted on
&lt;i&gt;/dev/cobd0             8256952    197876   7723532   3% /&lt;/i&gt;
tmpfs                   387996         0    387996   0% /lib/init/rw
udev                     10240        16     10224   1% /dev
tmpfs                   387996         0    387996   0% /dev/shm
cofs1                156280288  44281916 111998372  29% /mnt/c
cofs2                156280288    240400 156039888   1% /mnt/d
//storage/filodej     10175328   2711828   7463500  27% /mnt/storage/filodej
&lt;/pre&gt;
We are done for now, if everything goes fine we can possibly delete both the original image and its temporary copy.

&lt;h3&gt;GNOME installation&lt;/h3&gt;
&lt;a href="http://ubuntuforums.org/showthread.php?t=648896"&gt;[HOWTO: Minimal Debian Install (GNOME/KDE)]&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://forums.debian.net/viewtopic.php?t=8614"&gt;[Installing x server]&lt;/a&gt;&lt;br /&gt;
You have to decide what &lt;a href="http://en.wikipedia.org/wiki/X_display_manager"&gt;display manager&lt;/a&gt; 
and &lt;a href="http://en.wikipedia.org/wiki/Desktop_environment"&gt;Desktop environment&lt;/a&gt; to install.
&lt;br /&gt;
&lt;br /&gt;
Following table shows the numbers of packages and download and intallation sizes for "core" and "full" variations of mainstream environments
&lt;a href="http://en.wikipedia.org/wiki/GNOME_Display_Manager"&gt;GDM&lt;/a&gt;/&lt;a href="http://en.wikipedia.org/wiki/GNOME"&gt;GNOME&lt;/a&gt; and 
&lt;a href="http://en.wikipedia.org/wiki/KDE_Display_Manager"&gt;KDM&lt;/a&gt;/&lt;a href="http://en.wikipedia.org/wiki/KDE"&gt;KDE&lt;/a&gt;:
&lt;br/&gt;
&lt;br /&gt;
    &lt;table border="1"&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;/td&gt;
            &lt;td&gt;# packages&lt;/td&gt;
            &lt;td&gt;Archive size&lt;/td&gt;
            &lt;td&gt;Additional disk space&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;xorg&lt;/td&gt;
            &lt;td&gt;109&lt;/td&gt;
            &lt;td&gt;54.6 MB&lt;/td&gt;
            &lt;td&gt;143 MB&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;xorg + gnome-core&lt;/td&gt;
            &lt;td&gt;274&lt;/td&gt;
            &lt;td&gt;142 MB&lt;/td&gt;
            &lt;td&gt;461 MB&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;xorg + gnome&lt;/td&gt;
            &lt;td&gt;472&lt;/td&gt;
            &lt;td&gt;300 MB&lt;/td&gt;
            &lt;td&gt;931 MB&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;xorg + kde-core&lt;/td&gt;
            &lt;td&gt;208&lt;/td&gt;
            &lt;td&gt;120 MB&lt;/td&gt;
            &lt;td&gt;318 MB&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;xorg + kde&lt;/td&gt;
            &lt;td&gt;543&lt;/td&gt;
            &lt;td&gt;312 MB&lt;/td&gt;
            &lt;td&gt;830 MB&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;br/&gt;
I decided to try "full" GNOME installation:
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get install xorg gnome&lt;/b&gt;
...
0 upgraded, 472 newly installed, 0 to remove and 0 not upgraded.
Need to get 300MB of archives.
After unpacking 931MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
...
&lt;/pre&gt;
... during the relatively lenthy process of the installation (on my machine it was 30 minutes for downloading and 15 minutes of installation) the &lt;i&gt;xserver-xorg&lt;/i&gt; is configured and we are asked for desired screen resolutions. We are going to uninstall this package anyway so I do not think the settings we choose have any significant effect.
&lt;br/&gt;
&lt;br/&gt;
After the installation is finished we can inspect the free space:
&lt;pre class="code"&gt;
debian:~# &lt;b&gt;df&lt;/b&gt;
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cobd0             8256952   &lt;i&gt;1430612&lt;/i&gt;   6490796  19% /
tmpfs                   387996         0    387996   0% /lib/init/rw
udev                     10240        16     10224   1% /dev
tmpfs                   387996         0    387996   0% /dev/shm
cofs1                156280288  44284428 111995860  29% /mnt/c
cofs2                156280288    240400 156039888   1% /mnt/d
//storage/filodej     10175328   2711828   7463500  27% /mnt/storage/filodej
&lt;/pre&gt;
... and see that (as expected) the amount of used space on the root filesystem actually risen by approximately 1.2 GB.
&lt;br/&gt;
&lt;h3&gt;NX server&lt;/h3&gt;
&lt;a href="http://en.wikipedia.org/wiki/NX_technology"&gt;[NX technology]&lt;/a&gt;
&lt;a href="http://freenx.berlios.de/"&gt;[FreeNX]&lt;/a&gt;
&lt;a href="http://www.gnome.org/~markmc/a-look-at-nomachine-nx.html"&gt;[A look at NoMachine NX]&lt;/a&gt;
&lt;a href="http://www.nomachine.com/select-package.php?os=linux&amp;id=1"&gt;[NoMachine NX server free edition]&lt;/a&gt;
&lt;a href="http://richbradshaw.wordpress.com/2007/11/28/installing-nomachine-nx-on-linux/"&gt;[Installing NoMachine NX server]&lt;/a&gt;
&lt;a href="http://www.nomachine.com/ar/view.php?ar_id=AR03C00172"&gt;[NX keyboard shortcuts]&lt;/a&gt;
&lt;br/&gt;
The following is written about the licensing model of NX technology &lt;a href="http://en.wikipedia.org/wiki/NX_technology#License"&gt;on wikipedia&lt;/a&gt;:
&lt;blockquote&gt;&lt;i&gt;
NoMachine uses the GNU General Public License for the core NX technology, while at the same time offering non-free commercial NX server[2] and client products for Linux, Microsoft Windows, Solaris, Mac OS X and embedded systems.&lt;br/&gt;
&lt;br/&gt;
Due to the free software nature of NX, the FreeNX project was started in order to provide the wrapper scripts for the GPL NX libraries. FreeNX is developed and maintained by Fabian Franz.&lt;br/&gt;
&lt;/i&gt;&lt;/blockquote&gt;
&lt;br/&gt;
&lt;b&gt;FreeNX server&lt;/b&gt;
&lt;br/&gt;
At first I tried to install the FreeNX on my Laptop with Ubuntu installation but did not succeed. I used &lt;a href="http://www.drtek.ca/freenx-server-ubuntu-hardy"&gt;this&lt;/a&gt; and &lt;a href="http://www.debianhelp.co.uk/freenx.htm"&gt;this&lt;/a&gt; tutorial, everything went fine, the only thing that did not work was the shadow session from windows client.
&lt;br/&gt;
Every time I was connecting in shadow mode from windows client, &lt;i&gt;nxagent&lt;/i&gt; on server side crashed:
&lt;pre class="code"&gt;
Dec 19 17:08:23 notas kernel: [53641.720283] nxagent[5639]: segfault at 0000002c eip 080e9137 esp bff23b50 error 6
&lt;/pre&gt;
I tried to uninstall compiz (as &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=461284"&gt;someone&lt;/a&gt; advised) but it did not help. Maybe it was due to the client/server version incompatibility (I have used newer version of NoMachine windows client). As a result I decided to try the NoMachine NX server (free edition).
It is limited for only two users or two simultaneous connections to the server, but this limitation was not so significant for me.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;NoMachine NX server&lt;/b&gt;
&lt;br/&gt;
If you are using "full" GNOME installation then the first thing I would recommend to do is to install the &lt;a href="http://home.swbell.net/berzerke/printing.html"&gt;CUPS print server&lt;/a&gt;. The reasons are described &lt;a href="#gnome-not-responding"&gt;here&lt;/a&gt; (the issue was not necessarily connected with NX server, but also NX server complained when the CUPS was not installed):
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get install cupsys&lt;/b&gt;
...
&lt;/pre&gt;
Now we can proceed to the actual installation.
&lt;br/&gt;
&lt;br/&gt;
The NX Free Edition for Linux can be downloaded from &lt;a href="http://www.nomachine.com/download-package.php?Prod_Id=359"&gt;this page&lt;/a&gt;. The release I am using is 3.3.0-8.
&lt;br/&gt;
&lt;br/&gt;
For the installation of NX server I have followed &lt;a href="http://www.linux-tip.net/cms/content/view/298/26/"&gt;this tutorial&lt;/a&gt;.
&lt;br/&gt;
We will need three packages: &lt;a href="http://64.34.161.181/download/3.3.0/Linux/nxclient_3.3.0-3_i386.deb"&gt;nxclient&lt;/a&gt;, &lt;a href="http://64.34.161.181/download/3.3.0/Linux/nxnode_3.3.0-3_i386.deb"&gt;nxnode&lt;/a&gt; and &lt;a href="wget http://64.34.161.181/download/3.3.0/Linux/FE/nxserver_3.3.0-8_i386.deb"&gt;nxserver&lt;/a&gt;:
&lt;pre class="code"&gt;
deb# cd /tmp
deb# &lt;b&gt;wget http://64.34.161.181/download/3.3.0/Linux/nxclient_3.3.0-3_i386.deb&lt;/b&gt;
...
Length: 3,859,966 (3.7M) [application/x-debian-package]
...
deb# &lt;b&gt;wget http://64.34.161.181/download/3.3.0/Linux/nxnode_3.3.0-3_i386.deb&lt;/b&gt;
Length: 6,251,244 (6.0M) [application/x-debian-package]
deb# &lt;b&gt;wget http://64.34.161.181/download/3.3.0/Linux/FE/nxserver_3.3.0-8_i386.deb&lt;/b&gt;
...
Length: 6,717,880 (6.4M) [application/x-debian-package]
...
&lt;/pre&gt;
First we have to install the client (even if we are was not going to use it):
&lt;pre class="code"&gt;
deb# &lt;b&gt;dpkg -i nxclient_3.3.0-3_i386.deb&lt;/b&gt;
Selecting previously deselected package nxclient.
(Reading database ... 53454 files and directories currently installed.)
Unpacking nxclient (from nxclient_3.3.0-3_i386.deb) ...
Setting up nxclient (3.3.0-3) ...
Showing file: /usr/NX/share/documents/client/cups-info
&lt;i&gt;
 CUPS Printing Backend

 The NX Client set-up procedure detected that your "IPP CUPS" printing
 backend doesn't allow printing from the NX session. In order to have
 printing support in your NX system, you need to set proper permissions
 on the IPP backend. Please execute:

   chmod 755 /usr/lib/cups/backend/ipp&lt;/i&gt;
&lt;/pre&gt;
Ok, let's do what we are told:
&lt;pre class="code"&gt;
deb# chmod 755 /usr/lib/cups/backend/ipp
&lt;/pre&gt;
Then the nxnode has to be installed:
&lt;pre class="code"&gt;
deb# &lt;b&gt;dpkg -i nxnode_3.3.0-3_i386.deb&lt;/b&gt;
Selecting previously deselected package nxnode.
(Reading database ... 55884 files and directories currently installed.)
Unpacking nxnode (from nxnode_3.3.0-3_i386.deb) ...
Setting up nxnode (3.3.0-3) ...
NX&amp;gt; 700 Starting: install node operation at: Tue Jan 06 12:08:11 2009.
NX&amp;gt; 700 Autodetected system 'debian'.
NX&amp;gt; 700 Install log is '/usr/NX/var/log/install'.
NX&amp;gt; 700 Checking NX node configuration using /usr/NX/etc/node.cfg file.
NX&amp;gt; 700 Inspecting local CUPS environment.
NX&amp;gt; 700 Generating CUPS entries in: /usr/NX/etc/node.cfg.
NX&amp;gt; 700 Installation of version: 3.3.0-3 completed.
&lt;i&gt;NX&amp;gt; 700 Showing file: /usr/NX/share/documents/node/cups-info

     CUPS Printing Backend

     The NX Node setup procedure could not detect your "CUPS"
     installation: either CUPS  is not installed on your system
     or it was installed in a non-standard path. CUPS is needed
     in order to enable printing support in your NX system.
     Please note that you can enable  printing support for your
     NX system at any time; to do this make sure  that you have
     CUPS installed then run:

       /usr/NX/scripts/setup/nxnode --nxprintsetup &lt;pathname&gt;

     to specify the location of the CUPS root path.&lt;/i&gt;
&lt;/pre&gt;
... the CUPS related warning is hopefully not there if you have the CUPS server installed. If the warning is still there, the solution is simple:
&lt;pre class="code"&gt;
deb# &lt;b&gt;/usr/NX/scripts/setup/nxnode --nxprintsetup&lt;/b&gt;
NX&amp;gt; 701 Starting: nxprintsetup operation at: Mon Jan 05 13:14:31 2009.
NX&amp;gt; 701 Inspecting local CUPS environment.
NX&amp;gt; 701 Generating CUPS entries in: /usr/NX/etc/node.cfg.
NX&amp;gt; 701 CUPS configuration updated.
&lt;/pre&gt;
The last step is to install the nxserver itself:
&lt;pre class="code"&gt;
deb# &lt;b&gt;dpkg -i nxserver_3.3.0-8_i386.deb&lt;/b&gt;
Selecting previously deselected package nxserver.
(Reading database ... 56081 files and directories currently installed.)
Unpacking nxserver (from nxserver_3.3.0-8_i386.deb) ...
Setting up nxserver (3.3.0-8) ...
NX&amp;gt; 700 Installing: server at: Tue Jan 06 12:09:23 2009.
NX&amp;gt; 700 Autodetected system: debian.
NX&amp;gt; 700 Install log is: /usr/NX/var/log/install.
NX&amp;gt; 700 Creating configuration file: /usr/NX/etc/server.cfg.
NX&amp;gt; 723 Cannot start NX statistics:
NX&amp;gt; 709 NX statistics are disabled for this server.
NX&amp;gt; 700 Version '3.3.0-8' installation completed.
NX&amp;gt; 700 Showing file: /usr/NX/share/documents/server/install-notices
&lt;i&gt;
Server keys

The initial login between client and server happens through a DSA key
pair, i.e. a couple of specially generated cryptographic keys, called
the private key and the public key, which allow you to establish a
secure connection, by means of SSL encryption, between NX client and
NX server.

The public part of the key-pair is provided during the installation
of the server, while the private part of the key-pair is distributed
together with the NX Client. This ensures that each NX client is able
to authenticate to the server and to start the procedure for autho-
rizing the user and negotiating the session.

If you want to create a virtual private network (VPN) instead, you
need to generate a new DSA key-pair and distribute the private part
of the key-pair to those NX clients you want authenticated to the NX
server. More information on how to generate and distribute a new DSA
key-pair is available at:

http://www.nomachine.com/ar/view.php?ar_id=AR01C00126

Creating Users

NX is configured to allow access from any system user, as long as
valid credentials are given to the user for the SSH login. NX pro-
vides an alternative authorization method, allowing system admin-
istrators to determine which users are given access to the NX fun-
ctionalities. This works by implementing a separation between the
system password and the NX password, so that, for example, it is
possible to forbid remote access to the system by any other means
except via NX and use the NX tools to implement effective accounting
of the system resources used by the user, or to share NX passwords in
an external database.

To activate the NX user and password DBs, you will have to edit the
NX server configuration file by hand or use the NX Server Manager
Web tool available for download on the NoMachine Web site at:

http://www.nomachine.com/download-manager.php

Session Shadowing and Desktop Sharing

The session shadowing functionality allows you to share NX sessions
running on the node. The desktop sharing functionality instead, gives
access to the native display of the X server as if you were in front
of the monitor. By default you can access sessions in interactive mode
and upon authorization of the session owner. You can modify this beha-
viour by tuning the server configuration according to your needs, for
example by allowing access to sessions in view-only mode, or connecting
to either a suspended session or the local display via the Desktop
Manager login window.

Load Balancing

NX Advanced Server provides support for multi-node capabilities and
load balancing. In its current implementation, NX server can only
manage accounts on the host machine, so to grant access to the node
running remotely, you will need to create the user account directly
on the remote node host by issuing the NX node commands as root user.
You will also need to add the NX Server public DSA Key to the node to
allow this server to connect to the node running on the remote host.

Documentation

For further information on how to manage the configuration of your
NX system, please refer to the System Administrator's Guide available
on the NoMachine Web site at:

http://www.nomachine.com/documentation/admin-guide.php

The NoMachine Team.
&lt;/i&gt;
NX&amp;gt 700 Bye.
&lt;/pre&gt;
&lt;br/&gt;
&lt;b&gt;NX Client for Windows&lt;/b&gt;
&lt;br/&gt;
NX Client for Windows can be downloaded from &lt;a href="http://www.nomachine.com/download-client-windows.php"&gt;this page&lt;/a&gt;. Its installation is straightforward.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;NX Connection wizard&lt;/b&gt;
&lt;br/&gt;
With help of the NX connection wizard we can create a new session (if we are on local machine we can use the private TAP ethernet address):
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPH7_wTSRI/AAAAAAAACcE/ru6FVGNROGs/s1600-h/05-nx-conn-wizard1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 307px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPH7_wTSRI/AAAAAAAACcE/ru6FVGNROGs/s400/05-nx-conn-wizard1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290221003327762" /&gt;&lt;/a&gt;
Here we choose a desktop environment (Gnome in this case) and a resolution:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPH8fhwRgI/AAAAAAAACcM/iFONDpZOT7s/s1600-h/05-nx-conn-wizard2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 307px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPH8fhwRgI/AAAAAAAACcM/iFONDpZOT7s/s400/05-nx-conn-wizard2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290229532247554" /&gt;&lt;/a&gt;
In advanced configuration we can modify everything we setup so far and much more:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SWPIOeN_7iI/AAAAAAAACcU/X9MBiGOYO44/s1600-h/05-nx-conn-wizard3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 314px; height: 400px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SWPIOeN_7iI/AAAAAAAACcU/X9MBiGOYO44/s400/05-nx-conn-wizard3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290538418597410" /&gt;&lt;/a&gt;
If we are on local machine I would recommend to disable image compression (icons and images then look better):
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPIORlmvMI/AAAAAAAACcc/N5kqDUU9Zyc/s1600-h/05-nx-conn-wizard4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 299px; height: 400px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPIORlmvMI/AAAAAAAACcc/N5kqDUU9Zyc/s400/05-nx-conn-wizard4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290535027948738" /&gt;&lt;/a&gt;
We save the session settiongs and proceed to login dialog:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPIPFundoI/AAAAAAAACck/OSMDk_BlnHs/s1600-h/05-nx-conn-wizard5.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 330px; height: 217px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SWPIPFundoI/AAAAAAAACck/OSMDk_BlnHs/s400/05-nx-conn-wizard5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290549024388738" /&gt;&lt;/a&gt;
The first time we are asked to story the RSA fingerprint (there is SSH running under the covers):
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SWPIPeAX3iI/AAAAAAAACcs/tTseN1_5kqU/s1600-h/05-nx-conn-wizard6.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 338px; height: 192px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SWPIPeAX3iI/AAAAAAAACcs/tTseN1_5kqU/s400/05-nx-conn-wizard6.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290555541315106" /&gt;&lt;/a&gt;
Now we are succesfully connected to a new Gnome session:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPIPvkrWTI/AAAAAAAACc0/sca666CNV_4/s1600-h/06-gnome-session.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 320px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWPIPvkrWTI/AAAAAAAACc0/sca666CNV_4/s400/06-gnome-session.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5288290560256989490" /&gt;&lt;/a&gt;
&lt;h3&gt;Issues&lt;/h3&gt;
&lt;b&gt;X server start failure at boot time&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
When we reboot from the console we realize that X server is (unsuccesfully) started during the boot process:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWQDuhh6OPI/AAAAAAAACdE/UgerA40AF2Q/s1600-h/03-no-x-server.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 207px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SWQDuhh6OPI/AAAAAAAACdE/UgerA40AF2Q/s400/03-no-x-server.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5288355960249268466" /&gt;&lt;/a&gt;
Actually we do not need xserver running on the coLinux side, we are going to connect via the NX server or use an X server running on the Windows side. As a solution we can uninstall the unnecessary &lt;i&gt;gdm&lt;/i&gt; and &lt;i&gt;xserver-xorg&lt;/i&gt;.
&lt;br/&gt;
&lt;br/&gt;
I admit that this install/uninstall approach seems weird, but currently I do not know a better solution, when I tried to just install the &lt;i&gt;gnome&lt;/i&gt; without &lt;i&gt;xorg&lt;/i&gt; the nxclient connection did not succeed. If someone with better knowledge of GNOME/X server/NX server dependencies knows a better approach, please, let me know. 
&lt;br/&gt;
&lt;br/&gt;
Anyway, let's remove the GDM for now:
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get remove gdm&lt;/b&gt;
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  fast-user-switch-applet gdm gdm-themes gnome gnome-desktop-environment
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 17.4MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 52440 files and directories currently installed.)
Removing gnome ...
Removing gnome-desktop-environment ...
Removing fast-user-switch-applet ...
Removing gdm-themes ...
Removing gdm ...
Stopping GNOME Display Manager: gdm.
&lt;/pre&gt;
... and also the xserver: 
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get remove xserver-xorg&lt;/b&gt;
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  xorg xserver-xorg xserver-xorg-core xserver-xorg-input-all
  xserver-xorg-input-evdev xserver-xorg-input-kbd xserver-xorg-input-mouse
  xserver-xorg-input-synaptics xserver-xorg-video-all xserver-xorg-video-apm
  xserver-xorg-video-ark xserver-xorg-video-ati xserver-xorg-video-chips
  xserver-xorg-video-cirrus xserver-xorg-video-cyrix xserver-xorg-video-dummy
  xserver-xorg-video-fbdev xserver-xorg-video-glint xserver-xorg-video-i128
  xserver-xorg-video-i740 xserver-xorg-video-i810 xserver-xorg-video-imstt
  xserver-xorg-video-mga xserver-xorg-video-neomagic
  xserver-xorg-video-newport xserver-xorg-video-nsc xserver-xorg-video-nv
  xserver-xorg-video-rendition xserver-xorg-video-s3
  xserver-xorg-video-s3virge xserver-xorg-video-savage
  xserver-xorg-video-siliconmotion xserver-xorg-video-sis
  xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-tga
  xserver-xorg-video-trident xserver-xorg-video-tseng xserver-xorg-video-v4l
  xserver-xorg-video-vesa xserver-xorg-video-vga xserver-xorg-video-via
  xserver-xorg-video-vmware xserver-xorg-video-voodoo
0 upgraded, 0 newly installed, 44 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 19.3MB disk space will be freed.
Do you want to continue [Y/n]? Y
...
&lt;/pre&gt;
...and reboot to make sure the boot-up startx problem is gone.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Screensaver draining the CPU&lt;/b&gt;
&lt;br/&gt;
The default GNOME screensaver &lt;i&gt;"Floating Debian"&lt;/i&gt; was relatively CPU greedy. I disabled it and choose the &lt;i&gt;"Blank screen"&lt;/i&gt; (&lt;i&gt; Desktop -&amp;gt; Preferences -&amp;gt; Screensaver &lt;/i&gt;).
&lt;a name="gnome-not-responding"&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Gnome stopped responding&lt;/b&gt;
&lt;br/&gt;
Initially I ran the GNOME and had not the CUPS server installed. Everything went fine but after few days a problem emerged. When I logged in desktop environment after some time (typically couple dozens of seconds) it stopped responding.
&lt;br/&gt;
When I tried to start gnome session directly from console (using &lt;a href="http://en.wikipedia.org/wiki/Xming"&gt;XMing server&lt;/a&gt;), there was the same problem, but fortunately the following warning appeared on the console just about the same time the desktop stopped responding:
&lt;pre class="code"&gt;
deb# gnome-session
...
** (gnome-cups-icon:6107): WARNING **: Could not start the printer tray icon, because the CUPS server could not be contacted.
&lt;/pre&gt;
The issue is very similar to &lt;a href="https://answers.launchpad.net/ubuntu/+source/xorg/+question/52189"&gt;this (unresolved) one&lt;/a&gt;.
&lt;br/&gt;
It is likely that the issue is not connected with NX server, but it is a coincidence that also the NX server installation complained about the fact that the CUPS server was not installed.
&lt;br/&gt;
As a solution I decided to install the CUPS server:
&lt;pre class="code"&gt;
deb# &lt;b&gt;apt-get install cupsys&lt;/b&gt;
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  cupsys-common libslp1 poppler-utils
Suggested packages:
  cupsys-bsd cupsys-driver-gutenprint cupsys-driver-gimpprint
  foomatic-filters-ppds xpdf-korean xpdf-japanese xpdf-chinese-traditional
  xpdf-chinese-simplified cups-pdf hplip slpd openslp-doc
Recommended packages:
  cupsys-client smbclient foomatic-filters
The following NEW packages will be installed:
  cupsys cupsys-common libslp1 poppler-utils
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 2604kB of archives.
After unpacking 12.1MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
...
&lt;/pre&gt;
The installation complained about non-multicasting kernel, but hopefully it will not be a big problem:
&lt;pre class="code"&gt;
To reduce network traffic use a IP multicast enabled kernel

The kernel version that you are currently running does not appear to     
support IP multicast. OpenSLP will continue to work even without
multicast support in the kernel by using broadcasts. However, broadcasts 
are less efficient on the network, so please consider upgrading to a
multicast enabled kernel.
&lt;/pre&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Missing fonts&lt;/b&gt;
&lt;br/&gt;
When I run emacs the following error appeared:
&lt;pre class="code"&gt;
deb# &lt;b&gt;emacs&lt;/b&gt;
Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct
&lt;/pre&gt;
... and the emacs application looked as follows:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/Sconc2T6NpI/AAAAAAAACz0/gecPBude3lU/s1600-h/emacs-fonts.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 346px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/Sconc2T6NpI/AAAAAAAACz0/gecPBude3lU/s400/emacs-fonts.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317105686633133714" /&gt;&lt;/a&gt;
&lt;br/&gt;
The XOrg configuration seemed ok:
&lt;pre class="code"&gt;
deb# &lt;b&gt;cat /etc/X11/xorg.conf | grep FontPath&lt;/b&gt;
        FontPath        "/usr/share/fonts/X11/misc"
        FontPath        "/usr/share/fonts/X11/cyrillic"
        FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/Type1"
        FontPath        "/usr/share/fonts/X11/100dpi"
        FontPath        "/usr/share/fonts/X11/75dpi"
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
&lt;/pre&gt;
... the font paths really exist and contain the corresponding fonts:
&lt;pre class="code"&gt;
deb# &lt;b&gt;find /usr/share/fonts/X11/ -name *helv*&lt;/b&gt;
/usr/share/fonts/X11/100dpi/helvB08.pcf.gz
/usr/share/fonts/X11/100dpi/helvB10.pcf.gz
/usr/share/fonts/X11/100dpi/helvB12.pcf.gz
...
&lt;/pre&gt;
Really, there were some fonts matching the font name patterns:
&lt;pre class="code"&gt;
deb# &lt;b&gt;xlsfonts -fn '-*-helvetica-medium-r-*-*-*-120-*-*-*-*-iso8859-1'&lt;/b&gt;
-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-iso8859-1
-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-iso8859-1
-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
-adobe-helvetica-medium-r-normal--17-120-100-100-p-88-iso8859-1
deb# &lt;b&gt;xlsfonts -fn '-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*'&lt;/b&gt;
-adobe-courier-medium-r-normal--12-120-75-75-m-0-iso8859-1
-adobe-courier-medium-r-normal--12-120-75-75-m-0-iso8859-1
-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
-adobe-courier-medium-r-normal--17-120-100-100-m-100-iso8859-1
&lt;/pre&gt;
Finally the solution (or at least workaround, since I initially thought it should not be necessary) was to download the additional fonts for nxclient (windows side) from
&lt;a href="http://www.nomachine.com/download-client-windows.php"&gt;NoMachine site&lt;/a&gt;.
It helped in my case, although I don't fully understand why it was necessary, see the  
note from the &lt;i&gt;NoMachine&lt;/i&gt; site:
&lt;blockquote&gt;
&lt;i&gt;NOTE: The additional fonts are only needed when running very old Unix applications, requiring the use of client-side fonts. All recent Unix applications use fonts stored on the server, that are fully supported by NX.&lt;/i&gt;
&lt;/blockquote&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Microsoft TrueType fonts&lt;/b&gt;
&lt;br/&gt;
With default settings some websites (like &lt;a href="http://www.reddit.com"&gt;Reddit&lt;/a&gt;) render in fonts without antialiasing. The page with such fonts looks like follows:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/Su6iDHzJjbI/AAAAAAAADWk/hmJMS0XOg4g/s1600-h/reddit-alias.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 336px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/Su6iDHzJjbI/AAAAAAAADWk/hmJMS0XOg4g/s400/reddit-alias.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5399431177780694450" /&gt;&lt;/a&gt;
&lt;br/&gt;
In font mapper settings you can probably do many things about it, but I am not expert in this area. What worked for me was to install the fonts I am used to - the &lt;a href="http://packages.debian.org/lenny/msttcorefonts"&gt;msttcorefonts package&lt;/a&gt;.
&lt;br/&gt;
In order to be able to install the fonts, you have to extend your &lt;i&gt;sources.list&lt;/i&gt; to provide access to non-free packages. For detailed explanation see &lt;a href="http://www.marksanborn.net/linux/installing-microsoft-fonts-msttcorefonts-on-debian-linux/"&gt;this post&lt;/a&gt;.
&lt;br/&gt;
After the successful installation the same site looks as follows:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/Su6jsWU-8GI/AAAAAAAADWs/KLGd2rIR9JY/s1600-h/reddit-noalias.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 327px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/Su6jsWU-8GI/AAAAAAAADWs/KLGd2rIR9JY/s400/reddit-noalias.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5399432985566965858" /&gt;&lt;/a&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-7789968982796645108?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/7789968982796645108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=7789968982796645108' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7789968982796645108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7789968982796645108'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/cooperative-linux-with-debian.html' title='Cooperative Linux step by step'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xFBIBcRhwFQ/SWPMJynrivI/AAAAAAAACc8/HZNBWsmzPg4/s72-c/06-gnome-session-gimp.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-2587375051217033605</id><published>2008-12-22T20:28:00.004+01:00</published><updated>2009-01-08T13:04:55.723+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - dropbear-0.52</title><content type='html'>&lt;h3&gt;Introduction&lt;/h3&gt;
It seems to me that &lt;a href="http://matt.ucc.asn.au/dropbear/dropbear.html"&gt;dropbear ssh daemon&lt;/a&gt; from JoKeR's &lt;a href="http://mgb111.pradnik.net/addons/servers-ssh/dropbear-ssh-sshd-050.3.tgz"&gt;package&lt;/a&gt; is configured so it does not support &lt;a href="http://sial.org/howto/openssh/publickey-auth/"&gt;public key authentication&lt;/a&gt;. It is possible that I am doing something wrong but I was trying hard to make it work and did not succeed.&lt;br/&gt;
Finally I decided to build &lt;i&gt;dropbear&lt;/i&gt; on my own, since the publickey authentication feature is essential for me (I am using the box for hosting of git repositories and I really do not want to type my password every time I commit a code).&lt;br/&gt;
&lt;h3&gt;Build result&lt;/h3&gt;
&lt;a href="http://filodej.ic.cz/filopack/dropbear-0.52.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/dropbear-0.52.lst"&gt;[file list]&lt;/a&gt;
&lt;br/&gt;
&lt;h3&gt;Installation&lt;/h3&gt;
&lt;pre class="code"&gt;
box# &lt;b&gt;cd /mnt/C&lt;/b&gt;
box# &lt;b&gt;./filopack.sh --download dropbear-0.52&lt;/b&gt;
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package dropbear-0.52 from http://filodej.ic.cz ...
connected!

Length: 502 [text/plain]
connected!

Length: 177,869 [application/x-tar]
box# &lt;b&gt;./filopack.sh --install dropbear-0.52&lt;/b&gt;
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack dropbear-0.52 locally at /mnt/C (y/n)?y
sys/bin/dbclient
sys/bin/dropbearmulti
sys/bin/dropbearkey
sys/bin/dropbearconvert
sys/bin/scp
sys/sbin/dropbear
box# &lt;b&gt;killall dropbear&lt;/b&gt;
box# &lt;b&gt;dropbear&lt;/b&gt;
&lt;/pre&gt;
In this post I am going to describe how I built the dropbear package and diagnosed and solved (or worked around) problems which arose during the whole process. 
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;h3&gt;JoKeR's dropbear&lt;/h3&gt;
Let's try co connect to the box:&lt;br/&gt;
If ssh daemon (dropbear in our case) is not running on the box, the error message will likely look as follows:
&lt;pre class="code"&gt;
deb# ssh root@storage
ssh: connect to host storage port 22: Connection refused
&lt;/pre&gt;
If everything is ok, it should look similar to following:
&lt;pre class="code"&gt;
deb# ssh root@storage
root@storage's password: &lt;b&gt;&amp;lt; type a password &amp;gt; &lt;/b&gt;

  [    FW 4.00b4.C009-M[NG]    ]
  [ http://mgb111.pradnik.net/ ]

box#
&lt;/pre&gt;
Now we are trying to get rid of typing the password. We use the RSA public authentication for it.&lt;br/&gt;
&lt;h3&gt;Publickey authentication&lt;/h3&gt;
If we do not have a RSA key generated yet, we can generate it as follows:
&lt;pre class="code"&gt;
deb# cd ~
deb# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/filodej/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/filodej/.ssh/id_rsa.
Your public key has been saved in /home/filodej/.ssh/id_rsa.pub.
The key fingerprint is:
89:...:b4... filodej@debian
&lt;/pre&gt;

Deploy the public key to the box:
&lt;pre class="code"&gt;
deb# scp .ssh/id_rsa.pub root@storage:/mnt/C/sys/root/.ssh/
root@storage's password:
id_rsa.pub                                                              100%  393     0.4KB/s   00:00
&lt;/pre&gt;
Now, on the box, append the public key to the list of authorized keys:
&lt;pre class="code"&gt;
box# cd /mnt/C/sys/root/.ssh/
box# cat id_rsa.pub &gt;&gt; authorized_keys
&lt;/pre&gt;
From now on, the ssh client should not ask for anything &lt;i&gt;(more precisely, it should not ask for password, it should ask for publickey passphrase if we did not leave it empty - for someone it can look similar as password, but it is completely different thing).&lt;/i&gt;&lt;br/&gt;
&lt;br/&gt;
Let's try:
&lt;pre class="code"&gt;
deb# ssh root@storage
root@storage's password:
&lt;/pre&gt;
&lt;h3&gt;Simple diagnostics&lt;/h3&gt;
Ooops, it seems we did not succeed. Let's do some diagnostics (we can use either of &lt;i&gt;"-v"&lt;/i&gt;, &lt;i&gt;"-vv"&lt;/i&gt;, 

&lt;i&gt;"-vvv"&lt;/i&gt; verbose modes, one "v" is sufficiend here):
&lt;pre class="code"&gt;
dev# ssh -v root@storage
OpenSSH_4.3p2 Debian-9, OpenSSL 0.9.8c 05 Sep 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to storage [192.168.1.104] port 22.
debug1: Connection established.
debug1: identity file /home/filodej/.ssh/identity type -1
debug1: identity file /home/filodej/.ssh/id_rsa type 1
debug1: identity file /home/filodej/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version dropbear_0.50
debug1: no match: dropbear_0.50
...
debug1: Host 'storage' is known and matches the RSA host key.
debug1: Found key in /home/filodej/.ssh/known_hosts:4
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: &lt;b&gt;password&lt;/b&gt;
debug1: Next authentication method: password
root@storage's password:
&lt;/pre&gt;
Let's try to connect to another machine and compare the trace:
&lt;pre class="code"&gt;
deb# ssh -v root@notasw
OpenSSH_4.3p2 Debian-9, OpenSSL 0.9.8c 05 Sep 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to notasw [192.168.1.103] port 22.
debug1: Connection established.
debug1: identity file /home/filodej/.ssh/identity type -1
debug1: identity file /home/filodej/.ssh/id_rsa type 1
debug1: identity file /home/filodej/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1 Debian-8ubuntu1.2
debug1: match: OpenSSH_4.7p1 Debian-8ubuntu1.2 pat OpenSSH*
...
debug1: Host 'notasw' is known and matches the RSA host key.
debug1: Found key in /home/filodej/.ssh/known_hosts:8
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: &lt;b&gt;publickey,password&lt;/b&gt;
debug1: Next authentication method: publickey
debug1: Trying private key: /home/filodej/.ssh/identity
debug1: Offering public key: /home/filodej/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/filodej/.ssh/id_dsa
debug1: Next authentication method: password
root@notasw's password:
&lt;/pre&gt;
We can diff the logs to easily see the differences:
&lt;pre class="code"&gt;
deb# ssh -v root@storage 2&gt; storage.txt
root@storage's password:
&amp;lt;Ctrl-D&amp;gt;
deb# ssh -v root@notasw 2&gt; notas.txt
root@notasw's password:
&amp;lt;Ctrl-D&amp;gt;
deb# diff storage.txt notas.txt
4c4
&amp;lt; debug1: Connecting to storage [192.168.1.104] port 22.
---
&amp;gt; debug1: Connecting to notasw [192.168.1.103] port 22.
9,10c9,10
&amp;lt; debug1: Remote protocol version 2.0, remote software version dropbear_0.50
&amp;lt; debug1: no match: dropbear_0.50
---
&amp;gt; debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1 Debian-8ubuntu1.2
&amp;gt; debug1: match: OpenSSH_4.7p1 Debian-8ubuntu1.2 pat OpenSSH*
23,26c23,28
...
&amp;lt; debug1: Host 'storage' is known and matches the RSA host key.
&amp;lt; debug1: Found key in /home/filodej/.ssh/known_hosts:4
---
...
&amp;gt; debug1: Host 'notasw' is known and matches the RSA host key.
&amp;gt; debug1: Found key in /home/filodej/.ssh/known_hosts:8
33c35,40
&amp;lt; debug1: Authentications that can continue: &lt;b&gt;password&lt;/b&gt;
---
&amp;gt; debug1: Authentications that can continue: &lt;b&gt;publickey,password&lt;/b&gt;
&amp;gt; debug1: Next authentication method: publickey
&amp;gt; debug1: Trying private key: /home/filodej/.ssh/identity
&amp;gt; debug1: Offering public key: /home/filodej/.ssh/id_rsa
&amp;gt; debug1: Authentications that can continue: publickey,password
&amp;gt; debug1: Trying private key: /home/filodej/.ssh/id_dsa
&lt;/pre&gt;
It seems that the JoKeR's daemon is not configured for publickey authentication at all. Ok, let's build our own.&lt;br/&gt;
&lt;h3&gt;Build process&lt;/h3&gt;
First we have to download, extract and configure the build:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/
dev# wget &lt;a 

href="http://matt.ucc.asn.au/dropbear/dropbear-0.52.tar.bz2"&gt;http://matt.ucc.asn.au/dropbear/dropbear-0.52.tar.

bz2&lt;/a&gt;
dev# tar xjvf dropbear-0.52.tar.bz2 
dev# cd dropbear-0.52
dev# ./configure --prefix /mnt/C/sys
...
configure: Now edit options.h to choose features.
&lt;/pre&gt;
As the message suggests, now we can set up some additional build options:
&lt;pre class="code"&gt;
dev# nano options.h

&lt;i&gt;change:&lt;/i&gt;
  #define RSA_PRIV_FILENAME "/etc/dropbear/dropbear_rsa_host_key"
&lt;i&gt;to:&lt;/i&gt;
  #define RSA_PRIV_FILENAME "/mnt/C/sys/etc/dropbear_rsa_host_key"

&lt;i&gt;and possibly comment out:&lt;/i&gt;
  #define DROPBEAR_DSS
&lt;i&gt;or change:&lt;/i&gt;
  #define DSS_PRIV_FILENAME "/etc/dropbear/dropbear_dss_host_key"
&lt;i&gt;to:&lt;/i&gt;
  #define DSS_PRIV_FILENAME "/mnt/C/sys/etc/dropbear_dss_host_key"

&lt;i&gt;leave following unchanged:&lt;/i&gt;
  #define ENABLE_SVR_PASSWORD_AUTH
  /* PAM requires ./configure --enable-pam */
  /*#define ENABLE_SVR_PAM_AUTH*/
  #define ENABLE_SVR_PUBKEY_AUTH

  /* Wether to ake public key options in authorized_keys file into account */
  #ifdef ENABLE_SVR_PUBKEY_AUTH
  #define ENABLE_SVR_PUBKEY_OPTIONS
  #endif

  #define ENABLE_CLI_PASSWORD_AUTH
  #define ENABLE_CLI_PUBKEY_AUTH
  #define ENABLE_CLI_INTERACT_AUTH
&lt;/pre&gt;
... and make:
&lt;pre class="code"&gt;
dev# make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
...
&lt;/pre&gt;
It compiled successfully, but I have realized that I prefer to link the dependencies statically:
&lt;pre class="code"&gt;
dev# make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" clean
dev# make &lt;b&gt;STATIC=1&lt;/b&gt; PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
...
/mnt/C/sys/lib/gcc/i386-linux-uclibc/4.1.2/../../../../i386-linux-uclibc/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
&lt;/pre&gt;
... the error means that linker is unable to find a static version of &lt;a href="http://www.zlib.net/"&gt;zlib library&lt;/a&gt;.
&lt;br/&gt;
When we investigate that we see taht there is just a dynamic version of the library on the system:
&lt;pre class="code"&gt;
dev# ls /lib/libz*
/lib/libz.so.1  /lib/libz.so.1.2.2
dev# ls /mnt/C/sys/lib/libz*
/mnt/C/sys/lib/libz*: No such file or directory
&lt;/pre&gt;
We could pick the &lt;a href="http://www.zlib.net/zlib-1.2.3.tar.bz2"&gt;sources&lt;/a&gt; and build a static version of &lt;i&gt;zlib&lt;/i&gt; library, but for now I decided to re-configure the dropbear build and disable the &lt;i&gt;zlib&lt;/i&gt; support:
&lt;pre class="code"&gt;
dev# make STATIC=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" clean
dev# ./configure --prefix /mnt/C/sys &lt;b&gt;--disable-zlib&lt;/b&gt; STATIC=1 
dev# make STATIC=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
&lt;/pre&gt;
... now it compiled without problems, we can try to install it and upload to the box:
&lt;pre class="code"&gt;
dev# make STATIC=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
...
dev# scp /mnt/C/sys/sbin/dropbear root@storage:/tmp/
&lt;/pre&gt;
Now we can start the brand new version of dropbear daemon on the box:
&lt;pre class="code"&gt;
box# killall dropbear
box# /tmp/dropbear
&lt;/pre&gt;
And try to log in over ssh client (from my debian system):
&lt;pre class="code"&gt;
deb# ssh -vvv root@storage -i ~/.ssh/id_rsa.pub
...
debug2: key: /home/filodej/.ssh/id_rsa.pub (0xb7f7b480)
debug2: key:  (0xb7f7c8e0)
debug1: Authentications that can continue: &lt;b&gt;publickey,password&lt;/b&gt;
debug1: Next authentication method: publickey
debug1: Trying private key: /home/filodej/.ssh/identity
debug1: Offering public key: /home/filodej/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/filodej/.ssh/id_dsa
debug1: Next authentication method: password
root@storage's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
root@storage's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
root@storage's password:
&lt;/pre&gt;
It seems we have done some progress here, but still are not able to authenticate via publickey. And even if we are using the correct password, permission is denied.&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;List of valid shells&lt;/h3&gt;
Let's restart the daemon, but now not forking to the background and logging to the &lt;i&gt;stderr&lt;/i&gt; rather that &lt;i&gt;syslog&lt;/i&gt;:
&lt;pre class="code"&gt;
box# dropbear -E -F
[4456] Nov 30 23:59:30 Not backgrounding
[4462] Nov 30 23:59:56 Child connection from 192.168.1.103:49013
[4462] Dec 01 00:00:08 user 'root' has invalid shell, rejected
&lt;/pre&gt;
Ok, there is something wrong with the shell settings, let's investigate that:
&lt;pre class="code"&gt;
box# cat /var/config/passwd
root: ... :0:0:root:/mnt/C/sys/root:&lt;b&gt;/mnt/C/sys/bin/bash&lt;/b&gt;
...
box# ls /mnt/C/sys/bin/bash
/mnt/C/sys/bin/bash
&lt;/pre&gt;
User &lt;i&gt;root&lt;/i&gt; has &lt;i&gt;/mnt/C/sys/bin/bash&lt;/i&gt; in his settings, the file exists and is at correct place. Let's look at the list of valid shells:
&lt;pre class="code"&gt;
box# cat /etc/shells
/bin/sh
/sbin/nologin
/bin/nologin
/bin/ash
/sbin/ash
/bin/false
/sbin/false
&lt;b&gt;/mnt/C/sys/bash&lt;/b&gt;
/bin/bash
&lt;b&gt;/usr/bin/bash&lt;/b&gt;
&lt;/pre&gt;
The path &lt;i&gt;/mnt/C/sys/bash&lt;/i&gt; is wrong since the &lt;i&gt;bash&lt;/i&gt; executable is in &lt;i&gt;/mnt/C/sys/&lt;b&gt;bin&lt;/b&gt;&lt;/i&gt; directory, but the &lt;i&gt;/usr/bin/bash&lt;/i&gt; path should be ok, since the &lt;i&gt;/usr/bin&lt;/i&gt; is just a symlink to &lt;i&gt;/mnt/C/sys/bin&lt;/i&gt;:
&lt;pre class="code"&gt;
box# ls -l /usr/bin
lrwxrwxrwx    1 root     root           14 May 21  2008 /usr/bin -&gt; /mnt/C/sys/bin
&lt;/pre&gt;
We have to look at the problem in more detail. Since there is no verbose mode available in dropbear by default, we can enable it in code (I got the inspiration from &lt;a href="http://mlblog.osdir.com/network.ssh.dropbear/2004-09/index.shtml"&gt;this post&lt;/a&gt;):
&lt;pre class="code"&gt;
dev# nano debug.h
    &lt;i&gt;uncomment:
        #define DEBUG_TRACE&lt;/i&gt;
&lt;/pre&gt;
Now when we rebuilt and re-deployed the dropbear, we can run in in verbose mode:
&lt;pre class="code"&gt;
box# dropbear -v -E -F 
...
TRACE (4848): shell is /mnt/C/sys/bin/bash
TRACE (4848): test shell is '/bin/sh'
TRACE (4848): test shell is '/sbin/nologin'
TRACE (4848): test shell is '/bin/nologin'
TRACE (4848): test shell is '/bin/ash'
TRACE (4848): test shell is '/sbin/ash'
TRACE (4848): test shell is '/bin/false'
TRACE (4848): test shell is '/sbin/false'
TRACE (4848): test shell is '/mnt/C/sys/bash'
TRACE (4848): test shell is '/bin/bash'
TRACE (4848): test shell is '/usr/bin/bash'
&lt;/pre&gt;
As can be seen in the &lt;a 

href="http://dropbear.sourcearchive.com/documentation/0.52/svr-auth_8c-source.html"&gt;svr-auth.c source 

code&lt;/a&gt;:
&lt;pre class="code"&gt;
00273       while ((listshell = getusershell()) != NULL) {
00274             TRACE(("test shell is '%s'", listshell))
00275             if (&lt;b&gt;strcmp(listshell, usershell) == 0&lt;/b&gt;) {
00276                   /* have a match */
00277                   goto goodshell;
00278             }
00279       }
&lt;/pre&gt;
... the shell path is compared as plain strings and so &lt;i&gt;/usr/bin/bash&lt;/i&gt; and &lt;i&gt;/mnt/C/sys/bin/bash&lt;/i&gt; are two different things.&lt;br/&gt;
&lt;br/&gt;
Since the &lt;i&gt;/etc/shells&lt;/i&gt; file is placed on read-only file system we have to make a change in &lt;i&gt;/var/config/passwd&lt;/i&gt; file:
&lt;pre class="code"&gt;
box# sed -i 's|/mnt/C/sys/bin/|/usr/bin/|g' /var/config/passwd
&lt;/pre&gt;
Since it is overwritten on every boot, we have to make the correction in our &lt;i&gt;rc.cfg&lt;/i&gt; file, to make it permanent:
&lt;pre class="code"&gt;
nano /mnt/C/sys/etc/rc.d/rc.cfg
  &lt;i&gt; add the following line:
    sed -i 's|/mnt/C/sys/bin/|/usr/bin/|g' /var/config/passwd &lt;/i&gt;
&lt;/pre&gt;
Now when we try to connect again, we can see that the problem is solved:
&lt;pre class="code"&gt;
[394] Dec 01 01:32:25 pubkey auth succeeded for 'root' with key md5 

3a:...:05 from 192.168.1.103:44521
&lt;/pre&gt;
&lt;h3&gt;Read only file system&lt;/h3&gt;
There is another problem:
&lt;pre class="code"&gt;
[394] Dec 01 01:32:25 chown(/dev/ttyp2, 0, 0) failed: Read-only file system
[394] Dec 01 01:32:26 exit after auth (root): chmod(/dev/ttyp2, 0622) failed: Read-only file system
&lt;/pre&gt;
The problem seems to be in the file &lt;a href="http://dropbear.sourcearchive.com/documentation/0.52/sshpty_8c-source.html"&gt;sshpty.c&lt;/a&gt; in function &lt;i&gt;pty_setowner&lt;/i&gt; but I am not sure what exactly is wrong. We can try to debug it remotely in order to find out what is going on. One option in &lt;i&gt;debug.h&lt;/i&gt; can be handy - we can disable the forking the sub-processes - then there is just one dropbear process to attach.
&lt;pre class="code"&gt;
/* To debug with GDB it is easier to run with no forking of child processes.
   You will need to pass "-F" as well. */
/* #define DEBUG_NOFORK */
&lt;/pre&gt;
Let's rebuild it with debug info:
&lt;pre class="code"&gt;
dev# nano Makefile
...
CFLAGS=-I. -I$(srcdir) -I$(srcdir)/libtomcrypt/src/headers/ $(CPPFLAGS) -I/mnt/C/sys/include 

-I/mnt/C/sys/X11/include &lt;b&gt;-g&lt;/b&gt;
...
&lt;/pre&gt;
Rebuild and redeploy the &lt;i&gt;dropbear&lt;/i&gt; binary.&lt;br/&gt;
&lt;br/&gt;
Now we can run the dropbear process on the box:
&lt;pre class="code"&gt;
box# dropbear -E -F
box# [4498] Dec 21 23:50:01 Running in background
...
&lt;/pre&gt;
On another console connected to the box we start the gdbserver:
&lt;pre class="code"&gt;
box# gdbserver colinux:2345 --attach 4498
Attached; pid = 4498
Listening on port 2345
...
&lt;/pre&gt;
Now on the mirror system we can start the gdb:
&lt;pre class="code"&gt;
dev# gdb dropbear
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux-uclibc"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) target remote 192.168.1.104:2345
Remote debugging using 192.168.1.104:2345
0x0806d7ad in fast_s_mp_sqr (a=0xbfffe348, b=0xbfffe348) at bn_fast_s_mp_sqr.c:73
73               _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--);
(gdb) break pty_setowner
Breakpoint 1 at 0x805bfcc: file sshpty.c, line 364.
(gdb) cont
Continuing.
&lt;/pre&gt;
Now we are ready to connect over ssh:
&lt;pre class="code"&gt;
dev# ssh root@storage
root@storage's password:
&lt;/pre&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU_zXQdDZOI/AAAAAAAACZg/P9aWEPHzhP0/s1600-h/remote-debugging.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 311px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU_zXQdDZOI/AAAAAAAACZg/P9aWEPHzhP0/s400/remote-debugging.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5282708468808246498" /&gt;&lt;/a&gt;
... and debugger stops on the breakpoint:
&lt;pre class="code"&gt;
Breakpoint 1, pty_setowner (pw=0x80dd480, tty_name=0x80e1578 "/dev/ttyp3") at sshpty.c:364
364             grp = getgrnam("tty");
(gdb) step
365             if (grp) {
(gdb) step
369                     gid = pw-&gt;pw_gid;
(gdb) step
370                     mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH;
(gdb) step
378             if (stat(tty_name, &amp;st)) {
(gdb) step
382             dropbear_log(LOG_ERR, "stat: %u", (unsigned int)st.st_uid );
(gdb) print st
$1 = {st_dev = 7936, __pad1 = 45352, __st_ino = 363, st_mode = 8630, st_nlink = 1, st_uid = 0, st_gid = 5,
  st_rdev = 771, __pad2 = 0, st_size = 0, st_blksize = 4096, st_blocks = 0, st_atime = 1206970720,
  st_atimensec = 134760895, st_mtime = 1206970720, st_mtimensec = 134691188, st_ctime = 1206970720,
  st_ctimensec = 135124096, st_ino = 363}
(gdb) print tty_name
$2 = 0x80e1578 "/dev/ttyp3"
(gdb) next
383             if (st.st_uid != pw-&gt;pw_uid || st.st_gid != gid) {
(gdb) print *pw
$3 = {pw_name = 0x80dd380 "root", pw_passwd = 0x80dd385 "...", pw_uid = 0, pw_gid = 0, pw_gecos = 

0x80dd3a4 "root", pw_dir = 0x80dd3a9 "/mnt/C/sys/root", pw_shell = 0x80dd3b9 "/usr/bin/bash"}
...
(gdb) step
401 if ((st.st_mode &amp; (S_IRWXU|S_IRWXG|S_IRWXO)) != mode) {
(gdb) print /o st.st_mode
$4 = &lt;b&gt;020666&lt;/b&gt;
(gdb) step
402                     if (chmod(tty_name, mode) &lt; 0) {
(gdb) step
403                             if (errno == EROFS &amp;&amp;
(gdb) step
409                                     dropbear_exit("chmod(%.100s, 0%o) failed: %.100s",
&lt;/pre&gt;
Ok, we have analyzed the situation. The &lt;i&gt;pty_setowner&lt;/i&gt; function is trying to initialize the device file representing the terminal we are trying to connect to. Device file is on read only file system and so the attribute changes do not succeed.&lt;/br&gt;
&lt;/br&gt;
If changing the tty owner does not succeed, the code at (1) activates more relaxed mode in case the file system is read only and tty is owned by root or the uids match. In our case the relaxed mode is activated and the server just writes the warning &lt;i&gt;chown(/dev/ttyp2, 0, 0) failed: Read-only file system&lt;/i&gt; and continues.&lt;br/&gt;
&lt;br/&gt;
Then there is code changing &lt;i&gt;tty&lt;/i&gt; read mode. This code tries to prevent unauthorized users from reading &lt;i&gt;tty&lt;/i&gt; content. In order to get just a warning, the reading by group and reading by others must be prohibited. In our case the &lt;i&gt;st.st_mode&lt;/i&gt; is 020666 (read/write by everyone) and so we get the error &lt;i&gt;chmod(/dev/ttyp2, 0622) failed: Read-only file system.&lt;/i&gt;&lt;br/&gt;
&lt;br/&gt;

&lt;pre class="code"&gt;
 /*
  * Change owner and mode of the tty as required.
  * Warn but continue if filesystem is read-only and the uids match/
  * tty is owned by root.
  */
 if (stat(tty_name, &amp;st)) {
  dropbear_exit("pty_setowner: stat(%.101s) failed: %.100s",
    tty_name, strerror(errno));
 }

 if (st.st_uid != pw-&gt;pw_uid || st.st_gid != gid) {
  if (chown(tty_name, pw-&gt;pw_uid, gid) &lt; 0) {
   if (errno == EROFS &amp;&amp;
       (st.st_uid == pw-&gt;pw_uid || st.st_uid == 0)) {
&lt;b&gt;(1)&lt;/b&gt;    dropbear_log(LOG_ERR,
     "chown(%.100s, %u, %u) failed: %.100s",
      tty_name, (unsigned int)pw-&gt;pw_uid, (unsigned int)gid,
      strerror(errno));
   } else {
    dropbear_exit("chown(%.100s, %u, %u) failed: %.100s",
        tty_name, (unsigned int)pw-&gt;pw_uid, (unsigned int)gid,
        strerror(errno));
   }
  }
 }

 if ((st.st_mode &amp; (S_IRWXU|S_IRWXG|S_IRWXO)) != mode) {

  if (chmod(tty_name, mode) &lt; 0) {
   if (errno == EROFS &amp;&amp;
&lt;b&gt;(2)&lt;/b&gt;       (st.st_mode &amp; (S_IRGRP | S_IROTH)) == 0) {
    dropbear_log(LOG_ERR,
     "chmod(%.100s, 0%o) failed: %.100s",
     tty_name, mode, strerror(errno));
   } else {
    &lt;b&gt;dropbear_exit&lt;/b&gt;("chmod(%.100s, 0%o) failed: %.100s",
        tty_name, mode, strerror(errno));
   }
  }
 }
&lt;/pre&gt;
Some discussions (for example &lt;a href="http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/2007q2/000582.html"&gt;here&lt;/a&gt; and &lt;a href="http://osdir.com/ml/network.ssh.dropbear/2006-03/msg00014.html"&gt;here&lt;/a&gt;) recommended to configure build in order to disable &lt;i&gt;openpty&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# make STATIC=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" clean
dev# ./configure --prefix /mnt/C/sys --disable-zlib &lt;b&gt;--disable-openpty&lt;/b&gt; STATIC=1 
dev# make STATIC=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
dev# make STATIC=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
&lt;/pre&gt;
But it did not help in this case.&lt;br/&gt;
&lt;br/&gt;
Nowadays I do not know a better workaround in order to make it work than change the &lt;i&gt;dropbear_exit&lt;/i&gt; to &lt;i&gt;dropbear_log&lt;/i&gt;. I have found a &lt;a href="http://mlblog.osdir.com/network.ssh.dropbear/2004-09/msg00009.shtml"&gt;discussion about this&lt;/a&gt; on Web and the following rationale seems reasonable:
&lt;blockquote&gt;&lt;i&gt;
Ah. If it's a single user system, the easiest solution might just be to disable the chown() and chmod() call - it's not like there're any other users who might be sniffing :)&lt;br/&gt; 
(sshpty.c is where you'll find those chown/chmods). 
&lt;/i&gt;&lt;/blockquote&gt;
... but be careful, you were warned ;-)
&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Minor issues&lt;/h3&gt;
There were also two another problems (just warnings). The first was wtmp problem:
&lt;pre class="code"&gt;
[2398] Dec 01 12:13:04 wtmp_write: problem writing /var/log/wtmp: No such file or directory
&lt;/pre&gt;
It was solved by adding the &lt;i&gt;--disable-wtmp&lt;/i&gt; to the configure command line.&lt;br/&gt;
&lt;br/&gt;
The second was logging problem:
&lt;pre class="code"&gt;
dev# ssh root@storage
root@storage's password:
[2719] Dec 01 13:25:53 lastlog_perform_login: Couldn't stat /var/log/lastlog: No such file or directory
[2719] Dec 01 13:25:53 lastlog_openseek: /var/log/lastlog is not a file or directory!

  [    FW 4.00b4.C009-M[NG]    ]
  [ http://mgb111.pradnik.net/ ]
&lt;/pre&gt;
We are not alone on this (see &lt;a href="http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/2008q1/000702.html"&gt;this post&lt;/a&gt; or &lt;a href="https://dev.openwrt.org/ticket/2952"&gt;OpenWrt ticket&lt;/a&gt;, also &lt;a href="http://dealdatabase.com/forum/archive/index.php/t-48083.html"&gt;this archive&lt;/a&gt; served as a source of information).&lt;br/&gt;
&lt;br/&gt;
It was solved by adding the &lt;i&gt;--disable-lastlog&lt;/i&gt; to the configure command line.&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Final build&lt;/h3&gt;
As a result we have the following configure command line:
&lt;pre class="code"&gt;
dev# ./configure --prefix /mnt/C/sys --disable-zlib --disable-openpty &lt;b&gt;--disable-wtmp --disable-lastlog&lt;/b&gt;
&lt;/pre&gt;
Now we can modify the &lt;i&gt;Makefile&lt;/i&gt; in order to generate code optimized for size:
&lt;pre class="code"&gt;
dev# nano Makefile
...
CFLAGS=-I. -I$(srcdir) -I$(srcdir)/libtomcrypt/src/headers/ $(CPPFLAGS) -I/mnt/C/sys/include -I/mnt/C/sys/X11/include &lt;b&gt;-Os&lt;/b&gt;
&lt;/pre&gt;
If we want to create multi-application instead of individual applications, we can use &lt;i&gt;MULTI&lt;/i&gt; variable on the &lt;i&gt;make&lt;/i&gt; command line:
&lt;pre class="code"&gt;
dev# make STATIC=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" clean
dev# make STATIC=1 &lt;b&gt;MULTI=1&lt;/b&gt; PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
&lt;/pre&gt;
We can strip the sources to spare some space:
&lt;pre class="code"&gt;
dev# make STATIC=1 MULTI=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" &lt;b&gt;strip&lt;/b&gt;
&lt;/pre&gt;
And are ready to install and create the package:
&lt;pre class="code"&gt;
dev# make STATIC=1 MULTI=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
dev# cd /mnt/C
dev# ./filopack.sh --pack dropbear-0.52
&lt;/pre&gt;
&lt;h3&gt;Test&lt;/h3&gt;
Start the dropbear server (logging to strerr, not forking to background):
&lt;pre class="code"&gt;
box# dropbear -E -F
[902] Dec 22 02:14:49 Not backgrounding
&lt;/pre&gt;
This is output when I was connecting from a machine without a registered public key:
&lt;pre class="code"&gt;
[906] Dec 22 02:14:52 Child connection from 192.168.1.102:44241
[906] Dec 22 02:15:02 password auth succeeded for 'root' from 192.168.1.102:44241
[906] Dec 22 02:15:02 chown(/dev/ttyp3, 0, 0) failed: Read-only file system
[906] Dec 22 02:15:02 &lt;b&gt;!!! Filodej is warning you. Be sure you are the only user !!!&lt;/b&gt;
[906] Dec 22 02:15:02 chmod(/dev/ttyp3, 0622) failed: Read-only file system
[906] Dec 22 02:15:47 chown /dev/ttyp3 0 0 failed: Read-only file system
[906] Dec 22 02:15:47 chmod /dev/ttyp3 0666 failed: Read-only file system
[906] Dec 22 02:15:47 exit after auth (root): Exited normally
&lt;/pre&gt;
This is output when I was connecting from a machine with registered public key:
&lt;pre class="code"&gt;
[913] Dec 22 02:15:59 Child connection from 192.168.1.102:44242
[913] Dec 22 02:16:06 pubkey auth succeeded for 'root' with key md5 f1:...:3b from 192.168.1.102:44242
[913] Dec 22 02:16:06 chown(/dev/ttyp3, 0, 0) failed: Read-only file system
[913] Dec 22 02:16:06 &lt;b&gt;!!! Filodej is warning you. Be sure you are the only user !!!&lt;/b&gt;
[913] Dec 22 02:16:06 chmod(/dev/ttyp3, 0622) failed: Read-only file system
[913] Dec 22 02:16:21 chown /dev/ttyp3 0 0 failed: Read-only file system
[913] Dec 22 02:16:21 chmod /dev/ttyp3 0666 failed: Read-only file system
[913] Dec 22 02:16:21 exit after auth (root): Exited normally
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-2587375051217033605?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/2587375051217033605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=2587375051217033605' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/2587375051217033605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/2587375051217033605'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/11/wmu-6500fs-dropbear-052.html' title='WMU-6500FS - dropbear-0.52'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU_zXQdDZOI/AAAAAAAACZg/P9aWEPHzhP0/s72-c/remote-debugging.png' height='72' width='72'/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-6341520901231233295</id><published>2008-12-20T22:30:00.022+01:00</published><updated>2009-01-08T10:09:04.062+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - xterm 237</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SU1tG8NItXI/AAAAAAAACZI/Ut0ouBmr9v4/s1600-h/xterm-htop.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SU1tG8NItXI/AAAAAAAACZI/Ut0ouBmr9v4/s400/xterm-htop.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5281997903983326578" /&gt;&lt;/a&gt;

&lt;b&gt;GUI dependencies:&lt;/b&gt;
&lt;a href="http://filodej.ic.cz/filopack/x11-7.1.tar.bz2"&gt;[X.Org]&lt;/a&gt;

&lt;h3&gt;Build result&lt;/h3&gt;
&lt;a href="http://filodej.ic.cz/filopack/xterm-237.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/xterm-237.lst"&gt;[file list]&lt;/a&gt;
&lt;br/&gt;

&lt;h3&gt;Installation&lt;/h3&gt;
&lt;pre class="code"&gt;
box# &lt;b&gt;cd /mnt/C&lt;/b&gt;
box# &lt;b&gt;./filopack.sh --download xterm-237&lt;/b&gt;
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package xterm-237 from http://filodej.ic.cz ...
connected!

Length: 502 [text/plain]
connected!

Length: 177,869 [application/x-tar]
box# &lt;b&gt;./filopack.sh --install xterm-237&lt;/b&gt;
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack xterm-237 locally at /mnt/C (y/n)?y
sys/X11/share/pixmaps/xterm-color_32x32.xpm
sys/X11/share/pixmaps/xterm-color_48x48.xpm
sys/X11/share/pixmaps/xterm_32x32.xpm
sys/X11/share/pixmaps/xterm_48x48.xpm
sys/X11/man/man1/xterm.1
sys/X11/man/man1/resize.1
sys/X11/man/man1/uxterm.1
sys/X11/man/man1/koi8rxterm.1
sys/X11/lib/X11/app-defaults/XTerm
sys/X11/lib/X11/app-defaults/XTerm-color
sys/X11/lib/X11/app-defaults/UXTerm
sys/X11/lib/X11/app-defaults/KOI8RXTerm
sys/X11/bin/xterm
sys/X11/bin/resize
sys/X11/bin/uxterm
sys/X11/bin/koi8rxterm
box# &lt;b&gt;xterm&lt;/b&gt;
&lt;/pre&gt;
&lt;br/&gt;
&lt;a name="env-config"&gt;&lt;/a&gt;
Make sure you have the environment variables set properly (you can make it permanent e.g. by editing the &lt;i&gt;/mnt/C/sys/etc/profile&lt;/i&gt;; for details see the &lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-box-with-jokers-fw.html#x-config"&gt;X Configuration&lt;/a&gt; post):
&lt;br/&gt;
&lt;br/&gt;
&lt;i&gt;PATH&lt;/i&gt; variable can possibly contain the &lt;i&gt;/mnt/C/sys/X11/bin/&lt;/i&gt; path:
&lt;pre class="code"&gt;
box# export PATH=$PATH:/mnt/C/sys/X11/bin/
&lt;/pre&gt;
&lt;i&gt;LD_LIBRARY_PATH&lt;/i&gt; must (among others) contain the &lt;i&gt;/mnt/C/sys/X11/lib&lt;/i&gt; path:
&lt;pre class="code"&gt;
box# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/C/sys/X11/lib/
&lt;/pre&gt;
&lt;i&gt;DISPLAY&lt;/i&gt; environment variable properly set to a display of a machine running xserver:
&lt;pre class="code"&gt;
box# export DISPLAY=&amp;lt;machine&amp;gt;:&amp;lt;display-number&amp;gt;
&lt;/pre&gt;
... or in case you are using &lt;a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/"&gt;putty&lt;/a&gt;, X11 forwarding enabled:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SU1z-cIbY3I/AAAAAAAACZQ/VQNzC3vtbjM/s1600-h/putty-x11-forwarding.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 388px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SU1z-cIbY3I/AAAAAAAACZQ/VQNzC3vtbjM/s400/putty-x11-forwarding.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5282005454516085618" /&gt;&lt;/a&gt;

&lt;span class="fullpost"&gt;
&lt;h3&gt;Build procedure&lt;/h3&gt;
First we have to initialize the package timestamp.
&lt;pre class="code"&gt;
dev# cd /mnt/C
dev# ./filopack.sh --init xterm-237 
Configuration file .filopack/.config file found and used
Timestamp written to file .filopack/xterm-237.ts
&lt;/pre&gt;
Now we can download and extract the source.
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="ftp://invisible-island.net/xterm/xterm-237.tgz"&gt;ftp://invisible-island.net/xterm/xterm-237.tgz&lt;/a&gt;
...
Length: 860,424 (unauthoritative)

100%[==========================================================&gt;] 860,424       14.59K/s    ETA 00:00

14:18:14 (17.14 KB/s) - `xterm-237.tgz' saved [860424]

dev# tar xzvf xterm-237.tgz 
...
dev# cd xterm-237
&lt;/pre&gt;
We configure the build in order to have access to XOrg header files and libraries:
&lt;pre class="code"&gt;
dev#  ./configure --x-includes=/mnt/C/sys/X11/include/ --x-libraries=/mnt/C/sys/X11/lib/ --prefix=/mnt/C/sys/X11
...
&lt;/pre&gt;
... and make and install the source:
&lt;pre class="code"&gt;
dev# make
...
dev# make install
...
&lt;/pre&gt;
We can test the installation:
&lt;pre class="code"&gt;
dev# /mnt/C/sys/X11/bin/xterm
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
/mnt/C/sys/X11/bin/xterm Xt error: Can't open display: %s
/mnt/C/sys/X11/bin/xterm:  DISPLAY is not set
&lt;/pre&gt;
Oops, I forgot to set the display variable on the mirror machine. Let's do it now (note that the IP address 192.168.2.1 is specific to my network configuration):
&lt;pre class="code"&gt;
dev# export DISPLAY=192.168.2.1:0
dev# /mnt/C/sys/X11/bin/xterm
xterm: Error 18, errno 2: No such file or directory
Reason: spawn: open() failed on ptsname
&lt;/pre&gt;
It seems there is still some error. Let's investigate it with &lt;i&gt;strace&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# strace -f /mnt/C/sys/X11/bin/xterm 2&amp;gt; strace.txt

&amp;lt;Ctrl-C&amp;gt;

dev# tail -n 120 strace.txt
[pid  8119] close(8 &amp;lt;unfinished ...&amp;gt;
[pid  8120] &amp;lt;... setsid resumed&amp;gt; )      = 8120
[pid  8119] &amp;lt;... close resumed&amp;gt; )       = 0
[pid  8120] setpgid(0, 0 &amp;lt;unfinished ...&amp;gt;
[pid  8119] close(5 &amp;lt;unfinished ...&amp;gt;
[pid  8120] &amp;lt;... setpgid resumed&amp;gt; )     = -1 EPERM (Operation not permitted)
[pid  8119] &amp;lt;... close resumed&amp;gt; )       = 0
[pid  8120] ioctl(4, TIOCSPTLCK &amp;lt;unfinished ...&amp;gt;
[pid  8119] read(7,  &amp;lt;unfinished ...&amp;gt;
[pid  8120] &amp;lt;... ioctl resumed&amp;gt; , [0])  = 0
[pid  8120] ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
[pid  8120] ioctl(4, TIOCGPTN, [2])     = 0
[pid  8120] open(&lt;b&gt;"/dev/pts/2"&lt;/b&gt;, O_RDWR)  = -1 ENOENT (No such file or directory)
[pid  8120] write(2, "xterm", 5xterm)        = 5
[pid  8120] write(2, ": Error ", 8: Error )     = 8
[pid  8120] write(2, "18", 218)           = 2
[pid  8120] write(2, ", errno ", 8, errno )     = 8
[pid  8120] write(2, "2", 12)            = 1
[pid  8120] write(2, ": ", 2: )           = 2
[pid  8120] write(2, "No such file or directory", 25No such file or directory) = 25
[pid  8120] write(2, "\n", 1
)           = 1
[pid  8120] write(2, "Reason: ", 8Reason: )     = 8
[pid  8120] write(2, "&lt;b&gt;spawn: open() failed on ptsname&lt;/b&gt;", 31spawn: open() failed on ptsname) = 31
[pid  8120] write(2, "\n", 1
)           = 1
[pid  8120] ioctl(4, TCFLSH, 0x1)       = 0
[pid  8120] chown("/dev/pts/2", 0, 0)   = -1 ENOENT (No such file or directory)
[pid  8120] chmod("/dev/pts/2", 0666)   = -1 ENOENT (No such file or directory)
[pid  8120] close(4)                    = 0
[pid  8120] munmap(0xb7c10000, 33608)   = 0
[pid  8120] munmap(0xb7c0b000, 17560)   = 0
[pid  8120] _exit(18)                   = ?
Process 8120 detached
&amp;lt;... read resumed&gt; "", 1048)            = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
...
&lt;/pre&gt;
xterm is unable to open the pseudo terminal device, it should be OK when deployed to the box (there is no full device mapping on my mirror system; it is just chroot-ed to some sub-directory of hosting system).
&lt;br/&gt;
&lt;br/&gt;
Let's create the package:
&lt;pre class="code"&gt;
dev# ./filopack.sh --pack xterm-237
Configuration file .filopack/.config file found and used
-rw-r--r-- root/root      1381 2008-12-20 14:27:33 sys/X11/share/pixmaps/xterm-color_32x32.xpm
-rw-r--r-- root/root      2710 2008-12-20 14:27:33 sys/X11/share/pixmaps/xterm-color_48x48.xpm
-rw-r--r-- root/root      2110 2008-12-20 14:27:33 sys/X11/share/pixmaps/xterm_32x32.xpm
-rw-r--r-- root/root      2586 2008-12-20 14:27:33 sys/X11/share/pixmaps/xterm_48x48.xpm
-rw-r--r-- root/root    174641 2008-12-20 14:27:32 sys/X11/man/man1/xterm.1
-rw-r--r-- root/root      2678 2008-12-20 14:27:33 sys/X11/man/man1/resize.1
-rw-r--r-- root/root      2967 2008-12-20 14:27:33 sys/X11/man/man1/uxterm.1
-rw-r--r-- root/root      3188 2008-12-20 14:27:33 sys/X11/man/man1/koi8rxterm.1
-rw-r--r-- root/root      6853 2008-12-20 14:27:33 sys/X11/lib/X11/app-defaults/XTerm
-rw-r--r-- root/root      4324 2008-12-20 14:27:33 sys/X11/lib/X11/app-defaults/XTerm-color
-rw-r--r-- root/root      2109 2008-12-20 14:27:33 sys/X11/lib/X11/app-defaults/UXTerm
-rw-r--r-- root/root       747 2008-12-20 14:27:33 sys/X11/lib/X11/app-defaults/KOI8RXTerm
-rwxr-xr-x root/root    334759 2008-12-20 14:27:32 sys/X11/bin/xterm
-rwxr-xr-x root/root     11157 2008-12-20 14:27:32 sys/X11/bin/resize
-rwxr-xr-x root/root      2088 2008-12-20 14:27:32 sys/X11/bin/uxterm
-rwxr-xr-x root/root      2163 2008-12-20 14:27:32 sys/X11/bin/koi8rxterm
&lt;/pre&gt;
... and deploy the package to the box:
&lt;pre class="code"&gt;
dev# ./filopack.sh --upload xterm-237
Configuration file .filopack/.config file found and used
Sure to upload xterm-237 to root@storage:/mnt/C (y/n)?y
root@storage's password:
root@storage's password:
&lt;/pre&gt;
Now on the box, we can install it:
&lt;pre class="code"&gt;
box# [root@storage C]# ./filopack.sh --install xterm-237
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Module xterm-237 not found in package list - use 'tar.bz2' extension
Sure to unpack xterm-237 locally at /mnt/C (y/n)?y
sys/X11/share/pixmaps/xterm-color_32x32.xpm
sys/X11/share/pixmaps/xterm-color_48x48.xpm
sys/X11/share/pixmaps/xterm_32x32.xpm
sys/X11/share/pixmaps/xterm_48x48.xpm
sys/X11/man/man1/xterm.1
sys/X11/man/man1/resize.1
sys/X11/man/man1/uxterm.1
sys/X11/man/man1/koi8rxterm.1
sys/X11/lib/X11/app-defaults/XTerm
sys/X11/lib/X11/app-defaults/XTerm-color
sys/X11/lib/X11/app-defaults/UXTerm
sys/X11/lib/X11/app-defaults/KOI8RXTerm
sys/X11/bin/xterm
sys/X11/bin/resize
sys/X11/bin/uxterm
sys/X11/bin/koi8rxterm
&lt;/pre&gt;
And test the installation:
&lt;pre class="code"&gt;
box# xterm
Cannot chown /dev/ttyp4 to 0,0: Read-only file system
Cannot chmod /dev/ttyp4 to 620 currently 666: Read-only file system
Cannot chown /dev/ttyp4 to 0,0: Read-only file system
&lt;/pre&gt;
The problem here is that xterm is trying to change the rights for the terminal device it is using (&lt;i&gt;/dev/ttyp4&lt;/i&gt; in this case) in order to prevent a read access of an unauthorized person (octal value &lt;i&gt;620&lt;/i&gt; means that only root can read and write the terminal and users from the same group can just write). 
However, since the file system is read-only the &lt;i&gt;chmod&lt;/i&gt; operation does not succeed and so the terminal device stays readable for everyone. 
&lt;br/&gt;
I was dealing with the same issue during the &lt;a href="http://filodej.blogspot.com/2008/11/wmu-6500fs-dropbear-052.html"&gt;dropbear build&lt;/a&gt;.
&lt;br/&gt;
&lt;br/&gt;
Anyway, in case you are using the box on a trusted network with no one "sniffing around" and have it properly secured from the outside world then the warning should not mean any harm. Maybe it could be solved by a change in configuration (or by a slight change in source code), but I am not going to solve it now.
&lt;br/&gt;
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU1tG0tPC3I/AAAAAAAACZA/u036CfT8oIs/s1600-h/xterm-237.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU1tG0tPC3I/AAAAAAAACZA/u036CfT8oIs/s400/xterm-237.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5281997901970475890" /&gt;&lt;/a&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-6341520901231233295?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/6341520901231233295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=6341520901231233295' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/6341520901231233295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/6341520901231233295'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/12/wmu-6500fs-xterm-237.html' title='WMU-6500FS - xterm 237'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_xFBIBcRhwFQ/SU1tG8NItXI/AAAAAAAACZI/Ut0ouBmr9v4/s72-c/xterm-htop.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-3055464703673033209</id><published>2008-12-08T17:59:00.007+01:00</published><updated>2008-12-22T21:04:55.162+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - built sw -Python 2.5.2</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU12KUlB32I/AAAAAAAACZY/_Jqr7IbtEgA/s1600-h/python-252.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 252px;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU12KUlB32I/AAAAAAAACZY/_Jqr7IbtEgA/s400/python-252.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5282007857670250338" /&gt;&lt;/a&gt;

&lt;a href="http://www.python.org"&gt;[Homepage]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/python-2.5.2.lst"&gt;[files]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/python-2.5.2.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
First I briefly write about the initial build: 
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://python.org/ftp/python/2.5.2/Python-2.5.2.tgz"&gt;http://python.org/ftp/python/2.5.2/Python-2.5.2.tgz&lt;/a&gt;
dev# tar xvzf Python-2.5.2.tgz
dev# cd Python-2.5.2
dev# ./configure --prefix=/mnt/C/sys --enable-shared
dev# make
&lt;/pre&gt;
There was an error with missing &lt;i&gt;'yperr_string'&lt;/i&gt; symbol (I am not sure whether it was during the build or when I launched python console). The symbol was needed by the &lt;i&gt;nis&lt;/i&gt; extension module. I do not know how on earth I would utilize an &lt;a href="http://www.python.org/doc/2.5.2/lib/module-nis.html"&gt;Interface to Sun's NIS (Yellow pages)&lt;/a&gt; so as a workaround I simply disabled it.  
&lt;pre class="code"&gt;
dev# make
dev# make install
dev# python
&lt;/pre&gt;
Another failure - error while loading shared libraries: &lt;i&gt;libpython2.5.so.1.0&lt;/i&gt; (it is located in &lt;i&gt;/mnt/C/sys/lib&lt;/i&gt;).
&lt;br/&gt;
As a solution, if there was a dynamic loader configuration on the box (&lt;i&gt;/etc/ld.so.conf.d&lt;/i&gt;) we could do following:
&lt;pre class="code"&gt;
dev# echo /usr/local/lib &gt; /etc/ld.so.conf.d/python2.5.conf
dev# ldconfig
&lt;/pre&gt;
As there is not, we can use the &lt;i&gt;LD_LIBRARY_PATH&lt;/i&gt; variable instead:
&lt;pre class="code"&gt;
dev# nano /mnt/C/sys/etc/rc-local
&lt;i&gt;Add following:&lt;/i&gt;
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/C/sys/lib
&lt;/pre&gt;
Now everything works ok.
&lt;br/&gt;
&lt;br/&gt;
After some time I realized that there is a &lt;i&gt;readline&lt;/i&gt; extension module missing on the system. This module is needed for interactive console applications, and particularly is needed for the deluge console:
&lt;pre class="code"&gt;
box# deluge --ui=null
[INFO    ] 21:58:04 main:93 Deluge ui 1.0.5
[DEBUG   ] 21:58:04 main:94 options: {'config': None, 'logfile': None, 'ui': 'null'}
[DEBUG   ] 21:58:04 main:95 args: []
[DEBUG   ] 21:58:05 configmanager:44 ConfigManager started..
[INFO    ] 21:58:05 main:98 Starting ui..
[DEBUG   ] 21:58:05 ui:44 UI init..
[DEBUG   ] 21:58:05 configmanager:88 Getting config 'ui.conf'
[DEBUG   ] 21:58:05 config:47 Config created with filename: ui.conf
[DEBUG   ] 21:58:05 config:48 Config defaults: {'default_ui': 'gtk'}
[INFO    ] 21:58:05 ui:68 Starting NullUI..
[DEBUG   ] 21:58:06 client:54 CoreProxy init..
Traceback (most recent call last):
  File "/usr/bin/deluge", line 8, in &amp;lt;module&amp;gt;
    load_entry_point('deluge==1.0.5', 'console_scripts', 'deluge')()
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/main.py", line 99, in start_ui
    UI(options, args)
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/ui/ui.py", line 69, in __init__
    from deluge.ui.null.deluge_shell import NullUI
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/ui/null/deluge_shell.py", line 29, in &amp;lt;module&amp;gt;
    import readline
ImportError: No module named readline
&lt;/pre&gt;
We can replicate this problem directly from the python console:
&lt;pre class="code"&gt;
dev# python
Python 2.5.2 (r252:60911, May  3 2008, 16:19:27)
[GCC 3.3.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import readline
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
ImportError: No module named readline
&amp;gt;&amp;gt;&amp;gt;
&lt;/pre&gt;
So let's look at the old log of python's configure script to see why the &lt;i&gt;readline&lt;/i&gt; extension package was not built:
&lt;pre class="code"&gt;
dev# cat config.log | grep readline
configure:20980: checking for readline in -lreadline
configure:21015: gcc -pthread -o conftest -g -O2   conftest.c -lreadline  -lpthread -ldl  -lutil &amp;gt;&amp;5
/usr/bin/ld: &lt;b&gt;cannot find -lreadline&lt;/b&gt;
| char readline ();
| return readline ();
configure:21126: checking for rl_callback_handler_install in -lreadline
configure:21161: gcc -pthread -o conftest -g -O2   conftest.c -lreadline  -lpthread -ldl  -lutil &amp;gt;&amp;5
/usr/bin/ld: cannot find -lreadline
configure:21254: checking for rl_pre_input_hook in -lreadline
configure:21289: gcc -pthread -o conftest -g -O2   conftest.c -lreadline  -lpthread -ldl  -lutil &amp;gt;&amp;5
/usr/bin/ld: cannot find -lreadline
configure:21325: checking for rl_completion_matches in -lreadline
configure:21360: gcc -pthread -o conftest -g -O2   conftest.c -lreadline  -lpthread -ldl  -lutil &amp;gt;&amp;5
/usr/bin/ld: cannot find -lreadline
ac_cv_lib_readline_readline=&lt;b&gt;no&lt;/b&gt;
ac_cv_lib_readline_rl_callback_handler_install=no
ac_cv_lib_readline_rl_completion_matches=no
ac_cv_lib_readline_rl_pre_input_hook=no
&lt;/pre&gt;
We can see that the library simply was not on the system and so the python configure script decided to exclude it's python wrapper from the build.
&lt;br/&gt;
&lt;br/&gt;
Before we proceed, we have to build the GNU readline and create a new package for it. How it was done is described in &lt;a href="http://filodej.blogspot.com/2008/12/wmu-6500fs-readline-52.html"&gt;this post&lt;/a&gt;.
&lt;br/&gt;
&lt;br/&gt;
Now we have the &lt;i&gt;libreadline.so&lt;/i&gt; library on the system and so can proceed to re-configure and re-build the python package. First we create a new timestamp file for python package and touch all the old files (in order to be included in the package). We can use the filopack script for that purpose:
&lt;pre class="code"&gt;
dev# cd /mnt/C
dev# ./filopack.sh --init python-2.5.2
dev# ./filopack.sh --touch python-2.5.2
Configuration file .filopack/.config file found and used
Sure to touch all files of the python-2.5.2 locally at /mnt/C (y/n)?y
...
&lt;/pre&gt;
Now we can move to the python source directory and re-configure the build:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/Python-2.5.2
dev# ./configure --prefix=/mnt/C/sys --enable-shared
...
&lt;/pre&gt;
Let's check whether the &lt;i&gt;readline&lt;/i&gt; package was found and included to the build:
&lt;pre class="code"&gt;
dev# cat config.log | grep readline
configure:20980: checking for readline in -lreadline
configure:21015: &lt;b&gt;gcc -pthread -o conftest -I/mnt/C/sys/include -I/mnt/C/sys/X11/include  -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib conftest.c -lreadline  -lpthread -ldl  -lutil &amp;gt;&amp;5&lt;/b&gt;
&lt;b&gt;/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetnum'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgoto'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetflag'
/mnt/C/sys/lib/libreadline.so: undefined reference to `BC'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tputs'
/mnt/C/sys/lib/libreadline.so: undefined reference to `PC'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetent'
/mnt/C/sys/lib/libreadline.so: undefined reference to `UP'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetstr'&lt;/b&gt;
...
ac_cv_lib_readline_readline=&lt;b&gt;no&lt;/b&gt;
ac_cv_lib_readline_rl_callback_handler_install=no
ac_cv_lib_readline_rl_completion_matches=no
ac_cv_lib_readline_rl_pre_input_hook=no
&lt;/pre&gt;
The situation changed, the &lt;i&gt;readline&lt;/i&gt; library is (presumably) no longer missing, but still there are some missing symbols and thus the configure test failed.
&lt;br/&gt;
&lt;br/&gt;
After a short googling (for query &lt;i&gt;"libreadline.so: undefined reference to BC PC UP"&lt;/i&gt;) I found &lt;a href="http://www.nabble.com/I-could-not-find-libreadline-td13809746.html"&gt;this page&lt;/a&gt;.
&lt;br/&gt;
It seems that the missing symbols should be present in &lt;i&gt;ncurses&lt;/i&gt; library.
&lt;br/&gt;
&lt;br/&gt;
Let's look what symbols are at the library in our system:
&lt;pre class="code"&gt;
dev# nm /lib/libncurses.so | grep "tgetnum\|tgoto\|tgetflag\|BC\|PC\|UP"
0003a544 B BC
0003a770 B PC
0003a540 B UP
000248e1 T tgetflag
00024958 T tgetnum
00024b0c T tgoto
&lt;/pre&gt;
It means that the symbols are there, but the python configuration script did not manage to find the library.
&lt;br/&gt;
&lt;br/&gt;
For quick feedback for our experiments we can create a dummy C file and use the same compiler command line as the configure script did:
&lt;pre class="code"&gt;
dev# echo "int main() { return 0; }" &gt; conftest.c
dev# gcc -pthread -o conftest -I/mnt/C/sys/include -I/mnt/C/sys/X11/include  -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib conftest.c -lreadline  -lpthread -ldl  -lutil
/mnt/C/sys/lib/gcc/i386-linux-uclibc/4.1.2/../../../../i386-linux-uclibc/lib/crt1.o: In function `_start':
crt1.S:(.text+0x27): undefined reference to `main'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetnum'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgoto'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetflag'
/mnt/C/sys/lib/libreadline.so: undefined reference to `BC'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tputs'
/mnt/C/sys/lib/libreadline.so: undefined reference to `PC'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetent'
/mnt/C/sys/lib/libreadline.so: undefined reference to `UP'
/mnt/C/sys/lib/libreadline.so: undefined reference to `tgetstr'
collect2: ld returned 1 exit status
&lt;/pre&gt;
We see that the linker ended up with the same error. Now we can try to fix the command line. There is missing &lt;i&gt;ncurses&lt;/i&gt; library on the command line; what about adding it explicitly?
&lt;pre class="code"&gt;
dev# gcc -pthread -o conftest -I/mnt/C/sys/include -I/mnt/C/sys/X11/include  -L/mnt/C/sys/lib
 -L/mnt/C/sys/X11/lib conftest.c &lt;b&gt;-lncurses&lt;/b&gt; -lreadline  -lpthread -ldl  -lutil
&lt;/pre&gt;
The test build now works, so now we can remove the temporary C-file and re-configure the python build:
&lt;pre class="code"&gt;
dev# rm conftest.c

dev# &lt;b&gt;LIBS="-lncurses"&lt;/b&gt; ./configure --prefix=/mnt/C/sys --enable-shared
...
&lt;/pre&gt;
Let's make sure that &lt;i&gt;readline&lt;/i&gt; package passed the configure test:
&lt;pre class="code"&gt; 
dev# cat config.log | grep readline
configure:20980: checking for readline in -lreadline
configure:21015: gcc -pthread -o conftest -I/mnt/C/sys/include -I/mnt/C/sys/X11/include  -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib conftest.c -lreadline  -lpthread -ldl -lncurses -lutil &amp;gt;&amp;5
configure:21126: checking for rl_callback_handler_install in -lreadline
configure:21161: gcc -pthread -o conftest -I/mnt/C/sys/include -I/mnt/C/sys/X11/include  -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib conftest.c -lreadline  -lreadline -lpthread -ldl -lncurses -lutil &amp;gt;&amp;5
configure:21254: checking for rl_pre_input_hook in -lreadline
configure:21289: gcc -pthread -o conftest -I/mnt/C/sys/include -I/mnt/C/sys/X11/include  -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib conftest.c -lreadline  -lreadline -lpthread -ldl -lncurses -lutil &amp;gt;&amp;5
configure:21325: checking for rl_completion_matches in -lreadline
configure:21360: gcc -pthread -o conftest -I/mnt/C/sys/include -I/mnt/C/sys/X11/include  -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib conftest.c -lreadline  -lreadline -lpthread -ldl -lncurses -lutil &amp;gt;&amp;5
ac_cv_lib_readline_readline=&lt;b&gt;yes&lt;/b&gt;
ac_cv_lib_readline_rl_callback_handler_install=yes
ac_cv_lib_readline_rl_completion_matches=yes
ac_cv_lib_readline_rl_pre_input_hook=yes
&lt;/pre&gt;
Yes, everything is ok now, we can build the source and install the binaries:
&lt;pre class="code"&gt;
dev# make
...
/mnt/C/sys/include/sqlite3.h: version 3.5.8
INFO: Can't locate Tcl/Tk libs and/or headers
&lt;b&gt;building 'readline' extension&lt;/b&gt;
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/usr/local/src/Python-2.5.2/./Include -I/mnt/C/sys/include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/src/Python-2.5.2/Include -I/usr/local/src/Python-2.5.2 -c /usr/local/src/Python-2.5.2/Modules/readline.c -o build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/readline.o
gcc -pthread -shared -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/readline.o -L/usr/lib/termcap -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -L/usr/local/lib -L. -lreadline -lncurses -lpython2.5 -o build/lib.linux-i686-2.5/readline.so
building 'nis' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/usr/local/src/Python-2.5.2/./Include -I/mnt/C/sys/include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/src/Python-2.5.2/Include -I/usr/local/src/Python-2.5.2 -c /usr/local/src/Python-2.5.2/Modules/nismodule.c -o build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/nismodule.o
gcc -pthread -shared -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes build/temp.linux-i686-2.5/usr/local/src/Python-2.5.2/Modules/nismodule.o -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -L/usr/local/lib -L. -lnsl -lpython2.5 -o build/lib.linux-i686-2.5/nis.so
*** WARNING: renaming "nis" since importing it failed: dynamic module does not define init function (initnis)
running build_scripts

dev# make install
...
&lt;/pre&gt;
Now, let's test the new installation:
&lt;pre class="code"&gt;
dev# python
Python 2.5.2 (r252:60911, Dec  8 2008, 07:26:01)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import readline
&lt;/pre&gt;
This is fine; and what about the deluge console:
&lt;pre class="code"&gt;
dev# deluge --ui=null
[INFO    ] 07:28:18 main:93 Deluge ui 1.0.5
[DEBUG   ] 07:28:18 main:94 options: {'config': None, 'logfile': None, 'ui': 'null'}
[DEBUG   ] 07:28:18 main:95 args: []
[DEBUG   ] 07:28:18 configmanager:44 ConfigManager started..
[INFO    ] 07:28:18 main:98 Starting ui..
[DEBUG   ] 07:28:18 ui:44 UI init..
[DEBUG   ] 07:28:18 configmanager:88 Getting config 'ui.conf'
[DEBUG   ] 07:28:18 config:47 Config created with filename: ui.conf
[DEBUG   ] 07:28:18 config:48 Config defaults: {'default_ui': 'gtk'}
[INFO    ] 07:28:18 ui:68 Starting NullUI..
[DEBUG   ] 07:28:18 client:54 CoreProxy init..
Welcome to deluge-shell. Type 'help' to see a list of available commands.
&amp;gt; help

Available commands:
        * add: Add a torrent
        * config-set: Change a configuration setting
        * configs: Show configuration values
        * connect: Connect to a new deluge server.
        * del: Remove a torrent
        * exit: Exit from the client.
        * halt: Shutdown the deluge server.
        * help: Show help
        * info: Show information about the torrents
        * pause: Pause a torrent
        * quit: Exit from the client.
        * resume: Resume a torrent
        * rm: Remove a torrent
&amp;gt; quit

Thanks
&lt;/pre&gt;
Everything is now ok, we can create a new python package:
&lt;pre class="code"&gt;
dev# cd /mnt/C
dev# ./filopack.sh --pack python-2.5.2
...
&lt;/pre&gt;
I realized that there are many files which are not a necessary part of the resulting package. Thhose are files with &lt;i&gt;.pyc&lt;/i&gt; and &lt;i&gt;.pyo&lt;/i&gt; extensions - just in time compiled python files. So I removed them from the list and re-created the package:
&lt;pre class="code"&gt;
dev# ./filopack.sh -R --pack python-2.5.2
...
&lt;/pre&gt;
I have uploaded the &lt;a href="http://filodej.ic.cz/filopack/python-2.5.2.tar.bz2"&gt;resulting package&lt;/a&gt; on the web site. Now we can fix the problem on the box.
&lt;br/&gt;
&lt;br/&gt;
First let's look at the summary of installed files:
&lt;pre class="code"&gt;
box# cd /mnt/C
box# ./filopack.sh --summary
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)

Filodej package summary:
Package name                          downloaded [#installed/#total]
--------------------------------------------------------------------
...
python-2.5.2                              no           [3525/3648]
...
&lt;/pre&gt;
... so the python package is installed; let's remove it:
&lt;pre class="code"&gt;
box# ./filopack.sh --remove python-2.5.2
Configuration file .filopack/.config file found and used
Sure to remove python-2.5.2 locally at /mnt/C (y/n)?y
...
&lt;/pre&gt;
Now we can download and install both &lt;a href="http://filodej.ic.cz/filopack/readline-5.2.tar.bz2"&gt;readline-5.2&lt;/a&gt;:
&lt;pre class="code"&gt;
box# ./filopack.sh --download readline-5.2
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package readline-5.2 from http://filodej.ic.cz ...
connected!

Length: 573 [text/plain]
connected!

Length: 265,962 [application/x-tar]

box# ./filopack.sh --install readline-5.2
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack readline-5.2 locally at /mnt/C (y/n)?y
sys/lib/libreadline.a
sys/lib/libhistory.a
sys/lib/libhistory.so.5
sys/lib/libhistory.so.5.2
sys/lib/libhistory.so
sys/lib/libreadline.so.5.2
sys/lib/libreadline.so.5
sys/lib/libreadline.so
sys/man/man3/readline.3
sys/man/man3/history.3
sys/include/readline/rltypedefs.h
sys/include/readline/chardefs.h
sys/include/readline/history.h
sys/include/readline/keymaps.h
sys/include/readline/readline.h
sys/include/readline/rlconf.h
sys/include/readline/rlstdc.h
sys/include/readline/tilde.h
sys/info/readline.info
sys/info/rluserman.info
sys/info/history.info
&lt;/pre&gt;
... and &lt;a href="http://filodej.ic.cz/filopack/python-2.5.2.tar.bz2"&gt;python-2.5.2&lt;/a&gt; package:
&lt;pre class="code"&gt;
box# ./filopack.sh --download python-2.5.2
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package python-2.5.2 from http://filodej.ic.cz ...
connected!

Length: 134,205 [text/plain]
connected!

Length: 12,984,464 [application/x-tar]

box# ./filopack.sh --install python-2.5.2
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack python-2.5.2 locally at /mnt/C (y/n)?y
...
&lt;/pre&gt;
After the installation everything seemed ok:
&lt;pre class="code"&gt;
box# python
Python 2.5.2 (r252:60911, Dec  8 2008, 07:26:01)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import readline
&amp;gt;&amp;gt;&amp;gt;
&lt;/pre&gt;
... but surprisingly one more problem arose when I ran the deluge console:
&lt;pre class="code"&gt;
box# deluged.sh

box# deluge --ui=null
[INFO    ] 16:56:44 main:93 Deluge ui 1.0.5
[DEBUG   ] 16:56:44 main:94 options: {'config': None, 'logfile': None, 'ui': 'null'}
[DEBUG   ] 16:56:44 main:95 args: []
[DEBUG   ] 16:56:45 configmanager:44 ConfigManager started..
[INFO    ] 16:56:45 main:98 Starting ui..
[DEBUG   ] 16:56:45 ui:44 UI init..
[DEBUG   ] 16:56:45 configmanager:88 Getting config 'ui.conf'
[DEBUG   ] 16:56:45 config:47 Config created with filename: ui.conf
[DEBUG   ] 16:56:45 config:48 Config defaults: {'default_ui': 'gtk'}
[INFO    ] 16:56:45 ui:68 Starting NullUI..
[DEBUG   ] 16:56:46 client:54 CoreProxy init..
Welcome to deluge-shell. Type 'help' to see a list of available commands.
Traceback (most recent call last):
  File "/usr/bin/deluge", line 8, in &lt;module&gt;
    load_entry_point('deluge==1.0.5', 'console_scripts', 'deluge')()
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/main.py", line 99, in start_ui
    UI(options, args)
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/ui/ui.py", line 70, in __init__
    ui = NullUI(args)
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/ui/null/deluge_shell.py", line 470, in __init__
    readline.read_init_file()
IOError: [Errno 2] No such file or directory
&lt;/pre&gt;
When we look at the &lt;a href="http://docs.python.org/library/readline.html"&gt;python readline documentation&lt;/a&gt; we see the following:
&lt;pre&gt;
readline.read_init_file([filename])
    Parse a readline initialization file. The default filename is the last filename used.
&lt;/pre&gt;
It seems that there is a readline initialization file missing on the box (probably it was outside the &lt;i&gt;/mnt/C/sys&lt;/i&gt; directory tree and so was not transferred to the box).
&lt;br/&gt;
&lt;br/&gt;
Let's try to replicate the problem directly from python console:
&lt;pre class="code"&gt;
box# python
Python 2.5.2 (r252:60911, Dec  8 2008, 07:26:01)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import readline
&amp;gt;&amp;gt;&amp;gt; readline.read_init_file()
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
IOError: [Errno 2] No such file or directory
&lt;/pre&gt;
When I tried it on the colinux system, everything was ok:
&lt;pre class="code"&gt;
dev# python
Python 2.5.2 (r252:60911, Dec  8 2008, 07:26:01)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import readline
&amp;gt;&amp;gt;&amp;gt; readline.read_init_file()
&amp;gt;&amp;gt;&amp;gt;
&lt;/pre&gt;
Hopefully the system call trace will help:
&lt;pre class="code"&gt;
box# strace -o readline-init.txt python
Python 2.5.2 (r252:60911, Dec  8 2008, 07:26:01)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import readline
&amp;gt;&amp;gt;&amp;gt; readline.read_init_file()
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &lt;module&gt;
IOError: [Errno 2] No such file or directory
&amp;gt;&amp;gt;&amp;gt;
&lt;/pre&gt;
Let's look at the end of the trace log:
&lt;pre class="code"&gt;
box# tail -n 100 readline-init.txt
...
rt_sigprocmask(SIG_BLOCK, [INT], [RTMIN], 8) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
rt_sigaction(SIGWINCH, {SIG_DFL}, {0x40139066, [], SA_RESTORER|SA_RESTART, 0x401c45a8}, 8) = 0
time(NULL)                              = 1228752774
stat("&lt;b&gt;/mnt/C/sys/root/.inputrc&lt;/b&gt;", 0xbffff4ec) = -1 ENOENT (No such file or directory)
stat("&lt;b&gt;/etc/inputrc&lt;/b&gt;", 0xbffff4ec)        = -1 ENOENT (No such file or directory)
write(2, "Traceback (most recent call last"..., 35) = 35
...
write(2, "  File \"&amp;lt;stdin&amp;gt;\", line 1, in &amp;lt;mo"..., 38) = 38
write(2, "IOError", 7)                  = 7
write(2, ": ", 2)                       = 2
write(2, "[Errno 2] No such file or direct"..., 35) = 35
write(2, "\n", 1)                       = 1
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
rt_sigprocmask(SIG_BLOCK, [INT], [RTMIN], 8) = 0
ioctl(0, TIOCGWINSZ, {ws_row=31, ws_col=84, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(0, TIOCSWINSZ, {ws_row=31, ws_col=84, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0
rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
rt_sigaction(SIGWINCH, {0x40139066, [], SA_RESTORER|SA_RESTART, 0x401c45a8}, {SIG_DFL}, 8) = 0
write(1, "&amp;gt;&amp;gt;&amp;gt; ", 4)                     = 4
select(1, [0], NULL, NULL, NULL)        = 1 (in [0])
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(0, "\4", 1)                        = 1
rt_sigprocmask(SIG_BLOCK, [INT], [RTMIN], 8) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
rt_sigaction(SIGWINCH, {SIG_DFL}, {0x40139066, [], SA_RESTORER|SA_RESTART, 0x401c45a8}, 8) = 0
write(2, "\n", 1)                       = 1
rt_sigaction(SIGINT, {SIG_DFL}, {0x40139066, [], SA_RESTORER, 0x401c45a8}, 8) = 0
munmap(0x402ad000, 16188)               = 0
munmap(0x402b1000, 216100)              = 0
_exit(0)                                = ?
&lt;/pre&gt;
So we found that neither &lt;i&gt;/etc/inputrc&lt;/i&gt; nor &lt;i&gt;/mnt/C/sys/root/.inputrc&lt;/i&gt; is present on the box and thus the readline initialization complains.
&lt;br/&gt;
&lt;br/&gt;
As a solution I choosen to copy the initialization file to root's user directory and re-build the &lt;i&gt;readline&lt;/i&gt; package:
&lt;pre class="code"&gt;
dev# cp /etc/inputrc /mnt/C/sys/root/.inputrc
dev# echo "sys/root/.inputrc" &gt;&gt; .filopack/readline-5.2.lst
dev# ./filopack.sh -R --pack readline-5.2
&lt;/pre&gt;
After the re-deployment to the box everything works ok:
&lt;pre class="code"&gt;
dev# deluge --ui=null
[INFO    ] 17:22:53 main:93 Deluge ui 1.0.5
[DEBUG   ] 17:22:53 main:94 options: {'config': None, 'logfile': None, 'ui': 'null'}
[DEBUG   ] 17:22:53 main:95 args: []
[DEBUG   ] 17:22:53 configmanager:44 ConfigManager started..
[INFO    ] 17:22:53 main:98 Starting ui..
[DEBUG   ] 17:22:53 ui:44 UI init..
[DEBUG   ] 17:22:53 configmanager:88 Getting config 'ui.conf'
[DEBUG   ] 17:22:53 config:47 Config created with filename: ui.conf
[DEBUG   ] 17:22:53 config:48 Config defaults: {'default_ui': 'gtk'}
[INFO    ] 17:22:53 ui:68 Starting NullUI..
[DEBUG   ] 17:22:55 client:54 CoreProxy init..
Welcome to deluge-shell. Type 'help' to see a list of available commands.
&gt; help

Available commands:
        * add: Add a torrent
        * config-set: Change a configuration setting
        * configs: Show configuration values
        * connect: Connect to a new deluge server.
        * del: Remove a torrent
        * exit: Exit from the client.
        * halt: Shutdown the deluge server.
        * help: Show help
        * info: Show information about the torrents
        * pause: Pause a torrent
        * quit: Exit from the client.
        * resume: Resume a torrent
        * rm: Remove a torrent

&gt; connect


&gt; info

*** ID: 33820db6dd5e5928d23bc811bbac2f4ae94cb882
*** Name: ubuntu-8.10-desktop-i386.iso
*** Path: torrentfiles
*** Completed: 0.0 KiB/698.8 MiB
*** Status: Paused


&gt; resume

Usage: resume &lt;torrent-id&gt; [&lt;torrent-id&gt; ...]


&gt; resume 33820db6dd5e5928d23bc811bbac2f4ae94cb882


&gt; info

*** ID: 33820db6dd5e5928d23bc811bbac2f4ae94cb882
*** Name: ubuntu-8.10-desktop-i386.iso
*** Path: torrentfiles
*** Completed: 2.1 MiB/698.8 MiB
*** Status: Downloading
*** Download Speed: 60.9 KiB/s
*** Upload Speed: 0.0 KiB/s
*** ETA: 3h 15m


&gt; exit

Thanks
box#
&lt;/pre&gt;
That's all for now.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-3055464703673033209?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/3055464703673033209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=3055464703673033209' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3055464703673033209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3055464703673033209'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/12/wmu-6500fs-built-sw-python-252.html' title='WMU-6500FS - built sw -Python 2.5.2'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_xFBIBcRhwFQ/SU12KUlB32I/AAAAAAAACZY/_Jqr7IbtEgA/s72-c/python-252.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-7122647620877492936</id><published>2008-12-08T17:40:00.009+01:00</published><updated>2008-12-09T09:36:40.312+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - built sw - readline-5.2</title><content type='html'>&lt;a href="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"&gt;[Homepage]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/readline-5.2.lst"&gt;[files]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/readline-5.2.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
First we initialize the package timestamp:
&lt;pre class="code"&gt;
dev# cd /mnt/C/
dev# ./filopack.sh --init readline-5.2
Configuration file .filopack/.config file found and used
Timestamp written to file .filopack/readline-5.2.ts
&lt;/pre&gt;
Now we can download and extract the source to the &lt;i&gt;/usr/local/src&lt;/i&gt; directory:
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz"&gt;ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz&lt;/a&gt;
--06:08:23--  ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
           =&gt; `readline-5.2.tar.gz'
Resolving ftp.gnu.org... 140.186.70.20
Connecting to ftp.gnu.org[140.186.70.20]:21... connected.
Logging in as anonymous ... Logged in!
==&gt; SYST ... done.    ==&gt; PWD ... done.
==&gt; TYPE I ... done.  ==&gt; CWD /gnu/readline ... done.
==&gt; PORT ... done.    ==&gt; RETR readline-5.2.tar.gz ... done.
Length: 2,037,705 (unauthoritative)

100%[===============================================================================================================================&gt;] 2,037,705      4.38K/s    ETA 00:00

06:20:28 (2.75 KB/s) - `readline-5.2.tar.gz' saved [2037705]

dev# tar xzvf readline-5.2.tar.gz
...
&lt;/pre&gt;
Configuration and build process is straightforward:
&lt;pre class="code"&gt;
dev# cd readline-5.2
dev# ./configure --prefix=/mnt/C/sys
...
dev# make
...
dev# make install
...
&lt;/pre&gt;
Now we go back to the &lt;i&gt;/mnt/C&lt;/i&gt; directory and finish the package creation:
&lt;pre class="code"&gt;
dev# cd /mnt/C/
dev# ./filopack.sh --pack readline-5.2
Configuration file .filopack/.config file found and used
-rw-r--r-- root/root    308780 2008-12-08 06:26:38 sys/lib/libreadline.a
-rw-r--r-- root/root     37294 2008-12-08 06:26:38 sys/lib/libhistory.a
lrwxrwxrwx root/root         0 2008-12-08 06:26:38 sys/lib/libhistory.so.5 -&gt; libhistory.so.5.2
-r-xr-xr-x root/root     34696 2008-12-08 06:26:38 sys/lib/libhistory.so.5.2
lrwxrwxrwx root/root         0 2008-12-08 06:26:38 sys/lib/libhistory.so -&gt; libhistory.so.5
-r-xr-xr-x root/root    249866 2008-12-08 06:26:38 sys/lib/libreadline.so.5.2
lrwxrwxrwx root/root         0 2008-12-08 06:26:38 sys/lib/libreadline.so.5 -&gt; libreadline.so.5.2
lrwxrwxrwx root/root         0 2008-12-08 06:26:38 sys/lib/libreadline.so -&gt; libreadline.so.5
-rw-r--r-- root/root     38459 2008-12-08 06:26:38 sys/man/man3/readline.3
-rw-r--r-- root/root     21769 2008-12-08 06:26:38 sys/man/man3/history.3
-rw-r--r-- root/root      2977 2008-12-08 06:26:38 sys/include/readline/rltypedefs.h
-rw-r--r-- root/root      4684 2008-12-08 06:26:38 sys/include/readline/chardefs.h
-rw-r--r-- root/root     10207 2008-12-08 06:26:38 sys/include/readline/history.h
-rw-r--r-- root/root      3529 2008-12-08 06:26:38 sys/include/readline/keymaps.h
-rw-r--r-- root/root     34515 2008-12-08 06:26:38 sys/include/readline/readline.h
-rw-r--r-- root/root      2305 2008-12-08 06:26:38 sys/include/readline/rlconf.h
-rw-r--r-- root/root      1503 2008-12-08 06:26:38 sys/include/readline/rlstdc.h
-rw-r--r-- root/root      3167 2008-12-08 06:26:38 sys/include/readline/tilde.h
-rw-r--r-- root/root    192320 2008-12-08 06:26:38 sys/info/readline.info
-rw-r--r-- root/root     72955 2008-12-08 06:26:38 sys/info/rluserman.info
-rw-r--r-- root/root     58583 2008-12-08 06:26:38 sys/info/history.info
&lt;/pre&gt;
One more thing we have to do is to copy the readline initialization file to the root's directory, add it to the &lt;i&gt;.lst&lt;/i&gt; file and re-build the package:
&lt;pre class="code"&gt;
dev# cp /etc/inputrc /mnt/C/sys/root/.inputrc
dev# echo "sys/root/.inputrc" &gt;&gt; .filopack/readline-5.2.lst
dev# ./filopack.sh -R --pack readline-5.2
&lt;/pre&gt; 
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-7122647620877492936?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/7122647620877492936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=7122647620877492936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7122647620877492936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7122647620877492936'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/12/wmu-6500fs-readline-52.html' title='WMU-6500FS - built sw - readline-5.2'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-4045741810177951321</id><published>2008-12-04T14:41:00.035+01:00</published><updated>2008-12-28T22:49:59.983+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'></title><content type='html'>&lt;h3&gt;Questions and answers&lt;/h3&gt;
&lt;br/&gt;
This post will contain answers for some questions, which can be interesting for others and which are more elaborated so that their scope exceeds a limit reasonable for ordinary comments.

&lt;span class="fullpost"&gt;
&lt;a name="Q1"&gt;&lt;h3&gt;Deluge installation, missing pkg_resources package&lt;/h3&gt;&lt;/a&gt;
&lt;h3&gt;Q:&lt;/h3&gt;
&lt;blockquote&gt;&lt;pre&gt;
Hi Filodej,
thanks a lot for your reply. I got stuck when i was building the Apache files.
I don't know much about linux, but i'll try and i'll let you know if i get Deluge running

I'm planning to do this:

1.- Flash WMU box with Joker Firmware (already done w/o problems)

2.- Uncompress the binary files that you already build inside the WMU box (i'm not gonna use the chroot-ed system with uClibc library under Kubuntu)
For example:
tar xvzf binary_file

where binary_file are the following dependencies

X.Org
Gtk+
boost
python
pycairo
pygtk
atk
glade
pygobject
pyxdg
DBus
DBus-glib
DBus-python

I'll follow the order you set in your blog

3.- Modify configuration files or set environment variables (if any)

And that's all. I don't know if i can do this, or if i'm missing something. Hope this works! 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi Filodej,

i tried what i told you before. I uncompress the binaries and i got an error like "can't load library 'librt.so.0'"
So, i uncompress libs-essential-20080502.tar.bz2 and that fixed the error. But now, when i try to run Deluge i get this error:


[root@Nas_Storage site-packages]# deluge
Traceback (most recent call last):
File "/usr/bin/deluge", line 5, in &lt; module &gt;
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

I couldn't see that error on your blog and couldn't find any clue to help me solve this, do you have any idea about how to dix this?
Thanks a lot, and sorry for my qustions

Edgard 
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;h3&gt;A:&lt;/h3&gt;
The &lt;i&gt;pkg_resources &lt;/i&gt; is a part of python &lt;a href="http://pypi.python.org/pypi/setuptools/"&gt;setuptools&lt;/a&gt; package, 
you have to install it. I have install it during the 
&lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-built-sw-trac-011rc1.html"&gt;Trac installation&lt;/a&gt; and so did not
encounter this dependency, sorry for that.&lt;br/&gt;
&lt;br/&gt;
When I try it on a relatively clean debian installation (with python 2.5 already installed), I get the same error:
&lt;pre class="code"&gt;
debian:~# python2.5
Python 2.5 (release25-maint, Jul 20 2008, 20:47:25)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import pkg_resources
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
ImportError: No module named pkg_resources
&gt;&gt;&gt;
&lt;/pre&gt;
In order to install the setuptools package we can follow the 
&lt;a href="http://pypi.python.org/pypi/setuptools/#cygwin-mac-os-x-linux-other"&gt;installation instructions&lt;/a&gt;
or as described in the &lt;a href="http://trac.edgewall.org/wiki/TracInstall"&gt;Trac installation&lt;/a&gt; 
(&lt;a href="http://peak.telecommunity.com/DevCenter/setuptools"&gt;setuptools section&lt;/a&gt;) use the 
&lt;a href="http://peak.telecommunity.com/dist/ez_setup.py"&gt;ez_setup.py script&lt;/a&gt;:&lt;br/&gt;
&lt;br/&gt;
First, we have to download it:
&lt;pre class="code"&gt;
debian:~# cd /tmp
debian:/tmp# wget http://peak.telecommunity.com/dist/ez_setup.py
--04:10:59--  http://peak.telecommunity.com/dist/ez_setup.py
           =&gt; `ez_setup.py'
Resolving peak.telecommunity.com... 209.190.5.234
Connecting to peak.telecommunity.com|209.190.5.234|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9,716 (9.5K) [text/plain]

100%[=======================================================================================================&gt;] 9,716         24.97K/s

04:11:00 (24.97 KB/s) - `ez_setup.py' saved [9716/9716]
&lt;/pre&gt;
Now we can try to launch it:
&lt;pre class="code"&gt;
debian:/tmp# python2.5 ez_setup.py
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py2.5.egg
error: invalid Python installation: unable to open /usr/include/python2.5/pyconfig.h (No such file or directory)
&lt;/pre&gt;
It seems we are missing some python C headers, we have to install the package with python 2.5 header files:
&lt;pre class="code"&gt;
debian:/tmp# apt-get install python2.5-dev
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  python2.5-dev
0 upgraded, 1 newly installed, 0 to remove and 36 not upgraded.
Need to get 0B/1676kB of archives.
After unpacking 5349kB of additional disk space will be used.
Selecting previously deselected package python2.5-dev.
(Reading database ... 25024 files and directories currently installed.)
Unpacking python2.5-dev (from .../python2.5-dev_2.5-5+etch1_i386.deb) ...
Setting up python2.5-dev (2.5-5+etch1) ...
&lt;/pre&gt;
Now try it again:
&lt;pre class="code"&gt;
debian:/tmp# python2.5 ez_setup.py
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py2.5.egg
Processing setuptools-0.6c9-py2.5.egg
Copying setuptools-0.6c9-py2.5.egg to /usr/lib/python2.5/site-packages
Adding setuptools 0.6c9 to easy-install.pth file
Installing easy_install script to /usr/bin
Installing easy_install-2.5 script to /usr/bin

Installed /usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg
Processing dependencies for setuptools==0.6c9
Finished processing dependencies for setuptools==0.6c9
&lt;/pre&gt;
Now we can test whether the installation was sucessful:
&lt;pre class="code"&gt;
debian:/tmp# python2.5
Python 2.5 (release25-maint, Jul 20 2008, 20:47:25)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import pkg_resources
&gt;&gt;&gt;
&lt;/pre&gt;

&lt;a name="Q2"&gt;&lt;h3&gt;GCC package is huge, is it really necessary?&lt;/h3&gt;&lt;/a&gt;
&lt;h3&gt;Q:&lt;/h3&gt;
&lt;blockquote&gt;&lt;pre&gt;
Anonymous said... 
    ... 
    I tried to download 'gcc' from you site but the files seems to be corrupted. Do you have nay ideas ?

    below is a screen-shot from my machine:

    $ tar xjvf gcc-4.1.2-sjlj.tar.bz2.tar
    sys/bin/c++
    sys/bin/cpp
    sys/bin/g++
    sys/bin/gcc
    sys/bin/gccbug
    sys/bin/gcov
    sys/bin/i386-linux-uclibc-c++
    sys/bin/i386-linux-uclibc-g++
    sys/bin/i386-linux-uclibc-gcc
    sys/bin/i386-linux-uclibc-gcc-4.1.2
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/README
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/float.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/iso646.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/stdarg.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/stdbool.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/stddef.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/varargs.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/mmintrin.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/mm3dnow.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/xmmintrin.h
    sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/emmintrin.h
    tar: Decompression failed
    tar: Unable to read all data
    tar: Unable to read all data

    regards,
    Christos

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anonymous said...

    oops...sorry file was corrupted during download - apologies.
    Christos

&lt;/pre&gt;&lt;/blockquote&gt;

&lt;h3&gt;A:&lt;/h3&gt;
The truth is that the &lt;a href="http://filodej.ic.cz/filopack/gcc-4.1.2-sjlj.tar.bz2"&gt;gcc package&lt;/a&gt; is huge (~25MB) though there are just few libraries for deluge. I am going to address this issue so that I cut just a few relevant libraries out of the huge gcc package and provide a &lt;a href="http://filodej.ic.cz/filopack/deluge-1.0.5-gcclibs.tar.bz2"&gt;new package (~1MB)&lt;/a&gt; for it. Following text is by no means necessary for the successful installation, I am just going to describe the process of cutting out relevant dependencies for interested...
&lt;br/&gt;
&lt;br/&gt;
First we can list the installed packages. It is possible to use the &lt;a href="http://filodej.ic.cz/filopack/filopack.sh"&gt;filopack script&lt;/a&gt; for it:
&lt;pre class="code"&gt;
box# cd /mnt/C
box# ./filopack --summary
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)

Filodej package summary:
Package name                          downloaded [#installed/#total]
--------------------------------------------------------------------
...
gcc-4.1.2-sjlj                            no           [ 546/ 549]
...
&lt;/pre&gt;
Now we can uninstall the package:
&lt;pre class="code"&gt;
box# ./filopack.sh --remove gcc-4.1.2-sjlj
Configuration file .filopack/.config file found and used
Sure to remove gcc-4.1.2-sjlj locally at /mnt/C (y/n)?y
&lt;/pre&gt;
Let's make sure the package is actually removed:
&lt;pre class="code"&gt;
box# ./filopack.sh --summary
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)

Filodej package summary:
Package name                          downloaded [#installed/#total]
--------------------------------------------------------------------
...
gcc-4.1.2-sjlj                            no           [   0/ 549]
...
&lt;/pre&gt;
Ok, now when we try to run deluge, we get the "missing library" error message:
&lt;pre class="code"&gt;
box# deluged.sh
/usr/bin/python: can't load library 'libstdc++.so.6'
&lt;/pre&gt;
It seems we need at least the &lt;i&gt;libstdc++.so.6&lt;/i&gt; library. Let's find all the related files:
&lt;pre class="code"&gt;
box# cat .filopack/gcc-4.1.2-sjlj.lst | grep  libstdc++
sys/lib/libstdc++.a
sys/lib/libstdc++.so
sys/lib/libstdc++.so.6.0.8
sys/lib/libstdc++.so.6
sys/lib/libstdc++.la
&lt;/pre&gt;
We actually do not need the static libraries (unless we have a plan to build something directly on the box), so we are interested just in &lt;i&gt;so&lt;/i&gt; files:
&lt;pre class="code"&gt;
box# cat .filopack/gcc-4.1.2-sjlj.lst | grep  libstdc++*.so
sys/lib/libstdc++.so
sys/lib/libstdc++.so.6.0.8
sys/lib/libstdc++.so.6
&lt;/pre&gt;
Let's make a new &lt;i&gt;lst&lt;/i&gt; file representing the new package &lt;i&gt;deluge-1.0.5-gcclibs&lt;/i&gt; we are going to create. This file will contain a list of all the relevant libraries:
&lt;pre class="code"&gt;
box# cat .filopack/gcc-4.1.2-sjlj.lst | grep  libstdc++*.so &gt; .filopack/deluge-1.0.5-gcclibs.lst
&lt;/pre&gt;
... and extract just those files from the &lt;i&gt;gcc-4.1.2-sjlj&lt;/i&gt; package:
&lt;pre class="code"&gt;
box# cat .filopack/gcc-4.1.2-sjlj.lst | grep libstdc++*.so | xargs tar -xjvf gcc-4.1.2-sjlj.tar.bz2
sys/lib/libstdc++.so
sys/lib/libstdc++.so.6.0.8
sys/lib/libstdc++.so.6
&lt;/pre&gt;
When we try to start deluge daemon again:
&lt;pre class="code"&gt;
box# deluged.sh
/usr/bin/python: Can't resolve symbol '_Unwind_SjLj_Register'
&lt;/pre&gt;
... it seems there are still some missing libraries (or more likely some missing symbols in an older version of the same library). Let's look at the dependencies more closer:
&lt;pre class="code"&gt;
box# LD_TRACE_LOADED_OBJECTS=1 deluged.sh
        /usr/lib/libssl.so.0.9.7 =&gt; /usr/lib/libssl.so.0.9.7 (0x40007000)
        /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0 =&gt; /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0 (0x40030000)
        libpython2.5.so.1.0 =&gt; /mnt/C/sys/lib//libpython2.5.so.1.0 (0x4003f000)
        libpthread.so.0 =&gt; /mnt/C/sys/lib//libpthread.so.0 (0x40166000)
        libdl.so.0 =&gt; /lib/libdl.so.0 (0x40178000)
        libutil.so.0 =&gt; /mnt/C/sys/lib//libutil.so.0 (0x4017b000)
        libm.so.0 =&gt; /lib/libm.so.0 (0x4017d000)
        libc.so.0 =&gt; /lib/libc.so.0 (0x4018b000)
        libcrypto.so.0.9.7 =&gt; /mnt/C/sys/lib//libcrypto.so.0.9.7 (0x4021f000)
        libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x402f4000)
        libboost_system-gcc41-mt-1_35.so.1.35.0 =&gt; /mnt/C/sys/lib//libboost_system-gcc41-mt-1_35.so.1.35.0 (0x402fc000)
        librt.so.0 =&gt; /mnt/C/sys/lib//librt.so.0 (0x40300000)
        libstdc++.so.6 =&gt; /mnt/C/sys/lib//libstdc++.so.6 (0x40302000)
        ld-uClibc.so.0 =&gt; /lib/ld-uClibc.so.0 (0x40000000)
&lt;/pre&gt;
Here is a list of libraries present in the gcc package:
&lt;pre class="code"&gt;
dev# cat .filopack/gcc-4.1.2-sjlj.lst | grep "\.so"
sys/lib/libgcc_s.so
sys/lib/libgcc_s.so.1
sys/lib/libstdc++.so
sys/lib/libstdc++.so.6.0.8
sys/lib/libstdc++.so.6
sys/lib/libmudflap.so.0.0.0
sys/lib/libmudflap.so.0
sys/lib/libmudflap.so
sys/lib/libmudflapth.so.0.0.0
sys/lib/libmudflapth.so.0
sys/lib/libmudflapth.so
sys/lib/libssp.so.0.0.0
sys/lib/libssp.so.0
sys/lib/libssp.so
&lt;/pre&gt;
The &lt;i&gt;libgcc_s&lt;/i&gt; looks like a good candidate. We can look for the missing symbol:
&lt;pre class="code"&gt;
box# nm /lib/libgcc_s.so.1
nm: /lib/libgcc_s.so.1: no symbols

box# nm --dynamic /lib/libgcc_s.so | grep Unwind
00003ebc T _Unwind_Backtrace
00003e98 T _Unwind_DeleteException
00002800 T _Unwind_FindEnclosingFunction
00004e2c T _Unwind_Find_FDE
00003c50 T _Unwind_ForcedUnwind
000027dc T _Unwind_GetCFA
00002838 T _Unwind_GetDataRelBase
00003f60 T _Unwind_GetGR
00003f84 T _Unwind_GetIP
000027e8 T _Unwind_GetLanguageSpecificData
000027f4 T _Unwind_GetRegionStart
00002844 T _Unwind_GetTextRelBase
00003a08 T _Unwind_RaiseException
00003d00 T _Unwind_Resume
00003dc8 T _Unwind_Resume_or_Rethrow
00003f70 T _Unwind_SetGR
00003f90 T _Unwind_SetIP
&lt;/pre&gt;
The &lt;i&gt;/lib/libgcc_s.so&lt;/i&gt; is an "old" version of the library being replaced by the new one contained in the gcc package. Apparently the symbol &lt;i&gt;'_Unwind_SjLj_Register'&lt;/i&gt; is missing in the list, but there are similar symbols. 
&lt;br/&gt;
Let's list the &lt;i&gt;libgcc&lt;/i&gt; related files:
&lt;pre class="code"&gt;
box# cat .filopack/gcc-4.1.2-sjlj.lst | grep libgcc_s*.so
sys/lib/libgcc_s.so
sys/lib/libgcc_s.so.1
&lt;/pre&gt;
Now we can extract the files from the package tarball:
&lt;pre class="code"&gt;
box# cat .filopack/gcc-4.1.2-sjlj.lst | grep libgcc_s*.so | xargs tar -xjvf gcc-4.1.2-sjlj.tar.bz2
sys/lib/libgcc_s.so
sys/lib/libgcc_s.so.1
&lt;/pre&gt;
Make sure that the symbol is actually there:
&lt;pre class="code"&gt;
box# nm --dynamic /mnt/C/sys/lib/libgcc_s.so | grep Unwind
00005361 T _Unwind_Backtrace
00005345 T _Unwind_DeleteException
0000522e T _Unwind_FindEnclosingFunction
00004e4b T _Unwind_Find_FDE
000051d6 T _Unwind_GetCFA
00005235 T _Unwind_GetDataRelBase
000051c5 T _Unwind_GetGR
000051fb T _Unwind_GetIP
0000521a T _Unwind_GetLanguageSpecificData
00005227 T _Unwind_GetRegionStart
0000523c T _Unwind_GetTextRelBase
000051e7 T _Unwind_SetGR
00005209 T _Unwind_SetIP
000054a5 T _Unwind_SjLj_ForcedUnwind
000054ef T _Unwind_SjLj_RaiseException
0000511c T &lt;b&gt;_Unwind_SjLj_Register&lt;/b&gt;
00005452 T _Unwind_SjLj_Resume
0000557d T _Unwind_SjLj_Resume_or_Rethrow
000051ba T _Unwind_SjLj_Unregister
&lt;/pre&gt;
Now we can append the files to the &lt;i&gt;lst&lt;/i&gt; file. 
&lt;pre class="code"&gt;
box# cat .filopack/gcc-4.1.2-sjlj.lst | grep libgcc_s*.so &gt;&gt; .filopack/deluge-1.0.5-gcclibs.lst
&lt;/pre&gt;
And test the deluge again:
&lt;pre class="code"&gt;
[root@storage C]# deluged.sh
&lt;/pre&gt;
... now the daemon starts without problems.
&lt;br/&gt;
The last step is to create the &lt;i&gt;deluge-1.0.5-gcclibs&lt;/i&gt; package.
&lt;pre class="code"&gt;
box# cat .filopack/deluge-1.0.5-gcclibs.lst
sys/lib/libstdc++.so
sys/lib/libstdc++.so.6.0.8
sys/lib/libstdc++.so.6
sys/lib/libgcc_s.so
sys/lib/libgcc_s.so.1
&lt;/pre&gt;
We can use the &lt;i&gt;--pack&lt;/i&gt; action of the filopack script with &lt;i&gt;-R&lt;/i&gt; option in order to reuse the (already created) lst file:
&lt;pre class="code"&gt;
box# ./filopack.sh -R --pack deluge-1.0.5-gcclibs
Configuration file .filopack/.config file found and used
tar: unrecognized option `--files-from=.filopack/deluge-1.0.5-gcclibs.lst'
BusyBox v1.90-JKR (2008.04.09-06:53 CET) multi-call binary

Usage: tar -[czjZxtvO] [-f TARFILE] [-C DIR] [FILE(s)] ...

Create, extract, or list files from a tar file.

Options:
        c               create
        x               extract
        t               list

Archive format selection:
        z               Filter the archive through gzip
        j               Filter the archive through bzip2
        Z               Filter the archive through compress

File selection:
        f               name of TARFILE or "-" for stdin
        O               extract to stdout
        C               change to directory DIR before operation
        v               verbosely list files processed

&lt;/pre&gt;
... oops, it seems that I have different versions of &lt;i&gt;tar&lt;/i&gt; on my box and on my &lt;i&gt;dev#&lt;/i&gt; system (Chroot-ed environment on top of the Colinux with Debian), there the &lt;i&gt;--files-from&lt;/i&gt; works ok.
&lt;br/&gt;
Let's make sure. First find the &lt;i&gt;tar&lt;/i&gt; on the box:
&lt;pre class="code"&gt;
box# which tar
/bin/tar
box# ls -l /bin/tar
lrwxrwxrwx 1 root root 7 2008-05-21 13:40 /bin/tar -&gt; busybox
&lt;/pre&gt;
And now on the &lt;i&gt;dev#&lt;/i&gt; system:
&lt;pre class="code"&gt;
dev# tar --version
tar (GNU tar) 1.15.1

dev# which tar
/bin/tar

dev# ls -l /bin/tar
-rwxr-xr-x  1 root root 166880 Apr 16  2008 /bin/tar*
&lt;/pre&gt;
As a solution I have updated the filopack script to be compliant with the busybox tar version. I changed the following statement:
&lt;pre class="code"&gt;
tar $PACK_CMD $PACKAGE.$EXT --files-from $CONFIG_DIR/$PACKAGE.lst 2&gt;&amp;1 | tee $CONFIG_DIR/$PACKAGE.err
&lt;/pre&gt;
to the following:
&lt;pre class="code"&gt;
cat $CONFIG_DIR/$PACKAGE.lst | xargs tar $PACK_CMD $PACKAGE.$EXT 2&gt;&amp;1 | tee $CONFIG_DIR/$PACKAGE.err
&lt;/pre&gt;
.. the only thing I am not sure of is whether the number of command line argument is somewhat limited; such limitation could cause some problems for packages with many files.
&lt;br/&gt;
Let's try it directly:
&lt;pre class="code"&gt;
box# ./filopack.sh -R --pack deluge-1.0.5-gcclibs
Configuration file .filopack/.config file found and used
tar: Creating bzip2 compressed archives is not currently supported.
&lt;/pre&gt;
Equivalent command:&lt;br/&gt;
  &lt;i&gt;cat .filopack/deluge-1.0.5-gcclibs.lst | xargs tar cjvf deluge-1.0.5-gcclibs.tar.bz2&lt;/i&gt;&lt;br/&gt;
&lt;br/&gt;
Bzip compression is not supported, so try the tgz:
&lt;pre class="code"&gt;
box# ./filopack.sh -R -o tgz --pack deluge-1.0.5-gcclibs
Configuration file .filopack/.config file found and used
sys/lib/libgcc_s.so.1
sys/lib/libgcc_s.so
sys/lib/libstdc++.so.6
sys/lib/libstdc++.so.6.0.8
sys/lib/libstdc++.so
&lt;/pre&gt;
Equivalent command:&lt;br/&gt;
  &lt;i&gt;cat .filopack/deluge-1.0.5-gcclibs.lst | xargs tar czvf deluge-1.0.5-gcclibs.tgz&lt;/i&gt;&lt;br/&gt;
&lt;br/&gt;
... this works. We have successfully created the package. &lt;br/&gt;
&lt;i&gt;Note: Finally I created the bz2 version on my mirror system.&lt;/i&gt;
&lt;pre class="code"&gt;
dev# ./filopack.sh -R --pack deluge-1.0.5-gcclibs
...
&lt;/pre&gt;
So, that's all for now. I have uploaded the package and now it is publicly available:
&lt;pre class="code"&gt;
box# ./filopack.sh --packages
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Available packages:
...
deluge-1.0.5
&lt;b&gt;deluge-1.0.5-deplibs&lt;/b&gt;
...
&lt;/pre&gt;
You can download it to your box:
&lt;pre class="code"&gt;
box# ./filopack.sh --download deluge-1.0.5-gcclibs
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package deluge-1.0.5-gcclibs from http://filodej.ic.cz ...
connected!

Length: 113 [text/plain]
connected!

Length: 1,191,263 [application/x-tar]
&lt;/pre&gt;
And install it as follows:
&lt;pre class="code"&gt;
box# ./filopack.sh --install deluge-1.0.5-gcclibs
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack deluge-1.0.5-gcclibs locally at /mnt/C (y/n)?y
sys/lib/libstdc++.so
sys/lib/libstdc++.so.6.0.8
sys/lib/libstdc++.so.6
sys/lib/libgcc_s.so
sys/lib/libgcc_s.so.1
&lt;/pre&gt;

&lt;a name="Q3"&gt;&lt;h3&gt;Unresolved 'PyUnicodeUCS2_DecodeUTF8' symbol&lt;/h3&gt;&lt;/a&gt;
&lt;h3&gt;Q:&lt;/h3&gt;
&lt;pre class="code"&gt;
$ deluged.sh
/usr/bin/python: Can't resolve symbol '_Unwind_SjLj_Register'
$
$
$ LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0 /usr/lib/libgcc_s.so" deluged -d
[DEBUG ] 08:53:55 configmanager:44 ConfigManager started..
[INFO ] 08:53:55 daemon:44 Deluge daemon 1.0.5
[DEBUG ] 08:53:55 daemon:45 options: {'logfile': None, 'config': None, 'port': None, 'donot': True}
[DEBUG ] 08:53:55 daemon:46 args: []
/usr/bin/python: can't resolve symbol 'PyUnicodeUCS2_DecodeUTF8'
$
&lt;/pre&gt;

&lt;h3&gt;A:&lt;/h3&gt;
Likely this symbol should be defined in python library. Let's look if it is the case:
&lt;pre class="code"&gt;
box# nm /mnt/C/sys/lib/libpython2.5.so.1.0 | grep DecodeUTF8
00073f08 T PyUnicodeUCS4_DecodeUTF8
00073f30 T PyUnicodeUCS4_DecodeUTF8Stateful
&lt;/pre&gt;

So it seems there is a &lt;i&gt;UCS4&lt;/i&gt; vs. &lt;i&gt;UCS2&lt;/i&gt; mismatch on your system.
When I googled &lt;i&gt;PyUnicodeUCS4  PyUnicodeUCS2&lt;/i&gt; I got the &lt;a href="http://effbot.org/pyfaq/when-importing-module-x-why-do-i-get-undefined-symbol-pyunicodeucs2.htm"&gt;following explanation&lt;/a&gt;:

&lt;blockquote&gt;&lt;i&gt;
You are using a version of Python that uses a 4-byte representation for Unicode characters, but some C extension module you are importing was compiled using a Python that uses a 2-byte representation for Unicode characters (the default).
&lt;/i&gt;&lt;/blockquote&gt;

So it seems to be exactly the case on your system. Look at the python console just to make sure:
&lt;pre class="code"&gt;
box# python
Python 2.5.2 (r252:60911, May  3 2008, 16:19:27)
[GCC 3.3.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import sys
&gt;&gt;&gt; print sys.maxunicode &gt; 65535 and 'UCS4 build' or 'UCS2 build'
&lt;b&gt;UCS4 build&lt;/b&gt;
&gt;&gt;&gt;
&lt;/pre&gt;
Now we have to find out what is the python extension to be blamed, but unfortunately I cannot do it on my own since it seems there is no such problem on my box. At least I can try to help you a bit how to investigate that. 
&lt;br/&gt;
&lt;br/&gt;
You can use &lt;a href="http://en.wikipedia.org/wiki/Strace"&gt;strace&lt;/a&gt; (system calls and signals tracer) for that. &lt;a href="http://filodej.blogspot.com/2008/07/wmu-6500fs-strace-4515.html"&gt;Here&lt;/a&gt; is the a short explanation how I built it and &lt;a href="http://philodej.googlepages.com/strace-4.5.15.tar.bz2"&gt;here&lt;/a&gt; you can directly download the package, or possibly if you are using the &lt;a href="http://filodej.blogspot.com/2008/11/simple-packaging-sysetm.html"&gt;filopack system&lt;/a&gt; you can simply write:
&lt;pre class="code"&gt;
$ cd /mnt/C
$ ./filopack.sh --download strace-4.5.15
$ ./filopack.sh --install strace-4.5.15
&lt;/pre&gt; 
... and (hopefully) you are prepared.
&lt;br/&gt;
&lt;br/&gt;
To replicate a scenario similar to yours, I can run the deluge daemon without the &lt;i&gt;LD_PRELOAD&lt;/i&gt; prefix, in such case I am also missing some symbols:
&lt;pre class="code"&gt;
box# /usr/bin/deluged
box# /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
&lt;/pre&gt;
So now I can try to trace all the system calls:
&lt;pre class="code"&gt;
box# strace /usr/bin/deluged
...
stat64("/mnt/C/sys/root/.config/deluge", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
&lt;b&gt;fork()&lt;/b&gt;                                  = 17025
_exit(0)                                = ?
Process 17020 detached
box# /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
&lt;/pre&gt;
It seems that the loader problem was in another instance of deluged process. Let's look at strace help to see what we can do about it:
&lt;pre class="code"&gt;
box# strace -h
usage: strace [-dffhiqrtttTvVxx] [-a column] [-e expr] ... [-o file]
              [-p pid] ... [-s strsize] [-u username] [-E var=val] ...
              [command [arg ...]]
   or: strace -c [-e expr] ... [-O overhead] [-S sortby] [-E var=val] ...
              [command [arg ...]]
-c -- count time, calls, and errors for each syscall and report summary
&lt;b&gt;-f -- follow forks&lt;/b&gt;, -ff -- with output into separate files
-F -- attempt to follow vforks, -h -- print help message
-i -- print instruction pointer at time of syscall
-q -- suppress messages about attaching, detaching, etc.
-r -- print relative timestamp, -t -- absolute timestamp, -tt -- with usecs
-T -- print time spent in each syscall, -V -- print version
-v -- verbose mode: print unabbreviated argv, stat, termio[s], etc. args
-x -- print non-ascii strings in hex, -xx -- print all strings in hex
-a column -- alignment COLUMN for printing syscall results (default 40)
-e expr -- a qualifying expression: option=[!]all or option=[!]val1[,val2]...
   options: trace, abbrev, verbose, raw, signal, read, or write
-o file -- send trace output to FILE instead of stderr
-O overhead -- set overhead for tracing syscalls to OVERHEAD usecs
-p pid -- trace process with process id PID, may be repeated
-s strsize -- limit length of print strings to STRSIZE chars (default 32)
-S sortby -- sort syscall counts by: time, calls, name, nothing (default time)
-u username -- run command as username handling setuid and/or setgid
-E var=val -- put var=val in the environment for command
-E var -- remove var from the environment for command
&lt;/pre&gt;
Now we can give it another try, this time with the &lt;i&gt;-f&lt;/i&gt; option:
&lt;pre class="code"&gt;
box# strace -f /usr/bin/deluged
...
...
close(7)                                = 0
munmap(0x40006000, 4096)                = 0
open("./libbz2.so.1.0", O_RDONLY)       = -1 ENOENT (No such file or directory)
open(&lt;b&gt;"/mnt/C/sys/lib//libbz2.so.1.0"&lt;/b&gt;, O_RDONLY) = 7
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40006000
read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0$\21\0\000"..., 4096) = 4096
old_mmap(NULL, 57344, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40e57000
old_mmap(0x40e57000, 52556, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 7, 0) = 0x40e57000
old_mmap(0x40e64000, 3712, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 7, 0xd000) = 0x40e64000
close(7)                                = 0
munmap(0x40006000, 4096)                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40006000
write(2, "", 0)                         = 0
write(2, "/usr/bin/python", 15/usr/bin/python)         = 15
write(2, ": can\'t resolve symbol \'", 24: can't resolve symbol ') = 24
write(2, &lt;b&gt;"__cxa_pure_virtual"&lt;/b&gt;, 18__cxa_pure_virtual)      = 18
write(2, "\'\n", 2'
)                     = 2
munmap(0x40006000, 4096)                = 0
_exit(1)                                = ?
Process 17039 detached
&lt;/pre&gt;
Most likely the &lt;i&gt;libbz2.so&lt;/i&gt; module is requiring the unresolved &lt;i&gt;__cxa_pure_virtual&lt;/i&gt; symbol. 
&lt;br/&gt;
&lt;br/&gt;
Back to your problem, once we know the particular python extension requiring the 2 byte unicode version of the &lt;i&gt;DecodeUTF8&lt;/i&gt; method we can try to re-build or re-install it appropriately...
&lt;br/&gt;
&lt;br/&gt;
&lt;h4&gt;&lt;a name="Q3_2"&gt;Part II.&lt;/a&gt;&lt;/h4&gt;
&lt;pre&gt;
Dear Filodej,

you are right! I have followed your instructions and indeed this is the problem. 
I hope that the console output after executing strace commandes would be found 
usefull for you.
&lt;a href="http://geolos.blogspot.com/2008/12/console-output-of-strace-usrbindeluged.html"&gt;Here&lt;/a&gt; is the complete output from executing strace, and &lt;a href="http://geolos.blogspot.com/2008/12/console-output-of-strace-f.html"&gt;here&lt;/a&gt; for the strace -f.

Thank you in advance, for helping me out :-) hope others will benefit as well.

Regards,
Christos
&lt;/pre&gt;
Good, so the relevent part of your trace is here:
&lt;pre class="code"&gt;
$ strace -f /usr/bin/deluged
execve("/usr/bin/deluged", ["/usr/bin/deluged"], [/* 31 vars */]) = 0
...
ioctl(9, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffeddc8) = -1 ENOTTY (Inappropriate ioctl for device)
fstat64(9, {st_mode=S_IFREG|0755, st_size=411371, ...}) = 0
open(&lt;b&gt;"/usr/lib/python2.5/site-packages/_xmlplus/parsers/pyexpat.so"&lt;/b&gt;, O_RDONLY) = 10
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40006000
read(10, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0$7\0\000"..., 4096) = 4096
old_mmap(NULL, 180224, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4059c000
old_mmap(0x4059c000, 167720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 10, 0) = 0x4059c000
old_mmap(0x405c5000, 9872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 10, 0x29000) = 0x405c5000
close(10)                               = 0
munmap(0x40006000, 4096)                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40006000
write(2, "", 0)                         = 0
write(2, "/usr/bin/python", 15/usr/bin/python)         = 15
write(2, ": can\'t resolve symbol \'", 24: can't resolve symbol ') = 24
write(2, &lt;b&gt;"PyUnicodeUCS2_DecodeUTF8"&lt;/b&gt;, 24PyUnicodeUCS2_DecodeUTF8) = 24
write(2, "\'\n", 2'
)                     = 2
munmap(0x40006000, 4096)                = 0
_exit(1)                                = ?
Process 2748 detached
&lt;/pre&gt;

I wonder where did you get the &lt;i&gt;pyexpat&lt;/i&gt; library since I did not build the &lt;i&gt;PyXML&lt;/i&gt; as part of my &lt;a href="http://filodej.ic.cz/filopack/python-2.5.2.tgz"&gt;python package&lt;/a&gt;. Let's look at the JoKeR's package (it seems as a good candidate):
&lt;pre class="code"&gt;
box# wget http://mgb111.pradnik.net/addons/soft-lang/Python-25-PyXML-084.tar.gz
connected!

Length: 17,194,098 [application/x-gzip]

box# tar tzf Python-25-PyXML-084.tar.gz | grep pyexpat
&lt;b&gt;./sys/lib/python2.5/site-packages/_xmlplus/parsers/pyexpat.so&lt;/b&gt;
./sys/lib/python2.5/site-packages/_xmlplus/sax/drivers/drv_pyexpat.py
./sys/lib/python2.5/site-packages/_xmlplus/sax/drivers/drv_pyexpat.pyc
./sys/lib/python2.5/site-packages/_xmlplus/sax/drivers2/drv_pyexpat.py
./sys/lib/python2.5/site-packages/_xmlplus/sax/drivers2/drv_pyexpat.pyc
./sys/lib/python2.5/test/output/test_pyexpat
./sys/lib/python2.5/test/test_pyexpat.py
./sys/lib/python2.5/test/test_pyexpat.pyc
./sys/lib/python2.5/test/test_pyexpat.pyo
./sys/lib/python2.5/lib-dynload/pyexpat.so
&lt;/pre&gt;
Bingo! You probably did not remove the JoKeR's installation and just extract my python package over it.
&lt;br/&gt; 
Since I have built python with different unicode settings that JoKeR (it is nothing like Microsoft's intended incompatibilities, I swear I had no idea about it at the time ;-) now you are experiencing the missing symbol(s).
&lt;br/&gt;
&lt;br/&gt;
Just to make sure I am right in my assumption, I try to replicate your problem on my box. Let's extract the &lt;i&gt;_xmlplus&lt;/i&gt; directory from JoKeR's package:
&lt;pre class="code"&gt;
box# tar xzvf Python-25-PyXML-084.tar.gz ./sys/lib/python2.5/site-packages/_xmlplus/*
...
&lt;/pre&gt;
Now I can try to do some python xml parsing and see what happens:
&lt;pre class="code"&gt;
box# strace -o st.txt /usr/bin/python
Python 2.5.2 (r252:60911, May  3 2008, 16:19:27)
[GCC 3.3.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import xml.dom.minidom
&gt;&gt;&gt; xml.dom.minidom.parseString( '&lt;a&gt;test&lt;/a&gt;')
&lt;b&gt;/usr/bin/python: can't resolve symbol 'PyUnicodeUCS2_DecodeUTF8'&lt;/b&gt;
&lt;/pre&gt;
Great, now I am in the same trouble as you ;-)
&lt;br/&gt;
Let's look at the trace log:
&lt;pre class="code"&gt;
box# tail -n 20 st.txt
stat64("/usr/lib/python2.5/site-packages/_xmlplus/parsers/pyexpat", 0xbfff4a4c) = -1 ENOENT (No such file or directory)
open(&lt;b&gt;"/usr/lib/python2.5/site-packages/_xmlplus/parsers/pyexpat.so"&lt;/b&gt;, O_RDONLY|O_LARGEFILE) = 5
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfff49e8) = -1 ENOTTY (Inappropriate ioctl for device)
fstat64(5, {st_mode=S_IFREG|0755, st_size=411371, ...}) = 0
open("/usr/lib/python2.5/site-packages/_xmlplus/parsers/pyexpat.so", O_RDONLY) = 6
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40006000
read(6, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0$7\0\000"..., 4096) = 4096
old_mmap(NULL, 180224, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40310000
old_mmap(0x40310000, 167720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 6, 0) = 0x40310000
old_mmap(0x40339000, 9872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 6, 0x29000) = 0x40339000
close(6)                                = 0
munmap(0x40006000, 4096)                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40006000
write(2, "", 0)                         = 0
write(2, "/usr/bin/python", 15)         = 15
write(2, ": can\'t resolve symbol \'", 24) = 24
write(2, &lt;b&gt;"PyUnicodeUCS2_DecodeUTF8"&lt;/b&gt;, 24) = 24
write(2, "\'\n", 2)                     = 2
munmap(0x40006000, 4096)                = 0
_exit(1)                                = ?
&lt;/pre&gt;
and try to launch the deluge daemon:
&lt;pre class="code"&gt;
box# deluged.sh
box# /usr/bin/python: can't resolve symbol 'PyUnicodeUCS2_DecodeUTF8'
&lt;/pre&gt;
Ok, now I am pretty sure this is exactly your situation. Let's remove the &lt;i&gt;_xmlplus&lt;/i&gt; package again, we cannot use it anyway, since it is built incompatibly with the rest of the python framework:
&lt;pre class="code"&gt;
box# rm -d -r ./sys/lib/python2.5/site-packages/_xmlplus/
&lt;/pre&gt;
Now let's try the xml parsing and launch the deluge daemon again:
&lt;pre class="code"&gt;
box# python
Python 2.5.2 (r252:60911, May  3 2008, 16:19:27)
[GCC 3.3.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import xml.dom.minidom
&gt;&gt;&gt; xml.dom.minidom.parseString( '&amp;lt;a&amp;gt;test&amp;lt;/a&amp;gt;')
&amp;lt;xml.dom.minidom.Document instance at 0x4027940c&amp;gt;
&gt;&gt;&gt;

box# deluged.sh
box# 
&lt;/pre&gt;
Everything works again.
&lt;/br&gt;
&lt;/br&gt;
The removal of the &lt;i&gt;_xmlplus&lt;/i&gt; pyhon package should help in your case as well, but note that there could be other incompatible files. The ultimate solution would be to remove both python packages (mine and JoKeR's) and install just mine again. In case you needed the PyXML package (which seems unlikely to me, since it does not work for you anyway) I could sometimes build one compatible with 4-byte unicode.

&lt;a name="Q4"&gt;&lt;h3&gt;Unresolved 'g_assertion_message_expr' symbol&lt;/h3&gt;&lt;/a&gt;
&lt;h3&gt;Q:&lt;/h3&gt;
&lt;blockquote&gt;&lt;pre&gt;
Hello again,

I have erased everything from my box in order to perform a clean installation based on your instructions. 
Unfortunately, this didn't go as it was expected.
Initially I installed Deluge and all of the dependencies, apart from setuptools. 
This was due to the fact that I couldn't run python cause there was a library .so-something missing 
- unfortunately I did not write down the name.
In order to fix this (and hopefully it was fixed) I downloaded &amp; installed Joker's "minimal-config" &amp; "libs-essential".

Now when I run:
LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0 /usr/lib/libgcc_s.so" deluged -d

I am getting the following error:
/usr/bin/python: can't resolve symbol 'g_assertion_message_expr'
...
regards,
Christos
&lt;/pre&gt;&lt;/blockquote&gt;
&lt;h3&gt;A:&lt;/h3&gt;
First I googled a bit and found that the &lt;i&gt;g_assertion_message_expr&lt;/i&gt; symbol should be present in the &lt;i&gt;libglib-2.0.so&lt;/i&gt; library. It seemed little bit weird that you are experiencing such error, since this library is listed in my list of dependencies. It is clear that it needs a deeper analysis...
&lt;br/&gt;
&lt;br/&gt;
First let's make sure the &lt;i&gt;libglib&lt;/i&gt; library is really present on the system:
&lt;pre class="code"&gt;
box# ls -l /mnt/C/sys/lib/libglib*
-rwxr-xr-x 1 root root     878 2008-06-30 00:06 /mnt/C/sys/lib/libglib-2.0.la
lrwxrwxrwx 1 root root      23 2008-12-03 23:04 /mnt/C/sys/lib/libglib-2.0.so -&gt; libglib-2.0.so.0.1702.0
lrwxrwxrwx 1 root root      23 2008-12-03 23:04 /mnt/C/sys/lib/libglib-2.0.so.0 -&gt; libglib-2.0.so.0.1702.0
-rwxr-xr-x 1 root root 2631967 2008-04-17 12:34 &lt;b&gt;/mnt/C/sys/lib/libglib-2.0.so.0.1400.0&lt;/b&gt;
rwxr-xr-x 1 root root 1131687 2008-06-30 00:06 &lt;b&gt;/mnt/C/sys/lib/libglib-2.0.so.0.1702.0&lt;/b&gt;
&lt;/pre&gt;
... as can be seen there are two of them but just one of them is linked. This fact could be related to your problem.
&lt;br/&gt;
&lt;br/&gt;
We can learn what is present in &lt;a href="http://filodej.ic.cz/filopack/glib-2.17.2.tar.bz2"&gt;my glib package&lt;/a&gt;:
&lt;pre class="code"&gt;
box# ./filopack.sh --download glib-2.17.2                                 
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package glib-2.17.2 from http://filodej.ic.cz ...
connected!

Length: 21,692 [text/plain]
connected!

Length: 1,947,202 [application/x-tar]

box# tar tjvf glib-2.17.2.tar.bz2 | grep libglib
-rwxr-xr-x 0/0   1131687 2008-06-30 00:06:55 sys/lib/&lt;b&gt;libglib-2.0.so.0.1702.0&lt;/b&gt;
lrwxrwxrwx 0/0         0 2008-06-30 00:06:55 sys/lib/&lt;b&gt;libglib-2.0.so.0 -&gt; libglib-2.0.so.0.1702.0&lt;/b&gt;
lrwxrwxrwx 0/0         0 2008-06-30 00:06:55 sys/lib/&lt;b&gt;libglib-2.0.so -&gt; libglib-2.0.so.0.1702.0&lt;/b&gt;
-rwxr-xr-x 0/0       878 2008-06-30 00:06:55 sys/lib/libglib-2.0.la
&lt;/pre&gt;
So we see that the &lt;i&gt;2.17.2&lt;/i&gt; version comes from my package. What about the other one?
&lt;br/&gt;
&lt;br/&gt;
You write that you have downloaded &amp; installed Joker's "minimal-config" &amp; "libs-essential", so let's look at that:
&lt;pre class="code"&gt;
box# wget http://mgb111.pradnik.net/addons/libs-essential-20080502.tar.bz2
connected!

Length: 13,454,268 [application/x-bzip2]

box# tar tjvf libs-essential-20080502.tar.bz2 | grep libglib
-rwxr-xr-x 0/0       834 2008-04-17 12:34:55 ./sys/lib/libglib-2.0.la
lrwxrwxrwx 0/0         0 2008-05-10 20:41:07 ./sys/lib/&lt;b&gt;libglib-2.0.so -&gt; libglib-2.0.so.0.1400.0&lt;/b&gt;
lrwxrwxrwx 0/0         0 2008-05-10 20:41:07 ./sys/lib/&lt;b&gt;libglib-2.0.so.0 -&gt; libglib-2.0.so.0.1400.0&lt;/b&gt;
-rwxr-xr-x 0/0   2631967 2008-04-17 12:34:55 ./sys/lib/&lt;b&gt;libglib-2.0.so.0.1400.0&lt;/b&gt;
&lt;/pre&gt;
... ok, so another one (&lt;i&gt;2.14.0&lt;/i&gt; version) is from JoKeR's package.
&lt;br/&gt;
&lt;br/&gt;
Let's dig a little bit deeper, what about symbols?
&lt;pre class="code"&gt;
box# nm --dynamic /mnt/C/sys/lib/libglib-2.0.so.0.1702.0 | grep g_assertion_message_expr
0006409b T g_assertion_message_expr
box# nm --dynamic /mnt/C/sys/lib/libglib-2.0.so.0.1400.0 | grep g_assertion_message_expr
&lt;/pre&gt;
so it seems that the &lt;i&gt;g_assertion_message_expr&lt;/i&gt; symbol was introduced right between &lt;i&gt;14.0&lt;/i&gt; and &lt;i&gt;17.2&lt;/i&gt; versions (or possibly the lack of it in the older version is caused by different build configuration). In any case the problem was caused by the fact that you extracted JoKeR's &lt;i&gt;essential-libs&lt;/i&gt; package &lt;i&gt;AFTER&lt;/i&gt; my &lt;i&gt;glib&lt;/i&gt; package and thus effectively downgraded the glib from &lt;i&gt;2.17.2&lt;/i&gt; version down to &lt;i&gt;2.14.0&lt;/i&gt;.
&lt;br/&gt;
&lt;br/&gt;
Sorry for that complication, I built my system on top of JoKeR's &lt;i&gt;minimal-config&lt;/i&gt; and &lt;i&gt;libs-essential&lt;/i&gt; and I mention it in the &lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-box-with-jokers-fw.html"&gt;post about the box configuration&lt;/a&gt;; but it is sure my fault that I did not mention it explicitly among the deluge dependencies. I am doing it now to prevent further confusion.
&lt;br/&gt;
&lt;br/&gt;
That's all for now. You can now redirect the symlinks (&lt;i&gt;libglib-2.0.so&lt;/i&gt; and &lt;i&gt;libglib-2.0.so.0&lt;/i&gt;) by hand or better re-install &lt;a href="http://filodej.ic.cz/filopack/glib-2.17.2.tar.bz2"&gt;my glib package&lt;/a&gt;, supposedly it should fix your problem. As can be seen such subtle details like installation order can sometimes make a big difference :-)

&lt;a name="Q5"&gt;&lt;h3&gt;Missing bash shell&lt;/h3&gt;&lt;/a&gt;
&lt;h3&gt;Q:&lt;/h3&gt;
&lt;blockquote&gt;&lt;pre&gt;
...
Anyway, I then ran the "./filopack.sh --download deluge-1.0.5" line, and I got this: "-ash: ./filopack.sh: not found." Now, that's not good, right?

Any idea what it is that I'm doing wrong please?
...
&lt;/pre&gt;&lt;/blockquote&gt;
&lt;h3&gt;A:&lt;/h3&gt;
In a bash session with bash shell installed on the system the filopack script is running fine:
&lt;pre class="code"&gt;
box# ./filopack.sh
    
Stupid packaging system (version 0.3.7)

Usage:
 
  filopack.sh [OPTIONS] [&lt;action&gt;] [&lt;package-name&gt;]

Basic usage:
  ...
&lt;/pre&gt;
When we look at the first line of the script there is bash shell specified as an interpreter:
&lt;pre class="code"&gt;
box# head -n1 ./filopack.sh
#!/bin/bash
&lt;/pre&gt;
Let's look where is the bash shell installed:
&lt;pre class="code"&gt;
box# which bash
/usr/bin/bash
&lt;/pre&gt;
The /bin directory is on a read-only file system, but &lt;i&gt;/bin/bash&lt;/i&gt; is just a symlink to &lt;i&gt;/usr/bin/bash&lt;/i&gt;:
&lt;pre class="code"&gt;
box# ls -l /bin/bash 
lrwxrwxrwx 1 root root 19 2008-05-21 13:40 /bin/bash -&gt; /mnt/C/sys/bin/bash
&lt;/pre&gt;
Let's try to "delete" the bash shell for a moment:
&lt;pre class="code"&gt;
box# mv /usr/bin/bash{,.del}
&lt;/pre&gt;
Now when we try to run the filopack script:
&lt;pre class="code"&gt; 
box# ./filopack.sh           
-bash: ./filopack.sh: /bin/bash: bad interpreter: No such file or directory
&lt;/pre&gt;
The bash shell (we are still running the bash session even if the bash executable is removed) is sufficiently verbose in its error messages so the cause of the problem is obvious. Let's try the same in ash shell:
&lt;pre class="code"&gt;
box# ash
box$ cd /mnt/C/
box$ ./filopack.sh
ash: ./filopack.sh: not found
&lt;/pre&gt;
Ok now we have replicated your problem. You have to install the bash shell in order to run the filopack script.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-4045741810177951321?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/4045741810177951321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=4045741810177951321' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/4045741810177951321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/4045741810177951321'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/11/questions-and-answers-this-post-will.html' title=''/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-7587650561211952282</id><published>2008-11-24T22:10:00.048+01:00</published><updated>2009-01-16T13:44:31.143+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Deluge torrent 1.0.5 (part IV)</title><content type='html'>&lt;h3&gt;Screenshots&lt;/h3&gt;
Finally I found time to build the full version of &lt;a href="http://deluge-torrent.org/"&gt;deluge bittorrent client&lt;/a&gt; (version 1.0.5) and create a &lt;a href="http://filodej.ic.cz/filopack/deluge-1.0.5.tar.bz2"&gt;package&lt;/a&gt; for it.
&lt;br/&gt;
&lt;br/&gt;
&lt;div style="text-align:center"&gt;
Deluge 1.0.5 GTK client&lt;br/&gt;
(running on CoLinux with Debian 4.0, XMing server running on WinXP)
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/STBzXSBpZsI/AAAAAAAACRM/e6L4Kjwqd5E/s1600-h/colinux-about.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 324px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/STBzXSBpZsI/AAAAAAAACRM/e6L4Kjwqd5E/s400/colinux-about.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273842007463782082" /&gt;
&lt;/a&gt;
Deluge 1.0.5 GTK client&lt;br/&gt;
(running on WinXP)
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/STB0P05P0sI/AAAAAAAACRk/mRAZqFI0BQ8/s1600-h/win-xp-about.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 332px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/STB0P05P0sI/AAAAAAAACRk/mRAZqFI0BQ8/s400/win-xp-about.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273842978896466626" /&gt;
&lt;/a&gt;
Deluge 1.0.5 GTK client&lt;br/&gt;
(running on Ubuntu 8.04)
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STBzX6CKyOI/AAAAAAAACRc/tt58PPAiTFU/s1600-h/ubuntu-about.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 305px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STBzX6CKyOI/AAAAAAAACRc/tt58PPAiTFU/s400/ubuntu-about.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273842018203388130" /&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;h3&gt;Build result&lt;/h3&gt;
&lt;a href="http://filodej.ic.cz/filopack/deluge-1.0.5.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/deluge-1.0.5.lst"&gt;[file list]&lt;/a&gt;
&lt;br/&gt;

&lt;b&gt;Prerequisites:&lt;/b&gt;
&lt;a href="http://mgb111.pradnik.net/addons/minimal-config.tar"&gt;[JoKeR's minimal config]&lt;/a&gt;
&lt;a href="http://mgb111.pradnik.net/addons/libs-essential-20080502.tar.bz2"&gt;[JoKeR's essential libs]&lt;/a&gt;
&lt;br/&gt;
For filopack system: &lt;a href="http://mgb111.pradnik.net/addons/soft-shells/bash-3.2.33-3.tar.gz"&gt;[JoKeR's bash shell]&lt;/a&gt; 
&lt;a href="http://mgb111.pradnik.net/addons/busybox2-extended.tar.gz"&gt;[JoKeR's busybox extended]&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Dependencies:&lt;/b&gt;
&lt;a href="http://filodej.ic.cz/filopack/deluge-1.0.5-gcclibs.tar.bz2"&gt;[gcc libraries]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/glib-2.17.2.tar.bz2"&gt;[glib]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/readline-5.2.tar.bz2"&gt;[readline]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/boost-1.35.0.tar.bz2"&gt;[boost]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/python-2.5.2.tar.bz2"&gt;[python]&lt;/a&gt;
&lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-built-sw-trac-011rc1.html"&gt; [setuptools]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/dbus-1.2.1.tar.bz2"&gt;[DBus]&lt;/a&gt; 
&lt;a href="http://filodej.ic.cz/filopack/dbus-glib-0.76.tar.bz2"&gt;[DBus-glib]&lt;/a&gt; 
&lt;a href="http://filodej.ic.cz/filopack/dbus-python-0.82.4.tar.bz2"&gt;[DBus-python]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/pygobject-2.14.2.tar.bz2"&gt;[pygobject]&lt;/a&gt; 
&lt;a href="http://filodej.ic.cz/filopack/pyxdg-0.15.tar.bz2"&gt;[pyxdg]&lt;/a&gt; 
&lt;br/&gt;
&lt;b&gt;GUI dependencies:&lt;/b&gt;
&lt;a href="http://filodej.ic.cz/filopack/x11-7.1.tar.bz2"&gt;[X.Org]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/gtk+-2.13.3.tar.bz2"&gt;[Gtk+]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/pycairo-1.4.12.tar.bz2"&gt;[pycairo]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/pygtk-2.12.1.tar.bz2"&gt;[pygtk]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/atk-1.22.0.tar.bz2"&gt;[atk]&lt;/a&gt; 
&lt;a href="http://filodej.ic.cz/filopack/glade3-3.4.5.tar.bz2"&gt;[glade]&lt;/a&gt; 
&lt;br/&gt;
Edit: Regarding to &lt;a href="http://forum.ixbt.com/topic.cgi?id=11:38294:434#430"&gt;this post&lt;/a&gt; it seems that &lt;i&gt;[pygobject]&lt;/i&gt; and &lt;i&gt;[pyxdg]&lt;/i&gt; packages are needed even for non-gui mode.

&lt;h3&gt;Overview&lt;/h3&gt;
First I'll demonstrate the shortest path (given all the needed dependencies are already installed). Then I describe the build and package creation process, since I feel that such information can be helpful when something goes wrong.
&lt;h3&gt;Download &amp; Install&lt;/h3&gt;
We can utilize the &lt;a href="http://filodej.blogspot.com/2008/11/simple-packaging-sysetm.html"&gt;filopack system&lt;/a&gt; for that purpose. In case we do not have it we can simply download it (and make executable) as follows:
&lt;pre class="code"&gt;
box# cd /mnt/C
box# wget &lt;a href="http://filodej.ic.cz/filopack/filopack.sh"&gt;http://filodej.ic.cz/filopack/filopack.sh&lt;/a&gt;
box# chmod 755 filopack.sh
&lt;/pre&gt;
First action we have to do is to uninstall the previous Deluge version (assumed we have both &lt;i&gt;Deluge 0.9.03&lt;/i&gt; and &lt;i&gt;./filopack.sh&lt;/i&gt; installed on the box):
&lt;pre class="code"&gt;
box# cd /mnt/C
box# ./filopack.sh --remove deluge-0.9.03
Configuration file .filopack/.config file found and used
Sure to remove deluge-0.9.03 locally at /mnt/C (y/n)?y
...
&lt;/pre&gt;
Now we can download the package:
&lt;pre class="code"&gt;
box# cd /mnt/C
box# ./filopack.sh --download deluge-1.0.5
[root@storage C]# ./filopack.sh --download deluge-1.0.5
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package deluge-1.0.5 from http://filodej.ic.cz ...
connected!

Length: 68,332 [text/plain]
connected!

Length: 15,645,450 [application/x-tar]
&lt;/pre&gt;
And the last step is to install it:
&lt;pre class="code"&gt;
box# ./filopack.sh --install deluge-1.0.5
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack deluge-1.0.5 locally at /home/petr (y/n)?
...
&lt;/pre&gt;
Now, we are done (if we are lucky ;-)
&lt;br/&gt;
&lt;br/&gt;
I added scripts (&lt;i&gt;deluge.sh&lt;/i&gt; and &lt;i&gt;deluged.sh&lt;/i&gt;) which we can run in place of original loader scripts (&lt;i&gt;deluge&lt;/i&gt; and &lt;i&gt;deluged&lt;/i&gt;) which are working around the weird problems with dynamic loader missing some symbols.&lt;br/&gt;
&lt;pre class="code"&gt;
box# cat /mnt/C/sys/bin/deluged.sh
LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" deluged
&lt;/pre&gt;
So if you already have the /mnt/C/sys/bin/ directory in your PATH now instead of:
&lt;pre class="code"&gt;
box# deluged
/usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
&lt;/pre&gt;
... you can simple type:
&lt;pre class="code"&gt;
box# deluged.sh
&lt;/pre&gt;
It is great that the daemon mode is now supported and we can run the GTK GUI remotely (even so the demands of python runtime are relatively high for the box).&lt;br/&gt; 
In following figures you can see the clients running on Ubuntu and WinXP both connected to the daemon running on the box.
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/STB4Hn6WDzI/AAAAAAAACRs/B0kfWrv0lgY/s1600-h/storage-ubuntu-downloading.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 286px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/STB4Hn6WDzI/AAAAAAAACRs/B0kfWrv0lgY/s400/storage-ubuntu-downloading.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273847236018966322" /&gt;&lt;/a&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/STB4H3cBRrI/AAAAAAAACR0/JaWrDtvc-PM/s1600-h/storage-winxp-downloading.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 221px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/STB4H3cBRrI/AAAAAAAACR0/JaWrDtvc-PM/s400/storage-winxp-downloading.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273847240186742450" /&gt;&lt;/a&gt;
In previous figure there is also the client running on the box - it can be seen that its progress controls are way behind the real time and even the PC running client does not receive much information from the daemon. In such situations everything becomes reaaaalllllly sloooowwww as the box can't catch the train.
&lt;br/&gt;
&lt;br/&gt;
It is obvious that it is not a good idea to run GTK client directly on the box, since it pushes its HW resources really to its limits, but in is nice that it (no matter how slowly) works.
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/STB4H2-hJtI/AAAAAAAACR8/z9GwRRsD1lM/s1600-h/storage-winxp-2-clients.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 252px;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/STB4H2-hJtI/AAAAAAAACR8/z9GwRRsD1lM/s400/storage-winxp-2-clients.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273847240063002322" /&gt;&lt;/a&gt;

&lt;span class="fullpost"&gt;
&lt;h3&gt;Build &amp; Pack&lt;/h3&gt;
Everything necessary for successful build was already described in previous three parts of this series, this part just collects the information and describes the whole building process step-by-step. 
&lt;br/&gt;
&lt;br/&gt;
Same as in the previous case we have to uninstall the old Deluge version (0.9.03)
&lt;pre class="code"&gt;
dev# cd /mnt/C
dev# ./filopack.sh --remove deluge-0.9.03
Configuration file .filopack/.config file found and used
Sure to remove deluge-0.9.03 locally at /mnt/C (y/n)?
...
&lt;/pre&gt;
Now we are ready to start the building process. First thing we have to do is to create a timestamp file. With help of this file the packaging system determines what files are included to the resulting package.
&lt;pre class="code"&gt;
dev# ./filopack.sh --init  deluge-1.0.5
Configuration file .filopack/.config file found and used
Timestamp written to file .filopack/deluge-1.0.5.ts
&lt;/pre&gt;
Now we can download and extract the sources.
&lt;pre class="code"&gt;
dev# cd /usr/local/src/
dev# wget http://download.deluge-torrent.org/source/1.0.5/deluge-1.0.5.tar.bz2
...
dev# tar xjvf deluge-1.0.5.tar.bz2
dev# cd /usr/local/src/deluge-1.0.5
&lt;/pre&gt;
We have to do the following steps in order to make a successful build:
&lt;br/&gt;
(For explanations see previous parts of this series)
&lt;br/&gt;
Add proper paths to boost header files and libraries
&lt;pre class="code"&gt;
dev# export CFLAGS=-I/mnt/C/sys/include/boost-1_35
dev# export LDFLAGS=-L/mnt/C/sys/lib
&lt;/pre&gt;
Add missing IPV6 related macro to &lt;i&gt;socket.hpp&lt;/i&gt; header file:
&lt;pre class="code"&gt;
dev# nano libtorrent/include/libtorrent/socket.hpp
    add:
      #ifndef IPV6_V6ONLY
      #define IPV6_V6ONLY 26
      #endif
&lt;/pre&gt; 
Disable the memory debugging (file &lt;i&gt;libtorrent/src/memdebug.cpp&lt;/i&gt;) from the build. You can:&lt;br/&gt;
- either modify the &lt;i&gt;Makefile&lt;/i&gt; &lt;br/&gt;
- or clear the &lt;i&gt;memdebug.cpp&lt;/i&gt; &lt;br/&gt;
- or use the preprocessor condition: 
&lt;pre class="code"&gt;
      #if 0
        ...
      #endif
&lt;/pre&gt;
Now we are ready to start the build and installation:
&lt;pre class="code"&gt;
dev# python setup.py build 
...
dev# python setup.py install --prefix=/mnt/C/sys/
...
&lt;/pre&gt;
If the build and installation succeeded, we are almost done. Now, when we try to start the deluge daemon, the dynamic loader is missing some symbols (it was same with previous version, I am possibly doing something wrong but do not know what).
&lt;pre class="code"&gt;
dev# deluged
dev# /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
&lt;/pre&gt;
At least we have the workaround - library preload, with following triar and error method we get the set of libraries to be rpe-loaded:
&lt;pre class="code"&gt;
dev# LD_PRELOAD=/usr/lib/libstdc++.so.6 deluged
dev# /usr/bin/python: can't resolve symbol 'BIO_free'

dev# LD_PRELOAD="/usr/lib/libstdc++.so.6 /usr/lib/libssl.so.0.9.7" deluged
dev# /usr/bin/python: can't resolve symbol '_ZN5boost6system18get_posix_categoryEv'

dev# LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" deluged
&lt;/pre&gt;
OK, now it works. We can prepare the loader script with previous command-line:
&lt;pre class="code"&gt;
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" deluged \"\$@\" &gt; /mnt/C/sys/bin/deluged.sh
dev# chmod +x /mnt/C/sys/bin/deluged.sh 
&lt;/pre&gt;
Now (if we have the &lt;i&gt;/mnt/C/sys/bin&lt;/i&gt; in our PATH) we can run the deluge daemon as follows:
&lt;pre class="code"&gt;
dev# deluged.sh
&lt;/pre&gt;
For deluge client the symbol problem is the same, so we prepare a loader script as well:
&lt;pre class="code"&gt;
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" \"\$@\" deluge &gt; /mnt/C/sys/bin/deluge.sh
dev# chmod +x /mnt/C/sys/bin/deluge.sh 
&lt;/pre&gt;
Now we try to launch the GUI (GTK client) but some problems still remain:
&lt;pre class="code"&gt;
dev# deluge.sh
...
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/common.py", line 142, in get_logo
    size, size)
gobject.GError: Unrecognized image file format
&lt;/pre&gt;
We already solved this problem with previous version, so we know the receipt:
&lt;pre class="code"&gt;
dev# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/common.py
&lt;/pre&gt;
Let's try again:
&lt;pre class="code"&gt;
dev# deluge.sh
...
  self.window.show()
/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/ui/gtkui/mainwindow.py:95: GtkWarning: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed
  self.window.show()
Segmentation fault
&lt;/pre&gt;
We forgot the set up the DISPLAY environment variable properly (Actually I do not know why it crashes in such case, but the truth is that proper DISPLAY setup solves the problem):
&lt;pre class="code"&gt;
dev# export DISPLAY=&amp;lt;x-server-ip&amp;gt;
&lt;/pre&gt;
One more thing we have to do is to let python know the path to the deluge egg:
&lt;pre class="code"&gt;
dev# cd /mnt/C/sys/lib/python2.5/site-packages
dev# echo "./deluge-1.0.5-py2.5-linux-i686.egg" &gt; deluge.pth 
&lt;/pre&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STBzXpMXktI/AAAAAAAACRU/n_OPw0tp8Qo/s1600-h/colinux-winxp.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 306px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STBzXpMXktI/AAAAAAAACRU/n_OPw0tp8Qo/s400/colinux-winxp.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273842013682766546" /&gt;&lt;/a&gt;

Finally we are ready to create the deluge-1.0.5 package:
&lt;pre class="code"&gt;
dev# cd /mnt/C
dev# ./filopack.sh --pack deluge-1.0.5
&lt;/pre&gt;
&lt;h3&gt;Remote install&lt;/h3&gt;
Now we have the package created locally on the "mirror" system (colinux debian in my case). But we have to get it to the box. The filopack script can help us with this task as well.
&lt;br/&gt;
&lt;br/&gt;
First we have to uninstall the previous deluge version from the box. We can definitely do it locally on the box itself, but we can also do it remotely:
&lt;pre class="code"&gt;
dev# ./filopack.sh -r --remove deluge-0.9.03
Configuration file .filopack/.config file found and used
Sure to remove deluge-0.9.03 remotely at root@storage:/mnt/C (y/n)?y
...
&lt;/pre&gt;
If we want to make sure that the previously installed software is gone, we can look at the package summary (unfortunately this feature is supported only locally). So from the box shell we can do following:
&lt;pre class="code"&gt;
box# ./filopack.sh --summary
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)

Filodej package summary:
Package name                          downloaded [#installed/#total]
--------------------------------------------------------------------
Mesa-7.0.3                                no           [   0/  49]
MesaDemos-7.0.3                           no           [ 129/ 129]
atk-1.22.0                                no           [ 160/ 160]
audiofile-0.2.6                           no           [   0/  13]
binutils-2.18                             no           [ 140/ 140]
boost-1.35.0                              no           [5195/5195]
cairo-1.6.4                               no           [  76/  76]
code2html-0.9.1                           no           [   2/   2]
cvstrac-2.0.1-3                           no           [   3/   3]
dbus-1.2.1                                no           [  38/  38]
dbus-glib-0.76                            no           [  32/  32]
dbus-python-0.82.4                        no           [  66/  66]
&lt;b&gt;deluge-0.9.03                        no          [   0/ 673]&lt;/b&gt;
didiwiki-0.5                              no           [   1/   1]
faad2-2.6.1                               no           [   0/   8]
...
&lt;/pre&gt;
Now we are back in the "mirror" system console and we can upload the (newly created) package to the box:
&lt;pre class="code"&gt;
dev# ./filopack.sh -r --upload deluge-1.0.5 
Configuration file .filopack/.config file found and used
Sure to upload deluge-1.0.5 to root@storage:/mnt/C (y/n)?y
root@storage's password: 
deluge-1.0.5.tar.bz2                                                100%   15MB 318.3KB/s   00:48    
&lt;/pre&gt;
And perform the remote installation as well:
&lt;pre class="code"&gt;
dev# ./filopack.sh -r --install deluge-1.0.5
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Module deluge-1.0.5 not found in package list - use 'tar.bz2' extension
Sure to unpack deluge-1.0.5 remotely at root@storage:/mnt/C (y/n)?y
root@storage's password: 
...
&lt;/pre&gt;
Deluge daemon (&lt;i&gt;deluged.sh&lt;/i&gt;) now works OK on the box.&lt;br/&gt; 
&lt;br/&gt; 
The only remaining problem is following. When we run the GTK GUI client (&lt;i&gt;deluge.sh&lt;/i&gt;) we get following error:
&lt;pre class="code"&gt;
box# deluge.sh
...
gobject.GError: Failed to open file '/tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/inactive16.png': No such file or directory
&lt;/pre&gt;
When we look to the &lt;i&gt;/tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/&lt;/i&gt; directory there is not a &lt;i&gt;inactive16.png&lt;/i&gt; there is just &lt;i&gt;inactive16.png0000644&lt;/i&gt; file and the same is with &lt;i&gt;checking16.png&lt;/i&gt; file.
&lt;br/&gt;
It seems it is a bug in tar implementation, the file permissions are "leaking out" to the name (see &lt;a href="http://code.google.com/p/theunarchiver/issues/detail?id=108"&gt;this issue description&lt;/a&gt; or &lt;a href="http://www.powerarchiver.com/forums/showthread.php?t=2363&amp;page=2"&gt;this forum&lt;/a&gt;).&lt;br/&gt;
&lt;br/&gt;
The solution is easy in this case:
&lt;pre class="code"&gt;
box# mv /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/inactive16.png{0000644,}
box# mv /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/checking16.png{0000644,}
&lt;/pre&gt;
When you run the deluge and it looks similar like this:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STB4IHWJRfI/AAAAAAAACSE/OE9nCZlmPrc/s1600-h/storage-winxp-nofonts.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 269px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STB4IHWJRfI/AAAAAAAACSE/OE9nCZlmPrc/s400/storage-winxp-nofonts.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273847244457068018" /&gt;&lt;/a&gt;
... then there are some missing links to font directories:
&lt;pre class="code"&gt;
box# mkdir /usr/share/fonts
box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/OTF /usr/share/fonts/X11-OTF
box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/TTF /usr/share/fonts/X11-TTF
&lt;/pre&gt;
&lt;a name="setup"&gt;&lt;h3&gt;Setup&lt;/h3&gt;&lt;/a&gt;
Now (after the update of the &lt;a href="http://filodej.blogspot.com/2008/12/wmu-6500fs-built-sw-python-252.html"&gt;python package&lt;/a&gt;) we are able to run the console client right on the box:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/ST7dD9W0_hI/AAAAAAAACTE/FtfCjGdh-jQ/s1600-h/deluge-ui-null.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 278px; height: 400px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/ST7dD9W0_hI/AAAAAAAACTE/FtfCjGdh-jQ/s400/deluge-ui-null.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5277898873404456466" /&gt;&lt;/a&gt;
We can read the configuration options:
&lt;pre class="code"&gt;
&amp;gt;  configs             

* add_paused: False
* allow_remote: &lt;b&gt;False&lt;/b&gt;
* auto_managed: True
* autoadd_enable: False
* autoadd_location: C
* compact_allocation: False
* config_location: /mnt/C/sys/root/.config/deluge
...
* daemon_port: &lt;b&gt;58846&lt;/b&gt;
...
&lt;/pre&gt;
If we want access the daemon remotely, we can set it up as follows (of course it is possible to change the port as well):
&lt;pre class="code"&gt;
&amp;gt; config-set allow_remote &lt;b&gt;True&lt;/b&gt;

* Configuration value successfully updated.

&amp;gt;  quit 

Thanks
box#
&lt;/pre&gt;
Now we have to restart the daemon (if it is running):
&lt;pre class="code"&gt;
box# killall deluged
box# deluged.sh
&lt;/pre&gt;
... and we are set up to access the daemon remotely (from PC running either Linux or Windows) as can be seen on following screenshots:
&lt;div style="text-align:center"&gt;
Deluge 1.0.5 GTK client&lt;br/&gt;
(running on WinXP)
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/STB0P05P0sI/AAAAAAAACRk/mRAZqFI0BQ8/s1600-h/win-xp-about.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 332px;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/STB0P05P0sI/AAAAAAAACRk/mRAZqFI0BQ8/s400/win-xp-about.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273842978896466626" /&gt;
&lt;/a&gt;
Deluge 1.0.5 GTK client&lt;br/&gt;
(running on Ubuntu 8.04)
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STBzX6CKyOI/AAAAAAAACRc/tt58PPAiTFU/s1600-h/ubuntu-about.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 305px;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/STBzX6CKyOI/AAAAAAAACRc/tt58PPAiTFU/s400/ubuntu-about.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5273842018203388130" /&gt;
&lt;/a&gt;
&lt;/div&gt;

That's all for now.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-7587650561211952282?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/7587650561211952282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=7587650561211952282' title='49 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7587650561211952282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7587650561211952282'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/11/wmu-6500fs-deluge-torrent-part-iv.html' title='WMU-6500FS - Deluge torrent 1.0.5 (part IV)'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xFBIBcRhwFQ/STBzXSBpZsI/AAAAAAAACRM/e6L4Kjwqd5E/s72-c/colinux-about.png' height='72' width='72'/><thr:total>49</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-6805231346786368953</id><published>2008-11-21T15:37:00.030+01:00</published><updated>2008-12-29T19:26:28.664+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>Simple packaging system</title><content type='html'>&lt;h3&gt;Overview&lt;/h3&gt;
In this post I want to describe the &lt;a href="http://filodej.ic.cz/filopack/filopack.sh"&gt;filopack&lt;/a&gt; bash script, very simple (and stupid) packaging system I have prepared to ease the package manipulation. It is implemented specifically as a helper for packages presented here, but it could be used for any other system as well. It aims to help potential users with the installation process. It would be definitely better to base such a system on a well established package system like for example &lt;a href="http://nixdoc.net/man-pages/Linux/aptitude.1.html"&gt;aptitude&lt;/a&gt;, rather than create my own (primitive) system from scratch, but unfortunately I had no time to study the aptitude yet (probably it would be much easier than I imagine) and started to practically learn the &lt;a href="http://www.gnu.org/software/bash/manual/bashref.html"&gt;bash scripting&lt;/a&gt; instead ;-) 
&lt;br/&gt;
&lt;br/&gt;
Following examples should explain the basic usage of the &lt;i&gt;filopack&lt;/i&gt; packaging system. This tool serves for package enumeration, downloading, installation and un-instalation as well as package creation and uploading. However it does not handle dependencies at all, it just simplifies the installation routine, YOU have to know what packages you need. 
&lt;br/&gt;
&lt;br/&gt;
The system is suitable for usage on the box itself as well as on the chroot-ed "mirror" system. Also besides the downloading and installation of pre-built packages, it can be used for a creation user-built packages from source code. I consider the latter two scenarios as "advanced" and will cover separately from the "basic" usage scenario - it means downloading and installing pre-built packages directly to the box.   

&lt;span class="fullpost"&gt;
&lt;h3&gt;Basic usage&lt;/h3&gt;
In this scenario a user just wants to download and extract a package directly to the WMU box. This section will cover this scenario step by step.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Bash shell&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
In order to use the filopack script you need to have the &lt;a href="http://en.wikipedia.org/wiki/Bash"&gt;bash shell&lt;/a&gt; installed on the system. You can use the &lt;a href="http://mgb111.pradnik.net/addons/soft-shells/bash-3.2.33-3.tar.gz"&gt;JoKeR's prebuilt package&lt;/a&gt;:
&lt;pre class="code"&gt;
box# cd /mnt/C/
box# wget &lt;a href="http://mgb111.pradnik.net/addons/soft-shells/bash-3.2.33-3.tar.gz"&gt;http://mgb111.pradnik.net/addons/soft-shells/bash-3.2.33-3.tar.gz&lt;/a&gt;
box# tar xzvf bash-3.2.33-3.tar.gz
...
&lt;/pre&gt;
Now you can possibly set it as root's and users' shell:
&lt;pre class="code"&gt;
box# nano /mnt/C/sys/etc/env-ng 
...
&lt;i&gt;
# change root shell to bash (if exist)
ROOTSHELL=&lt;b&gt;1&lt;/b&gt;

# change users shell to bash (if exist)
USERSHELL=&lt;b&gt;1&lt;/b&gt;
&lt;/i&gt;
&lt;/pre&gt;
&lt;br/&gt;
&lt;b&gt;Busybox extended&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;pre class="code"&gt;
box# cd /mnt/C/
box# wget &lt;a href="http://mgb111.pradnik.net/addons/busybox2-extended.tar.gz"&gt;http://mgb111.pradnik.net/addons/busybox2-extended.tar.gz&lt;/a&gt;
box# tar xzvf busybox2-extended.tar.gz
...
&lt;/pre&gt;
Make sure you have the &lt;i&gt;/usr/bin&lt;/i&gt; (symlink to &lt;i&gt;/mnt/C/sys/bin&lt;/i&gt;) in your &lt;i&gt;PATH&lt;/i&gt; environment variable.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Download&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
The script can be downloaded from the &lt;i&gt;Packages&lt;/i&gt; section or you can get it from console via &lt;a href="http://linux.about.com/od/commands/l/blcmdl1_wget.htm"&gt;wget&lt;/a&gt; as follows (of course you have to make it executable via &lt;a href="http://www.computerhope.com/unix/uchmod.htm"&gt;chmod&lt;/a&gt; command):
&lt;pre class="code"&gt;
box# cd /mnt/C
box# wget &lt;a href="http://filodej.ic.cz/filopack/filopack.sh"&gt;http://filodej.ic.cz/filopack/filopack.sh&lt;/a&gt;
box# chmod 755 filopack.sh
&lt;/pre&gt;
&lt;br/&gt;
&lt;b&gt;Usage&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
Now we have the script ready to be used. When we start it with no arguments it just prints the command line documentation. It covers "basic" usage which is suitable for most users. 
&lt;pre class="code"&gt;
box# ./filopack.sh
Stupid packaging system (version 0.3.6)

Usage:
 
  filopack.sh [OPTIONS] [&amp;lt;action&amp;gt;] [&amp;lt;package-name&amp;gt;]

Basic usage:

  Basic actions: 
    (typically used when you just download and install/uninstall pre-built packages)

    --help     ... prints detailed help message
    --version  ... prints version of the script
    --config   ... perform system (re)configuration
    --packages ... lists all packages available for download
    --download ... downloads a selected package
    --print    ... just prints the files of selected package
    --install  ... unpacks (installs) the package  
    --delete   ... deletes the given package archive
    --remove   ... removes (uninstalls) the package
    --summary  ... generates a summary of installed packages
&lt;/pre&gt;
In case one wants to create own packages or perform remote package installation there is also the "advanced" mode supported. I'll come back to this mode later.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Initial configuration&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
Now we have to configure the package destination directory (/mnt/C by default) as well as box IP/hostname and username. Latter two parameters are used just for remote packaging and so "basic" users can simply ignere it and leave the default values. With &lt;i&gt;--config&lt;/i&gt; action we can re-configure system any time later.
&lt;pre class="code"&gt;
box# ./filopack.sh --config
Destination address and user not configured (.filopack/.config file not found)
Insert destination directory [/mnt/C]: 
Insert box IP address or hostname (remote packaging only)[storage]: 
Insert box user account (remote packaging only) [root]: 
Settings stored to .filopack/.config file
&lt;/pre&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Package listing&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
Now we are ready to retrieve the list of available packages. Individual package names are used as identifiers for package installation/uninstallation.
&lt;pre class="code"&gt;
box# ./filopack.h --packages
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Available packages:
Mesa-7.0.3
MesaDemos-7.0.3
atk-1.22.0
audiofile-0.2.6
binutils-2.18
boost-1.35.0
cairo-1.6.4
code2html-0.9.1
cvstrac-2.0.1-3
dbus-1.2.1
dbus-glib-0.76
dbus-python-0.82.4
deluge-0.9.03
didiwiki-0.5
faad2-2.6.1
file-4.24
flac-1.2.1
fontconfig-2.6.0
gcc-4.1.2-sjlj
git-1.5.5.3
glade3-3.4.5
glib-2.17.2
gperf-3.0.3
gtk+-2.13.3
highlight-2.6.10
htop-0.8
httpd-2.2.8
jasper-1.701.0-2
jpeg-6b
libao-0.8.8
libglade-2.6.2
libid3tag-0.15.1b
libmikmod-3.2.0-beta2
libogg-1.1.3
libvorbis-1.2.0
libxcb-1.1
libxml2-2.6.30
libxslt-1.1.22
lsof-4.78
mod_python-3.3.1
mpd-0.13.2
pango-1.21.3
pycairo-1.4.12
pygobject-2.14.2
pygtk-2.12.1
python-2.5.2
pyxdg-0.15
source-highlight-1.9
sqlite-3.5.8
strace-4.5.15
streamripper-1.63.1
subversion-1.5.0
tiff-3.8.2
x11-7.1
xcb-util-0.2
&lt;/pre&gt;
&lt;br/&gt;
&lt;b&gt;Package retrieval&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
Let's say we are interested in the &lt;i&gt;htop-0.8&lt;/i&gt; package and we want to learn the contents. 

&lt;pre class="code"&gt;
box# ./filopack.sh --print htop-0.8
.filopack/htop-0.8.lst: No such file or directory
&lt;/pre&gt;

Unfortunately in this version we have to download the whole package in order to learn the contents (Maybe it will be changed in a future version).
&lt;br/&gt;
We can use the following action in order to download the package:

&lt;pre class="code"&gt;
box# ./filopack.sh --download htop-08 
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Package htop-08 not available (try to use --packages switch)
&lt;/pre&gt;

Once more, now with the correct package name:

&lt;pre class="code"&gt;
box# ./filopack.sh --download htop-0.8
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package htop-0.8 from http://filodej.ic.cz ...
connected!

Length: 102 [text/plain]
connected!

Length: 224,259 [application/x-gtar]
&lt;/pre&gt;

Now we are ready to print the package contents:

&lt;pre class="code"&gt;
box# ./filopack.sh --print htop-0.8
sys/bin/htop
sys/share/man/man1/htop.1
sys/share/applications/htop.desktop
sys/share/pixmaps/htop.png
&lt;/pre&gt;
&lt;br/&gt;
&lt;b&gt;Package installation&lt;/b&gt;
&lt;br/&gt;
&lt;pre class="code"&gt;
box# ./filopack.sh --install htop-0.8
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack htop-0.8 locally at /mnt/C (y/n)?y
sys/bin/htop
sys/share/man/man1/htop.1
sys/share/applications/htop.desktop
sys/share/pixmaps/htop.png
&lt;/pre&gt;

Now if you want to spare some disk space, you can delete the package archive file:

&lt;pre class="code"&gt;
box# ./filopack.sh --delete htop-0.8 
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Are you sure to delete the htop-0.8.tgz archive (y/n)?y
&lt;/pre&gt;
&lt;br/&gt;
&lt;b&gt;Package removal&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
If later on you change your mind and decide to remove the package, you can do it as follows:

&lt;pre class="code"&gt;
box# ./filopack.sh --remove htop-0.8
Configuration file .filopack/.config file found and used
Sure to remove htop-0.8 locally at /mnt/C (y/n)?y
&lt;/pre&gt;

... and now if you try to uninstall the same package again, operation fails (since there are no such files).
&lt;pre class="code"&gt;
box# ./filopack.sh --remove htop-0.8
Configuration file .filopack/.config file found and used
Sure to remove htop-0.8 locally at /mnt/C (y/n)?y
rm: cannot remove `sys/bin/htop': No such file or directory
rm: cannot remove `sys/share/man/man1/htop.1': No such file or directory
rm: cannot remove `sys/share/applications/htop.desktop': No such file or directory
rm: cannot remove `sys/share/pixmaps/htop.png': No such file or directory
&lt;/pre&gt;

You may also want to get a summary what packages are available and what package archives are downloaded and/or installed.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Package summary&lt;/b&gt;
&lt;br/&gt;
&lt;pre class="code"&gt;
box# ./filopack.sh --summary
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)

Filodej package summary:
Package name                          downloaded [#installed/#total]
--------------------------------------------------------------------
Mesa-7.0.3                               yes           [  49/  49]
MesaDemos-7.0.3                          yes           [ 129/ 129]
atk-1.22.0-new                           yes           [ 160/ 160]
binutils-2.18-latest                     yes           [ 140/ 140]
boost-1.35.0-gcc4.1.2                    yes           [5195/5195]
boost-1.35                               yes           [5133/5195]
cairo-1.6.4                              yes           [  76/  76]
code2html-0.9.1                          yes           [   2/   2]
cvstrac-2.0.1-3                           no           [   3/   3]
dbus-1.2.1                               yes           [  38/  41]
dbus-glib-0.76                           yes           [  32/  32]
dbus-python-0.82.4                       yes           [  66/  66]
deluge-0.9.03-latest                     yes           [ 651/ 674]
deluge-torrent-0.5.9.3-new               yes           [   0/1543]
deluge-torrent-0.5.9.3                   yes           [   0/  99]
didiwiki-0.5                              no           [   1/   1]
file-4.24                                yes           [  11/  11]
fontconfig-2.6.0                         yes           [ 429/ 429]
gcc-4.1.2-sjlj                           yes           [  99/ 549]
git-1.5.5.3                               no           [ 228/ 228]
glade3-3.4.5                             yes           [ 323/ 323]
glib-2.17.2                              yes           [ 501/ 501]
gperf-3.0.3                              yes           [   4/   4]
gtk+-2.10.14                             yes           [1155/1155]
gtk+-2.13.3                              yes           [1233/1233]
highlight-2.6.10                          no           [ 206/ 206]
htop-0.8                                  no           [   0/   4]
httpd-2.2.8                               no           [ 174/ 174]
jasper-1.701.0-2                         yes           [  27/  27]
jpeg-6b                                  yes           [  10/  10]
libglade-2.6.2                           yes           [  34/  34]
libogg-1.1.3                              no           [  83/  83]
libvorbis-1.2.0                           no           [ 125/ 125]
libxcb-1.1                               yes           [ 160/ 160]
libxml2-2.6.30                           yes           [ 322/ 322]
libxslt-1.1.22                           yes           [ 142/ 142]
lsof-4.78                                yes           [   1/   1]
mod_python-3.3.1                          no           [  26/  26]
pango-1.21.3                             yes           [ 146/ 146]
pycairo-1.4.12                           yes           [   7/   7]
pygobject-2.14.2                         yes           [  44/  44]
pygtk-2.12.1                             yes           [ 647/ 649]
python-2.5.2                             yes           [3648/3648]
pyxdg-0.15                               yes           [  25/  25]
source-highlight-1.9                      no           [  49/  49]
sqlite-3.5.8                              no           [   8/   8]
strace-4.5.15                            yes           [   3/   3]
streamripper-1.63.1                       no           [  13/  13]
subversion-1.4.6-py-pl                    no           [ 211/ 211]
subversion-1.5.0                         yes           [ 319/ 319]
tiff-3.8.2                                no           [ 231/ 231]
x11-7.1                                  yes           [7791/7791]
xcb-util-0.2                              no           [  70/  70]
&lt;/pre&gt;

So that is all for now. In a following post I extend the tutorial with examples of "advanced" usage.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-6805231346786368953?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/6805231346786368953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=6805231346786368953' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/6805231346786368953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/6805231346786368953'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/11/simple-packaging-sysetm.html' title='Simple packaging system'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-8486918174592738807</id><published>2008-08-06T11:22:00.022+02:00</published><updated>2008-12-04T01:42:08.712+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Deluge torrent (part III)</title><content type='html'>&lt;h3&gt;Overview&lt;/h3&gt;
In &lt;a href="http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-ii.html"&gt;previous part&lt;/a&gt; I tried to workaround the issue with uncaught exceptions (due to 
the GCC mis-configuration), but after the long effort (and after a discovery of a
separate linker problem) 
I decided to &lt;a href="http://filodej.blogspot.com/2008/08/wmu-6500fs-gcc-412.html"&gt;rebuild the GCC compiler.&lt;/a&gt;
&lt;br/&gt;
Now with the new (properly configured) compiler we are ready to finish the deluge build process and finish the installation.
&lt;br/&gt;
In &lt;a href="http://forum.deluge-torrent.org/viewtopic.php?f=8&amp;t=7535&amp;start=0&amp;st=0&amp;sk=t&amp;sd=a"&gt;this post&lt;/a&gt; there are described new possibilities how to use the new version of the deluge torrent client, for me especially attractive is the "daemon" mode.
&lt;br/&gt;
&lt;h3&gt;Build result&lt;/h3&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/deluge-0.9.03.lst"&gt;[file list]&lt;/a&gt;
&lt;br/&gt;

&lt;h3&gt;Screenshots&lt;/h3&gt;
Deluge daemon and GTK client both running on &lt;i&gt;WMU-6500fs&lt;/i&gt; box 
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlvNgFesyI/AAAAAAAABnM/D73cEJbfCks/s1600-h/deluge-storage-local-select-torrent.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlvNgFesyI/AAAAAAAABnM/D73cEJbfCks/s400/deluge-storage-local-select-torrent.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231334719909442338" /&gt;&lt;/a&gt;
&lt;br/&gt;
GTK and web client running on &lt;i&gt;Ubuntu&lt;/i&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlubcNLy3I/AAAAAAAABm8/ISmKNKThsY4/s1600-h/deluge-ubu-gtk-web.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlubcNLy3I/AAAAAAAABm8/ISmKNKThsY4/s400/deluge-ubu-gtk-web.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231333859874556786" /&gt;&lt;/a&gt;
&lt;br/&gt;
GTK and web client running on &lt;i&gt;Windows XP&lt;/i&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SJluqma_R8I/AAAAAAAABnE/2yOE0H_79vQ/s1600-h/deluge-win-gtk-web.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SJluqma_R8I/AAAAAAAABnE/2yOE0H_79vQ/s400/deluge-win-gtk-web.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231334120314849218" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;h3&gt;Info sources:&lt;/h3&gt; 
&lt;a href="http://forum.deluge-torrent.org/viewtopic.php?f=8&amp;t=7535&amp;start=0&amp;st=0&amp;sk=t&amp;sd=a"&gt;[Deluge News]&lt;/a&gt;
&lt;a href="http://dev.deluge-torrent.org/wiki/Faq"&gt;[Deluge FAQ]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src/deluge-0.9.03
dev# python setup.py clean
dev# python setup.py build
dev# python setup.py install --prefix=/mnt/C/sys/
&lt;/pre&gt;
Now, when we test the new instalation, there is another problem with exception handling:
&lt;pre class="code"&gt;
dev# deluge
[INFO    ] 00:13:19 main:84 Deluge ui 0.9.03
...
[DEBUG   ] 00:13:23 configmanager:88 Getting config 'gtkui.conf'
can't resolve symbol '_Unwind_Resume_or_Rethrow' 4.1.2
&lt;/pre&gt;
With the deluge daemon the problem is the same:
&lt;pre class="code"&gt;
dev# deluged
can't resolve symbol _Unwind_Resume_or_Rethrow' 4.1.2
&lt;/pre&gt;
It seems there are missing symbols for the exception unwinding. Let's look
at the libtorrent dependencies:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/deluge-0.9.03
dev# ldd build/lib.linux-i686-2.5/deluge/libtorrent.so
        libboost_filesystem-gcc33-mt-1_35.so.1.35.0 =&gt; /mnt/C/sys/lib/libboost_filesystem-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        libboost_date_time-gcc33-mt-1_35.so.1.35.0 =&gt; /mnt/C/sys/lib/libboost_date_time-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        libboost_iostreams-gcc33-mt-1_35.so.1.35.0 =&gt; /mnt/C/sys/lib/libboost_iostreams-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        libboost_python-gcc33-mt-1_35.so.1.35.0 =&gt; /mnt/C/sys/lib/libboost_python-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        libboost_thread-gcc33-mt-1_35.so.1.35.0 =&gt; /mnt/C/sys/lib/libboost_thread-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        libpthread.so.0 =&gt; /lib/libpthread.so.0 (0x00000000)
        libssl.so.0.9.7 =&gt; /usr/lib/libssl.so.0.9.7 (0x00000000)
        libz.so.1 =&gt; /lib/libz.so.1 (0x00000000)
        libpython2.5.so.1.0 =&gt; /usr/lib/libpython2.5.so.1.0 (0x00000000)
        libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x00000000)
        libc.so.0 =&gt; /lib/libc.so.0 (0x00000000)
        libcrypto.so.0.9.7 =&gt; /usr/lib/libcrypto.so.0.9.7 (0x00000000)
        libdl.so.0 =&gt; /lib/libdl.so.0 (0x00000000)
        libutil.so.0 =&gt; /lib/libutil.so.0 (0x00000000)
        libm.so.0 =&gt; /lib/libm.so.0 (0x00000000)
        /lib/ld-uClibc.so.0 =&gt; /lib/ld-uClibc.so.0 (0x00000000)
&lt;/pre&gt;
And now when we look at the individual symbol dependencies:
&lt;pre class="code"&gt;
dev# nm -D build/lib.linux-i686-2.5/deluge/libtorrent.so | grep Unwind
         U _Unwind_SjLj_Register
         U _Unwind_SjLj_Resume
         U _Unwind_SjLj_Unregister

dev# nm -D /mnt/C/sys/lib/libboost_filesystem-gcc33-mt-1_35.so.1.35.0 | grep Unwind
         U _Unwind_Register
         U _Unwind_Resume
         U _Unwind_Unregister
&lt;/pre&gt;
... It is clear that I forgot to rebuild the boost library with the new compiler!
&lt;br /&gt;
Ok, so let's fix it and not forget to activate back the exceptions (comment out the define 
we previously added to the &lt;i&gt;boost/config/user.hpp&lt;/i&gt;):
&lt;pre class="code"&gt;
dev# cd ../boost_1_35_0
dev# nano boost/config/user.hpp

    &lt;b&gt;//&lt;/b&gt;#define BOOST_NO_EXCEPTIONS
dev# ./configure --prefix=/mnt/C/sys/
dev# make
...patience...
...found 3940 targets...
...updating 9 targets...
...
...updated 9 targets...

dev# make install
...found 14676 targets...
...updating 7 targets...
...
...updated 7 targets...
&lt;/pre&gt;
Now let's go back to deluge and rebuild it:
&lt;pre class="code"&gt;
dev# cd ../deluge-0.9.03
dev# python setup.py clean
dev# python setup.py build
...
/mnt/C/sys/lib/gcc/i386-linux-uclibc/4.1.2/../../../../i386-linux-uclibc/bin/ld: cannot find -lboost_filesystem
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
We have to update the symlinks we previously created for gcc33 version of boost libraries:
&lt;pre class="code"&gt;
dev# cd /mnt/C/sys/lib
dev# for i in `ls ./libboost_*-gcc41-mt-1_35.so.1.35.0`; do ln -s $i ${i/%-gcc41-mt-1_35.so.1.35.0/.so}; done
`./libboost_date_time.so': File exists
...
`./libboost_wave.so': File exists
&lt;/pre&gt;
The links are already there, but we want to rewrite them:
&lt;pre class="code"&gt;
dev# ls -l libboost_date_time.so
lrwxrwxrwx  1 root root 44 Jul 23 06:33 libboost_date_time.so -&gt; ./libboost_date_time-gcc33-mt-1_35.so.1.35.0
dev# for i in `ls ./libboost_*-gcc41-mt-1_35.so.1.35.0`; do ln &lt;b&gt;--force&lt;/b&gt; -s $i ${i/%-gcc41-mt-1_35.so.1.35.0/.so}; done
&lt;/pre&gt;
Now we can proceed with deluge:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/deluge-0.9.03
dev# python setup.py build 
dev# python setup.py install --prefix=/mnt/C/sys
&lt;/pre&gt;
Ok, it is now installed. When we try it we end up with already known icon issue 
(&lt;i&gt;sed&lt;/i&gt; helps us to solve it):
&lt;pre class="code"&gt;
dev# deluge
...
 line 59, in __init__
    self.dialog.set_icon(deluge.common.get_logo(32))
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-0.9.03-py2.5-linux-i686.egg/deluge/common.py", line 143, in get_logo
    size, size)
gobject.GError: Unrecognized image file format
dev# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/lib/python2.5/site-packages/deluge-0.9.03-py2.5-linux-i686.egg/deluge/common.py
&lt;/pre&gt;
Next run ended up with segfault:
&lt;pre class="code"&gt;
dev# deluge
...
gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed
  self.window.show()
Segmentation fault
&lt;/pre&gt;
In order to be able to debug it, I had to deploy it to the box. But after the deployment
some more problems emerged:
&lt;pre class="code"&gt;
box# deluge
Traceback (most recent call last):
  File "/usr/bin/deluge", line 5, in &amp;lt;module&amp;gt;
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 2561, in &amp;lt;module&amp;gt;
  File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 626, in require
  File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 524, in resolve
pkg_resources.DistributionNotFound: deluge==0.9.03
&lt;/pre&gt;
... we have to create a path to deluge egg:
&lt;pre class="code"&gt;
box# cd /mnt/C/sys/lib/python2.5/site-packages
box# echo "./deluge-0.9.03-py2.5-linux-i686.egg" &gt; deluge.pth
&lt;/pre&gt;
Then I noticed following wierd error:
&lt;pre class="code"&gt;
box# deluge
...
gobject.GError: Failed to open file 

'/tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-0.9.03-py2.5-linux-i686.egg/deluge/data/pixmaps/seeding16.png': No such file or directory
&lt;/pre&gt;
... do not know why, two files were untarred with a wrong name (with "0000644" postfix), quick fix:
&lt;pre class="code"&gt;
box# mv /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-0.9.03-py2.5-linux-i686.egg/deluge/data/pixmaps/seeding16.png{0000644,}
&lt;/pre&gt;
... then it seems we successfully replicated the crash:
&lt;pre class="code"&gt;
box# deluge
...
rning: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed
  self.window.show()
Segmentation fault
&lt;/pre&gt;
Let's start debugging:
&lt;pre class="code"&gt;
box# gdbserver colinux:2345 `which python` `which deluge`
&lt;/pre&gt;
... and attach with debugger remotely:
&lt;pre class="code"&gt;
dev# gdb `which python`
...
(gdb) target remote storage:2345
(gdb) cont
Continuing.
[New Thread 1024]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024]
0x408c1572 in render_icon_name_pixbuf () from /mnt/C/sys/X11/lib/libgtk-x11-2.0.so.0
(gdb) where
#0  0x408c1572 in render_icon_name_pixbuf () from /mnt/C/sys/X11/lib/libgtk-x11-2.0.so.0
#1  0x408c1736 in find_and_render_icon_source () from /mnt/C/sys/X11/lib/libgtk-x11-2.0.so.0
#2  0x408c1992 in gtk_icon_set_render_icon () from /mnt/C/sys/X11/lib/libgtk-x11-2.0.so.0
#3  0x40a61ded in gtk_widget_render_icon () from /mnt/C/sys/X11/lib/libgtk-x11-2.0.so.0
#4  0x408e0499 in gtk_image_calc_size () from /mnt/C/sys/X11/lib/libgtk-x11-2.0.so.0
#5  0x408e061e in gtk_image_size_request () from /mnt/C/sys/X11/lib/libgtk-x11-2.0.so.0
...
&lt;/pre&gt;
Do not know why the exactly &lt;i&gt;render_icon_name_pixbuf&lt;/i&gt; function crashed, but I noticed
that I was not running the Xming server, when I started it, the problem was gone.
&lt;br/&gt;
Another problem - missing &lt;i&gt;__cxa_pure_virtual&lt;/i&gt; symbol:
&lt;pre class="code"&gt;
box# deluged
/usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
&lt;/pre&gt;
... was "solved" with dirty &lt;i&gt;LD_PRELOAD&lt;/i&gt; workaround, then there was another missing symbol
'BIO_free':
&lt;pre class="code"&gt;
box# LD_PRELOAD=/usr/lib/libstdc++.so.6 deluged
/usr/bin/python: can't resolve symbol &lt;i&gt;BIO_free&lt;/i&gt;
&lt;/pre&gt;
... pre-loading &lt;i&gt;libssl&lt;/i&gt; moved us forward to next missing symbol 
'_ZN5boost6system18get_posix_categoryEv':
&lt;pre class="code"&gt;
box# LD_PRELOAD="/usr/lib/libstdc++.so.6 /usr/lib/libssl.so.0.9.7" deluged
/usr/bin/python: can't resolve symbol &lt;i&gt;_ZN5boost6system18get_posix_categoryEv&lt;/i&gt;
&lt;/pre&gt;
Have no idea what exactly is going on here (and would be pleased if anybody 
described it to me), but as a workaround the following helped:
&lt;pre class="code"&gt;
box# LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" deluged
&lt;/pre&gt;
The same pair of libraries I am pre-loading for the deluge GUI.
&lt;h3&gt;Setup&lt;/h3&gt;
Finally I was able to run deluge, but yet, I forgot to create symlinks to font directories:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SJlwZ6bcBxI/AAAAAAAABnU/iPgnv_T7Fkc/s1600-h/deluge-storage-missing-fonts.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SJlwZ6bcBxI/AAAAAAAABnU/iPgnv_T7Fkc/s400/deluge-storage-missing-fonts.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231336032650921746" /&gt;&lt;/a&gt;
&lt;br/&gt;
For details see &lt;a href="http://www.linuxfromscratch.org/blfs/view/svn/x/x7font.html"&gt;this page&lt;/a&gt;.
&lt;pre class="code"&gt;
box# mkdir /usr/share/fonts
box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/OTF /usr/share/fonts/X11-OTF
box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/TTF /usr/share/fonts/X11-TTF
&lt;/pre&gt;
The next thing I set up was to allow remote connections:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SJlxKT5GpKI/AAAAAAAABnc/dCM0ENKrsQk/s1600-h/deluge-storage-local-setup.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SJlxKT5GpKI/AAAAAAAABnc/dCM0ENKrsQk/s400/deluge-storage-local-setup.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231336864119956642" /&gt;&lt;/a&gt;
Then on client machines - running &lt;i&gt;Win XP&lt;/i&gt; and &lt;i&gt;Ubuntu&lt;/i&gt; in my case - in order to be able to remotely connect to the deluge daemon running on the &lt;i&gt;WMU-6500fs&lt;/i&gt; box - I had to disable the classic mode:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlzAXc_EeI/AAAAAAAABns/5FY_yg3Hvyo/s1600-h/deluge-win-classic-mode.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlzAXc_EeI/AAAAAAAABns/5FY_yg3Hvyo/s400/deluge-win-classic-mode.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231338892300325346" /&gt;&lt;/a&gt;
... and select storage as a default host in &lt;i&gt;Connection Manager&lt;/i&gt;:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlztuUm07I/AAAAAAAABn0/M9o3jHd1peg/s1600-h/deluge-win-connecting.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlztuUm07I/AAAAAAAABn0/M9o3jHd1peg/s400/deluge-win-connecting.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231339671533310898" /&gt;&lt;/a&gt;
As can be seen at following screenshot, the memory consumption is relatively high, but when I am not running web gui on the box (just deluged daemon) and am connecting to it from other computers, it is very stable and running smoothly.
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJl1GAX8VNI/AAAAAAAABn8/gXYY9968mIo/s1600-h/deluge-top.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJl1GAX8VNI/AAAAAAAABn8/gXYY9968mIo/s400/deluge-top.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231341188207629522" /&gt;&lt;/a&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-8486918174592738807?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/8486918174592738807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=8486918174592738807' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/8486918174592738807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/8486918174592738807'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/08/wmu-6500fs-deluge-torrent-part-iii.html' title='WMU-6500FS - Deluge torrent (part III)'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xFBIBcRhwFQ/SJlvNgFesyI/AAAAAAAABnM/D73cEJbfCks/s72-c/deluge-storage-local-select-torrent.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-3977072949656746748</id><published>2008-08-06T00:19:00.004+02:00</published><updated>2008-08-06T11:25:06.131+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - gcc 4.1.2</title><content type='html'>&lt;h3&gt;Overview&lt;/h3&gt;
During the &lt;a href="http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-ii.html"&gt;deluge build&lt;/a&gt; 
I tried to workaround the issue with uncaught exceptions (due to the GCC mis-configuration), 
but after the long effort (and after a discovery of a linker problem) I decided to rebuild GCC compiler.
&lt;br/&gt;

&lt;span class="fullpost"&gt;
&lt;h3&gt;Rationalization&lt;/h3&gt;
&lt;a href="http://www.uclibc.org/lists/uclibc/2004-May/008981.html"&gt;This discussion&lt;/a&gt; contains a 
simple test for exception catching. So we can get the two simple programs and test whether the 
exceptions are handled properly:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/
dev# mkdir test_exceptions
dev# cd test_exceptions/
dev# wget &lt;a href="http://codepoet.org/throw1.cpp"&gt;http://codepoet.org/throw1.cpp&lt;/a&gt;
dev# wget &lt;a href="http://codepoet.org/throw2.cpp"&gt;http://codepoet.org/throw2.cpp&lt;/a&gt;
dev# g++ -Wall -O2 throw1.cpp -o throw1
dev# ./throw1
Aborted
&lt;/pre&gt;
With the current compiler (gcc version 3.3.6 configured without &lt;i&gt;--enable-sjlj-exceptions&lt;/i&gt; flag) 
the exceptions are not caught at all. 
This message named &lt;a href="http://lists.debian.org/debian-gcc/2004/02/msg00096.html"&gt;
"libgcc_s.so compatibility between 3.3 and 3.4 (sjlj/dwarf2 exceptions)"&lt;/a&gt; describes 
a problem with the change of default exception model and it is likely that this issue
applies exactly in our case.
&lt;h3&gt;What version?&lt;/h3&gt;
When we are re-building the compiler, why not to upgrade to a newer version?
Based on &lt;a href="http://www.uclibc.org/FAQ.html#upstream_versions"&gt;uClibc FAQ&lt;/a&gt;
I choose the version 4.1.2 (along with binutils version 2.18):
&lt;blockquote&gt;
The last two GNU binutils releases are 2.17 and 2.18. While 2.16 should work, workarounds for bugs in it are not considered.

Since the GCC-3.4 and GCC-4.1 series are the recent stable release series (since the 4.0 and 4.2 series tend to be a bit broken for everyone), 
they are the latest versions we will address. If you encounter a compile error using an older version (say GCC 3.2), then you're out of luck. 
You'll need to workaround it yourself. 
&lt;/blockquote&gt;

&lt;h3&gt;binutils-2.18&lt;/h3&gt;
Building this package was the easy part:
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://filodej.ic.cz/filopack/binutils-2.18.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/binutils-2.18.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.bz2"&gt;http://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.bz2&lt;/a&gt;
dev# tar xjvf binutils-2.18.tar.bz2
dev# cd binutils-2.18
dev# ./configure --host=i386-linux-uclibc --target=i386-linux-uclibc --build=i386-pc-linux-uclibc --prefix=/mnt/C/sys
dev# ./make
dev# make install
&lt;/pre&gt;
&lt;h3&gt;gcc 4.1.2&lt;/h3&gt;
&lt;b&gt;Info sources:&lt;/b&gt;
&lt;a href="http://gcc.gnu.org/install/prerequisites.html"&gt;[Prerequisites]&lt;/a&gt;
&lt;a href="http://gcc.gnu.org/install/configure.html"&gt;[How to configure]&lt;/a&gt;
&lt;a href="http://gcc.gnu.org/install/build.html"&gt;[How to build]&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://filodej.ic.cz/filopack/gcc-4.1.2-sjlj.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://filodej.ic.cz/filopack/.filopack/gcc-4.1.2-sjlj.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;&lt;br/&gt;
We can either download whole source package:
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-4.1.2.tar.bz2"&gt;ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-4.1.2.tar.bz2&lt;/a&gt;
dev# tar xjvf gcc-4.1.2.tar.bz2
dev# cd gcc-4.1.2/
&lt;/pre&gt;
... or we can pick out just packages we are interested in - for example:
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-core-4.1.2.tar.bz2"&gt;ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-core-4.1.2.tar.bz2&lt;/a&gt;
dev# tar xjvf gcc-core-4.1.2.tar.bz2
dev# wget &lt;a href="ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-g++-4.1.2.tar.bz2"&gt;ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-g++-4.1.2.tar.bz2&lt;/a&gt;
dev# tar xjvf gcc-g++-4.1.2.tar.bz2
dev# wget &lt;a href="ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-objc-4.1.2.tar.bz2"&gt;ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-objc-4.1.2.tar.bz2&lt;/a&gt;
dev# tar xjvf gcc-objc-4.1.2.tar.bz2
dev# wget &lt;a href="ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-testsuite-4.1.2.tar.bz2"&gt;ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-testsuite-4.1.2.tar.bz2&lt;/a&gt;
dev# tar xjvf gcc-testsuite-4.1.2.tar.bz2
dev# cd gcc-4.1.2/
&lt;/pre&gt;
Now we can try to configure it:
&lt;pre class="code"&gt;
dev# ./configure --prefix=/mnt/C/sys --host=i386-linux-uclibc --target=i386-linux-uclibc --build=i386-pc-linux-uclibc 
--enable-languages=c,c++ --enable-shared --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls 
--enable-multilib --with-x --x-includes=/mnt/C/sys/X11/include/ --x-libraries=/mnt/C/sys/X11/lib/ 
--with-gxx-include-dir=/usr/include/c++ --enable-bootstrap 
...
checking for MPFR... no
*** This configuration is not supported in the following subdirectories:
     target-libada gnattools target-libgfortran target-libffi target-boehm-gc 
     target-zlib target-libjava zlib fastjar target-libobjc
    (Any other directories should still work fine.)
&lt;/pre&gt;
&lt;blockquote&gt;
The &lt;a href="http://www.mpfr.org/"&gt;MPFR&lt;/a&gt; library is a C library for multiple-precision floating-point 
computations with correct rounding. 
&lt;/blockquote&gt;
For now I decided to proceed without it:
&lt;pre class="code"&gt;
dev# make
...
/usr/local/src/gcc-4.1.2/host-i386-linux-uclibc/prev-gcc/xgcc 
-B/usr/local/src/gcc-4.1.2/host-i386-linux-uclibc/prev-gcc/ -B/mnt/C/sys/i386-linux-uclibc/bin/   
-O2 -g -fomit-frame-pointer -DIN_GCC   
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic 
-Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute 
-Werror    -DHAVE_CONFIG_H -DGENERATOR_FILE  -o build/genmodes \
 build/genmodes.o build/errors.o ../../build-i386-pc-linux-uclibc/libiberty/libiberty.a
build/genmodes -h &gt; tmp-modes.h
/bin/sh: build/genmodes: No such file or directory
make[3]: *** [s-modes] Error 127
&lt;/pre&gt;
This problem emerged after the long portion of the build process, in stage 2. 
When we try to launch genmodes from the stage 1 (built with the "old" gcc)
it runs with no problem:
&lt;pre class="code"&gt;
dev# ./host-i386-linux-uclibc/stage1-gcc/build/genmodes
...
DOUBLE ? &amp;ieee_extended_intel_96_round_53_format : &amp;ieee_extended_intel_96_format);
}
&lt;/pre&gt;
But the one from stage 2 (built with a new gcc) does not run at all:
&lt;pre class="code"&gt;
dev# ./host-i386-linux-uclibc/stage2-gcc/build/genmodes
-sh: ./host-i386-linux-uclibc/stage2-gcc/build/genmodes: No such file or directory
&lt;/pre&gt;
In &lt;a href="http://www.uclibc.org/lists/uclibc/2004-October/010365.html"&gt;this message&lt;/a&gt;
somebody is dealing with similar problem - In such cases it seems there is wrong path 
to the loader hardcoded in the generated elf file.
&lt;br/&gt;
So let's inspect the executables with &lt;a href="http://linux.die.net/man/1/readelf"&gt;readelf&lt;/a&gt; tool 
(we are mainly interested in used dynamic loader aka interpreter):
&lt;pre class="code"&gt;
dev# readelf -a ./host-i386-linux-uclibc/stage1-gcc/build/genmodes | grep interpreter
      [Requesting program interpreter: &lt;b&gt;/lib/ld-uClibc.so.0&lt;/b&gt;]
dev# readelf -a ./host-i386-linux-uclibc/stage2-gcc/build/genmodes | grep interpreter
      [Requesting program interpreter: &lt;b&gt;/lib/ld-linux.so.2&lt;/b&gt;]
&lt;/pre&gt;
So now we see the root of the problem. Now how to solve it...
I found that there is the loader path hardcoded in &lt;i&gt;gcc/config/linux.h&lt;/i&gt; (it does not 
depend on &lt;b&gt;--target&lt;/b&gt; configuration) as follows:
&lt;pre class="code"&gt;
#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
&lt;/pre&gt;
... so it seems we need a patch to correct this (and and possibly other settings)
specific to the build in uClibc environment.
&lt;br/&gt;
After some Web browsing I have found such set of patches 
&lt;a href="http://dev.wireless-fr.org/browser/firmware/trunk/kamikaze/toolchain/gcc/patches/4.1.2?rev=353"&gt;here&lt;/a&gt;
(the patches are actually for gcc-4.1.0, to overcome it we use -p1 
&lt;a href="http://linux.die.net/man/1/patch"&gt;patch&lt;/a&gt; option instead of -p1):
&lt;pre class="code"&gt;
dev# cd /usr/local/src/gcc-4.1.2
dev# wget -O 100-uclibc-conf.patch &lt;a href="http://dev.wireless-fr.org/browser/firmware/trunk/kamikaze/toolchain/gcc/patches/4.1.2/100-uclibc-conf.patch?rev=353&amp;format=raw"&gt;"http://dev.wireless-fr.org/browser/firmware/trunk/kamikaze/toolchain/gcc/patches/4.1.2/100-uclibc-conf.patch?rev=353&amp;format=raw"&lt;/a&gt;
dev# patch -p1 &lt; 100-uclibc-conf.patch
&lt;/pre&gt;
... now try to continue and after long time we end up with another kind of problem, 
missing locale support in uClibc:
&lt;pre class="code"&gt;
dev# make
...
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections -c ../../.././libstdc++-v3/src/ctype.cc  -fPIC -DPIC -o .libs/ctype.o
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h: In static member function 'static const short unsigned int* std::ctype&amp;lt;char&amp;gt;::classic_table()':
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h:51: error: '__ctype_b' was not declared in this scope
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h: In constructor 'std::ctype&amp;lt;char&amp;gt;::ctype(int*, const short unsigned int*, bool, size_t)':
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h:85: error: '__ctype_toupper' was not declared in this scope
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h:86: error: '__ctype_tolower' was not declared in this scope
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h:87: error: '__ctype_b' was not declared in this scope
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h: In constructor 'std::ctype&amp;lt;char&amp;gt;::ctype(const short unsigned int*, bool, size_t)':
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h:120: error: '__ctype_toupper' was not declared in this scope
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h:121: error: '__ctype_tolower' was not declared in this scope
/usr/local/src/gcc-4.1.2/i386-linux-uclibc/libstdc++-v3/include/i386-linux-uclibc/bits/ctype_noninline.h:122: error: '__ctype_b' was not declared in this scope
make[4]: *** [ctype.lo] Error 1
...
&lt;/pre&gt;
For this there is another &lt;a href="http://dev.wireless-fr.org/browser/firmware/trunk/kamikaze/toolchain/gcc/patches/4.1.2/200-uclibc-locale.patch?rev=353"&gt;patch&lt;/a&gt; we can apply:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/gcc-4.1.2
dev# wget -O 200-uclibc-locale.patch &lt;a href="http://dev.wireless-fr.org/browser/firmware/trunk/kamikaze/toolchain/gcc/patches/4.1.2/200-uclibc-locale.patch?rev=353&amp;format=raw"&gt;"http://dev.wireless-fr.org/browser/firmware/trunk/kamikaze/toolchain/gcc/patches/4.1.2/200-uclibc-locale.patch?rev=353&amp;format=raw"&lt;/a&gt;
dev# patch -p1 &lt; 200-uclibc-locale.patch 
&lt;/pre&gt;
After that I was able to finish build and installation successfully:
&lt;pre class="code"&gt;
dev# make
dev# make install
dev# gcc --version
gcc (GCC) 4.1.2
Copyright (C) 2006 Free Software Foundation, Inc.
...
&lt;/pre&gt;
Ok, let's test the new compiler with our simple exception test:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/test_exceptions/
dev# g++ -Wall -O2 throw1.cpp -o throw1
/mnt/C/sys/lib/gcc/i386-linux-uclibc/4.1.2/../../../../i386-linux-uclibc/lib/libstdc++.so: 
  undefined reference to `___tls_get_addr'
collect2: ld returned 1 exit status
&lt;/pre&gt;
According to &lt;a href="http://linux.die.net/man/1/ldd"&gt;ldd&lt;/a&gt; it seems there are no missing library dependencies:
&lt;pre class="code"&gt;
dev# ldd /mnt/C/sys/lib/gcc/i386-linux-uclibc/4.1.2/../../../../i386-linux-uclibc/lib/libstdc++.so
  libm.so.0 =&gt; /lib/libm.so.0 (0x00000000)
  libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x00000000)
  libc.so.0 =&gt; /lib/libc.so.0 (0x00000000)
  /lib/ld-uClibc.so.0 =&gt; /lib/ld-uClibc.so.0 (0x00000000)
&lt;/pre&gt;
Following &lt;a href="http://gcc.gnu.org/ml/gcc-help/2007-01/msg00093.html"&gt;message&lt;/a&gt; contains some info 
about this issue. According to &lt;a href="http://www.uclibc.org/lists/uclibc/2006-March/015046.html"&gt;this message&lt;/a&gt; 
there should be no tls problem after applying all the patches, so maybe the correct solution is to download 
all remaining patches from 
&lt;a href="http://dev.wireless-fr.org/browser/firmware/trunk/kamikaze/toolchain/gcc/patches/4.1.2?rev=353"&gt;this site&lt;/a&gt;.
There is one &lt;a href=""&gt;patch&lt;/a&gt; dealing with libstdc++, but I am not sure whether it solves the TLS problem.
&lt;br/&gt;
At the time I decided to re-configure GCC regarding to advice in 
&lt;a href="http://www.busybox.net/lists/uclibc/2006-March/015008.html"&gt;this message&lt;/a&gt;:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/gcc-4.1.2
dev# make distclean
dev# ./configure --prefix=/mnt/C/sys --host=i386-linux-uclibc --target=i386-linux-uclibc 
--build=i386-pc-linux-uclibc --enable-languages=c,c++ --enable-shared --disable-__cxa_atexit 
--enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib --with-x 
--x-includes=/mnt/C/sys/X11/include/ --x-libraries=/mnt/C/sys/X11/lib/ 
--with-gxx-include-dir=/usr/include/c++ --enable-bootstrap &lt;b&gt;--disable-tls&lt;/b&gt;
dev# make
dev# make install
&lt;/pre&gt;
Now let's repeat the test:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/test_exceptions/
dev# g++ -Wall -O2 throw1.cpp -o throw1
dev# ./throw1
Aborted
&lt;/pre&gt;
It seem that exceptions are still not being caught, let's debug it just to make sure:
&lt;pre class="code"&gt;
dev# gdb throw1
GNU gdb 6.3
...
(gdb) run
Starting program: /usr/local/src/test_exceptions/throw1

Program received signal SIGABRT, Aborted.
0xb7e63164 in kill () from /lib/libc.so.0

(gdb) where
#0  0xb7e63164 in kill () from /lib/libc.so.0
#1  0xb7e5345a in raise () from /lib/libc.so.0
#2  0xb7e5cc67 in abort () from /lib/libc.so.0
#3  0xb7eb82f8 in uw_init_context_1 (context=0xbf83b150, outer_cfa=0xbf83b1d0, outer_ra=0xb7f5fb08)
    at ../.././gcc/unwind-dw2.c:1255
#4  0xb7eb86d4 in _Unwind_RaiseException (exc=0x804ab68) at unwind.inc:92
#5  0xb7f5fb08 in __cxa_throw (obj=0x804ab88, tinfo=0x80499e0, dest=0)
    at ../../.././libstdc++-v3/libsupc++/eh_throw.cc:72
#6  0x08048737 in main ()

(gdb) list
67        header-&gt;unwindHeader.exception_cleanup = __gxx_exception_cleanup;
68
69      #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
70        &lt;b&gt;_Unwind_SjLj_RaiseException&lt;/b&gt; (&amp;header-&gt;unwindHeader);
71      #else
72        &lt;b&gt;_Unwind_RaiseException&lt;/b&gt; (&amp;header-&gt;unwindHeader);
73      #endif
74
75        // Some sort of unwinding error.  Note that terminate is a handler.
76        __cxa_begin_catch (&amp;header-&gt;unwindHeader);
&lt;/pre&gt;
So it seems there are still two versions of exception handling and the one without SjLj
does not work even with the new gcc version. I do not know exactly what is going on here, 
initially I thoought that the exception problem is specific to the 3.3 - 3.4 gcc versions,
but regarding to &lt;a href="http://www.uclibc.org/lists/uclibc/2005-June/011851.html"&gt;this message&lt;/a&gt;
it is possible that in some scenarios the &lt;b&gt;--enable-sjlj-exceptions&lt;/b&gt; configuration
is necessary for 4.x versions as well:
&lt;blockquote&gt;
I have rebuilt gcc-3.4.4 w/ sjlj-exceptions, both the uclibc++ test and 
and throw2 perform ok against libstdc++ and uclibc++, so up to 3.4.4 (but 
probably 4.0.0 too) need --enable-sjlj-exceptions
&lt;/blockquote&gt;
So let's try to re-configure the build once more:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/gcc-4.1.2
dev# make distclean
dev# ./configure --prefix=/mnt/C/sys --host=i386-linux-uclibc --target=i386-linux-uclibc 
--build=i386-pc-linux-uclibc --enable-languages=c,c++ --enable-shared --disable-__cxa_atexit 
--enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib --with-x 
--x-includes=/mnt/C/sys/X11/include/ --x-libraries=/mnt/C/sys/X11/lib/ 
--with-gxx-include-dir=/usr/include/c++ --enable-bootstrap --disable-tls &lt;b&gt;--enable-sjlj-exceptions&lt;/b&gt;
dev# make
dev# make install
&lt;/pre&gt;
And now when we repeat the test:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/test_exceptions/
dev# g++ -Wall -O2 throw1.cpp -o throw1
dev# ./throw1
caught an exception
&lt;/pre&gt;
Hurray! It seems now we have some progress.
&lt;br /&gt;
Let's try the second one:
&lt;pre class="code"&gt;
dev# g++ -Wall -O2 throw2.cpp -o throw2
dev# ./throw2
1  Throwing out_of_range()
    Catching: out_of_range out_of_range meaningful comment
2  Throwing exception()   // Can't specify comment
    Catching: St9exception
3  Throwing underflow_error  // caught by base class (runtime_error)
    Catching: runtime_error underflow_error
4  Throwing runtime_error
    Catching: runtime_error a comment
5  Throwing length_error   // caught be super-super-class (exception)
    Catching: St9exception
6  Throwing int
    Catching: int 26
7  Throwing const char*
    Catching: const char* This is a const char*
8  Throwing string
    Catching: string I'm a string
9  Throwing float
    ERROR: Nobody caught this!
10  Throwing up
&lt;/pre&gt;
The exception #9 is not caught but regarding to &lt;a href="http://www.uclibc.org/lists/uclibc/2004-May/008981.html"&gt;this discussion&lt;/a&gt; 
it seems ok.
&lt;br/&gt;
Now we have the gcc version 4.1.2 properly configured, built and ready for building c++ 
applications like &lt;a href="http://filodej.blogspot.com/2008/08/wmu-6500fs-deluge-torrent-part-iii.html"&gt;deluge&lt;/a&gt;.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-3977072949656746748?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/3977072949656746748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=3977072949656746748' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3977072949656746748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3977072949656746748'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/08/wmu-6500fs-gcc-412.html' title='WMU-6500FS - gcc 4.1.2'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-5568342161680879110</id><published>2008-07-28T14:24:00.005+02:00</published><updated>2008-07-28T21:29:40.496+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - strace 4.5.15</title><content type='html'>&lt;i&gt;strace&lt;/i&gt; is a system call tracer, i.e. a debugging tool which prints out a trace 
of all the system calls made by a another process/program.
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SI27QRdT_0I/AAAAAAAABms/nwfx9Y3xw_w/s1600-h/wmu6500fs-strace.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SI27QRdT_0I/AAAAAAAABms/nwfx9Y3xw_w/s400/wmu6500fs-strace.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5228040630685663042" /&gt;&lt;/a&gt;
&lt;b&gt;Build result:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/strace-4.5.15.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/strace-4.5.15.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Info sources:&lt;/b&gt;
&lt;a href="http://www.linuxcommand.org/man_pages/strace1.html"&gt;[Man page]&lt;/a&gt;
&lt;a href="http://sourceforge.net/projects/strace/"&gt;[Project page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# wget &lt;a href="http://downloads.sourceforge.net/strace/strace-4.5.15.tar.bz2?modtime=1168972008&amp;big_mirror=0&amp;filesize=455607"&gt;"http://downloads.sourceforge.net/strace/strace-4.5.15.tar.bz2?modtime=1168972008&amp;big_mirror=0&amp;filesize=455607"&lt;/a&gt;
dev# tar xjvf strace-4.5.15.tar.bz2
dev# cd strace-4.5.15
dev# ./configure --prefix=/mnt/C/sys
dev# make
cdv# make install
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-5568342161680879110?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/5568342161680879110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=5568342161680879110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5568342161680879110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5568342161680879110'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/07/wmu-6500fs-strace-4515.html' title='WMU-6500FS - strace 4.5.15'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xFBIBcRhwFQ/SI27QRdT_0I/AAAAAAAABms/nwfx9Y3xw_w/s72-c/wmu6500fs-strace.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-36517898141051356</id><published>2008-07-26T01:22:00.015+02:00</published><updated>2008-12-21T23:49:08.787+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Deluge torrent (part II)</title><content type='html'>&lt;h3&gt;Overview&lt;/h3&gt;
In &lt;a href="http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-i.html"&gt;previous part&lt;/a&gt; we have started building the deluge torrent ...
&lt;br/&gt;
&lt;br/&gt;
We ended up with a curious error, process was aborted after an exception thrown 
in &lt;i&gt;libtorrent::bdecode&lt;/i&gt;. It seems that for some reason there is exception thrown and not caught which causes immediate process termination. 

&lt;h3&gt;Screenshot&lt;/h3&gt;
Here is a screenshot of the remote debugging in action:
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SIh0W3rD25I/AAAAAAAABmc/W3g-ewZLw0U/s1600-h/wmu6500fs-remote-gdb2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SIh0W3rD25I/AAAAAAAABmc/W3g-ewZLw0U/s400/wmu6500fs-remote-gdb2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5226555303813962642" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;

&lt;h3&gt;Uncaught exception&lt;/h3&gt;
When we look at the &lt;i&gt;strace&lt;/i&gt; output:
&lt;pre class="code"&gt;
...
close(11)                               = 0
write(1, "Applying preferences\n", 21Applying preferences
)  = 21
write(1, "Starting DHT...\n", 16Starting DHT...
)       = 16
open("/root/.config/deluge/dht.state", O_RDONLY) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
kill(31503, SIGABRT)                    = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++
Process 31503 detached
&lt;/pre&gt;

Call stack at the moment of termination:
&lt;pre class="code"&gt;
...
Program received signal SIG32, Real-time event 32.
0x4019cb64 in __rt_sigsuspend () from /lib/libc.so.0
(gdb) Quit
(gdb) where
#0  0x4019cb64 in __rt_sigsuspend () from /lib/libc.so.0
#1  0x4019cb9b in sigsuspend () from /lib/libc.so.0
#2  0x40139cf9 in __pthread_wait_for_restart_signal () from /lib/libpthread.so.0
#3  0x401396bd in pthread_create () from /lib/libpthread.so.0
#4  0x416c9f26 in boost::thread::start_thread () from /mnt/C/sys/lib//libboost_thread-gcc33-mt-1_35.so.1.35.0
#5  0x415d68c8 in disk_io_thread (this=0x821acc8, block_size=-4) at thread.hpp:151
...
&lt;/pre&gt;

An the corresponding source file &lt;i&gt;src/deluge_core.cpp&lt;/i&gt;
&lt;pre class="code"&gt;
    boost::filesystem::path tempPath(DHT_path, empty_name_check);
    boost::filesystem::ifstream DHT_state_file(tempPath, std::ios_base::binary);
    DHT_state_file.unsetf(std::ios_base::skipws);

    entry DHT_state;
    try
    {
&lt;b&gt;(1)&lt;/b&gt;     DHT_state = bdecode(std::istream_iterator&amp;lt;char&amp;gt;(DHT_state_file),
            std::istream_iterator&amp;lt;char&amp;gt;());
        M_ses-&amp;gt;start_dht(DHT_state);
        //        printf("DHT state recovered.\r\n");

        //        // Print out the state data from the FILE (not the session!)
        //        printf("Number of DHT peers in recovered state: %ld\r\n", count_DHT_peers(DHT_state));

    }
&lt;b&gt;(2)&lt;/b&gt; catch (std::exception&amp;)
    {
        printf("No DHT file to resume\r\n");
        M_ses-&amp;gt;start_dht();
    }
&lt;/pre&gt;
... it seems obvious what happened. Application tried to open the &lt;i&gt;dht.state&lt;/i&gt; file
and since there was no such file an exception was thrown in the &lt;i&gt;std::istream_iterator&lt;/i&gt;
constructor (source code line marked as &lt;b&gt;(1)&lt;/b&gt;). This exception is nevertheless not caught 
in the catch block (source code line marked as &lt;b&gt;(2)&lt;/b&gt;). I do not know why, there is no aparent 
reason (the exception has definitely the &lt;i&gt;std::exception&lt;/i&gt; base), the fact is that 
due to this the application is aborted.
&lt;br/&gt;
&lt;h3&gt;Uncaught exception - workaround&lt;/h3&gt;
For now I decided to make the following workaround, explicitly handle the missing 
file and so bypass the exception:
&lt;pre class="code"&gt;
    boost::filesystem::path tempPath(DHT_path, empty_name_check);
    boost::filesystem::ifstream DHT_state_file(tempPath, std::ios_base::binary);
    DHT_state_file.unsetf(std::ios_base::skipws);

    entry DHT_state;
    &lt;b&gt;if ( !exists( tempPath ) )
    {
        printf("No DHT file to resume\r\n");
        M_ses-&amp;gt;start_dht();
    }
    else&lt;/b&gt; try
    {
        DHT_state = bdecode(std::istream_iterator&amp;lt;char&amp;gt;(DHT_state_file),
            std::istream_iterator&amp;lt;char&amp;gt;());
        M_ses-&amp;gt;start_dht(DHT_state);
        //        printf("DHT state recovered.\r\n");

        //        // Print out the state data from the FILE (not the session!)
        //        printf("Number of DHT peers in recovered state: %ld\r\n", count_DHT_peers(DHT_state));

    }
    catch (std::exception&amp;)
    {
        printf("No DHT file to resume\r\n");
        M_ses-&amp;gt;start_dht();
    }
&lt;/pre&gt;
The unified diff looks as follows:
&lt;pre class="code"&gt;
dev# diff -u src/deluge_core.cpp.old src/deluge_core.cpp
--- src/deluge_core.cpp.old     2008-06-04 20:03:49.000000000 -0600
+++ src/deluge_core.cpp 2008-07-02 16:32:01.000000000 -0600
@@ -1889,7 +1889,12 @@
     DHT_state_file.unsetf(std::ios_base::skipws);

     entry DHT_state;
-    try
+    if ( !exists( tempPath ) )
+    {
+        printf("No DHT file to resume\r\n");
+        M_ses-&amp;gt;start_dht();
+    }
+    else try
     {
         DHT_state = bdecode(std::istream_iterator&amp;lt;char&amp;gt;(DHT_state_file),
             std::istream_iterator&amp;lt;char&amp;gt;());
&lt;/pre&gt;
With this workaround we are able to sucessfully open the application. But when we 
add a torrent file, there is another (but similar) problem. Another exception is thrown 
which leads to process termination. Since the local debugging is really slow on the box,
before we proceed to solve this problem, let's look how to debug remotely.
&lt;h3&gt;Remote debugging&lt;/h3&gt;
For remote debugging we will use the &lt;i&gt;gdbserver&lt;/i&gt;. Following relevant inf is in the 
&lt;a href="http://davis.lbl.gov/Manuals/GDB/gdb_17.html"&gt;GDB remote debugging manual&lt;/a&gt;:
&lt;blockquote&gt;&lt;pre&gt;
gdbserver is a control program for Unix-like systems, which allows you to connect your program 
with a remote GDB via target remote - but without linking in the usual debugging stub.
...
The `host:2345' argument means that gdbserver is to expect a TCP connection from machine `host' 
to local TCP port 2345. (Currently, the `host' part is ignored.)
...
On some targets, gdbserver can also attach to running programs. This is accomplished via the 
--attach argument.
...
On the GDB host machine, you need an unstripped copy of your program, since GDB needs symbols 
and debugging information. Start up GDB as usual, using the name of the local copy of your 
program as the first argument. ... After that, use target remote to establish communications 
with gdbserver.
&lt;/pre&gt;&lt;/blockquote&gt;
The use of &lt;i&gt;gdbserver&lt;/i&gt; is ideal for us, since due to the deployment process we have 
identical copied of the debugged program both on the &lt;b&gt;box#&lt;/b&gt; and on the build 
&lt;b&gt;dev#&lt;/b&gt; system.
&lt;br/&gt;
&lt;br/&gt;
So on the box we can run the &lt;i&gt;deluge&lt;/i&gt;
&lt;pre class="code"&gt;
box# deluge &amp;
[1] 29193
&lt;/pre&gt;
... and attach to it with the &lt;i&gt;gdbserver&lt;/i&gt;:
&lt;pre class="code"&gt;
box# gdbserver colinux:2345 --attach 29193
Attached; pid = 29193
Listening on port 2345
&lt;/pre&gt;
or alternatively we can run the gdbserver running the &lt;i&gt;deluge&lt;/i&gt; roght from the beggining:
&lt;pre class="code"&gt;
box# gdbserver colinux:2345 `which python` `which deluge`
Process /mnt/C/sys/bin/python created; pid = 29235
Listening on port 2345
&lt;/pre&gt;
Now we can connect to the gdbserver with gdb running on the build machine (PC).
Since the &lt;i&gt;deluge&lt;/i&gt; just a python script, the executable we will debug
is in fact &lt;i&gt;python interpreter&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# gdb `which python`
...
(gdb) target remote 192.168.1.104:2345
(gdb) cont
Continuing.
[New Thread 1024]
...
&lt;/pre&gt;
Ok, that's it.
&lt;br/&gt;
&lt;br/&gt;
&lt;i&gt;Note:&lt;/i&gt; sometimes, when we interrupt the debugging process, the deluge
is not properly killed, there remains an instance. When we start deluge again 
the output looks like this:
&lt;pre class="code"&gt;
...
create proxy object
create iface
send to iface

Child exited with retcode = 0

Child exited with status 0
GDBserver exiting
&lt;/pre&gt;
In such situation we have to find the hanging processes and kill them:
&lt;pre class="code"&gt;
box# ps ax | grep deluge
29429 root      14136 S     1.7  /mnt/C/sys/bin/python /mnt/C/sys/bin/deluge
29440 root      14136 S     0.0  /mnt/C/sys/bin/python /mnt/C/sys/bin/deluge
29482 root        324 S     0.0  grep deluge
box# kill -9 29429 29440
&lt;/pre&gt;

&lt;h3&gt;Uncaught exceptions - looking for a cause&lt;/h3&gt;
So as I already said, the workaround pushed us forward, but another exception 
is thrown later on, when we open a torrent file:
&lt;pre class="code"&gt;
(gdb) where
...
#81 0xbfffca60 in ?? ()
#82 0x4027140f in __cxa_call_unexpected () from /mnt/C/sys/lib//libstdc++.so.5
#83 0x4027140f in __cxa_call_unexpected () from /mnt/C/sys/lib//libstdc++.so.5
#84 0x40271439 in std::terminate () from /mnt/C/sys/lib//libstdc++.so.5
#85 0x40271560 in __cxa_throw () from /mnt/C/sys/lib//libstdc++.so.5
#86 0x414d0d39 in libtorrent::entry::operator[] (this=0x821a4e0, key=0x41644ef4 "url-list") at entry.hpp:77
#87 0x415a5bc8 in libtorrent::torrent_info::read_torrent_info (this=0xbfffd090, torrent_file=@0xbfffcee0)
    at libtorrent/src/torrent_info.cpp:519
#88 0x4159e59e in torrent_info (this=0xbfffd090, torrent_file=@0xbfffcee0) at libtorrent/src/torrent_info.cpp:236
#89 0x41629068 in internal_get_torrent_info (torrent_name=@0x6) at src/deluge_core.cpp:264
#90 0x4162d0e7 in torrent_dump_file_info (self=0x0, args=0x41a7ab2c) at stl_alloc.h:652
#91 0x4005d122 in PyCFunction_Call (func=0x4127122c, arg=0x41a7ab2c, kw=0x6) at Objects/methodobject.c:108
...
&lt;/pre&gt;
When we look at the stack frame 87 and &lt;i&gt;torrent_file&lt;/i&gt; structure:
&lt;pre class="code"&gt;
(gdb) frame 87
#87 0x415a5bc8 in libtorrent::torrent_info::read_torrent_info (this=0xbfffd090, torrent_file=@0xbfffcee0)
    at libtorrent/src/torrent_info.cpp:519
519                             entry const&amp; url_seeds = torrent_file["url-list"];

(gdb) list
514                     catch (type_error) {}
515
516                     // if there are any url-seeds, extract them
517                     try
518                     {
519                             entry const&amp; url_seeds = &lt;b&gt;torrent_file["url-list"]&lt;/b&gt;;
520                             if (url_seeds.type() == entry::string_t)
521                             {
522                                     m_url_seeds.push_back(url_seeds.string());
523                             }

(gdb) print torrent_file
$1 = (const libtorrent::entry &amp;) @0xbfffcee0: {m_type = dictionary_t, {data = "øv!\b\004\000\000\000ògB@",
    dummy_aligner = 17316280056}}
&lt;/pre&gt;
... and to the &lt;i&gt;src/deluge-torrent-0.5.9.3/libtorrent/src/entry.cpp&lt;/i&gt; file :
&lt;pre class="code"&gt;
#ifndef BOOST_NO_EXCEPTIONS
        const entry&amp; entry::operator[](char const* key) const
        {
                dictionary_type::const_iterator i = dict().find(key);
                if (i == dict().end()) &lt;b&gt;throw type_error&lt;/b&gt;(
                        (std::string("key not found: ") + key).c_str());
                return i-&amp;gt;second;
        }

        const entry&amp; entry::operator[](std::string const&amp; key) const
        {
                return (*this)[key.c_str()];
        }
#endif
&lt;/pre&gt;
... we can see that the &lt;i&gt;torrent_file&lt;/i&gt; is a python-like dictionary, when one tries to access
a value stored with a key and there is no such entry, an exception is thrown. 
As in previous case neither this exception is not caught. It is time to stop with workarounds and look at the exception issue in a finer detail.
&lt;br/&gt;
&lt;a href="http://www.uclibc.org/lists/uclibc/2004-May/008981.html"&gt;This discussion&lt;/a&gt; contains an 
ellegant test for exception catching. It seems that I am not alone having this sort of problems:
&lt;blockquote&gt;&lt;pre&gt;
&amp;gt; So, the throw+catch are not hooking up properly under uClibc.
&amp;gt; This is uClibc's problem.

What version of uClibc?  gcc?  binutils?  How did you build your
toolchain?  Was gcc built with --enable-sjlj-exceptions?  What
kernel version are you using?
...
&amp;gt; part3:
&amp;gt; comment on gdb #5: __cxa_throw ()
&amp;gt; &amp;gt;From the backtrace above it looks that somethings goes wrong during stack 
&amp;gt; unwinding - does exception catching work for other C++ programs ?

It does if gcc was built properly...

    &lt;a href="http://codepoet.org/throw1.cpp"&gt;http://codepoet.org/throw1.cpp&lt;/a&gt;
    &lt;a href="http://codepoet.org/throw2.cpp"&gt;http://codepoet.org/throw2.cpp&lt;/a&gt;
&lt;/pre&gt;&lt;/blockquote&gt;
So let's make the same test:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/
dev# mkdir test_exceptions
dev# cd test_exceptions/
dev# wget &lt;a href="http://codepoet.org/throw1.cpp"&gt;http://codepoet.org/throw1.cpp&lt;/a&gt;
dev# cat throw1.cpp
#include &amp;lt;features.h&amp;gt;
#include "iostream"
int main(void)
{
    try {
        throw("This is an exception");
    }
    catch (...) {
        std::cout &amp;lt;&amp;lt; "caught an exception\n";
    }
    return(0);
}
dev# g++ -Wall -O2 throw1.cpp -o throw1
dev# ldd throw1
        libstdc++.so.5 =&amp;gt; /lib/libstdc++.so.5 (0xb7edf000)
        libm.so.0 =&amp;gt; /lib/libm.so.0 (0xb7ed1000)
        libgcc_s.so.1 =&amp;gt; /lib/libgcc_s.so.1 (0xb7ec9000)
        libc.so.0 =&amp;gt; /lib/libc.so.0 (0xb7e35000)
        ld-uClibc.so.0 =&amp;gt; /lib/ld-uClibc.so.0 (0xb7f91000)
dev# ./throw1
Aborted
&lt;/pre&gt;
So even in such a trivial case the exception is not caught and process is aborted.
&lt;br/&gt;
Now let's look at our gcc configuration:
&lt;pre class="code"&gt;
dev# gcc -v
Using built-in specs.
Configured with: /opt/buildroot/toolchain_build_i386/gcc-3.3.6/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-linux-uclibc 
--target=i386-linux-uclibc --enable-languages=c,c++,objc --enable-shared --with-gxx-include-dir=/usr/include/c++ --disable-__cxa_atexit 
--enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib : 
(reconfigured) /opt/buildroot/toolchain_build_i386/gcc-3.3.6/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-linux-uclibc 
--target=i386-linux-uclibc --enable-languages=c,c++,objc --enable-shared --with-gxx-include-dir=/usr/include/c++ --disable-__cxa_atexit 
--enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib : 
(reconfigured) /home/joker/CR/opt/buildroot/toolchain_build_i386/gcc-3.3.6/configure --prefix=/usr --build=i386-pc-linux-gnu 
--host=i386-linux-uclibc --target=i386-linux-uclibc --enable-languages=c,c++,objc --enable-shared --with-gxx-include-dir=/usr/include/c++ 
--disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib
Thread model: posix
gcc version 3.3.6
&lt;/pre&gt;
... it seems that it is not configured with &lt;i&gt;--enable-sjlj-exceptions&lt;/i&gt;.
&lt;br/&gt;
&lt;a name="gcc-compatibility-issue"&gt;&lt;/a&gt;
This message named &lt;a href="http://lists.debian.org/debian-gcc/2004/02/msg00096.html"&gt;
"libgcc_s.so compatibility between 3.3 and 3.4 (sjlj/dwarf2 exceptions)"&lt;/a&gt; describes a problem with the change of default exception model. It seems that the gcc change management (so versioning) 
did not go very well at that point:
&lt;blockquote&gt;
On m68k-linux and parisc-linux between 3.3 and 3.4 the default
exception model changed from sjlj based exceptions to dw2 based
exceptions. Unfortunately at this time the soversion number of the
shared libgcc was not bumped.
...
I didn't look at other architectures, if the distinction is needed as
well.
&lt;/blockquote&gt;
Regarding to &lt;a href="http://www.uclibc.org/lists/uclibc/2005-June/011851.html"&gt;this message&lt;/a&gt;
it seems that re-build of GCC with &lt;i&gt;--enable-sjlj-exceptions&lt;/i&gt; could be a solution. The problem 
is that I have not prepared the uClibc build environment (I just used 
&lt;a href="http://mgb111.pradnik.net/addons/uclibc-basic.tar.bz2"&gt;the one&lt;/a&gt; prebuilt by JoKeR) and
so have no experience with building the GCC. 
&lt;br/&gt;
I did not want to start such a big task, so I decided to give another shot to a workaround:
&lt;h3&gt;Disable exceptions&lt;/h3&gt;
The code in the &lt;i&gt;src/deluge-torrent-0.5.9.3/libtorrent/src/entry.cpp&lt;/i&gt; file inspired me to this workaround:
&lt;pre class="code"&gt;
#ifndef BOOST_NO_EXCEPTIONS
        const entry&amp; entry::operator[](char const* key) const
        {
                dictionary_type::const_iterator i = dict().find(key);
                if (i == dict().end()) throw type_error(
                        (std::string("key not found: ") + key).c_str());
                return i-&amp;gt;second;
        }

        const entry&amp; entry::operator[](std::string const&amp; key) const
        {
                return (*this)[key.c_str()];
        }
#endif
&lt;/pre&gt;
It seems that the &lt;i&gt;libtorrent&lt;/i&gt; code is prepared for cases when there is no exception support in the platform (as is the case for some embedded systems for example). So why not try to disable the boost exceptions?
&lt;pre class="code"&gt;
dev# cd /usr/local/src/boost_1_35_0
dev# nano boost/config/user.hpp
&lt;/pre&gt;
append the following at the end of the file:
&lt;pre class="code"&gt;
#define BOOST_NO_EXCEPTIONS
&lt;/pre&gt;
... and now re-build the boost libraries:
&lt;pre class="code"&gt;
dev# make
...
libs/serialization/src/xml_woarchive.cpp:58:   instantiated from here
boost/archive/iterators/wchar_from_mb.hpp:119: error: `dataflow_exception'
   undeclared in namespace `boost::archive::iterators'
...
...failed updating 9 targets...
...skipped 2 targets...
Not all Boost libraries built properly.
&lt;/pre&gt;
It seems not all the libraries are compatible with this define, anyway, let's 
proceed (finish the &lt;i&gt;boost&lt;/i&gt; installation and restart the &lt;i&gt;deluge&lt;/i&gt; build process):
&lt;pre class="code"&gt;
dev# make install
...
dev# cd ../deluge-torrent-0.5.9.3
dev#  python setup.py clean
dev# python setup.py build
...
libtorrent/src/metadata_transfer.cpp: In member function `virtual bool
   libtorrent::&amp;lt;unnamed&amp;gt;::metadata_peer_plugin::on_extension_handshake(const
   libtorrent::entry&amp;)':
libtorrent/src/metadata_transfer.cpp:275: error: passing `const
   libtorrent::entry' as `this' argument of `libtorrent::entry&amp;
   libtorrent::entry::operator[](const char*)' discards qualifiers
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
In &lt;i&gt;libtorrent/src/metadata_transfer.cpp&lt;/i&gt; there is a following code:
&lt;pre class="code"&gt;
    virtual bool on_extension_handshake(entry const&amp; h)
    {
            &lt;b&gt;entry const&amp; messages = h["m"];&lt;/b&gt;
            if (entry const* index = messages.find_key("LT_metadata"))
            {
                    m_message_index = int(index-&amp;gt;integer());
                    return true;
            }
            else
            {
                    m_message_index = 0;
                    return false;
            }
    }
&lt;/pre&gt;
... in &lt;i&gt;libtorrent/include/libtorrent/entry.hpp&lt;/i&gt; there are following map accessors:
&lt;pre class="code"&gt;
                entry&amp; operator[](char const* key);
                entry&amp; operator[](std::string const&amp; key);
#ifndef BOOST_NO_EXCEPTIONS
                const entry&amp; operator[](char const* key) const;
                const entry&amp; operator[](std::string const&amp; key) const;
#endif
                entry* find_key(char const* key);
                entry const* find_key(char const* key) const;
                entry* find_key(std::string const&amp; key);
&lt;/pre&gt;
the solution was to change the &lt;i&gt;operator[]&lt;/i&gt; access to &lt;i&gt;find_key()&lt;/i&gt; method call:
&lt;pre class="code"&gt;
    virtual bool on_extension_handshake(entry const&amp; h)
    {
&lt;b&gt;//          entry const&amp; messages = h["m"];
            entry const* messages( h.find_key("m") );
            if ( messages )
            {&lt;/b&gt;
                if (entry const* index = messages-&amp;gt;find_key("LT_metadata"))
                {
                    m_message_index = int(index-&amp;gt;integer());
                    return true;
                }
            }
&lt;b&gt;//          else&lt;/b&gt;
            {
                    m_message_index = 0;
                    return false;
            }
    }
&lt;/pre&gt;
There is a lot of such places in the code, it seems that the library support 
for &lt;i&gt;BOOST_NO_EXCEPTIONS&lt;/i&gt; directive is not fully implemented yet:
&lt;pre class="code"&gt;
dev# python setup.py build
...
libtorrent/src/ut_pex.cpp: In member function `virtual bool
   libtorrent::&amp;lt;unnamed&amp;gt;::ut_pex_peer_plugin::on_extension_handshake(const
   libtorrent::entry&amp;)':
libtorrent/src/ut_pex.cpp:201: error: passing `const libtorrent::entry' as
   `this' argument of `libtorrent::entry&amp; libtorrent::entry::operator[](const
   char*)' discards qualifiers
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
I still did not feel ready to rebuild the GCC. In a desperation I looked to the 
&lt;a href="http://deluge-torrent.org/"&gt;deluge site&lt;/a&gt; and noticed that there is a 
new version out there - 1.0.0_RC3. It promised a change in my miserable situation.
&lt;br/&gt;
&lt;h3&gt;Deluge new version - Disable exceptions&lt;/h3&gt;
So let's upgrade:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/
dev# wget &lt;a href="http://download.deluge-torrent.org/source/0.9.03/deluge-0.9.03.tar.gz"&gt;http://download.deluge-torrent.org/source/0.9.03/deluge-0.9.03.tar.gz&lt;/a&gt;
dev# tar xzvf deluge-0.9.03.tar.gz
dev# cd deluge-0.9.03
dev# python setup.py build
...
In file included from /mnt/C/sys/include/boost-1_35/boost/thread.hpp:17,
                 from libtorrent/include/libtorrent/storage.hpp:44,
                 from libtorrent/include/libtorrent/peer_connection.hpp:63,
                 from libtorrent/src/peer_connection.cpp:41:
/mnt/C/sys/include/boost-1_35/boost/thread/recursive_mutex.hpp:18:2: #error "Boost threads unavailable on this platform"
...
&lt;/pre&gt;
We already have a solution for this:
&lt;pre class="code"&gt;
dev# export CFLAGS="-pthread $CFLAGS "
&lt;/pre&gt;
Then there is another build error:
&lt;pre class="code"&gt;
dev# python setup.py build
...
libtorrent/src/torrent_handle.cpp: In member function `const
   libtorrent::torrent_info&amp; libtorrent::torrent_handle::get_torrent_info()
   const':
libtorrent/src/torrent_handle.cpp:503: error: no matching function for call to
   `libtorrent::torrent_info::torrent_info()'
libtorrent/include/libtorrent/torrent_info.hpp:86: error: candidates are:
   libtorrent::torrent_info::torrent_info(const libtorrent::torrent_info&amp;)
libtorrent/include/libtorrent/torrent_info.hpp:130: error:
   libtorrent::torrent_info::torrent_info(const libtorrent::entry&amp;)
libtorrent/include/libtorrent/torrent_info.hpp:92: error:
   libtorrent::torrent_info::torrent_info(const boost::filesystem::path&amp;)
libtorrent/include/libtorrent/torrent_info.hpp:91: error:
   libtorrent::torrent_info::torrent_info(const char*, int)
libtorrent/include/libtorrent/torrent_info.hpp:90: error:
   libtorrent::torrent_info::torrent_info(const libtorrent::lazy_entry&amp;)
libtorrent/include/libtorrent/torrent_info.hpp:89: error:
   libtorrent::torrent_info::torrent_info(const libtorrent::sha1_hash&amp;)
libtorrent/src/torrent_handle.cpp: In member function `libtorrent::entry
   libtorrent::torrent_handle::write_resume_data() const':
libtorrent/src/torrent_handle.cpp:533: error: return-statement with no value,
   in function declared with a non-void return type
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
When we look at &lt;i&gt;libtorrent/src/torrent_handle.cpp&lt;/i&gt;:
&lt;pre class="code"&gt;
        torrent_info const&amp; torrent_handle::get_torrent_info() const
        {
                INVARIANT_CHECK;
#ifdef BOOST_NO_EXCEPTIONS
                &lt;b&gt;const static torrent_info empty;&lt;/b&gt;
#endif
                boost::shared_ptr&amp;lt;torrent&amp;gt; t = m_torrent.lock();
        ...
&lt;/pre&gt;
... it is obvious that there the &lt;i&gt;torrent_info&lt;/i&gt; has no default constructor,
but in case of defined &lt;i&gt;BOOST_NO_EXCEPTIONS&lt;/i&gt; such one is used. 
So I tried to add one:&lt;br/&gt;
&lt;i&gt;libtorrent/include/libtorrent/torrent_info.hpp&lt;/i&gt;:
&lt;pre class="code"&gt;
&lt;b&gt;#ifdef BOOST_NO_EXCEPTIONS
 torrent_info();
#endif&lt;/b&gt;
    torrent_info(sha1_hash const&amp; info_hash);
    torrent_info(lazy_entry const&amp; torrent_file);
    torrent_info(char const* buffer, int size);
    torrent_info(fs::path const&amp; filename);
    ~torrent_info();
&lt;/pre&gt;
&lt;i&gt;libtorrent/src/torrent_info.cpp&lt;/i&gt;:
&lt;pre class="code"&gt;
#ifdef BOOST_NO_EXCEPTIONS
        torrent_info::torrent_info()
                : m_creation_date(pt::second_clock::universal_time())
                , m_multifile(false)
                , m_private(false)
                , m_info_section_size(0)
                , m_piece_hashes(0)
        {}
#endif
&lt;/pre&gt;
Another build error and solution was following:
&lt;pre class="code"&gt;
dev# python setup.py build
...
libtorrent/src/torrent_handle.cpp: In member function `libtorrent::entry
   libtorrent::torrent_handle::write_resume_data() const':
libtorrent/src/torrent_handle.cpp:533: error: return-statement with no value,
   in function declared with a non-void return type
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
Let's look to the &lt;i&gt;libtorrent/src/torrent_handle.cpp&lt;/i&gt; file:
&lt;pre class="code"&gt;
        entry torrent_handle::write_resume_data() const
        {
                INVARIANT_CHECK;

                entry ret(entry::dictionary_t);
                &lt;b&gt;TORRENT_FORWARD(write_resume_data(ret));&lt;/b&gt;
                t-&amp;gt;filesystem().write_resume_data(ret);

                return ret;
        }
&lt;/pre&gt;
When we look at the definition of the macro in the same file:
&lt;pre class="code"&gt;
#ifdef BOOST_NO_EXCEPTIONS

#define TORRENT_FORWARD(call) \
        boost::shared_ptr&amp;lt;torrent&amp;gt; t = m_torrent.lock(); \
        if (!t) &lt;b&gt;return;&lt;/b&gt; \
        session_impl::mutex_t::scoped_lock l(t-&amp;gt;session().m_mutex); \
        t-&amp;gt;call
...
#else

#define TORRENT_FORWARD(call) \
        boost::shared_ptr&amp;lt;torrent&amp;gt; t = m_torrent.lock(); \
        if (!t) throw_invalid_handle(); \
        session_impl::mutex_t::scoped_lock l(t-&amp;gt;session().m_mutex); \
        t-&amp;gt;call
...
&lt;/pre&gt;
... we see that this version of macro can be used only in function returning &lt;i&gt;void&lt;/i&gt;.
The solution is use another variant of the macro:
&lt;pre class="code"&gt;
        TORRENT_FORWARD_RETURN2(write_resume_data(ret), entry() );
&lt;/pre&gt;
Let's proceed:
&lt;pre class="code"&gt;
dev# python setup.py build
...
libtorrent/src/memdebug.cpp:34:22: execinfo.h: No such file or directory
libtorrent/src/memdebug.cpp: In constructor `memdebug::memdebug()':
libtorrent/src/memdebug.cpp:61: error: `__malloc_hook' undeclared (first use
   this function)
libtorrent/src/memdebug.cpp:61: error: (Each undeclared identifier is reported
   only once for each function it appears in.)
libtorrent/src/memdebug.cpp:62: error: `__free_hook' undeclared (first use this
   function)
libtorrent/src/memdebug.cpp: In static member function `static void*
   memdebug::my_malloc_hook(unsigned int, const void*)':
libtorrent/src/memdebug.cpp:133: error: `backtrace' undeclared (first use this
   function)
libtorrent/src/memdebug.cpp:144: error: `backtrace_symbols' undeclared (first
   use this function)
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
This kind of error is not connected with &lt;i&gt;BOOST_NO_EXCEPTIONS&lt;/i&gt;. It is due to
the missing &lt;i&gt;backtrace&lt;/i&gt; support in uClibc.
&lt;br/&gt;
Fortunately it seems that the &lt;i&gt;memdebug.cpp&lt;/i&gt; is used just for memory debugging
(prevention of memory leaks and so), this file is self contained and there are no 
outside dependencies on this file. Let's try simply disable it (simply undefine or 
clear the file content):
&lt;pre class="code"&gt;
&lt;b&gt;#if 0&lt;/b&gt;
#if defined __linux__ &amp;&amp; defined __GNUC__
...
#endif
&lt;b&gt;#endif&lt;/b&gt;
&lt;/pre&gt;
Here is another &lt;i&gt;BOOST_NO_EXCEPTIONS&lt;/i&gt; related build error:
&lt;pre class="code"&gt;
dev# python setup.py build
...
libtorrent/src/http_connection.cpp:208:   instantiated from here
libtorrent/include/libtorrent/variant_stream.hpp:226: error: no matching
   function for call to `libtorrent::ssl_stream&amp;lt;libtorrent::socket_type&amp;gt;::close
   ()'
libtorrent/include/libtorrent/ssl_stream.hpp:158: error: candidates are: void
   libtorrent::ssl_stream&amp;lt;Stream&amp;gt;::close(boost::system::error_code&amp;) [with
   Stream = libtorrent::socket_type]
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
As we see in the &lt;i&gt;libtorrent/include/libtorrent/ssl_stream.hpp&lt;/i&gt; the &lt;i&gt;ssl_stream&lt;/i&gt;
class contains two overloads of &lt;i&gt;close()&lt;/i&gt; method, the non-parametric one disabled in case 
there are no exceptions:
&lt;pre class="code"&gt;
#ifndef BOOST_NO_EXCEPTIONS
        void close()
        {
                m_sock.next_layer().close();
        }
#endif

        void close(error_code&amp; ec)
        {
                m_sock.next_layer().close(ec);
        }
&lt;/pre&gt;
In &lt;i&gt;libtorrent/include/libtorrent/variant_stream.hpp&lt;/i&gt; there are two kinds of 
close visitor class: &lt;i&gt;close_visitor&lt;/i&gt; (one used with exceptions) and &lt;i&gt;close_visitor&lt;/i&gt;
(one used with error codes), but the "exception" variant is not disabled, let's try to fix it:
&lt;pre class="code"&gt;
 struct close_visitor_ec
    : boost::static_visitor&amp;lt;&amp;gt;
  {
      close_visitor_ec(error_code&amp; ec_)
        : ec(ec_)
      {}

      template &amp;lt;class T&amp;gt;
      void operator()(T* p) const
      { p-&amp;gt;close(ec); }

      void operator()(boost::blank) const {}

      error_code&amp; ec;
  };

&lt;b&gt;#ifndef BOOST_NO_EXCEPTIONS&lt;/b&gt;
  struct close_visitor
    : boost::static_visitor&amp;lt;&amp;gt;
  {
      template &amp;lt;class T&amp;gt;
      void operator()(T* p) const
      { p-&amp;gt;close(); }

      void operator()(boost::blank) const {}
  };
&lt;b&gt;#endif&lt;/b&gt;
&lt;/pre&gt;
When we try to rebuild, we can see the place where the inappropriate visitor is called:
&lt;pre class="code"&gt;
dev# python setup.py build
...
libtorrent/include/libtorrent/variant_stream.hpp:665: error: `close_visitor'
   undeclared in namespace `libtorrent::aux'
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
We have to somewhat fix the &lt;i&gt;libtorrent/include/libtorrent/variant_stream.hpp&lt;/i&gt;.
There are basically two possibilities: &lt;i&gt;(a)&lt;/i&gt; undefine the non-parametric version or 
&lt;i&gt;(b)&lt;/i&gt;(maybe less correctly) use the error code variant and drop the error_code.&lt;br/&gt;
... as a quick fix I decided to use the latter method:
&lt;pre class="code"&gt;
    void close(error_code&amp; ec)
    {
        if (!instantiated()) return;
        boost::apply_visitor(
            aux::close_visitor_ec(ec), m_variant
        );
    }

&lt;b&gt;// #ifndef BOOST_NO_EXCEPTIONS   // (1st - more correct - method)&lt;/b&gt;
    void close()
    {&lt;i&gt;
//        if (!instantiated()) return;
//        boost::apply_visitor(aux::close_visitor(), m_variant);&lt;/i&gt;
&lt;b&gt;        error_code ec;              // 2nd - simpler - method
        close( ec );&lt;/b&gt;
    }
&lt;b&gt;// #endif                        // (1st - more correct - method) &lt;/b&gt;
&lt;/pre&gt;
Another build problem (with already known solution) followed - undeclared 
&lt;i&gt;IPV6_V6ONLY&lt;/i&gt;; so I have modified the &lt;i&gt;libtorrent/include/libtorrent/socket.hpp&lt;/i&gt; 
and added the dummy &lt;i&gt;IPV6_V6ONLY&lt;/i&gt; definition.
&lt;br/&gt;
&lt;br/&gt;
Then there was a bunch of errors with dictionary and lack of non-mutable &lt;i&gt;operator[]&lt;/i&gt; access in case of &lt;i&gt;BOOST_NO_EXCEPTIONS&lt;/i&gt; (similar to the previous version). I decided to solve it with a helper function called &lt;i&gt;get_subentry_const&lt;/i&gt; implementing the missing functionality:
&lt;br/&gt;
The &lt;i&gt;libtorrent/src/kademlia/dht_tracker.cpp&lt;/i&gt; file:
&lt;pre class="code"&gt;
        libtorrent::entry const&amp; get_subentry_const( libtorrent::entry const&amp; e, char const* key )
        {
#ifndef BOOST_NO_EXCEPTIONS
            return e[key];
#else
            libtorrent::entry const* const s( e.find_key( key ) );
            if (!s) throw std::runtime_error("subentry not found");
            return *s;
#endif
        }
&lt;/pre&gt;
This function - in case of missing key - throws the exception - which in turn cause the process 
termination, the question is whether the missing key in client code is really exceptional
or it is used in normal program flow... Alternative would be to return reference to a global 
empty instance of &lt;i&gt;entry&lt;/i&gt; class.
&lt;br/&gt;
&lt;br/&gt;
Now the client code has to be modified as follows:
&lt;pre class="code"&gt;
&lt;i&gt;//     std::string const&amp; id = r["id"].string();&lt;/i&gt;
&lt;b&gt;       std::string const&amp; id = get_subentry_const( r, "id" ).string();&lt;/b&gt;
&lt;/pre&gt;
With all these changes the compilation completed succesfully but I got the 
following link errors:
&lt;pre class="code"&gt;
dev# python setup.py build
...
`.L7753' referenced in section `.rodata' of build/temp.linux-i686-2.5/./libtorrent/src/create_torrent.o: defined in d
iscarded section `.gnu.linkonce.t._ZN5boost9date_time23gregorian_calendar_baseINS0_19year_month_day_baseINS_9gregoria
n9greg_yearENS3_10greg_monthENS3_8greg_dayEEEmE16end_of_month_dayES4_S5_' of build/temp.linux-i686-2.5/./libtorrent/s
rc/create_torrent.o
`.L7740' referenced in section `.rodata' of build/temp.linux-i686-2.5/./libtorrent/src/create_torrent.o: defined in d
iscarded section `.gnu.linkonce.t._ZN5boost9date_time23gregorian_calendar_baseINS0_19year_month_day_baseINS_9gregoria
n9greg_yearENS3_10greg_monthENS3_8greg_dayEEEmE16end_of_month_dayES4_S5_' of build/temp.linux-i686-2.5/./libtorrent/s
rc/create_torrent.o
...
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
&lt;/pre&gt;
As you can see in this &lt;a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16625"&gt;bug report&lt;/a&gt;
it seems as a known compiler bug. 
&lt;br/&gt;
There was one promising hint in this discussion:
&lt;blockquote&gt;&lt;pre&gt;
While trying to build some C++ code with g++-3.3.6 we encountered error
messages  similar to those mentioned in earlier comments in this discussion:

  `xxx' referenced in section `.rodata' of somefile.o: defined 
  in discarded section `.gnu.linkonce.t._zzz' of something.o

  ...

We were able to eliminate these error messages and successfuly compile our code
with g++-3.3.6 by using the '-frepo' option in our g++ compiles.

I understand that this may not be the ultimate solution to the bug(s) being
discussed here, but since we ended up here when searching for this particular
error message, I'm adding this comment in case it helps other people.
&lt;/pre&gt;&lt;/blockquote&gt;
Nevertheless when I tried the suggested workaround:
&lt;pre class="code"&gt;
dev# export CFLAGS="$CFLAGS -frepo"
&lt;/pre&gt;
... the result was exactly the same.
&lt;br/&gt;
&lt;br/&gt;
As you could see, I tried really hard to avoid the re-configuration and 
re-compilation of the compiler but at the end it seems inevitable.
&lt;br/&gt;
But it is enough for now, I feel really tired ;-)&lt;br/&gt;
We shall look at that in the &lt;a href="http://filodej.blogspot.com/2008/08/wmu-6500fs-deluge-torrent-part-iii.html"&gt;next part&lt;/a&gt;.
&lt;br/&gt;
&lt;br/&gt;
&lt;i&gt;Note: &lt;/i&gt; I have created a &lt;a href="http://code.rasterbar.com/libtorrent/ticket/377"&gt;ticket on libtorrent Trac&lt;/a&gt;; it contains the diff with all the changes I have done. 
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-36517898141051356?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/36517898141051356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=36517898141051356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/36517898141051356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/36517898141051356'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-ii.html' title='WMU-6500FS - Deluge torrent (part II)'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xFBIBcRhwFQ/SIh0W3rD25I/AAAAAAAABmc/W3g-ewZLw0U/s72-c/wmu6500fs-remote-gdb2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-5499650959291922343</id><published>2008-07-24T14:06:00.027+02:00</published><updated>2008-08-06T21:25:51.739+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Deluge torrent (part I)</title><content type='html'>&lt;b&gt;Info sources:&lt;/b&gt;
&lt;a href="http://deluge-torrent.org/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;h3&gt;Overview&lt;/h3&gt;
The deluge torrent client is first real X application (and the first 
application implemented in c++) I am trying to build on the WMU box. 
Thus it is by far the hardest puzzle I had to solve so far. I learned a lot along the way and so I would like to share it step by step with you.
&lt;br/&gt;
Whole build process is so complicated for me, that I have not finished it yet &lt;i&gt;(Update: it is finished now 8-) )&lt;/i&gt; and so I am going to organize this post as series of three (hopefully there will be no need for more ;) parts. Also the deluge version was changing during my mission so the series will reflect these changes. It is not because I want to force readers (possibly trying to build the deluge as well) to go the exact same path, the point is to show all the problems (along with solutions or workarounds) I have experienced, since they can emerge in another situations as well.
&lt;br/&gt;
&lt;br/&gt;
&lt;a href="http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-i.html"&gt;This part&lt;/a&gt; contains the initial build process and deployment. 
&lt;a href="http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-ii.html"&gt;Next part&lt;/a&gt; will deal with the local and remote debugging and (hopefully) the &lt;a href="http://filodej.blogspot.com/2008/08/wmu-6500fs-deluge-torrent-part-iii.html"&gt;last one&lt;/a&gt; will describe the solution of the problems found during the debugging sessions. I am also going to prepare a post with build sequence of libraries the deluge directly or indirectly depends on.
&lt;br/&gt;

&lt;span class="fullpost"&gt;

&lt;h3&gt;Compilation:&lt;/h3&gt;
I have started with the 0.5.9.1 version (the newest one at the time).
&lt;pre class="code"&gt;
dev# wget &lt;a href="http://download.deluge-torrent.org/source/0.5.9.1/deluge-0.5.9.1.tar.gz"&gt;http://download.deluge-torrent.org/source/0.5.9.1/deluge-0.5.9.1.tar.gz&lt;/a&gt;
dev# tar xzvf deluge-0.5.9.1.tar.gz
dev# export CFLAGS=-I/mnt/C/sys/include/boost-1_35
dev# python setup.py build
...
Error 1
libtorrent/src/session_impl.cpp:829:   instantiated from here
libtorrent/include/libtorrent/socket.hpp:181: error: `IPV6_V6ONLY' undeclared
&lt;/pre&gt;
It seems the uClibc (at least 0.9.27 version) lacks the IPV6_V6ONLY definition. 
See for example &lt;a href="http://mailman.videolan.org/pipermail/vlc-devel/2006-February/022277.html"&gt;this message&lt;/a&gt; 
for more info about this (missing) define.
&lt;br/&gt;
As a quick and dirty fix I just define the identifier locally:
&lt;pre class="code"&gt;
dev# nano libtorrent/include/libtorrent/socket.hpp
&lt;/pre&gt;
... and add following (the actual value got from debian &lt;i&gt;/usr/include/bits/in.h&lt;/i&gt; file) 
just after the include section:
&lt;pre class="code"&gt;
#define IPV6_V6ONLY             26
&lt;/pre&gt;

&lt;h3&gt;Static linkage:&lt;/h3&gt;
Now we can try the build again:
&lt;pre class="code"&gt;
dev# python setup.py build
...
/usr/bin/ld: cannot find -lboost_filesystem-mt
&lt;/pre&gt;
Static linker is unable to find the boost_filesystem-mt library. At first we have to make sure 
that linker flags &lt;i&gt;LDFLAGS&lt;/i&gt; are pointing to proper directory (&lt;i&gt;sys/lib&lt;/i&gt;):
&lt;pre class="code"&gt;
dev# echo $LDFLAGS

dev# export LDFLAGS=-L/mnt/C/sys/lib
&lt;/pre&gt;
... but the problem still persists. The problem is that the boost library names are more specific 
(contain boost version and compiler version). 
In README Additional notes is the following:
&lt;blockquote&gt;
1) On some distributions, boost libraries are renamed to have "-mt" at the end
(boost_thread_mt instead of boost_thread, for example), the "mt"  indicating
"multithreaded". In some cases it appears the distros lack symlinks to connect
things. The solution is to either add symlinks from the short names to those
with "-mt", or to alter setup.py to look for the "-mt" versions.
&lt;/blockquote&gt;
I do not know whether there should be libboost_*-mt.so symlinks by default, maybe I have not 
configured boost library properly, as a quick fix I decided to create the links manually:
&lt;pre class="code"&gt;
dev# cd /mnt/C/sys/lib
dev# for i in `ls ./libboost_*-gcc33-mt-1_35.so.1.35.0`; do ln -s $i ${i/%-gcc33-mt-1_35.so.1.35.0/-mt.so}; done
&lt;/pre&gt;
Now we have another link error:
&lt;pre class="code"&gt;
dev# python setup.py build
...
can't resolve symbol 'get_nprocs'
&lt;/pre&gt;
It seems that uClibc does not implement &lt;a&gt;get_nprocs&lt;/a&gt; function. 
Following text from &lt;a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;p=438259"&gt;this forum&lt;/a&gt; 
describes the workaround:
&lt;blockquote&gt;
I grep'ed the boost source tree for get_nprocs and found the only instance of it in thread.cpp. 
I found out that this function returns the number of processors and is really not needed in my case. 
So instead of having "return get_nprocs()", I changed it to "return 1". While I think this should 
not break anything, I thought I should still tell you. 
&lt;/blockquote&gt;
So in file &lt;i&gt;boost_1_35_0/libs/thread/src/pthread/thread.cpp&lt;/i&gt; I have replaced
&lt;pre class="code"&gt;
    return get_nprocs();
&lt;/pre&gt;
with:
&lt;pre class="code"&gt;
    return 1;
&lt;/pre&gt;
in short:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/boost_1_35_0
dev# sed -i 's/return get_nprocs();/return 1;/g' libs/thread/src/pthread/thread.cpp
&lt;/pre&gt;
... and rebuilt the boost library.
&lt;pre class="code"&gt;
dev# make
...
...updating 3 targets...
...
...updated 3 targets...
dev# make install
...
...updating 6 targets...
common.copy /mnt/C/sys/lib/libboost_thread-gcc33-mt-1_35.so.1.35.0
ln-UNIX /mnt/C/sys/lib/libboost_thread-gcc33-mt-1_35.so
common.copy /mnt/C/sys/lib/libboost_wave-gcc33-mt-1_35.so.1.35.0
ln-UNIX /mnt/C/sys/lib/libboost_wave-gcc33-mt-1_35.so
common.hard-link /mnt/C/sys/lib/libboost_thread-gcc33-mt.so
common.hard-link /mnt/C/sys/lib/libboost_wave-gcc33-mt.so
...updated 6 targets...
&lt;/pre&gt;
... now the build finished successfully, we are ready to install:
&lt;pre class="code"&gt;
dev# python setup.py install --prefix=/mnt/C/sys/X11
&lt;/pre&gt;
In order to correctly deploy on the box, one additional hack was needed 
(touch everything containing deluge in path so it is included in the &lt;i&gt;filopack&lt;/i&gt; archive):
&lt;pre class="code"&gt;
dev# find /mnt/C/sys -path "*deluge*" -type f -exec touch {} \;
&lt;/pre&gt;
We have the first step done. Do not know yet what is ahead of us ;-) 
&lt;br/&gt;
&lt;h3&gt;Dynamic linkage:&lt;/h3&gt;
Now we can try to run the application:
&lt;pre class="code"&gt;
dev# deluge
...
/usr/bin/python: can't resolve symbol '_ZN5boost6system19get_system_categoryEv'
&lt;/pre&gt;
It seems there is some symbol expected by deluge app but missing in the boost libraries.
&lt;br/&gt;
With the &lt;a href="http://linux.about.com/library/cmd/blcmdl1_nm.htm"&gt;nm command&lt;/a&gt; we find out 
whether the symbol is in any boost library:
&lt;pre class="code"&gt;
dev# nm -A -D /mnt/C/sys/lib/libboost_* | grep "T _ZN5boost6system19get_system_categoryEv"
/mnt/C/sys/lib/libboost_system-gcc33-mt-1_35.so:00001d28 T _ZN5boost6system19get_system_categoryEv
/mnt/C/sys/lib/libboost_system-gcc33-mt-1_35.so.1.35.0:00001d28 T _ZN5boost6system19get_system_categoryEv
/mnt/C/sys/lib/libboost_system-gcc33-mt.so:00001d28 T _ZN5boost6system19get_system_categoryEv
/mnt/C/sys/lib/libboost_system-mt.so:00001d28 T _ZN5boost6system19get_system_categoryEv
&lt;/pre&gt;
Make sure that the symbol is needed from the deluge_core library:
&lt;pre class="code"&gt;
dev# nm /mnt/C/sys/lib/python2.5/site-packages/deluge/deluge_core.so | grep _ZN5boost6system19get_system_categoryEv
         U _ZN5boost6system19get_system_categoryEv
&lt;/pre&gt;
We can test whether all the libraries the deluge_core depends on are properly found by the dynamic linker:
&lt;pre class="code"&gt;
dev# ldd /mnt/C/sys/lib/python2.5/site-packages/deluge/deluge_core.so
        libboost_filesystem-gcc33-mt-1_35.so.1.35.0 =&gt; /usr/lib/libboost_filesystem-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        libboost_date_time-gcc33-mt-1_35.so.1.35.0 =&gt; /usr/lib/libboost_date_time-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        libboost_thread-gcc33-mt-1_35.so.1.35.0 =&gt; /usr/lib/libboost_thread-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        ...
        libboost_system-gcc33-mt-1_35.so.1.35.0 =&gt; /usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 (0x00000000)
        ...
&lt;/pre&gt;
I am not sure what exactly is going on here, I would be glad if anybody shed some light on it,
as a workaround the &lt;a href="http://en.wikipedia.org/wiki/Dynamic_linker#LD_PRELOAD"&gt;LD_PRELOAD&lt;/a&gt; works for me:
&lt;pre class="code"&gt;
dev# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 deluge
Traceback (most recent call last):
  File "/usr/bin/deluge", line 46, in &lt;module&gt;
    import deluge._dbus as dbus
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge/_dbus.py", line 32, in &lt;module&gt;
    from dbus import Interface, SessionBus, version
ImportError: No module named dbus
&lt;/pre&gt;
We have to install &lt;i&gt;dbus&lt;/i&gt; before we proceed 
(see &lt;a href="http://timjoh.com/no-module-named-_dbus-in-deluge-torrent/"&gt;this post&lt;/a&gt;)...
&lt;br/&gt;
Now we can try it again:
&lt;pre class="code"&gt;
dev# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 deluge
process 16385: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open 

"/mnt/C/sys/X11//var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
  D-Bus not compiled with backtrace support so unable to print a backtrace
Aborted
&lt;/pre&gt;
So far so good, following command seem to solve it:
&lt;pre class="code"&gt;
dev# sys/X11/bin/dbus-uuidgen --ensure
&lt;/pre&gt;
... but then there is another problem:
&lt;h3&gt;Crashes:&lt;/h3&gt;
&lt;pre class="code"&gt;
#  LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 deluge
no existing Deluge session

(deluge:16391): GLib-GIO-CRITICAL **: g_unix_mount_is_system_internal: assertion `mount_entry != NULL' failed
Segmentation fault
&lt;/pre&gt;

The &lt;i&gt;g_unix_mount_is_system_internal&lt;/i&gt; function (in &lt;i&gt;glib-2.17.2/gio/gunixmounts.c&lt;/i&gt; file) 
asserted since the given mount_entry was NULL.
&lt;pre class="code"&gt;
gboolean
g_unix_mount_is_system_internal (GUnixMountEntry *mount_entry)
{
  g_return_val_if_fail (mount_entry != NULL, FALSE);

  return mount_entry-&gt;is_system_internal;
}
&lt;/pre&gt;
Look at the places where the function is called. We find the &lt;i&gt;g_unix_mount_guess_should_display&lt;/i&gt;
function in the same file.
&lt;pre class="code"&gt;
gboolean
g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
{
  const char *mount_path;

  /* Never display internal mountpoints */
  if (g_unix_mount_is_system_internal (mount_entry))
    return FALSE;

  /* Only display things in /media (which are generally user mountable)
     and home dir (fuse stuff) */
  mount_path = &lt;b&gt;mount_entry-&gt;mount_path&lt;/b&gt;;
&lt;/pre&gt;
It is apperent that this function calls the &lt;i&gt;g_unix_mount_is_system_internal&lt;/i&gt;
it asserts but returns FALSE and so the &lt;i&gt;g_unix_mount_guess_should_display&lt;/i&gt;
immediatelly crashes.
&lt;br/&gt;
Now we can look at the caller's code, to the &lt;i&gt;_g_unix_mount_new&lt;/i&gt; function in
the &lt;i&gt;glib-2.17.2/gio/gunixmount.c&lt;/i&gt;:
&lt;pre class="code"&gt;
GUnixMount *
_g_unix_mount_new (GVolumeMonitor  *volume_monitor,
                   GUnixMountEntry *mount_entry,
                   GUnixVolume     *volume)
{
  GUnixMount *mount;

  /* No volume for mount: Ignore internal things */
  if (volume == NULL &amp;&amp; !g_unix_mount_guess_should_display (mount_entry) )
    return NULL;
  ...
&lt;/pre&gt;
I do not know what are the exact contract of those functions,
from the code it seems that all three functions share the precondition 
that the mount_entry cannot be NULL.  
&lt;br /&gt;
I decided not to go up on the call stack and look for the actual cause of the NULL
mount_entry, it can very well be the fact that I am running on the chroot-ed environment. 
As a quick fix I modify this function as follows:
&lt;pre class="code"&gt;
dev# nano /usr/local/src/glib-2.17.2/gio/gunixmount.c
  if (volume == NULL &amp;&amp; ( &lt;b&gt;!mount_entry ||&lt;/b&gt; !g_unix_mount_guess_should_display (mount_entry) ) )
    return NULL;
dev# make 
dev# make install
&lt;/pre&gt;
&lt;pre class="code"&gt;
Ok, let's try it again:
dev# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 /mnt/C/sys/X11/bin/deluge
no existing Deluge session
Traceback (most recent call last):
  File "/mnt/C/sys/X11/bin/deluge", line 130, in &lt;module&gt;
    deluge.wizard.WizardGTK()
  File "/mnt/C/sys/X11/lib/python2.5/site-packages/deluge/wizard.py", line 58, in __init__
    self.window.set_icon(deluge.common.get_logo(18))
  File "/mnt/C/sys/X11/lib/python2.5/site-packages/deluge/common.py", line 154, in get_logo
    size, size)
gobject.GError: Unrecognized image file format
&lt;/pre&gt;
When we look to the &lt;i&gt;common.py&lt;/i&gt; we see there are two icon variants: svg and png.
When we change .svg to .png everything works. You can open the file in a text editor:
&lt;pre class="code"&gt;
dev# nano /mnt/C/sys/X11/lib/python2.5/site-packages/deluge/common.py
        return gtk.gdk.pixbuf_new_from_file_at_size(get_pixmap("deluge.png"), \
            size, size)
&lt;/pre&gt;
... or simply call the following command:
&lt;pre class="code"&gt;
dev# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/X11/lib/python2.5/site-packages/deluge/common.py
&lt;/pre&gt;
Now we have made a progress, when we launch deluge the we have to &lt;i&gt;setup the preferences&lt;/i&gt;.
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SIhz0DqDVfI/AAAAAAAABmU/_3HIOEcedW0/s1600-h/deluge-setup.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SIhz0DqDVfI/AAAAAAAABmU/_3HIOEcedW0/s400/deluge-setup.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5226554705735538162" /&gt;&lt;/a&gt;
&lt;br/&gt;
But when we proceed, there is another error:
&lt;pre class="code"&gt;
...
no existing Deluge session
Starting new Deluge session...
deluge_core; using libtorrent 0.13.0.0. Compiled with NDEBUG.
Applying preferences
Scanning plugin dir /mnt/C/sys/X11/share/deluge/plugins
Initialising plugin TorrentPeers
...
Initialising plugin SpeedLimiter
Applying preferences
Starting DHT...
Aborted
&lt;/pre&gt;
When we use &lt;a href="http://linux.die.net/man/1/strace"&gt;strace tool&lt;/a&gt; to monitor system calls 
we get the following:
&lt;pre class="code"&gt;
dev# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 strace deluge
...
close(11)                               = 0
write(1, "Applying preferences\n", 21Applying preferences
)  = 21
write(1, "Starting DHT...\n", 16Starting DHT...
)       = 16
open("/root/.config/deluge/dht.state", O_RDONLY) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
kill(31503, SIGABRT)                    = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++
Process 31503 detached
&lt;/pre&gt;
It seems the abort could have some relation with missing &lt;i&gt;dht.state&lt;/i&gt; file. 
Let's try to debug it:
&lt;pre class="code"&gt;
dev# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 gdb python
GNU gdb 6.3
...
(gdb) run /mnt/C/sys/X11/bin/deluge
Starting program: /mnt/C/sys/bin/python /mnt/C/sys/X11/bin/deluge
[Thread debugging using libthread_db enabled]
[New Thread 1024 (LWP 7763)]
Could not open /proc/7763/status
&lt;/pre&gt;
It seems it is not so easy to run gdb on chroot-ed system, I have tried mess up with 
manual &lt;i&gt;/proc&lt;/i&gt; "dummy" file creation but had no success.
&lt;br/&gt;
Another possibility is to debug directly on the box. Before that we have to upload it.
&lt;h3&gt;Deployment to the box:&lt;/h3&gt;
&lt;br/&gt;
After the upload routine some more problems emerged:
&lt;pre class="code"&gt;
box# deluge
Traceback (most recent call last):
  File "/mnt/C/sys/X11/bin/deluge", line 43, in &lt;module&gt;
    import deluge
  File "/mnt/C/sys/X11/lib/python2.5/site-packages/deluge/__init__.py", line 34, in &lt;module&gt;
ImportError: No module named pygtk
&lt;/pre&gt;
Ok, I forgot to deploy &lt;i&gt;pygtk&lt;/i&gt;. Done.
&lt;pre class="code"&gt;
box# deluge
Traceback (most recent call last):
  File "/mnt/C/sys/X11/bin/deluge", line 45, in &lt;module&gt;
    import deluge.core
  File "/usr/lib/python2.5/site-packages/deluge/core.py", line 59, in &lt;module&gt;
    import deluge_core
ImportError: File not found
&lt;/pre&gt;
This one is more interesting, we have to find out what is going on:
&lt;pre class="code"&gt;
box# strace python
...
import deluge.deluge_core
...
open("./libboost_filesystem-gcc33-mt-1_35.so.1.35.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/mnt/C/sys/lib//libboost_filesystem-gcc33-mt-1_35.so.1.35.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/mnt/C/sys/X11/lib//libboost_filesystem-gcc33-mt-1_35.so.1.35.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libboost_filesystem-gcc33-mt-1_35.so.1.35.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libboost_filesystem-gcc33-mt-1_35.so.1.35.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libboost_filesystem-gcc33-mt-1_35.so.1.35.0", O_RDONLY) = -1 ENOENT (No such file or directory)
close(3)                                = 0
write(2, "Traceback (most recent call last"..., 35Traceback (most recent call last):
) = 35
...
&lt;/pre&gt;
Ok, it seems we forgot to deploy the boost libraries. Done.
&lt;pre class="code"&gt;
box# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 deluge
no existing Deluge session

(deluge:19324): libglade-WARNING **: could not find glade file '/usr/share/deluge/glade/wizard.glade'
Traceback (most recent call last):
  File "/mnt/C/sys/X11/bin/deluge", line 130, in &lt;module&gt;
    deluge.wizard.WizardGTK()
  File "/usr/lib/python2.5/site-packages/deluge/wizard.py", line 50, in __init__
    , domain='deluge')
RuntimeError: could not create GladeXML object
&lt;/pre&gt;
We have to create a symlink in &lt;i&gt;/usr/share&lt;/i&gt; (since it is just memory filesystem,
in order to make it permanent we have to make symlink anytime the box boots up). 
&lt;br/&gt;
For now just call following command, later on we can modify an config file 
(e.g. &lt;i&gt;/mnt/C/sys/etc/rc-local&lt;/i&gt;).
&lt;pre class="code"&gt;
box# ln -s /mnt/C/sys/share/deluge /usr/share/deluge
&lt;/pre&gt;
When we try to launch it again, we get known "Unrecognized image file format" message.
&lt;pre class="code"&gt;
box# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 deluge
no existing Deluge session
Traceback (most recent call last):
  File "/mnt/C/sys/X11/bin/deluge", line 130, in &lt;module&gt;
    deluge.wizard.WizardGTK()
  File "/mnt/C/sys/X11/lib/python2.5/site-packages/deluge/wizard.py", line 58, in __init__
    self.window.set_icon(deluge.common.get_logo(18))
  File "/mnt/C/sys/X11/lib/python2.5/site-packages/deluge/common.py", line 154, in get_logo
    size, size)
gobject.GError: Unrecognized image file format
&lt;/pre&gt;
&lt;a href="http://en.wikipedia.org/wiki/Sed"&gt;Stream editor&lt;/a&gt; helps us to fix it:
&lt;pre class="code"&gt;
box# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/X11/lib/python2.5/site-packages/deluge/common.py
&lt;/pre&gt;
Now when run it under strace again, and it seems that we got on the &lt;b&gt;box#&lt;/b&gt; system as far as we 
were on the &lt;b&gt;dev#&lt;/b&gt; system:
&lt;pre class="code"&gt;
box# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 strace deluge
...
close(11)                               = 0
write(1, "Applying preferences\n", 21Applying preferences
)  = 21
write(1, "Starting DHT...\n", 16Starting DHT...
)       = 16
open("/root/.config/deluge/dht.state", O_RDONLY) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
kill(31503, SIGABRT)                    = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++
Process 31503 detached
&lt;/pre&gt;
&lt;h3&gt;Local debugging:&lt;/h3&gt;
Now we are ready to try the gdb debugger:
&lt;pre class="code"&gt;
box# LD_PRELOAD=/usr/lib/libboost_system-gcc33-mt-1_35.so.1.35.0 gdb python
...
(gdb) run /mnt/C/sys/X11/bin/deluge
Starting program: /bin/python /mnt/C/sys/X11/bin/deluge
...
no existing Deluge session
Starting new Deluge session...
deluge_core; using libtorrent 0.13.0.0. Compiled with NDEBUG.

Program received signal SIG32, Real-time event 32.
0x4019cb64 in __rt_sigsuspend () from /lib/libc.so.0
(gdb) Quit
(gdb) where
#0  0x4019cb64 in __rt_sigsuspend () from /lib/libc.so.0
#1  0x4019cb9b in sigsuspend () from /lib/libc.so.0
#2  0x40139cf9 in __pthread_wait_for_restart_signal () from /lib/libpthread.so.0
#3  0x401396bd in pthread_create () from /lib/libpthread.so.0
#4  0x416c9f26 in boost::thread::start_thread () from /mnt/C/sys/lib//libboost_thread-gcc33-mt-1_35.so.1.35.0
#5  0x415d68c8 in disk_io_thread (this=0x821acc8, block_size=-4) at thread.hpp:151
...
&lt;/pre&gt;
Sig32 event is not really what we are looking for (some info about it can be 
seen in &lt;a href="http://www.mail-archive.com/bug-gdb@gnu.org/msg01102.html"&gt;this discussion&lt;/a&gt;),
we wait for the ABORT signal and so can continue:
&lt;pre class="code"&gt;
(gdb) cont
Continuing.
Program received signal SIG32, Real-time event 32.
0x4019cb64 in __rt_sigsuspend () from /lib/libc.so.0
(gdb) cont
Continuing.
...
Applying preferences
Scanning plugin dir /usr/share/deluge/plugins
...
Starting DHT...

Program received signal SIGABRT, Aborted.
0x4019b1c4 in kill () from /lib/libc.so.0
&lt;/pre&gt;
So let's look where the problem is:
&lt;pre class="code"&gt;
(gdb) where
#0  0x4019b1c4 in kill () from /lib/libc.so.0
#1  0x4013af69 in pthread_kill () from /lib/libpthread.so.0
#2  0x4013b37f in raise () from /lib/libpthread.so.0
#3  0x40194cc7 in abort () from /lib/libc.so.0
#4  0x4027140f in __cxa_call_unexpected () from /mnt/C/sys/lib//libstdc++.so.5
#5  0x40271439 in std::terminate () from /mnt/C/sys/lib//libstdc++.so.5
#6  0x40271560 in __cxa_throw () from /mnt/C/sys/lib//libstdc++.so.5
#7  0x41638218 in libtorrent::bdecode&amp;lt;std::istream_iterator&amp;lt;char, char, 
std::char_traits&amp;lt;char&amp;gt;, int&amp;gt; &amp;gt; (end= {&amp;lt;std::iterator&amp;lt;std::input_iterator_tag, char, int, char const*, char 
const&amp;&amp;gt;&amp;gt; = {&amp;lt;No data fields&amp;gt;}, _M_stream = 0x8d188, _M_value = -124 
'\204', _M_ok = 88}) at bencode.hpp:332
#8  0x41632d47 in torrent_start_DHT (self=0x0, args=0x41a6d44c) at basic_ios.h:110
#9  0x4005d122 in PyCFunction_Call (func=0x412712ac, arg=0x41a6d44c, kw=0x6) at Objects/methodobject.c:108
#10 0x400a2661 in call_function (pp_stack=0xbfffec5c, oparg=0) at Python/ceval.c:3573
...
&lt;/pre&gt;
So we can see an exception thrown in &lt;i&gt;libtorrent::bdecode&lt;/i&gt; which causes the immediate
process termination. As far as I know it can be caused either by not-catching the exception or by a double throw.
&lt;a href="http://gcc.gnu.org/ml/gcc-help/2002-08/msg00072.html"&gt;Here&lt;/a&gt; and &lt;a href="http://www.itk.org/Bug/view.php?id=5574"&gt;here&lt;/a&gt; 
are examples when one experiences the same.
&lt;br/&gt;
&lt;br/&gt;
This is enough for today, we shall look at it in the next part. Since the local debugging is reaaaallyyyyy sloooow and several times I have even run out of swap space, in &lt;a href="http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-ii.html"&gt;next part&lt;/a&gt; we also look at the remote debugging.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-5499650959291922343?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/5499650959291922343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=5499650959291922343' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5499650959291922343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5499650959291922343'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/07/wmu-6500fs-deluge-torrent-part-i.html' title='WMU-6500FS - Deluge torrent (part I)'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_xFBIBcRhwFQ/SIhz0DqDVfI/AAAAAAAABmU/_3HIOEcedW0/s72-c/deluge-setup.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-1986414273935104839</id><published>2008-07-09T21:32:00.002+02:00</published><updated>2008-07-28T21:30:17.335+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Mesa 7.0.3</title><content type='html'>Following image demonstrates the &lt;a href="http://www.mesa3d.org/"&gt;Mesa 3d&lt;/a&gt; application running on the box. As can be seen from FPS, there is no HW acceleration  :-)
&lt;br/&gt;
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SFb7YkcsWoI/AAAAAAAABdM/9Cbt9UGNecA/s1600-h/mesa.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_xFBIBcRhwFQ/SFb7YkcsWoI/AAAAAAAABdM/9Cbt9UGNecA/s400/mesa.png" alt="" id="BLOGGER_PHOTO_ID_5212630018247383682" border="0" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results (library):&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/Mesa-7.0.3.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/Mesa-7.0.3.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Build results (demos):&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/MesaDemos-7.0.3.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/MesaDemos-7.0.3.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Info sources:&lt;/b&gt;
&lt;a href="http://mesa3d.org/"&gt;[Home page]&lt;/a&gt; 
&lt;a href="http://www.linuxfromscratch.org/blfs/view/svn/x/mesalib.html"&gt;[MesaLib dependencies]&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Related info:&lt;/b&gt;
&lt;a href="http://www.straightrunning.com/XmingNotes/"&gt;[Xming notes]&lt;/a&gt;
&lt;a href="http://digg.com/linux_unix/Remote_Desktop_for_Linux"&gt;[Remote desktop for linux]&lt;/a&gt;
&lt;a href="http://osdir.com/ml/video.mesa3d.user/2006-03/msg00008.html"&gt;[Compiling Mesa fbdev/DRI drivers without X installed]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
For now we try to compile the stand-alone/Xlib mode (no Hardware acceleration necessary ;-)
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Dependencies:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/file-4.24.tar.bz2"&gt;[file 4.24]&lt;/a&gt;
&lt;a href="http://rapidshare.com/files/125380138/x11-7.1.tar.bz2.html"&gt;[Xorg libraries]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
First we have to download and extract the libraries and related stuff:
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget "http://downloads.sourceforge.net/mesa3d/MesaLib-7.0.3.tar.bz2?modtime=1207336858&amp;big_mirror=0"
dev# tar xjvf MesaLib-7.0.3.tar.bz2
dev# wget "http://downloads.sourceforge.net/mesa3d/MesaDemos-7.0.3.tar.bz2?modtime=1207336927&amp;big_mirror=0"
dev# tar xjvf MesaDemos-7.0.3.tar.bz2
dev# wget "http://downloads.sourceforge.net/mesa3d/MesaGLUT-7.0.3.tar.bz2?modtime=1207336986&amp;big_mirror=0"
dev# tar xjvf MesaGLUT-7.0.3.tar.bz2 
dev# cd Mesa-7.0.3
&lt;/pre&gt;
Now it is necessary to modify the configuration files, we have to replace the following two paths in the &lt;i&gt;configs/linux&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# nano configs/linux

#X11_INCLUDES = -I/usr/X11R6/include
&lt;b&gt;X11_INCLUDES = -I/mnt/C/sys/X11/include&lt;/b&gt;

#EXTRA_LIB_PATH = -L/usr/X11R6/lib
&lt;b&gt;EXTRA_LIB_PATH = -L/mnt/C/sys/X11/lib&lt;/b&gt;
&lt;/pre&gt;
Also we have to alter the installation paths int the &lt;i&gt;configs/default&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# nano configs/default

#INSTALL_DIR = /usr/local
&lt;b&gt;INSTALL_DIR = /mnt/C/sys/X11&lt;/b&gt;

#DRI_DRIVER_INSTALL_DIR = /usr/X11R6/lib/modules/dri
&lt;b&gt;DRI_DRIVER_INSTALL_DIR = /mnt/C/sys/X11/lib/modules/dri&lt;/b&gt;
&lt;/pre&gt;
No we are ready build:
&lt;pre class="code"&gt;
dev# make linux-x86
...
../../lib/libGL.so: undefined reference to `posix_memalign'
collect2: ld returned 1 exit status
&lt;/pre&gt;
Regarding to &lt;a href="http://www.delilinux.org/forum/topic.php?id=252"&gt;this forum topic&lt;/a&gt; the &lt;i&gt;posix_memalign&lt;/i&gt; is currently not 
implemented in &lt;i&gt;uClibc&lt;/i&gt; so we have to disable it.
&lt;br/&gt;
So let's back to the configuration file:
&lt;pre class="code"&gt;
dev# nano configs/linux

DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
        -D_BSD_SOURCE -D_GNU_SOURCE \
        -DPTHREADS -DUSE_XSHM
&lt;b&gt;# -DHAVE_POSIX_MEMALIGN&lt;/b&gt;
&lt;/pre&gt;
Now we try the build... 
&lt;pre class="code"&gt;
dev# make linux-x86
&lt;/pre&gt;
... and it completed successfully. 
&lt;br/&gt;
&lt;br/&gt;
We are ready to start testing some demo apps, we try the notorious &lt;i&gt;gears&lt;/i&gt; application:
&lt;pre class="code"&gt;
#dev /mnt/C/sys/bin/mesa-demos/gears
&lt;/pre&gt;
If you get an error message similar to this:
&lt;pre class="code"&gt;
Error: Can't open display:
&lt;/pre&gt;
... you probably did not configured the DISPLAY environment variable properly. For a hint how to do that see the 
&lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-box-with-jokers-fw.html#x-config"&gt;X client/server configuration&lt;/a&gt;.
&lt;br/&gt;
&lt;br/&gt;
We have now the X client/server properly configured, &lt;i&gt;gears&lt;/i&gt; test passed with no problems, we are ready to deploy on the box.
&lt;br/&gt;
Curiously on the box we observe the following crash:
&lt;pre class="code"&gt;
box# /mnt/C/sys/bin/mesa-demos/gears
Illegal instruction
&lt;/pre&gt;
To get to the heart of the matter we have to digg little deeper, however we need a tool for it. Let's try JoKeR's built version of gdb. For now we are going to debug directly at the box, later on we look at the remote debugging.
&lt;pre class="code"&gt;
box# &lt;b&gt;gdb /mnt/C/sys/bin/mesa-demos/gears&lt;/b&gt;
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux-uclibc"...Using host libthread_db library "/mnt/C/sys/lib/libthread_db.so.1".

(gdb) &lt;b&gt;run&lt;/b&gt;
Starting program: /tmp/mnt/C/sys/bin/mesa-demos/gears
warning: Cannot initialize thread debugging library: generic error


Program received signal SIGILL, Illegal instruction.
_mesa_x86_cpuid () at x86/common_x86_asm.S:80
80      x86/common_x86_asm.S: No such file or directory.
        in x86/common_x86_asm.S
Current language:  auto; currently asm
(gdb) &lt;b&gt;backtrace&lt;/b&gt;
#0  _mesa_x86_cpuid () at x86/common_x86_asm.S:80
#1  0x403053f0 in ?? () from /mnt/C/sys/lib/libGL.so.1
#2  0x4031f980 in quad_tab () from /mnt/C/sys/lib/libGL.so.1
#3  0x4021c24a in _mesa_init_all_x86_transform_asm () at x86/common_x86.c:180
#4  0x4016a17d in _math_init_transformation () at math/m_xform.c:214
#5  0x4016a19a in _math_init () at math/m_xform.c:227
#6  0x400e8674 in one_time_init (ctx=0x8056b38) at main/context.c:368
#7  0x400e75e1 in _mesa_initialize_context (ctx=0x8056b38, visual=0x8054688,
    share_list=0x0, driverFunctions=0xbffff6c0, driverContext=0x0) at main/context.c:1067
#8  0x4026f92b in XMesaCreateContext (v=0x8054688, share_list=0x0)
    at drivers/x11/xm_api.c:1504
#9  0x4026c234 in Fake_glXCreateContext (dpy=0x804cfa0, visinfo=0x8056900,
    share_list=0x0, direct=1) at drivers/x11/fakeglx.c:1401
#10 0x4026a46d in glXCreateContext (dpy=0x804cfa0, visinfo=0x8056900, shareList=0x0,
    direct=1) at drivers/x11/glxapi.c:188
#11 0x40020d22 in __glutCreateWindow (parent=0x0, x=0, y=0, width=300,
    height=1073998032, gameMode=0) at glut_win.c:609
#12 0x40020df3 in glutCreateWindow (title=0x804ae60 "Gears") at glut_win.c:731
#13 0x0804902e in main (argc=1, argv=0xbffffbc4) at gears.c:370
(gdb)
&lt;/pre&gt;
Ok, it seems promising, now we can look at the file in question:
&lt;pre class="code"&gt;
dev# less /usr/local/src/Mesa-7.0.3/src/mesa/x86/common_x86_asm.S
&lt;/pre&gt;
... or we can look for example &lt;a href="http://webcvs.freedesktop.org/mesa/Mesa/src/mesa/x86/common_x86_asm.S?annotate=1.20"&gt;here&lt;/a&gt; 

on the web. At the line 80 we see the CPUID instruction:
&lt;pre class="code"&gt;
...
76 :  MOV_L (REGOFF(4, ESP), EAX) /* cpuid op */
77 :  PUSH_L (EDI)
78 :  PUSH_L (EBX)
79 :  
&lt;b&gt;80 :  CPUID&lt;/b&gt;
81 :  
82 :  MOV_L (REGOFF(16, ESP), EDI) /* *eax */
83 :  MOV_L (EAX, REGIND(EDI))
...
&lt;/pre&gt;
At the &lt;a href="http://en.wikipedia.org/wiki/CPUID"&gt;CPUID instruction description&lt;/a&gt; we can see what exactly the this instruction means and when it was introduced.
&lt;br/&gt;
The following way we can find out the exact info about the CPU in the box:
&lt;pre class="code"&gt;
box# cat /proc/cpuinfo
processor       : 0
vendor_id       : CyrixInstead
cpu family      : 4
model           : 1
model name      : &lt;b&gt;Cx486SLC&lt;/b&gt;
stepping        : unknown
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : no
fpu_exception   : no
cpuid level     : -1
wp              : yes
flags           :
bogomips        : 44.33
&lt;/pre&gt;
In the document &lt;a href="http://datasheets.chipdb.org/Cyrix/112ap.pdf"&gt;Application Note112 CyrixCPU Detection Guide&lt;/a&gt; I have found the 

following info:
&lt;br/&gt;
&lt;blockquote&gt;
&lt;i&gt;The &lt;b&gt;Cx486SLC&lt;/b&gt;, Cx486DLC, Cx486SRx2, Cx486DRx2, Cx486S, Cx486DX, Cx486DX2, and 5x86
processors do not recognize the CPUID instruction and must be identified using the DIR0 and DIR1 register.&lt;/i&gt;
&lt;/blockquote&gt;
So the cause of the problem is found. There is no support of certain instructions on the box and so we cannot be sure the code we built on the PC will run. 
&lt;br/&gt;
In the configuration file &lt;i&gt;configs/linux-x86&lt;/i&gt; we can see following ASM related switches:
&lt;pre class="code"&gt;
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
&lt;/pre&gt;
In order not to use ASM implementations we can use &lt;i&gt;linux&lt;/i&gt; configuration instead of &lt;i&gt;linux-x86&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# make realclean
dev# make linux
&lt;/pre&gt;
Everything seem to be working now :-)
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-1986414273935104839?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/1986414273935104839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=1986414273935104839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/1986414273935104839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/1986414273935104839'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/07/mesa-703.html' title='WMU-6500FS - Mesa 7.0.3'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_xFBIBcRhwFQ/SFb7YkcsWoI/AAAAAAAABdM/9Cbt9UGNecA/s72-c/mesa.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-496095877248159954</id><published>2008-06-27T12:51:00.010+02:00</published><updated>2008-06-27T13:18:49.081+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - GTK+ 2.10.14</title><content type='html'>&lt;h3&gt;GTK+ 2.10.14&lt;/h3&gt;
&lt;a href="http://www.gtk.org"&gt;[Home page]&lt;/a&gt; 
&lt;a href="http://www.linuxfromscratch.org/blfs/view/svn/x/gtk2.html"&gt;[List of dependencies]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/gtk-2.10.14.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/gtk-2.10.14.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Related stuff:&lt;/b&gt;&lt;br/&gt;
&lt;a href="http://philodej.googlepages.com/libxcb-1.1.tar.bz2"&gt;[XCB]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/xcb-util-0.2.tar.bz2"&gt;[XCB util]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/gperf-3.0.3.tar.bz2"&gt;[gperf]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/cairo-1.6.4.tar.bz2"&gt;[cairo]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/pango-1.21.3.tar.bz2"&gt;[pango]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/tiff-3.8.2.tar.bz2"&gt;[libtiff]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/fontconfig-2.6.0.tar.bz2"&gt;[fontconfig]&lt;/a&gt;
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SGLxJ2YNwII/AAAAAAAABdU/KNfroh2bzSs/s1600-h/gtk.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SGLxJ2YNwII/AAAAAAAABdU/KNfroh2bzSs/s400/gtk.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5215996469966651522" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-2.10.14.tar.bz2"&gt;http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-2.10.14.tar.bz2&lt;/a&gt;
dev# tar xjvf gtk+-2.10.14.tar.bz2
dev# ./configure --prefix=/mnt/C/sys
gdkdrawable-x11.c:32:24: cairo-xlib.h: No such file or directory
&lt;/pre&gt;
Not much of a progress. It seems we need to build the &lt;i&gt;cairo&lt;/i&gt; library. &lt;a href="#cairo"&gt;Here are the details.&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
Now we can try to re-configure...
&lt;pre class="code"&gt;
dev# ./configure --prefix=/mnt/C/sys/X11/ &lt;b&gt;--with-x --x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/&lt;/b&gt;
configure: error:
*** Checks for TIFF loader failed. You can build without it by passing
*** --without-libtiff to configure but some programs using GTK+ may
*** not work properly
&lt;/pre&gt;
We can build it with the &lt;i&gt;--without-libtiff&lt;/i&gt; option or we have to install the &lt;a href="#libtiff"&gt;TIFF library&lt;/a&gt;.
&lt;br/&gt;
&lt;br/&gt;
Once it is done we can re-configure and make:
&lt;pre class="code"&gt;
dev# export LDFLAGS=-L/mnt/C/sys/lib
dev# ./configure --prefix=/mnt/C/sys/X11/ &lt;b&gt;--with-x --x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/&lt;/b&gt;
dev# make
...
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION 
-I../.. -I../../gdk -I../../gdk -DGDK_PIXBUF_DISABLE_DEPRECATED 
-DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo 
-I/mnt/C/sys/X11/include/ -g -O2 -Wall -MT gdkdrawable-x11.lo -MD -MP -MF 
.deps/gdkdrawable-x11.Tpo -c gdkdrawable-x11.c  -fPIC -DPIC -o 
libs/gdkdrawable-x11.o
gdkdrawable-x11.c:32:24: cairo-xlib.h: No such file or directory
&lt;/pre&gt;
It seems some modules try to directly include the &lt;i&gt;cairo&lt;/i&gt; header files as they were placed at an include path, but that is not the case.
&lt;pre class="code"&gt;
dev# export CXXFLAGS=-I/mnt/C/sys/X11/include/cairo
dev# ./configure --prefix=/mnt/C/sys/X11/ &lt;b&gt;--with-x --x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/&lt;/b&gt;
dev# make
In file included from gdkdrawable-x11.c:32:
/mnt/C/sys/X11/include/cairo/cairo-xlib.h:97:3: #error Cairo was not compiled with support for the xlib backend
&lt;/pre&gt;
It seems we have to build the &lt;i&gt;XCB&lt;/i&gt; library (&lt;a href="#xcb"&gt;Here&lt;/a&gt; is the build sequence) and then re-build the &lt;i&gt;cairo&lt;/i&gt; library properly.
&lt;br/&gt;
&lt;br/&gt;
Now we are ready to proceed with GTK:
&lt;pre class="code"&gt;
dev# ./configure --prefix=/mnt/C/sys/X11/ &lt;b&gt;--with-x --x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/&lt;/b&gt;
...
configure:31390: gcc -o conftest -I/mnt/C/sys/X11/include/cairo -Wall -I/mnt/C/sys/X11/include
-L/mnt/C/sys/lib conftest.c -L/mnt/C/sys/X11/lib -lXext -lXrender -lX11  -lintl &gt;&amp;5
/mnt/C/sys/X11/lib/libxcb-xlib.so.0: undefined reference to `backtrace_symbols'
/mnt/C/sys/X11/lib/libxcb-xlib.so.0: undefined reference to `backtrace'
&lt;/pre&gt;
It seems that xcb is not properly configured, it needs a backtrace support (not provided by uClibc). So we have to &lt;a href="#xcb"&gt;rebuild 

&lt;i&gt;libxcb&lt;/i&gt;&lt;/a&gt; with the &lt;i&gt;HAVE_BACKTRACE&lt;/i&gt; configure hack.
&lt;br/&gt;
&lt;br/&gt;
Let's try it again, do not worry, we are almost there ;-)
&lt;pre class="code"&gt;
dev# make clean
dev# ./configure --prefix=/mnt/C/sys/X11/ &lt;b&gt;--with-x --x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/&lt;/b&gt;
dev# make
...
/bin/sh ../libtool --mode=link gcc  -I/mnt/C/sys/X11/include/cairo -Wall  
-L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -o gtk-query-immodules-2.0 queryimmodules.o 
libgtk-x11-2.0.la ../gdk-pixbuf/libgdk_pixbuf-2.0.la ../gdk/libgdk-x11-2.0.la 
gcc -I/mnt/C/sys/X11/include/cairo -Wall -o .libs/gtk-query-immodules-2.0 
queryimmodules.o  -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib  ./.libs/libgtk-x11-2.0.so 
/usr/local/src/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so -L/mnt/C/sys/X11/lib 
/usr/lib/libatk-1.0.so ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so 
../gdk/.libs/libgdk-x11-2.0.so /usr/lib/libpangocairo-1.0.so /usr/lib/libcairo.so 
/usr/lib/libpixman-1.so /usr/lib/libpangoft2-1.0.so /usr/lib/libpango-1.0.so 
...
/usr/local/src/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so: undefined reference to `cairo_xlib_surface_create_for_bitmap'
/usr/local/src/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so: undefined reference to `cairo_xlib_surface_create'
/usr/local/src/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so: undefined reference to `cairo_xlib_surface_set_size'
collect2: ld returned 1 exit status
&lt;/pre&gt;
It seems that the static linker did not find some &lt;i&gt;cairo&lt;/i&gt; symbols. 
&lt;br/&gt;
Let's look to &lt;i&gt;gdk&lt;/i&gt; to be sure what &lt;i&gt;cairo&lt;/i&gt; symbols are referenced:
&lt;pre class="code"&gt;
dev# nm /usr/local/src/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so | grep cairo_xlib_surface_create
         U cairo_xlib_surface_create
         U cairo_xlib_surface_create_for_bitmap
&lt;/pre&gt;
Let's look at the &lt;i&gt;cairo&lt;/i&gt; library why they are missing...
&lt;pre class="code"&gt;
dev# nm /mnt/C/sys/X11/lib/libcairo.so | grep cairo_xlib_surface_create
...
0005b7d3 T cairo_xlib_surface_create
0005b834 T cairo_xlib_surface_create_for_bitmap
...
&lt;/pre&gt;
It seems the symbols are there. If they was not there it would be due to incorrect cairo configuration, namely missing &lt;i&gt;--with-x&lt;/i&gt; configure 

script option (see &lt;a href="http://archive.netbsd.se/?ml=freebsd-gnome&amp;a=2006-04&amp;t=1937183"&gt;this mail&lt;/a&gt;). However I think that in this regard we have the &lt;i&gt;cairo&lt;/i&gt; configured properly.
&lt;br/&gt;
&lt;br/&gt;
Not sure what is actually going on here, maybe it is the order of libraries passed to static linker (the fact that the &lt;i&gt;libcairo.so&lt;/i&gt; goes 

&lt;b&gt;after&lt;/b&gt; the libgdk-x11-2.0.so):
&lt;pre class="code"&gt;
gcc -I/mnt/C/sys/X11/include/cairo -Wall -o .libs/gtk-query-immodules-2.0 queryimmodules.o
-L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib ./.libs/libgtk-x11-2.0.so 
&lt;b&gt;/usr/local/src/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so&lt;/b&gt; -L/mnt/C/sys/X11/lib 
/usr/lib/libatk-1.0.so ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so 
../gdk/.libs/libgdk-x11-2.0.so /usr/lib/libpangocairo-1.0.so &lt;b&gt;/usr/lib/libcairo.so&lt;/b&gt; 
/usr/lib/libpixman-1.so /usr/lib/libpangoft2-1.0.so /usr/lib/libpango-1.0.so 
/usr/lib/libpng12.so /mnt/C/sys/X11/lib/libxcb-render-util.so /mnt/C/sys/X11/lib/libxcb-render.so 
/mnt/C/sys/X11/lib/libpixman-1.so /usr/lib/libfontconfig.so /usr/lib/libfreetype.so 
-lz /usr/lib/libexpat.so /mnt/C/sys/X11/lib/libXinerama.so 
/mnt/C/sys/X11/lib/libXrandr.so /mnt/C/sys/X11/lib/libXext.so 
...
&lt;/pre&gt;
In any case the following hack "fixed" the problem:
&lt;pre class="code"&gt;
dev# make clean
dev# export LDFLAGS="-L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib &lt;b&gt;/mnt/C/sys/X11/lib/libcairo.so&lt;/b&gt;"
dev# ./configure --prefix=/mnt/C/sys/X11/ &lt;b&gt;--with-x --x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/&lt;/b&gt;
dev# make
&lt;/pre&gt;

&lt;b&gt;Test installation:&lt;/b&gt;
&lt;br/&gt;
&lt;br/&gt;
Now we are ready to test the installation:
&lt;pre class="code"&gt;
dev# /mnt/C/sys/X11/bin/gtk-demo
...
(gtk-demo:25684): Pango-CRITICAL **: No fonts found:
This probably means that the fontconfig
library is not correctly configured. You may need to
edit the fonts.conf configuration file. More information
about fontconfig can be found in the fontconfig(3) manual
page and on http://fontconfig.org
...
&lt;/pre&gt;
The application seems as follows:
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SGTHfyAviKI/AAAAAAAABd0/It7SHsbyCpo/s1600-h/gtk-no-fonts.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SGTHfyAviKI/AAAAAAAABd0/It7SHsbyCpo/s400/gtk-no-fonts.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5216513617216637090" /&gt;&lt;/a&gt;
&lt;br/&gt;
The fonts are compiled and deployed but not installed correctly, when we &lt;a href="#fontconfig"&gt;build the &lt;i&gt;fontconfig&lt;/i&gt;&lt;/a&gt; then we can perform the following test:
&lt;pre class="code"&gt;
dev# fc-list
dev#
&lt;/pre&gt;
We have to create a link to &lt;i&gt;/usr/share/&lt;/i&gt; directory to make fonts visible:
&lt;pre class="code"&gt;
dev# ln -s /mnt/C/sys/X11/lib/X11/fonts/ /usr/share/fonts
dev# fc-cache
dev# fc-list
Luxi Serif:style=Regular
LucidaBright:style=Italic
Utopia:style=Bold Italic
Serto Malankara:style=Regular
...
&lt;/pre&gt;
The startup time of the &lt;i&gt;gtk-demo&lt;/i&gt; application (as well as for example simple &lt;i&gt;xclock&lt;/i&gt;) increased significantly. It seems that number of 

fonts greatly influences the x-apps' startup times. When we (&lt;a herf="http://www.linuxfromscratch.org/blfs/view/svn/x/x7font.html"&gt;according to 

this source&lt;/a&gt;) limit the number of linked fonts (e.g. only OTF and TTF) (see alsho &lt;a 

href="http://efod.se/writings/linuxbook/html/x-tip.html"&gt;this tip&lt;/a&gt;), the situation is slightly better:
&lt;pre class="code"&gt;
box# rm /usr/share/fonts
box# mkdir /usr/share/fonts
box# ln -sn $XORG_PREFIX/lib/X11/fonts/OTF /usr/share/fonts/X11-OTF &amp;&amp;
box# ln -sn $XORG_PREFIX/lib/X11/fonts/TTF /usr/share/fonts/X11-TTF
&lt;/pre&gt;
Still the x-client applications are relatively slow, turning the ssh compression helped a bit, but more evaluation and benchmarking is needed...
&lt;br/&gt;
&lt;a name="xcb"&gt;&lt;/a&gt;
&lt;h3&gt;libxcb-1.1&lt;/h3&gt;
&lt;a href="http://www.linuxfromscratch.org/blfs/view/svn/x/libxcb.html"&gt;[XCB dependencies]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/libxcb-1.1.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libxcb-1.1.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
We can download &lt;i&gt;XCB&lt;/i&gt; via the git_xorg.sh script (for details see XOrg related &lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-xorg-71-teaser.html"&gt;post&lt;/a&gt;) or we can do it by hand. As it is described here. First we 

have to download and build the protocol headers and pthread stubs (on linux it should be just stubs and nothing more).
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://xcb.freedesktop.org/dist/xcb-proto-1.1.tar.gz"&gt;http://xcb.freedesktop.org/dist/xcb-proto-1.1.tar.gz&lt;/a&gt;
dev# tar xzvf xcb-proto-1.1.tar.gz
dev# ./configure --prefix=/mnt/C/sys/X11
dev# make
dev# cp xcb-proto.pc /mnt/C/sys/X11/lib/pkgconfig/
dev# cd ..
dev# wget &lt;a href="http://xcb.freedesktop.org/dist/libpthread-stubs-0.1.tar.bz2"&gt;http://xcb.freedesktop.org/dist/libpthread-stubs-0.1.tar.bz2&lt;/a&gt;
dev# tar xjzf libpthread-stubs-0.1.tar.bz2
dev# cd libpthread-stubs-0.1
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;
Now we can proceed to build the &lt;i&gt;XCB&lt;/i&gt; itself:
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://xcb.freedesktop.org/dist/libxcb-1.1.tar.bz2"&gt;http://xcb.freedesktop.org/dist/libxcb-1.1.tar.bz2&lt;/a&gt;
dev# tar xjvf libxcb-1.1.tar.bz2
dev# cd libxcb-1.1
&lt;/pre&gt;
In order to configure the it was necessary to set the &lt;i&gt;PKG_CONFIG_PATH&lt;/i&gt; properly. Maybe it is a good idea to have it set on every boot... 
&lt;br/&gt;
For now we just set it one-shot:
&lt;pre class="code"&gt;
dev# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/mnt/C/sys/lib/pkgconfig/:/mnt/C/sys/X11/lib/pkgconfig/
&lt;/pre&gt;
Another problem was with &lt;i&gt;backtrace&lt;/i&gt; symbols. During the static linking everything seem ok, but the runtime linker (when an application is 

launched) complains about missing symbols:
&lt;pre class="code"&gt;
/mnt/C/sys/X11/lib/libxcb-xlib.so.0: undefined reference to `backtrace_symbols'
/mnt/C/sys/X11/lib/libxcb-xlib.so.0: undefined reference to `backtrace'
&lt;/pre&gt;
It seems that backtrace support is not implemented in uClibc 0.9.27. Regarding &lt;a href="http://bugs.uclibc.org/view.php?id=101"&gt;this ticket&lt;/a&gt; it 

should be present since version 0.9.28.
&lt;br/&gt;
For now I decided to re-configure the library not to use the backtrace support at all. It is relatively simple - we just backup and alter the 

&lt;i&gt;configure.ac&lt;/i&gt; file as follows:
&lt;pre class="code"&gt;
dev# cat configure.ac | grep backtrace
AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
dev# cp configure.ac{,.backup}   
dev# sed -i 's/AC_CHECK_HEADER(\[execinfo.h\],\[AC_DEFINE(HAVE_BACKTRACE/#AC_CHECK_HEADER(\[execinfo.h\],\[AC_DEFINE(HAVE_BACKTRACE/g' configure.ac
dev# cat configure.ac | grep backtrace
#AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
&lt;/pre&gt;
One more time we re-configure and rebuild the library:
&lt;pre class="code"&gt;
dev# make clean
dev# ./configure --prefix=/mnt/C/sys/X11
dev# make
dev# make install
&lt;/pre&gt;

&lt;i&gt;Note:&lt;/i&gt; Regarding to the missing &lt;i&gt;backtrace&lt;/i&gt; support we can also consider deleting the &lt;i&gt;/usr/include/execinfo.h&lt;/i&gt; file instead of 

altering the configuration files. 
&lt;pre class="code"&gt;
dev# mv /usr/include/execinfo.h{,.deleted}
&lt;/pre&gt;
I do not know if it is correct solution but it seems logically the file contains just declarations of those backtrace related functions and the fact that is 

it not present fixes the behavior of configure scripts.
&lt;br/&gt;
For more info see &lt;a href="http://mailman.powerdns.com/pipermail/pdns-users/2006-August/003680.html"&gt;Problems compiling pdns using 

uClibc&lt;/a&gt;.

&lt;a name="gperf"&gt;&lt;/a&gt;
&lt;h3&gt;gperf-3.0.3&lt;/h3&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/gperf-3.0.3.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/gperf-3.0.3.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://ftp.gnu.org/gnu/gperf/gperf-3.0.3.tar.gz"&gt;http://ftp.gnu.org/gnu/gperf/gperf-3.0.3.tar.gz&lt;/a&gt;
dev# tar xzvf gperf-3.0.3.tar.gz
dev# cd gperf-3.0.3
dev# ./configure --prefix=/mnt/C/sys/
dev# make
dev# make install
&lt;/pre&gt;

&lt;a name="xcb-util"&gt;&lt;/a&gt;
&lt;h3&gt;xcb-util-0.2&lt;/h3&gt;
&lt;b&gt;Dependencies: &lt;/b&gt;
&lt;a href="#gperf"&gt;[gperf]&lt;/a&gt; 
&lt;a href="#xcb"&gt;[xcb]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/xcb-util-0.2.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/xcb-util-0.2.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://xcb.freedesktop.org/dist/xcb-util-0.2.tar.bz2"&gt;http://xcb.freedesktop.org/dist/xcb-util-0.2.tar.bz2&lt;/a&gt;
dev# tar xjvf xcb-util-0.2.tar.bz2
dev# ./configure --prefix=/mnt/C/sys/X11
dev# make
dev# make install
&lt;/pre&gt;

&lt;a name="cairo"&gt;&lt;/a&gt;
&lt;h3&gt;cairo-1.6.4&lt;/h3&gt;
&lt;a href="http://cairographics.org/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Dependencies: &lt;/b&gt;
&lt;a href="#xcb"&gt;[xcb]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/cairo-1.6.4.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/cairo-1.6.4.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://cairographics.org/releases/cairo-1.6.4.tar.gz"&gt;http://cairographics.org/releases/cairo-1.6.4.tar.gz&lt;/a&gt;
dev# tar xzvf cairo-1.6.4.tar.gz
dev# cd cairo-1.6.4
&lt;/pre&gt;
Simply calling &lt;i&gt;./configure --prefix=/mnt/C/sys/X11&lt;/i&gt; does not work with the GTK library, we have to configure the cairo with the Xlib support.
&lt;pre class="code"&gt;
dev# ./configure --prefix=/mnt/C/sys/X11 &lt;b&gt;--with-x -x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/ --enable-xlib=yes --enable-xlib-xrender=yes --enable-xcb=yes&lt;/b&gt;
cairo (version 1.6.4) will be compiled with the following surface backends:
  image:         yes (always builtin)
  Xlib:          yes
  Xlib Xrender:  yes
  Quartz:        no (CoreGraphics framework not found)
  Quartz-image:  no (disabled, use --enable-quartz-image to enable)
  XCB:           yes
  Win32:         no (requires a Win32 platform)
  OS2:           no (disabled, use --enable-os2 to enable)
  PostScript:    yes
  PDF:           yes
  SVG:           yes
  glitz:         no (disabled, use --enable-glitz to enable)
  BeOS:          no (disabled, use --enable-beos to enable)
  DirectFB:      no (disabled, use --enable-directfb to enable)

the following font backends:
  FreeType:      yes
  Win32:         no (requires a Win32 platform)
  Quartz:        no (CoreGraphics framework not found)

the following features:
  PNG functions: yes

and the following debug options:
  gcov support:  no
  test surfaces: no
  ps testing:    no (requires ghostscript)
  pdf testing:   no (requires poppler-glib &gt;= 0.8.0)
  svg testing:   no (requires librsvg-2.0 &gt;= 2.15.0)

using CFLAGS:
-I/usr/include/freetype2 -I/usr/include/libpng12 -I/mnt/C/sys/X11/include -I/mnt/C/sys/XOrg/include -I/mnt/C/sys/XOrg/include -I/mnt/C/sys/XOrg/include/pixman-1 -Wall -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute 
-Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing

*** The XCB backend is still under active development and
*** is included in this release only as a preview. It does not
*** fully work yet and incompatible changes may yet be made
*** to XCB-backend specific API.

dev# make
dev# make install
&lt;/pre&gt;

&lt;a name="libtiff"&gt;&lt;/a&gt;
&lt;h3&gt;libtiff 3.8.2&lt;/h3&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/tiff-3.8.2.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/tiff-3.8.2.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz"&gt;ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz&lt;/a&gt;
dev# tar xzvf tiff-3.8.2.tar.gz
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;

&lt;a name="pango"&gt;&lt;/a&gt;
&lt;h3&gt;pango-1.21.3&lt;/h3&gt;
&lt;a href="http://www.pango.org/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Dependencies: &lt;/b&gt;
&lt;a href="#cairo"&gt;[cairo]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/pango-1.21.3.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/pango-1.21.3.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://ftp.gnome.org/pub/GNOME/sources/pango/1.21/pango-1.21.3.tar.bz2"&gt;http://ftp.gnome.org/pub/GNOME/sources/pango/1.21/pango-1.21.3.tar.bz2&lt;/a&gt;
dev# tar xjvf pango-1.21.3.tar.bz2
dev# cd pango-1.21.3
dev# ./configure --prefix=/mnt/C/sys/X11 &lt;b&gt;--with-x --x-includes=/mnt/C/sys/X11/include/ 
--x-libraries=/mnt/C/sys/X11/lib/&lt;/b&gt;
dev# make
dev# make install
&lt;/pre&gt;

&lt;a name="fontconfig"&gt;&lt;/a&gt;
&lt;h3&gt;fontconfig-2.6.0&lt;/h3&gt;
&lt;a href="http://fontconfig.org"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/fontconfig-2.6.0.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/fontconfig-2.6.0.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
We have to configure it to look at the &lt;i&gt;/mnt/C/sys/X11/etc/fonts/&lt;/i&gt; directory (instead of default &lt;i&gt;/etc/fonts/&lt;/i&gt;) since the /etc directory is 

read-only (we are not even able to create a symlink).
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://fontconfig.org/release/fontconfig-2.6.0.tar.gz"&gt;http://fontconfig.org/release/fontconfig-2.6.0.tar.gz&lt;/a&gt;
dev# tar xzvf fontconfig-2.6.0.tar.gz
dev# cd fontconfig-2.6.0
dev# ./configure --prefix=/mnt/C/sys/X11 &lt;b&gt;--with-confdir=/mnt/C/sys/X11/etc/fonts/&lt;/b&gt;
dev# make 
dev# make install
&lt;/pre&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-496095877248159954?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/496095877248159954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=496095877248159954' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/496095877248159954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/496095877248159954'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-gtk-21014.html' title='WMU-6500FS - GTK+ 2.10.14'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xFBIBcRhwFQ/SGLxJ2YNwII/AAAAAAAABdU/KNfroh2bzSs/s72-c/gtk.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-647537052549815237</id><published>2008-06-26T17:20:00.015+02:00</published><updated>2008-07-10T14:48:17.720+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><title type='text'>A curious AIX crash</title><content type='html'>Few days ago we had to solve an odd crash on AIX platform (powerpc chip). The company I am working in as a developer uses mainly 
MS Windows as a development platform but supports Linux as well as Unix platforms (namely AIX, HP-UX and Solaris). 
&lt;br/&gt;
The crash was only on AIX and we was not able to replicate it on any other platform. Our Unix experience is not such as it 
should be so it is always painful process to solve it when such a platform specific bug appears.
&lt;br/&gt;
&lt;br/&gt;
What I am going to describe here is too technical and boring for a majority of people, and on the other side 
maybe too trivial for those UNIX developers more experienced than me, but I hope there could be some (evenly non-practiced) developers
out there who could find this information helpful or at least interesting.
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;br/&gt;
The crash we experienced was easily replicable and was always at the same place - there was a totally innocent looking member
function, its code is something like the following:
&lt;pre class="code"&gt;
virtual T const&amp; get( unsigned int id ) const
{    &lt;---------------------------- The crash was right here before anything happen
 if ( id &lt; static_cast&lt;unsigned int&gt;( m_values.size() ) )
  return get_internal( id );
 throw ExceptionNotFound( LOCARG, id, count() );
 UNREACHABLE_RETURN( T() );
}
&lt;/pre&gt;
The object instance was ok, the &lt;i&gt;id&lt;/i&gt; parameter was in range &lt;0, m_values.size() ), there was no apparent 
reason why it should crash. So it was necessary to sink at the assembly level. The code for this function
started as follows (&lt;a href="http://felinemenace.org/~nemo/docs/ppcasm/ppc-stack-1.html"&gt;PowerPC Stack Attacks&lt;/a&gt; 
helped us to interpret the code):
&lt;pre class="code"&gt;
0x39927250 (get(unsigned int) const)      7c0802a6       mflr   r0              Function call prologue routine
0x39927254 (get(unsigned int) const+0x4)  93e1fffc        stw   r31,-4(r1)      (seems like the registers are 
0x39927258 (get(unsigned int) const+0x8)  93c1fff8        stw   r30,-8(r1)       associated with individual local
0x3992725c (get(unsigned int) const+0xc)  93a1fff4        stw   r29,-12(r1)      variables)
0x39927260 (get(unsigned int) const+0x10) 9381fff0        stw   r28,-16(r1)
0x39927264 (get(unsigned int) const+0x14) 9361ffec        stw   r27,-20(r1)
0x39927268 (get(unsigned int) const+0x18) 9341ffe8        stw   r26,-24(r1)
0x3992726c (get(unsigned int) const+0x1c) 90010008        stw   r0,0x8(r1)
&lt;b&gt;0x39927270 (get(unsigned int) const+0x20) 9421ed30       stwu   r1,-4816(r1)&lt;/b&gt;  -&gt; Here was the place of the segfault
0x39927274 (get(unsigned int) const+0x24) 83e2017c        lwz   r31,0x17c(r2)    
0x39927278 (get(unsigned int) const+0x28) 83c20180        lwz   r30,0x180(r2)    What the coed does is that a new stack frame 
...                                                                              is "allocated" and the stack pointer register 
                                                                                 (r1) is updated

                                                                                 "stwu" instruction stores the current content of 
                                                                                 the r1 register at address computed as (r1-offset) 
                                                                                 and decrements the r1 by offset at the same time
                                                                                 (offset is 4816 bytes in this case)
&lt;/pre&gt;
Initially we thought that due to the stack corruption the the stack pointer (r1) contain 
incorrect address (pointing to a read-only memory page) and so the write operation to that 
address failed. 
&lt;br/&gt;
Here is the stack pointer register value:
&lt;pre class="code"&gt;
(dbx) registers
  $r0:0x3d1dd854  &lt;b&gt;$stkp:0x400f5cb0&lt;/b&gt;   $toc:0x3a7071dc    $r3:0x40146fb0
  ...
&lt;/pre&gt;
When we looked to the address 0x400f5cb0 we could see an address of the previous frame,
at that address was the previous one and over and over. This way was possible to traverse
down to the stack and everything seemed consistent. The stack did not seem to be corrupted
at all.
&lt;pre class="code"&gt;
(dbx) 0x400f5cb0/4X
0x400f5cb0:  &lt;b&gt;400f5d00&lt;/b&gt; 00000000 3d2b2854 00000000      (   80 bytes)
(dbx) 0x400f5d00/4X
0x400f5d00:  &lt;b&gt;400f7010&lt;/b&gt; 00000000 3d2b228c 00000000      ( 4880 bytes)
(dbx) 0x400f7010/4X
0x400f7010:  &lt;b&gt;400f70e0&lt;/b&gt; 00000000 3d2b410c 00000000      (  208 bytes)
(dbx) 0x400f70e0/4X
0x400f70e0:  &lt;b&gt;400fd560&lt;/b&gt; 00000000 3d287294 00000000      (25728 bytes)
(dbx) 0x400fd560/4X
0x400fd560:  &lt;b&gt;401026e0&lt;/b&gt; 00000000 3d289bd0 00000000      (20864 bytes)
(dbx) 0x401026e0/4X
0x401026e0:  &lt;b&gt;40102750&lt;/b&gt; 00000000 3d28a0cc 00000000      (  112 bytes)
&lt;/pre&gt;
The interesting part was the stack frame size (4816 bytes) - the fact that the memory at 
the current &lt;i&gt;stkp&lt;/i&gt; address seemed to contain a consistent data while the 
attempt to write to an address computed as 0x400f5cb0-4816 == 0x400f49e0 results in 
the segmentation violation brought us to an idea that it could be the stack overflow.
&lt;br/&gt;
&lt;br/&gt;
The documentation at the IBM Systems Information Center describes the following structure of call stack and 
related data structures (for whole documentation see 
&lt;a href="http://publib.boulder.ibm.com/infocenter/systems/topic/com.ibm.aix.prftungd/doc/prftungd/thread_env_vars.htm"&gt;this page&lt;/a&gt;):
&lt;pre class="code"&gt;
     *      +-----------------------+
     *      | page alignment 2      |
     *      | [8K-4K+PTH_FIXED-a1]  |
     *      +-----------------------+
     *      | pthread ctx [368]     |
     *      +-----------------------+&lt;--- pthread-&gt;pt_attr
     *      | pthread attr [112]    |
     *      +-----------------------+ &lt;--- pthread-&gt;pt_attr
     *      | pthread struct [960]  |
     *      +-----------------------+ &lt;--- pthread
     *      | pthread stack         |         pthread-&gt;pt_stk.st_limit
     *      |   |[96K+4K-PTH_FIXED] |
     *      |   V                   |
     *      +-----------------------+ &lt;--- pthread-&gt;pt_stk.st_base
     *      | RED ZONE [4K]         |
     *      +-----------------------+ &lt;--- pthread-&gt;pt_guardaddr
     *      | pthread key data [4K] |
     *      +-----------------------+ &lt;--- pthread-&gt;pt_data
     *      | page alignment 1 (a1) |
     *      | [&lt;4K]                 |
     *      +-----------------------+
     
     The RED ZONE on this illustration is called the Guardpage.

The decimal number of guard pages to add to the end of the pthread stack is n, which overrides the attribute values 
that are specified at pthread creation time. If the application specifies its own stack, no guard pages are created. 
The default is 0 and n must be a positive value.
The guardpage size in bytes is determined by multiplying n by the PAGESIZE. Pagesize is a system-determined size.
&lt;/pre&gt;
The relatively small default call stack size (96K) supported our hypothesis. We needed just to find
a proof that the address being written to is actually the RED ZONE.
&lt;br/&gt;
&lt;br/&gt;
Here is the memory dump retrieved from the &lt;i&gt;dbx&lt;/i&gt; along with my comments (please note that the address orientation 
is reversed relatively to previous schema):
&lt;pre class="code"&gt;
(dbx) 0x400f3fe8/2048X
0x400f3fe8:  00000000 00000000 00000000 00000000  ------&gt; Bottom of another thread's call stack
0x400f3ff8:  00000001 40135cac 40135cac 40135cac  ----&gt; 
0x400f4008:  f0286708 f0286708 f0286708 f0286708  ----&gt; Guard page (aka "Red zone")
0x400f4018:  f0286708 f0286708 f0286708 f0286708        Read/write protected memory region
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   (4096 bytes)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x400f49c8:  f0286708 f0286708 f0286708 f0286708
0x400f49d8:  f0286708 f0286708 &lt;b&gt;f0286708&lt;/b&gt; f0286708  &lt;---.  BOOM (Segmentation fault)
0x400f49e8:  f0286708 f0286708 f0286708 f0286708      |  Attempt to write to the 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |  "red zone" (guard page
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |   
0x400f4fe8:  f0286708 f0286708 f0286708 f0286708      |
0x400f4ff8:  f0286708 f0286708 00000000 00000000   ---+-&gt; Top of the current thread's call stack
0x400f5008:  00000000 00000000 00000000 00000000      |   
0x400f5018:  00000000 00000000 00000000 00000000      |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  |
0x400f5988:  00000000 00000000 00000000 00000000      | 
0x400f5c78:  00000000 00000000 400f5cd0 00000000      | 4816 bytes
0x400f5c88:  00000000 00000000 00000000 00000000      |
0x400f5c98:  400fd5b8 401ad028 4019fa58 40165f90    --'
0x400f5ca8:  3d4263e8 3d9981e8 &lt;b&gt;400f5d00&lt;/b&gt; 00000000  &lt;---.
0x400f5cb8:  3d2b2854 00000000 401ad028 3d9bd578      |
0x400f5cc8:  00000000 00000000 400f5d20 00000000      |
0x400f5cd8:  39a87794 00000000 00000000 00000000      |
0x400f5ce8:  40165cc4 00000000 00000000 00000000    --'   80 bytes 
0x400f5cf8:  00000000 00000000 &lt;b&gt;400f7010&lt;/b&gt; 00000000  &lt;---.
0x400f5d08:  3d2b228c 00000000 401ad028 00000000      |
0x400f5d18:  40165f90 00000000 400f6ff0 00000000      |
0x400f5d28:  39a74c24 00000000 00000000 00000000      |
0x400f5d38:  40165cc0 00000000 00000000 00000000      |  4880 bytes
0x400f5d48:  00000000 00000000 00000000 00000000      |
0x400f5d58:  00000000 00000000 00000000 00000000      | 
0x400f5d68:  00000000 00000000 00000000 00000000      . Linked list of current thread's stack frames
0x400f5d78:  00000000 00000000 00000000 00000000      . 
(dbx)
&lt;/pre&gt;
Those almost 5 kilobytes stack frames were caused by Exception objects residing on stack. Our exception implementation holds relatively big array of wide characters (to avoid heap allocations in case of a failure) and so in some cases the exceptions (though not thrown, just prepared on stack to be thrown in case something fails) consume substantial portion of stack memory and finally cause the stack overflow error.
&lt;br/&gt;
&lt;br/&gt;
Just now I am quite happy that we have found and solved this problem and 
at the same time have learned something new.
&lt;br/&gt;
&lt;br/&gt;
It is necessary to a priori know the maximum call stack size and the default values for AIX system are relatively low. 
Since the architecture has no special support for the call stack, the only available diagnostics is a &lt;i&gt;Guard page&lt;/i&gt;
(aka &lt;i&gt;Red zone&lt;/i&gt;). It is implemented as &lt;i&gt;N&lt;/i&gt; read/write protected memory pages mapped above the call stack limit 
(please, node that regarding the documentation this functionality is disabled by default). A Stack overflow event then 
(if you are lucky) causes the "normal" segmentation violation - the same as as any other invalid access to a protected 
memory region and so it is relatively difficult to diagnose for a developers with not much platform-specific experience.
&lt;br/&gt;
&lt;br/&gt;
&lt;i&gt;Post note:&lt;/i&gt; There is an interesting &lt;a href="http://www.priorartdatabase.com/IPCOM/000117422/"&gt;document&lt;/a&gt; about method called 
"Automatically Extensible Discontinuous Stacks" - a method eliminating the need of the stack size pre-knowledge.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-647537052549815237?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/647537052549815237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=647537052549815237' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/647537052549815237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/647537052549815237'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/hard-aix-crash.html' title='A curious AIX crash'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-3580470190226740130</id><published>2008-06-25T23:35:00.007+02:00</published><updated>2008-07-28T21:32:03.942+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - X.Org 7.1 (updated)</title><content type='html'>Just for fun I am trying to build &lt;a href="http://www.x.org/wiki/"&gt;X.Org&lt;/a&gt; and it seems it won't be such a problem to finish it. There are many issues remaining to be solved but at least for now I am able to run couple of simple X-applications.
&lt;br/&gt;
&lt;i&gt;Update:&lt;/i&gt; I have not finished the X server yet, but have built X.Org libraries, so now it is possible to build X client applications.
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://rapidshare.com/files/125380138/x11-7.1.tar.bz2.html"&gt;[binary (82MB)]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/x11-7.1.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
Following image demonstrates the &lt;a href="http://linuxcommand.org/man_pages/xcalc1.html"&gt;xcalc&lt;/a&gt; application running on the box acting as X-client of the &lt;a href="http://en.wikipedia.org/wiki/Xming"&gt;XMing server&lt;/a&gt; running on my PC :-)
&lt;br/&gt;
&lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SFW1kogfhwI/AAAAAAAABdE/0AlxoIef-fM/s1600-h/xcalc.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_xFBIBcRhwFQ/SFW1kogfhwI/AAAAAAAABdE/0AlxoIef-fM/s400/xcalc.png" alt="" id="BLOGGER_PHOTO_ID_5212271784704837378" border="0" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Dependencies:&lt;/b&gt; 
&lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-m4-1411.html"&gt;[m4-1.4.11]&lt;/a&gt;
&lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-libxslt-1122.html"&gt;[libxslt-1.1.22]&lt;/a&gt;
&lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-xmlto-0020.html"&gt;[xmlto 0.0.20]&lt;/a&gt;
&lt;a href=""&gt;[Mesa 7.0.3]&lt;/a&gt;
[rsh (fake with &lt;i&gt;ssh&lt;/i&gt; alias)]
&lt;br/&gt;
&lt;b&gt;Info sources:&lt;/b&gt;
&lt;br/&gt;
  &lt;a href="http://www.linuxfromscratch.org/blfs/view/svn/x/installing.html"&gt;[X Window System Environment]&lt;/a&gt;&lt;br/&gt;
  &lt;a href="http://www.x.org/wiki/ModularDevelopersGuide"&gt;[Modular Developer's Guide]&lt;/a&gt;&lt;br/&gt;
  &lt;a href="http://www.x.org/wiki/Development/git"&gt;[Modular X development using the git trees]&lt;/a&gt;&lt;br/&gt;
  &lt;a href="http://linuxdevices.com/articles/AT9202043619.html"&gt;[Embedded Linux Graphics Quick Reference Guide]&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;br/&gt;
Create source directory and download git_xorg script (will be used to get all xorg modular components from git repository)
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# mkdir Xorg
dev# cd Xorg
dev# wget "&lt;a href="http://www.x.org/wiki/ModularDevelopersGuide?action=AttachFile&amp;do=get&amp;target=git_xorg.sh"&gt;http://www.x.org/wiki/ModularDevelopersGuide?action=AttachFile&amp;do=get&amp;target=git_xorg.sh&lt;/a&gt;" -O git_xorg.sh
dev# chmod a+x git_xorg.sh
dev# echo "do_dir xorg font \"\${font}\"        # this line added to get fonts" &amp;gt;&amp;gt; git_xorg.sh
&lt;/pre&gt;
Customize git_xorg script&lt;br/&gt;
&lt;pre class="code"&gt;
dev# nano git_xorg.sh
&lt;/pre&gt;
... you can for example remove all &lt;tt&gt;xf86-video-*&lt;/tt&gt; drivers and related stuff, 
remove &lt;tt&gt;do_dir . xcb "${xcb}"&lt;/tt&gt;, 
add &lt;tt&gt;do_dir xorg font "${font}"&lt;/tt&gt; in order to download fonts, etc.

&lt;pre class="code"&gt;
dev # diff git_xorg.sh git_xorg.sh.orig
50c50,65
&lt;       xf86-input-vmmouse xf86-input-void"
---
&gt;       xf86-input-vmmouse xf86-input-void xf86-video-apm\
&gt;       xf86-video-ark xf86-video-ast xf86-video-ati\
&gt;       xf86-video-chips xf86-video-cirrus xf86-video-cyrix\
&gt;       xf86-video-dummy xf86-video-fbdev xf86-video-glide\
&gt;       xf86-video-glint xf86-video-i128 xf86-video-i740\
&gt;       xf86-video-impact xf86-video-imstt xf86-video-intel\
&gt;       xf86-video-mga xf86-video-neomagic xf86-video-newport\
&gt;       xf86-video-nsc xf86-video-nv xf86-video-rendition\
&gt;       xf86-video-s3 xf86-video-s3virge xf86-video-savage\
&gt;       xf86-video-siliconmotion xf86-video-sis xf86-video-sisusb\
&gt;       xf86-video-sunbw2 xf86-video-suncg14 xf86-video-suncg3\
&gt;       xf86-video-suncg6 xf86-video-sunffb xf86-video-sunleo\
&gt;       xf86-video-suntcx xf86-video-tdfx xf86-video-tga\
&gt;       xf86-video-trident xf86-video-tseng xf86-video-v4l\
&gt;       xf86-video-vesa xf86-video-vga xf86-video-via\
&gt;       xf86-video-vmware xf86-video-voodoo xf86-video-wsfb"
129c144
&lt; do_dir xorg font "${font}"        # this line added to get fonts
---
&gt; do_dir . xcb "${xcb}"
&lt;/pre&gt;
Now we can start downloading the source:
&lt;pre class="code"&gt;
dev# ./git_xorg.sh
&lt;/pre&gt;
And now we can try to run the build (we have not solved any dependencies yet, I decided to solve it along the way).
&lt;br/&gt;
The first one is the m4 preprocessor:
&lt;pre class="code"&gt;
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh /mnt/C/sys/X11
    ...
    autom4te: need GNU m4 1.4 or later: /usr/bin/m4
&lt;/pre&gt;
For info how to get and build the &lt;i&gt;m4&lt;/i&gt; preprocessor see &lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-m4-1411.html"&gt;this post&lt;/a&gt;.
&lt;br/&gt;
Then there is xcb build error (in case one have not removed it from the &lt;i&gt;git_xorg.sh&lt;/i&gt;):
&lt;pre class="code"&gt;
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh /mnt/C/sys/X11
    ...
     configure: error: XCB requires xsltproc.
    /mnt/C/sys/X11/lib/libxcb-xlib.so: undefined reference to `backtrace_symbols'
    /mnt/C/sys/X11/lib/libxcb-xlib.so: undefined reference to `backtrace'
&lt;/pre&gt;
It seems that uClibc does not implement the &lt;i&gt;backtrace&lt;/i&gt; related stuff. As a solution we can re-configure the xcb:
&lt;pre class="code"&gt;
dev# cp xcb/libxcb/configure.ac{,.backup}
dev# nano xcb/libxcb/configure.ac
&lt;/pre&gt;
From the &lt;i&gt;configure.ac&lt;/i&gt; comment out the following line:
&lt;pre class="code"&gt;
    AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() ...
&lt;/pre&gt;
And then we can continue the build process, the next error is in the &lt;i&gt;libXcomposite&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh &lt;b&gt;-r xcb/libxcb&lt;/b&gt; /mnt/C/sys/X11
    ...
    make[3]: Entering directory `/usr/local/src/Xorg/lib/libXcomposite/man'
    WARNING: configure did not find xmlto, cannot create Xcomposite.man without it
&lt;/pre&gt;
For info how to get and build the &lt;i&gt;xmlto&lt;/i&gt; see &lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-xmlto-0020.html"&gt;this post&lt;/a&gt;.
&lt;br/&gt;
The next problem was in &lt;i&gt;xconsole&lt;/i&gt; application:
&lt;pre class="code"&gt;
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh &lt;b&gt;-r lib/libXcomposite&lt;/b&gt; /mnt/C/sys/X11
...
make[1]: Entering directory `/usr/local/src/Xorg/app/xconsole'
...
In file included from xconsole.c:185:
/usr/include/sys/stropts.h:1:21: stropts.h: No such file or directory
&lt;/pre&gt;
uClibc does not implement streams and so the fact that the &lt;i&gt;stropts.h&lt;/i&gt; header file is missing is understandable.&lt;br/&gt; 
Commenting out the include in &lt;i&gt;xconsole.c&lt;/i&gt; file semms to work. For more info about this issue see &lt;a href="http://bugs.gentoo.org/show_bug.cgi?id=131318"&gt;this&lt;/a&gt; source.
&lt;br/&gt;
After the &lt;i&gt;xconsole.c&lt;/i&gt; modification we can try to continue the build process:
&lt;pre class="code"&gt;
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh &lt;b&gt;-r app/xconsole&lt;/b&gt; /mnt/C/sys/X11
...
Building app module component xdriinfo...
...
configure: error: cannot find GL library - make sure Mesa or other OpenGL package is installed
&lt;/pre&gt;
For info how to get and build &lt;i&gt;Mesa library&lt;/i&gt; see &lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-xmlto-0020.html"&gt;this post&lt;/a&gt;.
&lt;br/&gt;
After that we have to add the new include and library dirs to the environment:
&lt;pre class="code"&gt;
dev# export LDFLAGS="-lGL -L/mnt/C/sys/lib -L/mnt/C/sys/X11/lib -lX11"
dev# export CFLAGS=-I/mnt/C/sys/include
&lt;/pre&gt;
And then we can continue.
&lt;pre class="code"&gt;
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh &lt;b&gt;-r app/xdriinfo -m /usr/local/src/Mesa-7.0.3&lt;/b&gt; /mnt/C/sys/X11
...
Building app module component xsm...
...
configure: error: No rsh like program found
&lt;/pre&gt;
For more details about this issue see &lt;a href="http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2007-May/120203.html"&gt;this&lt;/a&gt; message. 
&lt;br/&gt;
&lt;br/&gt;
At the time I had not even the dropbear/ssh installed I decided to install it and solve the lack of rsh binary with the following fake:
&lt;pre class="code"&gt;
dev# cd /mnt/C
dev# wget http://mgb111.pradnik.net/addons/servers-ssh/dropbear-ssh-sshd-050.3.tgz
dev# tar xzvf dropbear-ssh-sshd-050.3.tgz
dev# which ssh
/mnt/C/sys/bin/ssh
&lt;/pre&gt;
Now we can create &lt;i&gt;rsh&lt;/i&gt; names alias for the &lt;i&gt;ssh&lt;/i&gt; binary. 
&lt;pre class="code"&gt;
dev# ln -s /mnt/C/sys/bin/{s,r}sh
dev# rsh
Dropbear multi-purpose version 0.50
Make a symlink pointing at this binary with one of the following names:
'dropbear' - the Dropbear server
'dbclient' or 'ssh' - the Dropbear client
'dropbearkey' - the key generator
'dropbearconvert' - the key converter
'scp' - secure copy
dev# ls -l /mnt/C/sys/bin/rsh
lrwxrwxrwx  2 root root 18 Jun 25 14:42 /mnt/C/sys/bin/rsh -&gt; /mnt/C/sys/bin/ssh*
dev# ls -l /mnt/C/sys/bin/ssh
lrwxrwxrwx  1 root root 13 Jun 17 14:34 /mnt/C/sys/bin/ssh -&gt; dropbearmulti*
&lt;/pre&gt;
The symlink method does not work. It is because of the fact that dropbear is the multiapplication and so the &lt;i&gt;ssh&lt;/i&gt; binary is actually a symlink pointing to the binary called &lt;i&gt;dropbearmulti&lt;/i&gt; binary. For such case the szmlink name matters, it can be one of the names listed above.
&lt;br/&gt;
We have another possibility, we can create a shell script calling ssh along with all its command line arguments:
&lt;pre class="code"&gt;
dev# echo "\
&gt; #!/bin/bash
&gt; ssh \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9" &gt; /mnt/C/sys/bin/rsh
dev# cat /mnt/C/sys/bin/rsh
#!/bin/bash
ssh $1 $2 $3 $4 $5 $6 $7 $8 $9
dev# chmod a+x /mnt/C/sys/bin/rsh
dev# rsh
Dropbear client v0.50
Usage: ssh [options] [user@]host [command]
Options are:
...
&lt;/pre&gt;
Now back to the Xorg source directory and continue the building process:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/Xorg
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh &lt;b&gt;-r app/xsm&lt;/b&gt; -m /usr/local/src/Mesa-7.0.3 /mnt/C/sys/X11
Building xserver module ...
...
checking for GL... configure: error: Package requirements (glproto &gt;= 1.4.9 gl &gt;= 7.1.0) were not met.
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively you may set the GL_CFLAGS and GL_LIBS environment variables
to avoid the need to call pkg-config.  See the pkg-config man page for
more details.
&lt;/pre&gt;
For now we can skip the &lt;i&gt;xserver&lt;/i&gt; as well as the driver (we are interested in xclients mainly) modules:
&lt;pre class="code"&gt;
dev# PATH=/mnt/C/sys/X11/bin:$PATH ./util/modular/build.sh &lt;b&gt;-r font/util&lt;/b&gt; -m /usr/local/src/Mesa-7.0.3 /mnt/C/sys/X11
...
xcb module component util does not exist, skipping.
Wed Jun 25 13:21:59 MDT 2008

***** Skipped components (not available) *****
 xcb/util
&lt;/pre&gt;
For now we are done with X.Org libraries, except the &lt;i&gt;xserver&lt;/i&gt;, drivers and &lt;i&gt;xcb&lt;/i&gt;. Maybe we come back to that later...
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-3580470190226740130?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/3580470190226740130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=3580470190226740130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3580470190226740130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3580470190226740130'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-xorg-71-teaser.html' title='WMU-6500FS - X.Org 7.1 (updated)'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xFBIBcRhwFQ/SFW1kogfhwI/AAAAAAAABdE/0AlxoIef-fM/s72-c/xcalc.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-3417995542208167613</id><published>2008-06-20T17:49:00.007+02:00</published><updated>2008-06-26T18:12:25.884+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - mpd-0.13.2</title><content type='html'>&lt;h3&gt;mpd-0.13.2&lt;/h3&gt;
&lt;a href="http://www.musicpd.org/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/mpd-0.13.2.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/mpd-0.13.2.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Dependencies:&lt;/b&gt; 
&lt;a href="http://philodej.googlepages.com/libao-0.8.8.tar.bz2"&gt;[libao]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libid3tag-0.15.1b.tar.bz2"&gt;[libid3tag]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/flac-1.2.1.tar.bz2"&gt;[flac]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libmad-0.15.1b.tar.bz2"&gt;[libmad]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/audiofile-0.2.6.tar.bz2"&gt;[audiofile]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/faad2-2.6.1.tar.bz2"&gt;[faad2]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libmikmod-3.2.0-beta2.tar.bz2"&gt;[libmikmod]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libogg-1.1.3.tgz"&gt;[libogg-1.1.3]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libvorbis-1.2.0.tgz"&gt;[libvorbis-1.2.0]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://www.musicpd.org/uploads/files/mpd-0.13.2.tar.bz2"&gt;http://www.musicpd.org/uploads/files/mpd-0.13.2.tar.bz2&lt;/a&gt;
dev# tar xjvf mpd-0.13.2.tar.bz2
dev# cd cd mpd-0.13.2
dev# export PKG_CONFIG_PATH=/mnt/C/sys/lib/pkgconfig:$PKG_CONFIG_PATH
dev# ./configure --prefix=/mnt/C/sys &lt;b&gt;--enable-ao --enable-mvp --with-libFLAC=/mnt/C/sys&lt;/b&gt;
...
########### MPD CONFIGURATION ############

 Playback Support:
 libao support .................enabled
 OSS support ...................enabled
 ALSA support ..................disabled
 JACK support ..................disabled
 OS X support ..................disabled
 PulseAudio support ............disabled
 Media MVP support .............enabled
 Shout streaming support .......disabled

 File Format Support:
 ID3 tag support ...............enabled
 mp3 support ...................enabled
 Ogg Vorbis support ............enabled
   using tremor.................no
 FLAC support ..................enabled
 OggFLAC support ...............enabled(FLAC 1.1.3)
 Wave file support .............enabled
 MP4/AAC support ...............enabled
 Musepack (MPC) support ........disabled
 MOD support ...................disabled

 Other features:
 libsamplerate support .........disabled
 Zeroconf support ..............disabled

##########################################
&lt;/pre&gt;
Some dependency libraries are still not found succesfully, hopefully I will solve it later...
&lt;pre class="code"&gt;
dev# make
dev# make install
&lt;/pre&gt;

&lt;h3&gt;libao-0.8.8&lt;/h3&gt;
&lt;a href="http://www.xiph.org/ao"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/libao-0.8.8.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libao-0.8.8.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://downloads.xiph.org/releases/ao/libao-0.8.8.tar.gz"&gt;http://downloads.xiph.org/releases/ao/libao-0.8.8.tar.gz&lt;/a&gt;
dev# tar xzvf libao-0.8.8.tar.gz
dev# cd libao-0.8.8
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;

&lt;h3&gt;libid3tag-0.15.1b&lt;/h3&gt;
&lt;a href="http://mad.sf.net/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/libid3tag-0.15.1b.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libid3tag-0.15.1b.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz"&gt;ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz&lt;/a&gt;
dev# tar xzvf libid3tag-0.15.1b.tar.gz
dev# cd libid3tag-0.15.1b
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;

&lt;h3&gt;libmad-0.15.1b&lt;/h3&gt;
&lt;a href="http://mad.sf.net/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/libmad-0.15.1b.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libmad-0.15.1b.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz"&gt;ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz&lt;/a&gt;
dev# tar xzvf libmad-0.15.1b.tar.gz
dev# cd libmad-0.15.1b
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;

&lt;h3&gt;flac-1.2.1&lt;/h3&gt;
&lt;a href="http://flac.sourceforge.net/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/flac-1.2.1.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/flac-1.2.1.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://downloads.sourceforge.net/flac/flac-1.2.1.tar.gz?modtime=1189961849&amp;big_mirror=0"&gt;"http://downloads.sourceforge.net/flac/flac-1.2.1.tar.gz?modtime=1189961849&amp;big_mirror=0"&lt;/a&gt;
dev# tar xzvf flac-1.2.1.tar.gz
dev# cd flac-1.2.1
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;

&lt;h3&gt;audiofile-0.2.6&lt;/h3&gt;
&lt;a href="http://www.68k.org/~michael/audiofile/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/audiofile-0.2.6.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/audiofile-0.2.6.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://www.68k.org/~michael/audiofile/audiofile-0.2.6.tar.gz"&gt;http://www.68k.org/~michael/audiofile/audiofile-0.2.6.tar.gz&lt;/a&gt;
dev# tar xzvf audiofile-0.2.6.tar.gz
dev# cd audiofile-0.2.6
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;

&lt;h3&gt;faad2-2.6.1&lt;/h3&gt;
&lt;a href="http://www.audiocoding.com/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/faad2-2.6.1.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/faad2-2.6.1.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Dependencies:&lt;/b&gt; 
&lt;a href="http://mgb111.pradnik.net/addons/soft-lang/perl-5.8.8-080509.tar.bz2"&gt;[Perl &gt;= 5.005]&lt;/a&gt;
&lt;a href="http://filodej.blogspot.com/2008/06/wmu-6500fs-m4-1411.html"&gt;[GNU m4 &gt;= 1.4]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz"&gt;http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz&lt;/a&gt;
dev# tar xzvf faad2-2.6.1.tar.gz
dev# cd faad2
dev# autoreconf -vif
Perl 5.005 required--this is only version 5.00405, stopped at /usr/share/autoconf/Autom4te/Channels.pm line 59.
BEGIN failed--compilation aborted at /usr/share/autoconf/Autom4te/Channels.pm line 59.
BEGIN failed--compilation aborted at /usr/share/autoconf/Autom4te/ChannelDefs.pm line 20.
BEGIN failed--compilation aborted at /usr/bin/autoreconf line 42.
&lt;/pre&gt;
In order to generate the configure script we have to upgrade perl installation 
- fortunately we can use JoKeR's &lt;a href="http://mgb111.pradnik.net/addons/soft-lang/perl-5.8.8-080509.tar.bz2"&gt;binary&lt;/a&gt; (version 5.8.8).
&lt;pre class="code"&gt;
dev# cd /mnt/C
dev# wget http://mgb111.pradnik.net/addons/soft-lang/perl-5.8.8-080509.tar.bz2
dev# tar xjvf perl-5.8.8-080509.tar.bz2
&lt;/pre&gt;
The old one is itill in front of the PATH sequence, now we have to disable the previous one:
&lt;pre class="code"&gt;
dev# perl -v
This is perl, version 5.004_05 built for i686-linux
...
# mv /usr/bin/perl{,-5.004_05}
# ln -s {/mnt/C/sys/bin/,/usr/bin/}perl
# perl -v
This is perl, v5.8.8 built for i386-linux-thread-multi
...
&lt;/pre&gt;
Ok, now we are ready to proceed with the build process:
&lt;pre class="code"&gt;
# autoreconf -vif
# ./configure --prefix=/mnt/C/sys
# make
# make install
&lt;/pre&gt;

&lt;h3&gt;libmikmod-3.2.0-beta2&lt;/h3&gt;
&lt;a href="http://mikmod.raphnet.net/"&gt;[Home page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/libmikmod-3.2.0-beta2.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libmikmod-3.2.0-beta2.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://mikmod.raphnet.net/files/libmikmod-3.2.0-beta2.tar.bz2"&gt;http://mikmod.raphnet.net/files/libmikmod-3.2.0-beta2.tar.bz2&lt;/a&gt;
dev# tar xjvf libmikmod-3.2.0-beta2.tar.bz2
dev# cd libmikmod-3.2.0-beta2
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-3417995542208167613?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/3417995542208167613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=3417995542208167613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3417995542208167613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3417995542208167613'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-mpd-0132.html' title='WMU-6500FS - mpd-0.13.2'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-5748138170945774855</id><published>2008-06-18T17:50:00.007+02:00</published><updated>2008-07-07T13:38:49.531+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - xml stuff</title><content type='html'>&lt;h3&gt;xmlto 0.0.20&lt;/h3&gt;
&lt;b&gt;Build results:&lt;/b&gt; 
Not actually deployed to the box, just built as an Xorg dependency...
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Dependencies:&lt;/b&gt;
&lt;a href="#sgml-base"&gt;[sgml-base 1.26]&lt;/a&gt;
[docbook-xsl-1.74]
[docbook-xml-4.2]
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;br/&gt;
I think it is not necessary to deploy xmlto to the box, co will configure it locally (it will not go to the &lt;i&gt;/mnt/C/sys&lt;/i&gt; directory).
&lt;pre class="code"&gt;
dev# wget http://cyberelk.net/tim/data/xmlto/stable/xmlto-0.0.20.tar.bz2
dev# tar xjvf xmlto-0.0.20.tar.bz2
dev# cd xmlto-0.0.20
dev# ./configure
dev# make
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
...
Variable $SGML_CATALOG_FILES not set
&lt;/pre&gt;
It seems there is no support for XML catalogs on the system. According to &lt;a href="http://kbase.wincent.com/old/knowledge-base/Setting_up_the_Git_documentation_build_chain_on_Mac_OS_X_Leopard.html"&gt;this source&lt;/a&gt; we can fix it in a following way:
&lt;pre class="code"&gt;
dev# mkdir -p /usr/local/etc/xml
dev# xmlcatalog --noout --create /usr/local/etc/xml/catalog
dev# mkdir -p /usr/local/share/docbook/xsl
dev# cd /usr/local/share/docbook/xsl
dev# wget
"&lt;a href="http://downloads.sourceforge.net/docbook/docbook-xsl-1.74.0.tar.bz2?modtime=1212403365&amp;big_mirror=0"&gt;http://downloads.sourceforge.net/docbook/docbook-xsl-1.74.0.tar.bz2?modtime=1212403365&amp;big_mirror=0&lt;/a&gt;"
-O docbook-xsl-1.74.tar.bz2
dev# tar xjvf docbook-xsl-1.74.tar.bz
&lt;/pre&gt;
I would have liked to install it in &lt;i&gt;/usr/local/etc&lt;/i&gt;, but according to the source only &lt;i&gt;/etc&lt;/i&gt; works
&lt;pre class="code"&gt;
dev# mkdir -p /etc/xml
dev# xmlcatalog --noout --add 'nextCatalog' '' 'file:///usr/local/share/docbook/docbook-xsl-1.73.2/catalog.xml' --create /etc/xml/catalog
&lt;/pre&gt;
Now it is time to install the catalog:
&lt;pre class="code"&gt;
dev# cd /usr/local/share/docbook/xsl/docbook-xsl-1.74.0/
dev# ./install.sh
WARNING: This install script is meant to be run as a non-root
         user, but you are running it as root.

Are you sure you want to continue? [No] Y
...
Create /root/.resolver/CatalogManager.properties file? [Yes] Y
...
Add /etc/xml/catalog to /root/.resolver/CatalogManager.properties? [Yes] Y
...
Add /usr/local/share/docbook/xsl/docbook-xsl-1.74.0/catalog.xml
to /root/.resolver/CatalogManager.properties file? [Yes] Y
...
To source your shell environment for this distribution, type the
following:
. /usr/local/share/docbook/xsl/docbook-xsl-1.74.0/.profile.incl
dev# . /usr/local/share/docbook/xsl/docbook-xsl-1.74.0/.profile.incl
&lt;/pre&gt;
Now back to the xmlto installation:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/xmlto-0.0.20
dev# make clean
dev# ./configure
dev# make
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd
/usr/local/src/xmlto-0.0.20/./doc/xmlif.xml:4: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"&gt;
&lt;/pre&gt;
There is a progress, but we are not done withe XML catalogs yet:
&lt;pre class="code"&gt;
dev# cd /usr/local/share/docbook
dev# wget &lt;a href="http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip"&gt;http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip&lt;/a&gt;
&lt;/pre&gt;
There is a bug in the busybox version of &lt;i&gt;unzip&lt;/i&gt; - for details see &lt;a href="http://www.mail-archive.com/busybox@busybox.net/msg02249.html"&gt;this&lt;/a&gt; message.
&lt;br/&gt;
As a workaround we can pre-create the directories before the actual unzipping:
&lt;pre class="code"&gt;
dev# mkdir -p docbook-xml-4.2/ent
dev# unzip docbook-xml-4.2.zip -d docbook-xml-4.2
&lt;/pre&gt;
Now we can register the new XML catalog:
&lt;pre class="code"&gt;
dev# xmlcatalog --noout --add nextCatalog '' file:///usr/local/share/docbook/docbook-xml-4.2/catalog.xml --create /etc/xml/catalog
&lt;/pre&gt;
And finally finish the xmlto installation:
&lt;pre class="code"&gt;
dev# cd /usr/local/src/xmlto-0.0.20
dev# make clean
dev# ./configure
dev# make
dev# make install
&lt;/pre&gt;
&lt;a name="libxslt"&gt;&lt;/a&gt;
&lt;h3&gt;libxslt - 1.1.22&lt;/h3&gt;
&lt;b&gt;Build results:&lt;/b&gt; 
&lt;a href="http://philodej.googlepages.com/libxslt-1.1.22.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libxslt-1.1.22.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Dependencies:&lt;/b&gt;
&lt;a href="#libxml"&gt;[libxml2-2.6.30]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /ust/local/src
dev# wget &lt;a href="ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/libxslt-1.1.22.tar.bz2"&gt;ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/libxslt-1.1.22.tar.bz2&lt;/a&gt;
dev# tar xjvf libxslt-1.1.22.tar.bz2
dev# cd libxslt-1.1.22
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;
&lt;a name="libxml2"&gt;&lt;/a&gt;
&lt;h3&gt;libxml2 2.6.30&lt;/h3&gt;
&lt;b&gt;Build results:&lt;/b&gt; 
&lt;a href="http://philodej.googlepages.com/libxml2-2.6.30.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/libxml2-2.6.30.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# wget &lt;a href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.30.tar.bz2"&gt;ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.30.tar.bz2&lt;/a&gt;
dev# tar xjvf libxml2-2.6.30.tar.bz2
dev# cd libxml2-2.6.30
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;
&lt;a name="sgml-base"&gt;&lt;/a&gt;
&lt;h3&gt;sgml-base 1.26&lt;/h3&gt;
&lt;b&gt;Build results:&lt;/b&gt; Not actually deployed to the box
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://ftp.de.debian.org/debian/pool/main/s/sgml-base/sgml-base_1.26.tar.gz"&gt;http://ftp.de.debian.org/debian/pool/main/s/sgml-base/sgml-base_1.26.tar.gz&lt;/a&gt;
dev# tar xzvf sgml-base_1.26.tar.gz
dev# cd sgml-base-1.26
dev# make
dev# make install
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-5748138170945774855?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/5748138170945774855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=5748138170945774855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5748138170945774855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/5748138170945774855'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-xmlto-0020.html' title='WMU-6500FS - xml stuff'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-6368918426254330489</id><published>2008-06-18T15:11:00.004+02:00</published><updated>2008-06-27T13:22:28.130+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - file 4.24 (unix command)</title><content type='html'>&lt;b&gt;Build results:&lt;/b&gt; 
&lt;a href="http://philodej.googlepages.com/file-4.24.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/file-4.24.lst"&gt;[list files]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;a href="http://darwinsys.com/file/"&gt;Home page&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# wget &lt;a href="ftp://ftp.astron.com/pub/file/file-4.24.tar.gz"&gt;ftp://ftp.astron.com/pub/file/file-4.24.tar.gz&lt;/a&gt;
dev# tar xzvf file-4.24.tar.gz
dev# cd file-4.24
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-6368918426254330489?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/6368918426254330489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=6368918426254330489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/6368918426254330489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/6368918426254330489'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-file-424-unix-command.html' title='WMU-6500FS - file 4.24 (unix command)'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-2970709705760166905</id><published>2008-06-18T13:47:00.006+02:00</published><updated>2008-06-27T13:30:53.139+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - m4 1.4.11</title><content type='html'>&lt;b&gt;Build results:&lt;/b&gt; Not actually deployed to the box
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# wget http://ftp.gnu.org/gnu/m4/m4-1.4.11.tar.bz2
dev# tar xjvf m4-1.4.11.tar.bz2
dev# cd m4-1.4.11
dev# ./configure
dev# make
dev# make install
&lt;/pre&gt;
Xorg configure looks directly to &lt;i&gt;/usr/bin&lt;/i&gt;, it can probably be re-configured, but I do not want to solve it correctly now, here is a workaround I have used:
&lt;pre class="code"&gt;
dev# ln -s /usr/local/bin/m4 /usr/bin
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-2970709705760166905?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/2970709705760166905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=2970709705760166905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/2970709705760166905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/2970709705760166905'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-m4-1411.html' title='WMU-6500FS - m4 1.4.11'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-2497335776077918217</id><published>2008-06-14T21:54:00.009+02:00</published><updated>2008-07-02T23:19:21.636+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - lsof 4.78</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SGvwzAMKM_I/AAAAAAAABd8/K82O5BfJ5Yk/s1600-h/wmu6500fs-lsof.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xFBIBcRhwFQ/SGvwzAMKM_I/AAAAAAAABd8/K82O5BfJ5Yk/s400/wmu6500fs-lsof.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218529352253846514" /&gt;&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/lsof-4.78.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/lsof-4.78.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
In the Web UI there is a possibility to create/delete/resize/format individual disk partitions (&lt;i&gt;WebUI/Storage configuration/Disk utility&lt;/i&gt;) however sometimes it is not possible, e.g. &lt;i&gt;format&lt;/i&gt; operation fails with error &lt;i&gt;"Device is busy"&lt;/i&gt;. 
&lt;br/&gt;
It seems there is some process using the drive (holding some file handles or so). The &lt;b&gt;lsof&lt;/b&gt; command (meaning &lt;i&gt;"LiSt Open Files"&lt;/i&gt;) is a tool which can be used to determine what files are being held by which processes.
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Info sources:&lt;/b&gt;
&lt;a href="http://mindspill.net/computing/linux-notes/how-to-get-around-the-umount-device-is-busy-error..html"&gt;[Device is busy error]&lt;/a&gt;
&lt;a href="http://en.wikipedia.org/wiki/Lsof"&gt;[lsof tool]&lt;/a&gt;
&lt;a href="http://people.freebsd.org/~abe/"&gt;[Vic Abell's Home Page]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;br/&gt;
Download and extract:
&lt;pre class="code"&gt;
dev# wget &lt;a href="ftp://ftp.cert.dfn.de/pub/tools/admin/lsof/lsof_4.78.tar.gz"&gt;ftp://ftp.cert.dfn.de/pub/tools/admin/lsof/lsof_4.78.tar.gz&lt;/a&gt;
dev# tar xzvf lsof_4.78.tar.gz
dev# cd lsof_4.78
dev# tar xvf lsof_4.78_src.tar
dev# cd lsof_4.78_src
&lt;/pre&gt;
Configure settings &lt;br/&gt;
(I left all default values, it is here just for you to see what the possible settings are).
&lt;pre class="code"&gt;
dev# ./Configure linux
Do you want to take inventory (y|n) [y]? y
Do you want to customize (y|n) [y]? y
Customizing ...
Enable HASSECURITY (y|n) [n]?
Disable WARNINGSTATE? (y|n) [n]?
Enable HASKERNIDCK (y|n) [n]?
Do you want to rename machine.h to machine.h.old and replace it with
new_machine.h (y|n) [y]? y
dev# make
&lt;/pre&gt;
In order to find what processes hold a file on the &lt;i&gt;C&lt;/i&gt; partition, you can use the following command:
&lt;pre class="code"&gt;
box# lsof | grep mnt/C
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-2497335776077918217?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/2497335776077918217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=2497335776077918217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/2497335776077918217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/2497335776077918217'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-lsof-478.html' title='WMU-6500FS - lsof 4.78'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xFBIBcRhwFQ/SGvwzAMKM_I/AAAAAAAABd8/K82O5BfJ5Yk/s72-c/wmu6500fs-lsof.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-4480654230874796133</id><published>2008-06-13T22:23:00.008+02:00</published><updated>2008-06-26T21:14:50.266+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - cvstrac 2.0.1</title><content type='html'>&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/cvstrac-2.0.1-3.tgz"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/cvstrac-2.0.1-3.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Info sources:&lt;/b&gt;
&lt;a href="http://www.cvstrac.org"&gt;[cvstrac site]&lt;/a&gt;
&lt;a href="http://www.cvstrac.org/cvstrac/wiki?p=ColoredDiffs"&gt;[cvstrac colored diffs]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# cd /usr/local/src
dev# wget &lt;a href="http://www.cvstrac.org/cvstrac-2.0.1.tar.gz"&gt;http://www.cvstrac.org/cvstrac-2.0.1.tar.gz&lt;/a&gt;
dev# tar xzvf cvstrac-2.0.1.tar.gz
dev# cd cvstrac-2.0.1
dev# cp linux-gcc.mk Makefile
&lt;/pre&gt;
Customize &lt;i&gt;Makefile&lt;/i&gt; &lt;br/&gt;
(build dir need not be necessary the same as source dir, you have to alter &lt;i&gt;SRCDIR&lt;/i&gt; accordingly. Also the &lt;i&gt;INSTALLDIR&lt;/i&gt; can be for example set to &lt;i&gt;/mnt/C/sys/var/www/cgi-bin&lt;/i&gt; in case you want to run it as CGI)
&lt;pre class="code"&gt;
dev# nano Makefile

SRCDIR = .

INSTALLDIR = /mnt/C/sys/bin
&lt;/pre&gt;
If you have not set the include and lib directories to &lt;i&gt;sys&lt;/i&gt; you have to modify also the &lt;i&gt;main.mk&lt;/i&gt;:
&lt;pre class="code"&gt;
dev# nano main.mk

XTCC = $(TCC) $(CFLAGS) -I. -I$(SRCDIR) &lt;b&gt;-I/mnt/C/sys/include&lt;/b&gt;

$(TCC) -o $(APPNAME) $(OBJ) $(LIBSQLITE) &lt;b&gt;-L/mnt/C/sys/lib&lt;/b&gt;
&lt;/pre&gt;
Make the application
&lt;pre class="code"&gt;
dev# make
&lt;/pre&gt;
&lt;b&gt;Error&lt;/b&gt;
&lt;br/&gt;
Undefined reference to &lt;i&gt;sqlite3StrICmp&lt;/i&gt; and similar symbols. It seems that 2.0.1 release used a non-public part of SQLite interface and in a recent version of SQLite the referenced functions disappeared.
&lt;br/&gt;
Fortunately there is a patch 2.0.1-3 solving the problem:
&lt;pre class="code"&gt;
dev# cd ..
dev# wget &lt;a href="http://ftp.de.debian.org/debian/pool/main/c/cvstrac/cvstrac_2.0.1-3.diff.gz"&gt;http://ftp.de.debian.org/debian/pool/main/c/cvstrac/cvstrac_2.0.1-3.diff.gz&lt;/a&gt;
dev# gunzip cvstrac_2.0.1-3.diff.gz
dev# patch -p0 &lt; cvstrac_2.0.1-3.diff
dev# cd cvstrac-2.0.1
&lt;/pre&gt;
Or alternatively you can download the development version directly from their CVS:
&lt;pre class="code"&gt;
dev# cvs -d :pserver:anonymous@cvstrac.org:/cvstrac login
dev# cvs -d :pserver:anonymous@cvstrac.org:/cvstrac checkout cvstrac
&lt;/pre&gt;
When prompted for a password, enter "anonymous". For more info see &lt;a href="http://www.cvstrac.org/cvstrac/wiki?p=DownloadCvstrac"&gt;[cvstrac download]&lt;/a&gt;.
&lt;br/&gt;
&lt;br/&gt;
We are ready to build all the three available variants:
&lt;pre class="code"&gt;
dev# make
dev# make install
dev# make APPNAME=svntrac
dev# make install APPNAME=svntrac
dev# make APPNAME=gittrac
dev# make install APPNAME=gittrac
&lt;/pre&gt;
Now we have the application(s) installed and can launch it. Root can neither initialize a project nor launch the server (actually it is possible but you have to launch it in chroot jail), for more info see &lt;a href="http://www.cvstrac.org/cvstrac/wiki?p=CvstracInstallation"&gt;[installation]&lt;/a&gt; and &lt;a href="http://www.cvstrac.org/cvstrac/wiki?p=ChrootJailForCvstrac"&gt;[chroot jail]&lt;/a&gt;.
&lt;pre class="code"&gt;
dev# su &lt;b&gt;&amp;lt;user&amp;gt;&lt;/b&gt;
dev# gittrac init /mnt/C/sys/var/git &lt;b&gt;&amp;lt;project&amp;gt;&lt;/b&gt;
dev# gittrac server 8008 /mnt/C/sys/var/git/ &lt;b&gt;&amp;lt;project&amp;gt;&lt;/b&gt; &amp;amp;
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-4480654230874796133?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/4480654230874796133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=4480654230874796133' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/4480654230874796133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/4480654230874796133'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-cvstrac-201.html' title='WMU-6500FS - cvstrac 2.0.1'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-3444024804344318679</id><published>2008-06-10T22:54:00.006+02:00</published><updated>2008-06-26T21:14:35.375+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - Boost 1.35</title><content type='html'>&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/boost-1.35.tar.bz2"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/boost-1.35.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
Note: besides the DSO files this archive contains even all the boost header files and documentation (not actually necessary on the box).
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# wget &lt;a href="http://downloads.sourceforge.net/boost/boost_1_35_0.tar.bz2?modtime=1206795398&amp;big_mirror=0"&gt;http://downloads.sourceforge.net/boost/boost_1_35_0.tar.bz2?modtime=1206795398&amp;big_mirror=0&lt;/a&gt;
dev# tar xjvf boost_1_35_0.tar.bz2
dev# cd boost_1_35_0
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;
The boost library names are more specific (contain boost version and compiler version) than some software demand. I do not know whether there should be &lt;i&gt;libboost_*-mt.so&lt;/i&gt; symlinks, maybe I have not configured boost library properly, as a quick fix I have created the links manually:
&lt;pre class="code"&gt;
dev# cd /mnt/C/sys/lib
dev# for i in `ls ./libboost_*-gcc33-mt-1_35.so.1.35.0`; do ln -s `basename $i` ${i/%-gcc33-mt-1_35.so.1.35.0/-mt.so}; done
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-3444024804344318679?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/3444024804344318679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=3444024804344318679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3444024804344318679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/3444024804344318679'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-boost-135.html' title='WMU-6500FS - Boost 1.35'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-7210645857027432942</id><published>2008-06-09T09:31:00.023+02:00</published><updated>2008-07-02T23:23:21.824+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - GIT 1.5.5.3</title><content type='html'>&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/git-1.5.5.3.tgz"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/git-1.5.5.3.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# wget &lt;a href="http://kernel.org/pub/software/scm/git/git-1.5.5.3.tar.gz"&gt;http://kernel.org/pub/software/scm/git/git-1.5.5.3.tar.gz&lt;/a&gt;
dev# tar xzvf git-1.5.5.3.tar.gz
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;

&lt;b&gt;Deployment hack&lt;/b&gt; &lt;br/&gt;
(touch some files in order to include them to the package)
&lt;pre class="code"&gt;
dev# find /mnt/C/sys/share/ -path "*git*" -type f -exec touch {} \;
dev# find /mnt/C/sys/lib/ -path "*Git*" -type f -exec touch {} \;
&lt;/pre&gt;

&lt;b&gt;Transfer Subversion DB to GIT&lt;/b&gt;&lt;br/&gt;
&lt;b&gt;Dependencies:&lt;/b&gt;
&lt;a href="http://filodej.blogspot.com/2008/06/wmu.html"&gt;subversion&lt;/a&gt;
&lt;br/&gt;
&lt;b&gt;Info source:&lt;/b&gt; 
&lt;a href="http://utsl.gen.nz/talks/git-svn/intro.html#getting"&gt;[git-svn intro]&lt;/a&gt;
&lt;pre class="code"&gt;
box# svnserve -d -r /mnt/C/sys/var/svn/&amp;lt;project&amp;gt;
box# cd /mnt/C/sys/var/git/&amp;lt;project&amp;gt;
box# git svn init -t tags -b branches -T trunk svn://localhost/&amp;lt;project&amp;gt;
(or simply: box# git svn init svn://localhost/&amp;lt;project&amp;gt; )
box# git svn fetch
&lt;/pre&gt;
&lt;b&gt;Error 1&lt;/b&gt;
&lt;pre class="code"&gt;
perl: Can't resolve symbol 'apr_initialize'
&lt;/pre&gt;
can be replicated as follows:
&lt;pre class="code"&gt;
box# perl -e "use SVN::Core"
&lt;/pre&gt;
Inspect dependencies:
&lt;pre class="code"&gt;
dev# ldd /mnt/C/sys/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/SVN/_Core/_Core.so
...
libapr-1.so.0 =&gt; /mnt/C/sys/apache2/lib/libapr-1.so.0 (0x00000000)
...
dev# nm /mnt/C/sys/apache2/lib/libapr-1.so.0 | grep apr_initialize
00013c18 T apr_initialize
&lt;/pre&gt;
Everything seem to be ok, maybe the libraries are loaded in a wrong order...
&lt;pre class="code"&gt;
# export LD_PRELOAD=/mnt/C/sys/apache2/lib/libapr-1.so.0
&lt;/pre&gt;

... error 1 fixed, but there is one more ...&lt;br/&gt;
&lt;b&gt;Error 2&lt;/b&gt;
&lt;pre class="code"&gt;
perl: Can't resolve symbol 'svn_swig_pl_get_current_pool'
&lt;/pre&gt;
can be replicated as follows:
&lt;pre class="code"&gt;
box# perl -e "use SVN::Wc; SVN::Wc::adm_open3(undef, '.', 0, 0);"
&lt;/pre&gt;
Another pre-load needed:
&lt;pre class="code"&gt;
box# export LD_PRELOAD=$LD_PRELOAD:/mnt/C/sys/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/SVN/_Core/_Core.so
&lt;/pre&gt;
Problem fixed - not saying that the fix is a proper solution, but I use the export only for repo conversion.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-7210645857027432942?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/7210645857027432942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=7210645857027432942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7210645857027432942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/183431720687819497/posts/default/7210645857027432942'/><link rel='alternate' type='text/html' href='http://filodej.blogspot.com/2008/06/wmu-6500fs-built-sw-git-1553.html' title='WMU-6500FS - GIT 1.5.5.3'/><author><name>filodej</name><uri>http://www.blogger.com/profile/17389359539567562061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-183431720687819497.post-5694592645161573075</id><published>2008-06-09T09:31:00.022+02:00</published><updated>2008-07-02T23:20:06.691+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMU-6500FS box with JoKeR&apos;s fw'/><title type='text'>WMU-6500FS - DidiWiki 0.5</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SGvxAerHDWI/AAAAAAAABeE/lfH_Ui3y390/s1600-h/wmu6500fs-didiwiki.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_xFBIBcRhwFQ/SGvxAerHDWI/AAAAAAAABeE/lfH_Ui3y390/s400/wmu6500fs-didiwiki.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218529583775026530" /&gt;&lt;/a&gt;

&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Build results:&lt;/b&gt;
&lt;a href="http://philodej.googlepages.com/didiwiki-0.5.tgz"&gt;[binary]&lt;/a&gt;
&lt;a href="http://philodej.googlepages.com/didiwiki-0.5.lst"&gt;[files list]&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;span class="fullpost"&gt;
&lt;b&gt;Build sequence:&lt;/b&gt;
&lt;pre class="code"&gt;
dev# wget &lt;a href="http://www.openzaurus.org/download/3.5.4/sources/didiwiki-0.5.tar.gz"&gt;http://www.openzaurus.org/download/3.5.4/sources/didiwiki-0.5.tar.gz&lt;/a&gt;
dev# tar xzvf didiwiki-0.5.tar.gz
dev# cd didiwiki-0.5
dev# ./configure --prefix=/mnt/C/sys
dev# make
dev# make install
&lt;/pre&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/183431720687819497-5694592645161573075?l=filodej.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://filodej.blogspot.com/feeds/5694592645161573075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=183431720687819497&amp;postID=5694592645161573075' title='0 Comments'/><link rel='edit' type='application/atom+
