2009-01-19 08:48:19 change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68102
Hi guys,
i try to make my uCLinux-filesystem smaller because my Ram-disk uses too much space of my Ram.....
My idea is that i save the libraries on my JFFS2-Filesystem on my Flash.
But where can i say that the path to the libraries is not "/lib" or "/usr/lib" but "/media/lib" or "media/usr/lib" ?
Can somebody give me an example how i can change this paths?
greetings
Patrick
TranslateQuoteReplyEditDelete
2009-01-19 09:51:54 Re: change the library-path in uCLinux-2009pre
Mike Frysinger (UNITED STATES)
Message: 68106
you cant change the paths in the build system and such, but you can cheat and make them symlinks. initial romfs/ setup is handled by your board's Makefile in uclinux-dist/$vendor/$board/Makefile.
QuoteReplyEditDelete
2009-01-19 10:23:42 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68109
Hi Mike,
I have just looked at the Board-Makefile in ....Vendors/Bluetechnix/TCM-BF537.
I am a little bit confused because the makefile looks very complex and i dont know what all this things means.
The only things i know in this file is the size of the Ram-disk.....
Can you explain me where i can set the symlinks and exclude the library-files?
- Patrick
TranslateQuoteReplyEditDelete
2009-01-19 10:29:16 Re: change the library-path in uCLinux-2009pre
Mike Frysinger (UNITED STATES)
Message: 68110
just remove lib from ROMFS_DIRS-y and then add a new line like the one that links /sbin to bin
QuoteReplyEditDelete
2009-01-19 10:49:54 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68111
Hi Mike,
i have just tried to do this but there is a error:
...
romfs-inst.sh -s lib /media/lib
ln: Erzeuge symbolische Verknüpfung "/home/photz/uclinux-dist/romfs/media/lib": Datei oder Verzeichnis nicht gefunden
make[2]: *** [romfs] Fehler 1
...
Is that a problem of my SD-Card?
The /media folder is my SD-Card which i mount....
but the media/lib is a folder in my SD-Card.....
- Patrick
TranslateQuoteReplyEditDelete
2009-01-19 10:57:18 Re: change the library-path in uCLinux-2009pre
Mike Frysinger (UNITED STATES)
Message: 68112
please read the man page of `ln`. you've inverted the targets.
also, if you're using ELF, then /lib needs to be available in order to execute ... the kernel wont mount /media for you
QuoteReplyEditDelete
2009-01-19 11:10:25 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68113
Sorry, my mistake....
but the /usr/lib will not be used during boot ?
My next try is that i move this folder onto my SD-Card...
Where is the symlik to this folder? I cant find it in my Makefile...
- Patrick
TranslateQuoteReplyEditDelete
2009-01-19 11:16:42 Re: change the library-path in uCLinux-2009pre
Mike Frysinger (UNITED STATES)
Message: 68114
Linux convention is that nothing in /usr is needed when booting
QuoteReplyEditDelete
2009-01-19 11:24:56 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68115
OK, that means that i can link the whole contents onto my SD-Card.
The size of the files in this folder are very large and the qt-libraries are slso save onto this folder.
Where can i set a symlink of this folder to the usr/ folder on my SD-Card?
Is there any other Makefile like the Board-Makefile?
- Patrick
TranslateQuoteReplyEditDelete
2009-01-19 11:41:44 Re: change the library-path in uCLinux-2009pre
Mike Frysinger (UNITED STATES)
Message: 68116
do it in the makefile already mentioned
QuoteReplyEditDelete
2009-01-20 04:14:08 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68137
Hi Mike,
now i have successful set a symlink of my /usr-folder onto the folder at my SD-Card..
The ls shows this:
root:/> ls -al
drwxr-xr-x 15 root root 1024 Jan 20 09:16 .
drwxr-xr-x 15 root root 1024 Jan 20 09:16 ..
drwxr-xr-x 2 1001 1001 2048 Jan 20 08:09 bin
drwxr-xr-x 4 root root 2048 Jan 20 09:13 dev
drwxr-xr-x 4 1001 1001 1024 Jan 20 08:10 etc
drwxr-xr-x 3 root root 0 Jan 1 1970 flash
drwxr-xr-x 2 1001 1001 1024 Jan 20 08:09 home
drwxr-xr-x 3 1001 1001 1024 Jan 20 08:10 lib
drwxr-xr-x 7 root root 4096 Jan 20 09:53 media
drwxr-xr-x 2 1001 1001 1024 Jan 20 08:09 mnt
dr-xr-xr-x 31 root root 0 Jan 1 2007 proc
drwxr-xr-x 2 1001 1001 1024 Jan 20 08:09 root
lrwxrwxrwx 1 1001 1001 3 Jan 20 08:09 sbin -> bin
drwxr-xr-x 12 root root 0 Jan 1 2007 sys
drwxrwxrwt 2 1001 1001 1024 Jan 20 08:09 tmp
lrwxrwxrwx 1 root root 10 Jan 20 09:16 usr -> /media/usr
drwxr-xr-x 6 root root 0 Jan 20 09:13 var
The free Ram is now much more than previously..
free shows this:
root:/> free
total used free shared buffers
Mem: 24636 4460 20176 0 48
I have thought this reaches for the tetrix-qt-application or something else in the qt-sample dir....
But if i execute one of this programms it looks like there is still not enught free RAM.
root:/media/tetrix> ./tetrix -qws -display VNC:0
tetrix: page allocation failure. order:11, mode:0x40d0
Hardware Trace:
0 Target : <0x00004928> { _dump_stack + 0x0 }
Source : <0x00032602> { ___alloc_pages_internal + 0x1be } CALL pcrel
1 Target : <0x00032602> { ___alloc_pages_internal + 0x1be }
Source : <0x0000e4e6> { _printk + 0x16 } RTS
2 Target : <0x0000e4e2> { _printk + 0x12 }
Source : <0x0000ed0c> { _vprintk + 0x130 } RTS
3 Target : <0x0000ed00> { _vprintk + 0x124 }
Source : <0xffa00bd0> { __common_int_entry + 0xd8 } RTI
4 Target : <0xffa00b6e> { __common_int_entry + 0x76 }
Source : <0xffa009b8> { _return_from_int + 0x58 } RTS
5 Target : <0xffa009b8> { _return_from_int + 0x58 }
Source : <0xffa0098e> { _return_from_int + 0x2e } IF !CC JUMP
6 Target : <0xffa00960> { _return_from_int + 0x0 }
Source : <0xffa00b6a> { __common_int_entry + 0x72 } CALL pcrel
7 Target : <0xffa00b68> { __common_int_entry + 0x70 }
Source : <0xffa0035a> { _asm_do_IRQ + 0x6e } RTS
8 Target : <0xffa00352> { _asm_do_IRQ + 0x66 }
Source : <0x0001228a> { __local_bh_enable + 0x3e } RTS
9 Target : <0x0001224c> { __local_bh_enable + 0x0 }
Source : <0x00012374> { ___do_softirq + 0xa0 } JUMP.L
10 Target : <0x0001236c> { ___do_softirq + 0x98 }
Source : <0x00012350> { ___do_softirq + 0x7c } IF !CC JUMP
11 Target : <0x00012332> { ___do_softirq + 0x5e }
Source : <0x0002d368> { _rcu_process_callbacks + 0x30 } RTS
12 Target : <0x0002d364> { _rcu_process_callbacks + 0x2c }
Source : <0x0002d29e> { ___rcu_process_callbacks + 0x132 } RTS
13 Target : <0x0002d298> { ___rcu_process_callbacks + 0x12c }
Source : <0x0002d222> { ___rcu_process_callbacks + 0xb6 } IF !CC JUMP
14 Target : <0x0002d21c> { ___rcu_process_callbacks + 0xb0 }
Source : <0x0002d2a4> { ___rcu_process_callbacks + 0x138 } IF CC JUMP
15 Target : <0x0002d2a0> { ___rcu_process_callbacks + 0x134 }
Source : <0x0002d20e> { ___rcu_process_callbacks + 0xa2 } IF !CC JUMP
Stack info:
SP: [0x019e7e04] <0x019e7e04> /* kernel dynamic memory */
FP: (0x019e7e10)
Memory from 0x019e7e00 to 019e8000
019e7e00:<000325da>[0039a6a0]<00032606> 0039a6a0 (00000000)<000240d0> 0039a888
019e7e20: 000040d0 00000001 00000048 019e6000 019e6000 00000000 <000240d0>
019e7e40: 00000010 00000000 00000000 00000000 00000000 000000f5 <0003272e>
019e7e60: 0069c000 018301a0 ffffffda 00000000 00000002 019ce5c0 <00039d2e>
019e7e80: 00000004 00000000 <00039f58> 00000000 00000000 0109f210 <0003e404>
019e7ea0: 00000000 00000000 00447620 00001000 00001000 0109f210 <000038c8>
019e7ec0: 0069b3ec 00397034 019e6000 00000002 019ce5c0 00000005 00001000
019e7ee0: 00000000 00000005 00000002 00000000 <ffa0082c> 00003880 000000c0
019e7f00: ffffe000 00000000 00000003 01938776 <001aec60> 0018948c 00001802
019e7f20: 00000000 003b34fe 00008000 00002000 00000000 019e8000 003b34fe
019e7f40:<003b2c92><ffa00d94> 02002020 003b5051 0185f8db 003b5050 0185f8da
019e7f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
019e7f80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
019e7fa0: 00000000 00000000 00000000 004122a8 004db005 0109f0c0 0109f210
019e7fc0: 0109f23c 00397034 00000000 00397034 000000c0 0069b3ec 00000001
019e7fe0: 00000003 00001802 00000005 0069b3ec 00000000 00000000 000000c0
019e8000: 00100100
Return addresses in stack:
address : <0x000325da> { ___alloc_pages_internal + 0x196 }
address : <0x00032606> { ___alloc_pages_internal + 0x1c2 }
frame 1 : <0x000240d0> { _timer_list_show + 0x424 }
address : <0x000240d0> { _timer_list_show + 0x424 }
address : <0x0003272e> { ___get_free_pages + 0x1e }
address : <0x00039d2e> { _do_mmap_pgoff + 0x35a }
address : <0x00039f58> { _do_mmap_pgoff + 0x584 }
address : <0x0003e404> { _vfs_read + 0xac }
address : <0x000038c8> { _sys_mmap2 + 0x48 }
address : <0xffa0082c> { _system_call + 0x68 }
address : <0x001aec60> { _bfin_debug_mmrs_init + 0x6bf0 }
address : <0x003b2c92> [ /lib/ld-uClibc.so.0 + 0x2c92 ]
address : <0xffa00d94> { _evt_system_call + 0x64 }
Mem-Info:
DMA per-cpu:
CPU 0: hi: 0, btch: 1 usd: 0
Active_anon:0 active_file:4 inactive_anon:0
inactive_file:0 dirty:0 writeback:0 unstable:0
free:5182 slab:457 mapped:0 pagetables:0 bounce:0
DMA free:20728kB min:648kB low:808kB high:972kB active_anon:0kB inactive_anon:0o
lowmem_reserve[]: 0 0 0
DMA: 60*4kB 55*8kB 31*16kB 21*32kB 13*64kB 13*128kB 10*256kB 7*512kB 2*1024kB 2B
4 total pagecache pages
6656 pages RAM
497 pages reserved
3 pages shared
954 pages non-shared
Allocation of length 6930432 from process 144 failed
DMA per-cpu:
CPU 0: hi: 0, btch: 1 usd: 0
Active_anon:0 active_file:4 inactive_anon:0
inactive_file:0 dirty:0 writeback:0 unstable:0
free:5182 slab:457 mapped:0 pagetables:0 bounce:0
DMA free:20728kB min:648kB low:808kB high:972kB active_anon:0kB inactive_anon:0o
lowmem_reserve[]: 0 0 0
DMA: 60*4kB 55*8kB 31*16kB 21*32kB 13*64kB 13*128kB 10*256kB 7*512kB 2*1024kB 2B
4 total pagecache pages
./tetrix:582: can't map '/usr/lib/libQtGui.so.4'
./tetrix: can't load library 'libQtGui.so.4
I am desperated.......
Is it realy impossible to get qt-programms running on a board with 32MB ram?
- Patrick
TranslateQuoteReplyEditDelete
2009-01-20 08:30:46 Re: change the library-path in uCLinux-2009pre
Robin Getz (UNITED STATES)
Message: 68149
Patrick:
If you are running from a device with enough flash on it - can you run a flash file system as the rootfs (like jffs2)?
Also - I have seen this (added to the /etc/rc file) help:
echo 4096 > /proc/sys/vm/min_free_kbytes
echo 300 > /proc/sys/vm/vfs_cache_pressure
-Robin
QuoteReplyEditDelete
2009-01-21 04:42:08 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68186
Hi guys,
i have tried some ideas but the result is only a bit better than bevore....
My uClinux-image is now only the base-system which i need (LAN, FLASH, SD-Card).
This has reduced the size of the Ram-disk to 2048k.
So i have 2048k more Ram free:
root:/> free
total used free shared buffers
Mem: 27708 3972 23736 0 44
root:/>
My /usr folder is a symlink to /media/usr (on my SD-Card):
root:/> ls -al
drwxr-xr-x 15 root root 1024 Jan 1 02:40 .
drwxr-xr-x 15 root root 1024 Jan 1 02:40 ..
drwxr-xr-x 2 1001 1001 2048 Jan 21 2009 bin
drwxr-xr-x 4 root root 2048 Jan 1 02:40 dev
drwxr-xr-x 4 1001 1001 1024 Jan 21 2009 etc
drwxr-xr-x 3 root root 0 Jan 1 00:00 flash
drwxr-xr-x 2 1001 1001 1024 Jan 21 2009 home
drwxr-xr-x 3 1001 1001 1024 Jan 21 2009 lib
drwxr-xr-x 7 root root 4096 Jan 1 00:00 media
drwxr-xr-x 2 1001 1001 1024 Jan 21 2009 mnt
dr-xr-xr-x 30 root root 0 Jan 1 2007 proc
drwxr-xr-x 2 1001 1001 1024 Jan 21 2009 root
lrwxrwxrwx 1 1001 1001 3 Jan 21 2009 sbin -> bin
drwxr-xr-x 12 root root 0 Jan 1 2007 sys
drwxrwxrwt 2 1001 1001 1024 Jan 21 2009 tmp
lrwxrwxrwx 1 root root 11 Jan 1 02:40 usr -> /media/usr/
drwxr-xr-x 6 root root 0 Jan 1 02:40 var
root:/>,
I also have added:
echo 4096 > /proc/sys/vm/min_free_kbytes
echo 300 > /proc/sys/vm/vfs_cache_pressure
to my rc-file....
If i try to execute the analogcl (a sample which is saved in ../staging/qt/examples/widgets/...)
root:/media/analogcl> ./analogcl -qws -display VNC:0
analogcl: page allocation failure. order:10, mode:0x40d0
Hardware Trace:
0 Target : <0x00004928> { _dump_stack + 0x0 }
Source : <0x00032602> { ___alloc_pages_internal + 0x1be } CALL pcrel
1 Target : <0x00032602> { ___alloc_pages_internal + 0x1be }
Source : <0x0000e4e6> { _printk + 0x16 } RTS
2 Target : <0x0000e4e2> { _printk + 0x12 }
Source : <0x0000ed0c> { _vprintk + 0x130 } RTS
3 Target : <0x0000ed00> { _vprintk + 0x124 }
Source : <0xffa00bd0> { __common_int_entry + 0xd8 } RTI
4 Target : <0xffa00b6e> { __common_int_entry + 0x76 }
Source : <0xffa009b8> { _return_from_int + 0x58 } RTS
5 Target : <0xffa009b8> { _return_from_int + 0x58 }
Source : <0xffa0098e> { _return_from_int + 0x2e } IF !CC JUMP
6 Target : <0xffa00960> { _return_from_int + 0x0 }
Source : <0xffa00b6a> { __common_int_entry + 0x72 } CALL pcrel
7 Target : <0xffa00b68> { __common_int_entry + 0x70 }
Source : <0xffa0035a> { _asm_do_IRQ + 0x6e } RTS
8 Target : <0xffa00352> { _asm_do_IRQ + 0x66 }
Source : <0x0001228a> { __local_bh_enable + 0x3e } RTS
9 Target : <0x0001224c> { __local_bh_enable + 0x0 }
Source : <0x00012374> { ___do_softirq + 0xa0 } JUMP.L
10 Target : <0x0001236c> { ___do_softirq + 0x98 }
Source : <0x00012350> { ___do_softirq + 0x7c } IF !CC JUMP
11 Target : <0x00012332> { ___do_softirq + 0x5e }
Source : <0x0002d368> { _rcu_process_callbacks + 0x30 } RTS
12 Target : <0x0002d364> { _rcu_process_callbacks + 0x2c }
Source : <0x0002d29e> { ___rcu_process_callbacks + 0x132 } RTS
13 Target : <0x0002d298> { ___rcu_process_callbacks + 0x12c }
Source : <0x0002d222> { ___rcu_process_callbacks + 0xb6 } IF !CC JUMP
14 Target : <0x0002d21c> { ___rcu_process_callbacks + 0xb0 }
Source : <0x0002d2a4> { ___rcu_process_callbacks + 0x138 } IF CC JUMP
15 Target : <0x0002d2a0> { ___rcu_process_callbacks + 0x134 }
Source : <0x0002d20e> { ___rcu_process_callbacks + 0xa2 } IF !CC JUMP
Stack info:
SP: [0x001b1e04] <0x001b1e04> { _reserve_bootmem + 0x14 }
FP: (0x001b1e10)
Memory from 0x001b1e00 to 001b2000
001b1e00:<000325da>[01c9a3a0]<00032606> 01c9a3a0 (00000000)<000240d0> 01c9a588
001b1e20: 000040d0 00000001 00000048 001b0000 001b0000 00000000 <000240d0>
001b1e40: 00000010 00000000 00000000 00000000 00000000 000000f5 <0003272e>
001b1e60: 00211000 00ab1ec0 ffffffda 00000000 00000002 01c964a0 <00039d2e>
001b1e80: 00000004 00000000 <00039f58> 00000000 00000000 019df1e8 <0003e404>
001b1ea0: 00000000 00000000 019474c0 00001000 00001000 019df1e8 <000038c8>
001b1ec0: 00210618 00aac034 001b0000 00000002 01c964a0 00000005 00001000
001b1ee0: 00000000 00000005 00000002 00000000 <ffa0082c> 00003880 000000c0
001b1f00: ffffe000 00000000 00000003 ffffe000 00000000 0000fffe 00001802
001b1f20: 00000000 01cb34fe 00008000 00002000 00000000 001b2000 01cb34fe
001b1f40:<01cb2c92><ffa00d94> 02002020 01cb2ee3 0035f8db 01cb2ee2 0035f8da
001b1f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
001b1f80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
001b1fa0: 00000000 00000000 00000000 01b7c2a8 01b7d005 019df098 019df1e8
001b1fc0: 019df214 00aac034 00000000 00aac034 000000c0 00210618 00000001
001b1fe0: 00000003 00001802 00000005 00210618 00000000 00000000 000000c0
001b2000: 321f3030
Return addresses in stack:
address : <0x000325da> { ___alloc_pages_internal + 0x196 }
address : <0x00032606> { ___alloc_pages_internal + 0x1c2 }
frame 1 : <0x000240d0> { _timer_list_show + 0x424 }
address : <0x000240d0> { _timer_list_show + 0x424 }
address : <0x0003272e> { ___get_free_pages + 0x1e }
address : <0x00039d2e> { _do_mmap_pgoff + 0x35a }
address : <0x00039f58> { _do_mmap_pgoff + 0x584 }
address : <0x0003e404> { _vfs_read + 0xac }
address : <0x000038c8> { _sys_mmap2 + 0x48 }
address : <0xffa0082c> { _system_call + 0x68 }
address : <0x01cb2c92> [ /lib/ld-uClibc.so.0 + 0x2c92 ]
address : <0xffa00d94> { _evt_system_call + 0x64 }
Mem-Info:
DMA per-cpu:
CPU 0: hi: 0, btch: 1 usd: 0
Active_anon:0 active_file:4 inactive_anon:0
inactive_file:9 dirty:0 writeback:0 unstable:0
free:3077 slab:446 mapped:0 pagetables:0 bounce:0
DMA free:12308kB min:4096kB low:5120kB high:6144kB active_anon:0kB inactive_anoo
lowmem_reserve[]: 0 0 0
DMA: 51*4kB 33*8kB 20*16kB 14*32kB 11*64kB 9*128kB 6*256kB 3*512kB 2*1024kB 0*2B
13 total pagecache pages
7424 pages RAM
497 pages reserved
14 pages shared
3821 pages non-shared
Allocation of length 2166784 from process 77 failed
DMA per-cpu:
CPU 0: hi: 0, btch: 1 usd: 0
Active_anon:0 active_file:4 inactive_anon:0
inactive_file:9 dirty:0 writeback:0 unstable:0
free:3077 slab:446 mapped:0 pagetables:0 bounce:0
DMA free:12308kB min:4096kB low:5120kB high:6144kB active_anon:0kB inactive_anoo
lowmem_reserve[]: 0 0 0
DMA: 51*4kB 33*8kB 20*16kB 14*32kB 11*64kB 9*128kB 6*256kB 3*512kB 2*1024kB 0*2B
13 total pagecache pages
./analogcl:582: can't map '/usr/lib/libQtCore.so.4'
./analogcl: can't load library 'libQtCore.so.4'
root:/media/analogcl>
This shows that the library with 6MB is now loaded OK but the next with 2MB failed.......
Move the /usr folder onto my flash is impossible because in my board there are only 8MB and the /usr folder has about 15MB.....
- Patrick
TranslateQuoteReplyEditDelete
2009-01-21 08:01:07 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68195
Hi,
the problem with my low ram seems to be bigger than i think....
My last idea is to link the qt-library static to my programm....
Can somebody give me an example how i can do this?
For testing i would use some of the sample-programms in qt-embedded (tetrix or analogclk).....
I know that i must use -static ore something like that......
regards
- Patrick
TranslateQuoteReplyEditDelete
2009-01-21 14:55:18 Re: change the library-path in uCLinux-2009pre
Mike Frysinger (UNITED STATES)
Message: 68204
you only need -static when linking
you could also just statically link a few libs (so you still dynamically link with the C library):
... -Wl,-Bstatic -lQt.... -Wl,-Bdynamic ...
QuoteReplyEditDelete
2009-01-22 02:41:22 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68215
Hi guys,
thank you for your answers, i will have a try today.....
For /usr folder i have an idea...
Is it possible to say that the "make" command creates a uImage without /usr folder??
I want so save this folder on Flash or SD-Card.....
I think the "make" creates a uImage and the /usr folder i can copy manually onto my board...
- Patrick
TranslateQuoteReplyEditDelete
2009-01-22 10:22:24 Re: change the library-path in uCLinux-2009pre
Mike Frysinger (UNITED STATES)
Message: 68244
there is no way to filter arbitrary paths. you can edit the romfs/ and then just run `make image`.
QuoteReplyEditDelete
2009-01-22 13:58:47 Re: change the library-path in uCLinux-2009pre
Patrick Hotz (GERMANY)
Message: 68248
Hi Mike,
thank you for the answers.
I will try it tomorrow.
Also i try a new way to increase my free RAM.... in the other tread..
- Patrick