|
Vlatko Kosturjak - Kost | Vlatko Kosturjak - Kost
Hi and welcome to my page. There's still nothing useful here. Maybe it will be useful some day.
|
Installing IO::Socket::SSL using Strawberry Perl
| |
When you try to install Net::SSLeay as dependency of IO::Socket::SSL using Strawberry Perl and you get something like this:
Running install for module 'Net::SSLeay' Running make for F/FL/FLORA/Net-SSLeay-1.35.tar.gz Has already been unwrapped into directory C:\strawberry\cpan\build\Net-SSLeay-1.35-zncySb 'C:\strawberry\perl\bin\perl.exe Makefile.PL' returned status 512, won't make Running make test Make had some problems, won't test Running make install Make had some problems, won't install
or this:
dmake.EXE Error code 129, while making SSLeay.o
or error code 512.
You should download OpenSSL library from Shining Light Productions - Win32 OpenSSL and NOT from gnuwin32 sourceforge page. After that, you just need to copy the files from C:\OpenSSL\lib\MinGW to C:\OpenSSL\lib. Installation will succeed. At least it did for me ;)
Technorati tags: perl windows ssl strawberry openssl debian
|
|
Debian 5.0 lenny - 1st experience
| |
Debian released 5.0 version (aka lenny). You can read announcement here. First upgrade to lenny on testing server went good. No problems at all. Few notes regarding the packages I use: mod-security is not in default repositories due to late fix. Also, they have only client for OpenVAS available on repositories. Hope they will fix it in later revisions...
Any way, more about mod-security legal saga in Lenny you can read here. Unofficial apt repository for mod-security you can reach here.
Technorati tags: lenny security apache linux xandros debian
|
|
ASUS EEE - few tricks for beginners ;)
| |
As ASUS EEE is available in Croatia stores now, I'll give few tips (and no tricks) for beginners with ASUS EEE in Croatia.
Probably you noticed that you cannot select Croatian keyboard layout. What you need to do is edit /etc/X11/xorg.conf and find following line:
Option "XkbLayout" "us"
And change it to (for Croatian keyboard):
Option "XkbLayout" "hr"
Optionally, you can change it to (if you want Croatian letters on AltGr):
Option "XkbLayout" "hr(us)"
If you want to change keyboard layout on the fly, open terminal (ctrl+alt+t) and type following (if you need to change to Croatian layout):
setxkbmap hr
Also, if you want Croatian letters on AltGr, you need to type:
setxkbmap hr us
If you want to switch back to US keyboard layout, type following:
setxkbmap us
If you need Croatian spelling checker for OpenOffice.Org, you need to edit /etc/apt/sources.list and add following lines (as administrator/root):
deb http://ftp.linux.hr/asuseee/xandros/ binary/
deb-src http://ftp.linux.hr/asuseee/xandros/ source/
After that, type this in terminal (in order to install packages):
sudo apt-get update
sudo apt-get install myspell-hr
And if you need hyphenation support in OpenOffice.Org, type following:
sudo apt-get install openoffice.org-hyphenation-hr
Now, launch OpenOffice.Org, choose Tools->Options, then Language Settings, and in Languages in section Default language for documents choose Croatian in drop down menu.
You can restart OpenOffice.Org and Spelling checker (as you type) will be enabled by default.
If you want to tweak default ASUS Icewm preferences, copy preferences file from /etc/X11/icewm/ (not /usr/share/icewm!) to .icewm and modify it.
Regarding overclocking and fan control, you can download precompiled module (Note to everyone: this is new version/release - with new and better patch!)
Technorati tags: asus eee hacking linux xandros debian
|
|
Debugging SquashFS and tools
| |
Recently, I was playing with squashfs and with its SquashFS LZMA companion. I hit the segmentatin fault while I was building squashfs from ASUS EEE read only image. I'll try to explain my debug process, so people who are not familiar can follow (and learn something). I run gdb on core dump and discovered that problematic function is write_file_blocks_dup (output of gdb):
Program terminated with signal 11, Segmentation fault.
#0 0x08050b84 in write_file_blocks_dup ()
(gdb) bt
#0 0x08050b84 in write_file_blocks_dup ()
#1 0x080519e9 in write_file ()
#2 0x0805257c in dir_scan2 ()
#3 0x08052502 in dir_scan2 ()
#4 0x08052502 in dir_scan2 ()
#5 0x08052502 in dir_scan2 ()
#6 0x08052502 in dir_scan2 ()
#7 0x08052c60 in dir_scan ()
#8 0x0805506e in main ()
(gdb) print reader_buffer
$1 = 139977672
Seg fault often happens when you try to read/write memory which you don't own (or you freed already). By looking at that function (write_file_blocks_dup), I found interesting piece of code:
Code: | if(read_buffer->c_byte) { |
| read_buffer->block = bytes; |
| bytes += read_buffer->size; |
| file_bytes += read_buffer->size; |
| if(block < thresh) { |
| buffer_list[block].read_buffer = NULL; |
| queue_put(to_writer, read_buffer); |
| } else |
| buffer_list[block].read_buffer = read_buffer; |
| } else { |
| buffer_list[block].read_buffer = NULL; |
| alloc_free(read_buffer); |
| } |
| buffer_list[block].start = read_buffer->block; |
| buffer_list[block].size = read_buffer->size; |
| progress_bar(++cur_uncompressed, estimated_uncompressed,columns); |
If you notice, there is alloc_free function which try to free read_buffer, but immediately after that - there's statements which try to access that memory (which doesn't exist any more). So, I changed it to:
Code: | if(read_buffer->c_byte) { |
| read_buffer->block = bytes; |
| bytes += read_buffer->size; |
| file_bytes += read_buffer->size; |
| if(block < thresh) { |
| buffer_list[block].read_buffer = NULL; |
| queue_put(to_writer, read_buffer); |
| } else |
| buffer_list[block].read_buffer = read_buffer; |
| } else { |
| buffer_list[block].read_buffer = NULL; |
| } |
| buffer_list[block].start = read_buffer->block; |
| buffer_list[block].size = read_buffer->size; |
| progress_bar(++cur_uncompressed, estimated_uncompressed,columns); |
| alloc_free(read_buffer); |
I made patch for it and sent to author via squashfs sourceforge page. That's one bug less...
But! Here it comes again. I hit another problem. My mksquashfs process was stuck at around 60% and progress bar is not moving. So, I connected to PID of mksquashfs process using gdb and discovered that it's waiting in get_fragment function on pthread as illustrated below:
xb7f32c01 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0
(gdb) bt
#0 0xb7f32c01 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x0804dcad in get_fragment ()
#2 0x0804e104 in duplicate ()
#3 0x0805155f in write_file_frag_dup ()
#4 0x080516f8 in write_file_frag ()
#5 0x08051a36 in write_file ()
#6 0x0805257c in dir_scan2 ()
#7 0x08052502 in dir_scan2 ()
#8 0x08052502 in dir_scan2 ()
#9 0x08052502 in dir_scan2 ()
#10 0x08052502 in dir_scan2 ()
#11 0x08052502 in dir_scan2 ()
#12 0x08052502 in dir_scan2 ()
#13 0x08052502 in dir_scan2 ()
#14 0x08052c60 in dir_scan ()
#15 0x0805506e in main ()
I tried to see on what file it hangs while building filesystem and it hangs at the following:
mksquashf 32709 root 3u REG 8,3 607996129 1484897 /asus-eee/asus-eee.lza
mksquashf 32709 root 4r REG 8,3 395 277747 /asus-eee/usr/share/games/frozen-bubble/gfx/menu/backgrnd-closedeye-right-green.png
I tried to start it again, and it again hang at the following file:
mksquashf 6544 root 3u REG 8,3 607996129 1101584 /asus-eee/asus-eee.lza
mksquashf 6544 root 4r REG 8,3 395 277747 /asus-eee/usr/share/games/frozen-bubble/gfx/menu/backgrnd-closedeye-right-green.png
It seems that pthread implementation is broken somehow. I tried to look at get_fragment function, and discovered that mksquashfs is waiting at the following piece of code:
Code: | pthread_mutex_lock(&fragment_mutex); |
| while(fragment_table[fragment->index].pending) |
| pthread_cond_wait(&fragment_waiting, &fragment_mutex); |
| pthread_mutex_unlock(&fragment_mutex); |
| disk_fragment = &fragment_table[fragment->index]; |
| size = SQUASHFS_COMPRESSED_SIZE_BLOCK(disk_fragment->size); |
Notice that there's no error checking on pthread functions at all (like in pthread_mutex_lock), so I have to implement error checking in order to see what's wrong around pthread implementation (because it seems like some pthread runaway). But, It's too late and this would take long as I have to put lot of error checkings around every pthread call, so I'm leaving this as exercise for the reader of this blog!
Good luck! :)
Technorati tags: asus eee hacking linux xandros debian squashfs gdb debug
|
|
Compiling kernel modules for Xandros ASUS EEE
| |
As lot of people asked me how I managed to compile kernel modules for Xandros default distribution on ASUS EEE, here's explanation.
First, I copied all files (except /proc, /sys, ...) from ASUS EEE to my laptop. I used tar and netcat for that. After that, I chrooted that ASUS EEE file structure (chroot . bash).
Now, i've done lot of apt-gets to have development enviroment ready (gcc, libc-dev, etc...). For kernel part, I downloaded vanilla kernel source (same version as ASUS EEE) from kernel.org (direct link). In order to make kernel as match as close to original one, I downloaded unionfs (direct link) and applied patch to vanilla tree.
It's good feature that ASUS engineers left the kernel .config file in /boot, so I could use original .config file (it's full pathname is /boot/config-2.6.21.4-eeepc). Just copied that config file to source tree as .config and made:
make oldconfig && make prepare
So, now I have full enviroment ready and I just compile any additional extra module I need. This way you can compile the kernel (not just modules). But it would lack full ASUS EEE hardware support. I used this method to compile kernel modules (like eee.ko).
In the meantime, ASUS released their kernel source (or I just realized that) and you can download it here (choose EEEPC and find it under Source code category).
You need to unrar the downloaded file and install it using dpkg (dpkg -i linux-source-2.6.21.4-eeepc.deb). The linux source is installed in /usr/src/linux-source-2.6.21.4-eeepc.tar.bz2. Untar it, compile it and have fun! :)
It's good, now you have two options: vanilla kernel or original EEE kernel.
Technorati tags: asus eee hacking linux xandros debian squashfs
|
|
Making ASUS EEE more useful
| |
ASUS EEE is becoming more and more popular. As such, there's more and more modifications and support for it. eee.ko module is one of them. eee.ko consists of a kernel module to change the eee's FSB speed, allowing the CPU to run at its full 900Mhz. eee.ko provides nice /proc interface for fan control too.
Because, there's no eee.ko precompiled module for Xandros default distribution, I compiled one and you can download it (together with source patch to work on Xandros if you want to compile it yourself because the module is written for Ubuntu newer kernel originally). There's also nice script for FAN control which you can download (if you don't like /proc interface).
If you are interested only in controlling the fan of your ASUS EEE, then you can download this eee.ko fan module only..
I would recommend reading this topic and this topic to people interested in booting puppy linux on ASUS EEE (as they contain link to kernel modules/drivers for ASUS EEE hardware compiled for puppyLinux). If you're just interested in PET packages for puppylinux having these modules/drivers, you can download them here.
I have also compiled squashfs (3.3) for Xandros default distribution. I made it available on my site so, you can download squashfs kernel module and squashfs tools (in case you want to make squashfs directly on ASUS EEE). Why squashfs? Well, you can compress read only part of 4gb disk with squashfs and save some space on your ASUS EEE.
If you are from Croatia and interested in ASUS EEE tweaking, I would also recommend joining eeepc-zagreb group.
Technorati tags: asus eee hacking linux xandros debian squashfs
|
|
First 24 hours with ASUS EEE
| |
ASUS EEE doesn't have Bluetooth by default, but it has bluetooth packages lying around in default installation. So, I plugged in my Bluetooth USB dongle and changed few parameters. After few minutes, I got my bluetooth connection working with my phone, NXT and Thinkpad.
Because ASUS EEE doesn't have PCMCIA slot, I couldn't use my VIP 3G PCMCICA card to access Internet everywhere. I need that in order to be fully mobile with my ASUS EEE. So, I managed to set up Internet connection using my mobile phone via bluetooth. I just copied the scripts I use with my Thinkpad to reach Internet via mobile phone and it worked! Now, my ASUS EEE become even more mobile :)
If you want to connect your ASUS EEE to Internet via mobile phone, I found nice instructions here. It's typical instructions for connecting to internet via your mobile phone with chat scripts and pppd.
 Happy ASUS EEE users ;)
