Hi everybody,
I'm a relatively new VDR user and very happy with it. As I like to fiddle with such things, I've tried to compile it against uclibc instead of glibc. This worked without problems, but it turned out to be slightly more complicated due to VDR's use of a glibc extension to the sscanf function ("%a[..."), which is defined in another way in C99.
VDR uses this only when parsing config files. It was easy to implement a small dirty hack that works around this, but it would be easy to construct a clean patch, too.
If there is demand for such a patch, please give me a short notice, I'll post it here, then. Of course this doesn't make much sense if VDR is focussing on glibc only - I can live fine with the hack...
I'm currently happily running VDR (1.3.34) from a uclibc-based system and haven't noticed any problems yet.
-hwh
On Tue, Nov 01, 2005 at 01:59:29PM +0100, Hans-Werner Hilse wrote:
If there is demand for such a patch, please give me a short notice, I'll post it here, then. Of course this doesn't make much sense if VDR is focussing on glibc only - I can live fine with the hack...
I'd like to build a minimal setup comprising a 2.6 series Linux kernel, BusyBox, VDR and softdevice, all linked against uClibc. Ideally, the system would boot up from flash memory.
In other words, I'm interested. If possible, please also make your configuration files available.
Marko
Hi,
On Tue, 1 Nov 2005 17:05:39 +0200 Marko Mäkelä marko.makela@hut.fi wrote:
On Tue, Nov 01, 2005 at 01:59:29PM +0100, Hans-Werner Hilse wrote: I'd like to build a minimal setup comprising a 2.6 series Linux kernel, BusyBox, VDR and softdevice, all linked against uClibc. Ideally, the system would boot up from flash memory.
That's the future for me, but currently I'm lacking a (hopefully cheap) CompactFlash IDE adapter. People owning bootable USB-Sticks and a capable BIOS will make their profit out of this, too, I think.
In other words, I'm interested. If possible, please also make your configuration files available.
OK, I'll rework my first very dirty hack (just to test it) which I made available (probably only for about two weeks from now) as
http://arbeit.hilses.de/hw/vdr-dirtyhack.patch
It's against 1.3.34. It's very badly done as it just allocates a buffer (of 1kB) for all strings that were unallocated before (and meant to be allocated by sscanf). If anyone around knows the most common (not glibc-based) approach to solve this problem, I'd like to know. Otherwise I'll try to find a way doing this without causing too much havoc in the codebase.
A few additional uclibc-related notes: - I found that only newest 0.9.28 happened to have the threading stuff needed to compile vdr. I.e., not working with Gentoo embedded right now. It worked with uclibc's buildroot just fine. - Using uclibc and only busybox' stripped down sysv init implementation lead to boot time of 35 sec on my 200MHz Pentium-MMX with a mostly static kernel (only module is lirc). Basic VDR's CPU utilization is at 10%. I found this impressive... 13secs is due to BIOS and grub. - A lot of plugins are working quite well (mplayer, mp3 still untested, osdteletext, screenshot, tvonscreen, dvd are working). - Kernel+mplayer+above mentioned plugins+libs+vdr+lirc+busybox is around 16MB atm.
I'll make a build description, an updated patch and some config files for busybox available ASAP. I.e., probably around tomorrow...
-hwh
Hans-Werner Hilse schrieb:
On Tue, Nov 01, 2005 at 01:59:29PM +0100, Hans-Werner Hilse wrote: I'd like to build a minimal setup comprising a 2.6 series Linux kernel, BusyBox, VDR and softdevice, all linked against uClibc. Ideally, the system would boot up from flash memory.
It is no problem to get a sytem which fits into 16MB with a real (a little bit striped) glibc.
Here is the content of my /lib (about 4MB)
-rwxr-xr-x 1 root root 86816 Jan 9 2005 ld-2.3.4.so lrwxrwxrwx 1 root root 11 Aug 22 2004 ld-linux.so.2 -> ld-2.3.4.so -rwxr-xr-x 1 root root 9112 Jan 9 2005 libanl-2.3.4.so lrwxrwxrwx 1 root root 15 Aug 22 2004 libanl.so.1 -> libanl-2.3.4.so -rwxr-xr-x 1 root root 1126896 Jan 9 2005 libc-2.3.4.so -rwxr-xr-x 1 root root 18644 Jan 9 2005 libcrypt-2.3.4.so lrwxrwxrwx 1 root root 17 Aug 22 2004 libcrypt.so.1 -> libcrypt-2.3.4.so lrwxrwxrwx 1 root root 13 Aug 22 2004 libc.so.6 -> libc-2.3.4.so -rwxr-xr-x 1 root root 8464 Jan 9 2005 libdl-2.3.4.so lrwxrwxrwx 1 root root 14 Aug 22 2004 libdl.so.2 -> libdl-2.3.4.so lrwxrwxrwx 1 root root 18 Aug 28 2003 libdvdcss.so.2 -> libdvdcss.so.2.0.7 -rwxr-xr-x 1 root root 26496 Jan 8 2005 libdvdcss.so.2.0.7 lrwxrwxrwx 1 root root 18 Aug 28 2003 libdvdnav.so.0 -> libdvdnav.so.0.3.0 -rwxr-xr-x 1 root root 149792 Jan 8 2005 libdvdnav.so.0.3.0 lrwxrwxrwx 1 root root 13 Aug 15 2004 libgcc_s.so -> libgcc_s.so.1 -rw-r--r-- 1 root root 33508 Jan 8 2005 libgcc_s.so.1 -rw-r--r-- 1 root root 187244 Jan 8 2005 libglcddrivers.so -rw-r--r-- 1 root root 42296 Jan 8 2005 libglcdgraphics.so lrwxrwxrwx 1 root root 21 Aug 28 2003 libglib-1.2.so.0 -> libglib-1.2.so.0.0.10 -rwxr-xr-x 1 root root 138236 Jan 8 2005 libglib-1.2.so.0.0.10 lrwxrwxrwx 1 root root 18 Aug 28 2003 libid3tag.so.0 -> libid3tag.so.0.1.0 -rwxr-xr-x 1 root root 57932 Jan 8 2005 libid3tag.so.0.1.0 lrwxrwxrwx 1 root root 17 Aug 28 2003 libjpeg.so.62 -> libjpeg.so.62.0.0 -rwxr-xr-x 1 root root 121800 Jan 8 2005 libjpeg.so.62.0.0 lrwxrwxrwx 1 root root 23 Nov 20 2004 liblirc_client.so.0 -> liblirc_client.so.0.0.0 -rwxr-xr-x 1 root root 15144 Jan 8 2005 liblirc_client.so.0.0.0 -rwxr-xr-x 1 root root 144168 Jan 9 2005 libm-2.3.4.so lrwxrwxrwx 1 root root 15 Aug 28 2003 libmad.so.0 -> libmad.so.0.1.0 -rwxr-xr-x 1 root root 88224 Jan 8 2005 libmad.so.0.1.0 lrwxrwxrwx 1 root root 13 Aug 22 2004 libm.so.6 -> libm-2.3.4.so -rwxr-xr-x 1 root root 65604 Jan 9 2005 libnsl-2.3.4.so lrwxrwxrwx 1 root root 15 Aug 22 2004 libnsl.so.1 -> libnsl-2.3.4.so -rwxr-xr-x 1 root root 14524 Jan 9 2005 libnss_dns-2.3.4.so lrwxrwxrwx 1 root root 19 Aug 22 2004 libnss_dns.so.2 -> libnss_dns-2.3.4.so -rwxr-xr-x 1 root root 32760 Jan 9 2005 libnss_files-2.3.4.so lrwxrwxrwx 1 root root 21 Aug 22 2004 libnss_files.so.2 -> libnss_files-2.3.4.so lrwxrwxrwx 1 root root 15 Aug 28 2003 libogg.so.0 -> libogg.so.0.4.0 -rwxr-xr-x 1 root root 15008 Jan 8 2005 libogg.so.0.4.0 -rwxr-xr-x 1 root root 60456 Jan 9 2005 libpthread-2.3.4.so lrwxrwxrwx 1 root root 19 Aug 22 2004 libpthread.so.0 -> libpthread-2.3.4.so -rwxr-xr-x 1 root root 60876 Jan 9 2005 libresolv-2.3.4.so lrwxrwxrwx 1 root root 18 Aug 22 2004 libresolv.so.2 -> libresolv-2.3.4.so -rwxr-xr-x 1 root root 25832 Jan 9 2005 librt-2.3.4.so lrwxrwxrwx 1 root root 14 Aug 22 2004 librt.so.1 -> librt-2.3.4.so lrwxrwxrwx 1 root root 19 Aug 28 2003 libsndfile.so.1 -> libsndfile.so.1.0.1 -rwxr-xr-x 1 root root 267024 Jan 8 2005 libsndfile.so.1.0.1 lrwxrwxrwx 1 root root 18 Aug 15 2004 libstdc++.so.6 -> libstdc++.so.6.0.1 -rwxr-xr-x 1 root root 880368 Jan 8 2005 libstdc++.so.6.0.1 -rwxr-xr-x 1 root root 7592 Jan 9 2005 libutil-2.3.4.so lrwxrwxrwx 1 root root 16 Aug 22 2004 libutil.so.1 -> libutil-2.3.4.so lrwxrwxrwx 1 root root 22 Aug 28 2003 libvorbisfile.so.3 -> libvorbisfile.so.3.0.0 -rwxr-xr-x 1 root root 23636 Jan 8 2005 libvorbisfile.so.3.0.0 lrwxrwxrwx 1 root root 18 Aug 28 2003 libvorbis.so.0 -> libvorbis.so.0.2.0 -rwxr-xr-x 1 root root 141149 Aug 28 2003 libvorbis.so.0.2.0 lrwxrwxrwx 1 root root 13 Aug 28 2003 libz.so.1 -> libz.so.1.1.4 -rwxr-xr-x 1 root root 50224 Jan 8 2005 libz.so.1.1.4
autofs: -rw-r--r-- 1 root root 7575 Sep 7 2003 lookup_file.so -rw-r--r-- 1 root root 6396 Sep 7 2003 lookup_multi.so -rw-r--r-- 1 root root 6579 Sep 7 2003 lookup_nisplus.so -rw-r--r-- 1 root root 8513 Sep 7 2003 lookup_program.so -rw-r--r-- 1 root root 5639 Sep 7 2003 lookup_userhome.so -rw-r--r-- 1 root root 6337 Sep 7 2003 lookup_yp.so -rw-r--r-- 1 root root 5433 Sep 7 2003 mount_afs.so -rw-r--r-- 1 root root 7451 Sep 7 2003 mount_autofs.so -rw-r--r-- 1 root root 7549 Sep 7 2003 mount_bind.so -rw-r--r-- 1 root root 7627 Sep 7 2003 mount_changer.so -rw-r--r-- 1 root root 6209 Sep 7 2003 mount_generic.so -rw-r--r-- 1 root root 8752 Sep 7 2003 mount_nfs.so -rw-r--r-- 1 root root 12849 Sep 7 2003 parse_sun.so
gconv: -rw-r--r-- 1 root root 45568 Jan 9 2005 gconv-modules -rwxr-xr-x 1 root root 7528 Jan 9 2005 IBM850.so -rwxr-xr-x 1 root root 7308 Jan 9 2005 ISO8859-15.so -rwxr-xr-x 1 root root 5612 Jan 9 2005 ISO8859-1.so -rwxr-xr-x 1 root root 7044 Jan 9 2005 UNICODE.so
keymap: -rw-rw-rw- 1 root root 2823 Jun 26 2001 qwertz
locale: -rw-r--r-- 1 root root 554016 Jan 9 2005 locale-archive
mc: -rwxr-xr-x 1 root root 8459 Sep 14 2003 cons.saver -rw-r--r-- 1 root root 12045 Sep 14 2003 mc.ext -rw-r--r-- 1 root root 2429 Jan 22 2005 mc.ini -rw-r--r-- 1 root root 1636 Sep 14 2003 mc.lib -rw-r--r-- 1 root root 1400 Sep 14 2003 mc.menu drwxr-xr-x 2 root root 1184 Aug 23 2003 syntax
modules: drwxr-xr-x 4 root root 480 Aug 28 08:06 2.6.12
samba: drwxr-xr-x 2 root root 64 Nov 23 2003 auth drwxr-xr-x 2 root root 128 Nov 23 2003 charset drwxr-xr-x 2 root root 64 Nov 23 2003 idmap -rw-r--r-- 1 root root 131072 Nov 23 2003 lowcase.dat drwxr-xr-x 2 root root 64 Nov 23 2003 pdb drwxr-xr-x 2 root root 64 Nov 23 2003 rpc -rw-r--r-- 1 root root 131072 Nov 23 2003 upcase.dat -rw-r--r-- 1 root root 65536 Nov 23 2003 valid.dat drwxr-xr-x 2 root root 320 Nov 23 2003 vfs
terminfo: drwxr-xr-x 2 root root 96 Jun 26 2001 l drwxr-xr-x 2 root root 128 Jun 26 2001 x
vdr: -rwxr-xr-x 1 root root 158392 Oct 3 17:06 libvdr-dvd.so.1.3.34 -rwxr-xr-x 1 root root 136932 Oct 3 17:06 libvdr-femon.so.1.3.34 -rwxr-xr-x 1 root root 207328 Oct 3 17:06 libvdr-graphlcd.so.1.3.34 -rwxr-xr-x 1 root root 267380 Oct 3 17:06 libvdr-graphtft.so.1.3.34 -rwxr-xr-x 1 root root 24372 Oct 3 17:06 libvdr-joystick.so.1.3.34 -rwxr-xr-x 1 root root 60308 Oct 3 17:06 libvdr-lcdproc.so.1.3.34 -rwxr-xr-x 1 root root 325780 Oct 3 17:06 libvdr-mp3.so.1.3.34 -rwxr-xr-x 1 root root 19852 Oct 3 17:06 libvdr-mpex.so.1.3.34 -rwxr-xr-x 1 root root 400752 Oct 3 17:06 libvdr-vcd.so.1.3.34 -rwxr-xr-x 1 root root 20732 Oct 3 17:06 libvdr-vdrinside.so.1.3.34
zoneinfo: drwxr-xr-x 2 root root 96 Jul 26 2003 Europe
- Using uclibc and only busybox' stripped down sysv init
implementation lead to boot time of 35 sec on my 200MHz Pentium-MMX with a mostly static kernel (only module is lirc). Basic VDR's CPU utilization is at 10%. I found this impressive... 13secs is due to BIOS and grub.
20 seconds here.
best regards Alfred
Hi,
short update:
isn't available anymore, instead, I did a cleaner patch against 1.3.35, it's available here:
http://arbeit.hilses.de/hw/vdr-1.3.35-isoc-scanf-compat.patch
it cleans up (s)scanf invocations. Care has been taken to free all allocated memory. Maybe even under circumstances where the original version would leak, can't really tell. The source can now be compiled against uclibc with these patches applied and some occurence of "lround (...)" rewritten to "rint(...)" (not in the patch, there may be other ways to archive the same).
BTW, there was a note in timers.c regarding mysterious things happening "if the last %a argument results in an empty string". It possibly won't result in an empty string, however, because there isn't even a match under these circumstances, so no memory gets allocated and sscanf shouldn't count this as a match in its return value. Maybe I'm just too ignorant to the the problem here...
In my patch, this code path is cleaned, but I hope I didn't delete something still necessary (I don't think so, but you never know).
-hwh