linux on eten glofiish m800 (contd 1)

description page on http://gnufiish.org/trac/wiki/GettingStarted

I want my money back for my openmoko freerunner

Well, I knew few days after I bought openmoko that it was the worst investment in my life :) I am sad to read on Herald Welte’s, Slashdot, H-online that the project is half over. Well it is unclear what is the state as all the news information say different things. There is an email exchange between some of the guys involved in the project, but it is unclear what the project B means. I am confident that the project will survive!

booting linux or gnu make negative target

Booting linux is a slow process. And it is slow as there is no good order in organizing that process… I do not pretend perfect order, but good order. That is if process X could be already started, it should be started… And is nonsense to wait for y,z,w etc. to finish to start. There are some experiments like upstart or whatsoever, but they go to far from classical unix concepts.

I was therefore playing arround with the idea of using classical gnu make to implement the build process. Each script (boot script, service script etc) should create a status file at the end. So these files would be targets. We would have rules like:

webserver: networking

networking: kernel_modules

There is however something that I would call negative target, that is missing in makefile. It in impossible to write something like:

!networking: !webserver

!kernel_modules: !networking

So this is the magic that is missing from the gnu make… Maybe it makes sense to add sthg. like that…

 

android on openmoko

new compiled android kernel/filesystem available for openmoko:

http://forum.koolu.org/files/uImage-android-patched_bc2caff9cdef8a16.bin

http://forum.koolu.org/files/androidfs-koolu-1_0.jffs2

download videos on linux from youtube

There is an alternative to the method I described earlier to find out the links to videos hidden on the tube family portals. The method I described needs admin rights, but you can get the same results using another approach.

To be continued…

download your colourful tube videos on linux

the web is full with different funny virus-full programs that promise you to download videos from different tube sites. I will present you a quite universal way of doing it on unix (linux) machines.

Requisites:

  • tshark
  • sed
  • grep
  • wget

probably you will find sed, grep and wget already installed on your system. For example on Ubuntu you can issue:

user>sudo apt-get install tshark

or on fedora/redhat

root> yum install tshark

If this does not work on your system, go to their website and download the sources.

Tshark provides a super-set of functionalities of that provided by tcpdump. Both tshark and tcpdump are so called network sniffer tools, with their help you can investigate what is happening on your local network. You can output the content of tcp/ip packets in different formats (ps, xml, text). You can select if you want just certain field of certain type of packets. The following command selects the http packets that have destination port 80:

sudo tshark -i eth0  -d tcp.port==80,http

this will contain too much from what we do not want, and will not provide what we want.

sudo tshark -i eth0  -d tcp.port==80,http -T fields -ehttp.host -e http.request.uri

the form above introduces two new flags, -T and -e. The -T specifies the output types. The type field requires field specifiers that are specified with the -e flags. So the form above selects the fields destination host and the uri. This form will provide however lines in form of

www.blahblah.moc        /files/noproblem/file.cgi?lala=cucu&bebe=haha

but also a lot of empty uris, that we are not interested in. The empty uris can be eliminated by piping with the first grep, and the second eliminates the tab (spaces) between the two displayed fields.

sudo tshark -i eth0  -d tcp.port==80,http -T fields -ehttp.host -e http.request.uri | grep -e “[a-zA-Z0-0.\-\/_]” | sed -e ’s/\t//’

this needs a last fix, we need to escape the & characters.

sudo tshark -i eth0  -d tcp.port==80,http -T fields -ehttp.host -e http.request.uri | grep -e “[a-zA-Z0-0.\-\/_]” | sed -e ’s/\t//’ | sed -e ’s/\&/\\&/g’

the latest version will show you all the requests  your browser issues. Now depending on the tube tube site you are using, you have to observe what can be the link to the video. In most of the cases the link contains the word “video” so a last grep with “video” will reduce the number of links suggested.

What you also can do, redirect the output of the latest form to a fail, and on another terminal issue:

tail -f links | xargs -i wget {}

gnufiish, linux on eten m800

I was almost sure, there will be some other people who will do much more than me for linux porting to eten glofiish m800. and le voila:

at least, I hope they will reuse the arm machine number… or they reuse the openmoko number?

upstart openmoko

Due to the complex dependencies in the linux boot process the safest way to boot is to run the different initialization scripts sequentially. The result is a long boot process, subsystems are initialized earlier than needed etc.

There are different approaches like upstart, initng, runit, einit that try to improve the boot process on linux, each approach concentrating on several aspects, like running initialization scripts in parallel, handling device generated events in a more flexible way etc. Ubuntu for example comes now with upstart as default init, but it failes to use even at minimum the strength of the ideas behind upstart.

With the intent to speed up the linux process both for desktop and for embedded devices like ubuntu, I started to write some scripts that generates native upstart scripts based on the information from the /etc/init.d/* scripts. As first stage it would be enough to create the native upstart script as wrapper scripts around the /etc/init.d/* scripts.

One could speed up the boot process if initialization scripts could be run in parallel. As we know certain scripts need to have other scripts already started before. To simplify my description I will use the terms target as synonim for the script and dependencies for scripts that need to be started. Having the dependency relation ship we identify two categories of scripts: dependants and dependees. Of course the dependee can be dependant and so on… It is a general requirement that there should be no cyclic dependencies in sysVinit scripts.

The most trivial approach is to create upstart scripts for the dependees containing following

start on starting …. #list those targets that require the current one

pre-start exec /etc/init.d/$MYSCRIPT start

pre-stop exec /etc/init.d/$MYSCRIPT stop

the dependants (targets) would contain sthg. like:

stop on stopping … #list those dependencies that if stopped, the current one should be stopped

pre-start exec /etc/init.d/$MYSCRIPT start

pre-stop exec /etc/init.d/$MYSCRIPT stop

the two above would be merged like:

start on starting …. #list those targets that require the current one

stop on stopping … #list those dependencies that if stopped, the current one should be stopped

pre-start exec /etc/init.d/$MYSCRIPT start

pre-stop exec /etc/init.d/$MYSCRIPT stop

the first version of a python script that would generate such wrappers would be sthg. like… (GPL!!!!)

def createfile(file, startingon):
f = open(”/etc/event.d/upgen/” + file, ‘w’)
f.write(’#file automatically generated by upgen \n\n’)
for dep in startingon:
f.write(’start on starting ‘ + dep + ‘\n\n’)
f.write(’\n\n’)
f.write(’pre-start exec /etc/init.d/’ + file + ‘ start \n\n’)
f.write(’pre-stop exec /etc/init.d/’ + file + ‘ stop\n\n’)
f.close()

def createfiles(startingonmap):
for file in startingonmap:
createfile(file, startingonmap[file])

depfile=’/etc/init.d/.depend.boot’

startingonmap={}

for line in open(depfile, ‘r’).readlines():
#skip lines with
if (line.find(’TARGETS =’) != -1) or (line.find(’INTERACTIVE =’) != -1):
pass
else:
t = line.split(’:')
dependant = t[0]
dependies = t[1].split()
for dependy in dependies:
inversemap = {}
try:
inversemap = startingonmap[dependy]
except:
pass
inversemap[dependant] = 1
startingonmap[dependy]=inversemap

createfiles(startingonmap)

nvidia tv out under linux

there is too much noise about activating tv out on nvidia cards under linux. I did not use the tv out as all these were too complicated. Today I tried the nvida-settings with the cable connected, and the card has recognized that the cable is connected, and the tv out showed up. The rest is easy…

nfs4 is slow, but nfs3 behaves well!

here: http://www.mobiphil.com/?p=33 I was writing about my bad experience with nfs4. Switched back to 3, and things work just NICE…