If you didn't know - ASUS EEE has web camera (with Skype software and Skype video working out of the box). With my knowledge of audio/video streaming I gained from streaming HULK events like this one, I tried to set up basic audio/video streaming using ASUS EEE device, just for fun.
First, I had to enable camera (it's enabled only if you use Skype or webcam software) using this command:
echo 1 > /proc/acpi/asus/camera
After turning on the camera, typical V4L device appears at /dev/video0. Basically, I used gstreamer to grab and recode audio/video and shout2send gstreamer plugin to forward OGG stream to icecast server (I could use oggfwd too, but gstreamer seemed faster solution). With combination of mobile internet, I got extremely mobile streaming solution using open OGG (Theora/Vorbis) format. It's stil not perfect streaming, because it's only 900 Mhz procesor, but it's usable. I guess I have to tune it more. Probably, I'll write step by step guide for EEE user Wiki about that.
After playing with camera, don't forget to turn off your camera in order to save battery :) :
echo 0 > /proc/acpi/asus/camera
Actually, /proc/acpi/asus is just interface for asus_acpi module. Using it, you can turn off (or turn on) some devices in order to save battery life of your ASUS EEE. Here is quick oneliner how you can turn off wireless, camera and card reader:
for i in camera cardr wlan; do (echo 0 > /proc/acpi/asus/$i); done
and to turn it on all again:
for i in camera cardr wlan; do (echo 1 > /proc/acpi/asus/$i); done
If you don't like my quick solutions :), you can see this solution from Avian.
Dobrica told me he has problems with apt-get upgrading his ASUS EEE (Firefox segfaults after upgrade). Anyway, I found the fix on the internet. Solution is actually to remove scim support (it's for Asian languages anyway and we don't use it here). Dobrica said he used another fix: apt-get install eeepc-updatepack-20071126. It seems it's the better one. Anyway, I guess I'm lucky because I didn't had that problem he had.
Technorati tags: asus eee hacking linux xandros debian
|
...read more...
|