| Author |
Message |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Thu 20 Jan 2011, 11:01 Post subject:
|
|
yes you have come across another of the many programs that is riddled with "GNU=isms" It would probably need getline instead of gnu_getline (may need to change the constructs a bit) ... comment out getdelim in the find code so that it uses the diet version and define the types (pid_t and time_t) with their corresponding types such as:
#define pid_t int //maybe unsigned int?
As you can see, it takes some time and work to get things to work with dietlibc (including making use of libowfat sometimes)
see my efforts here:
http://code.google.com/p/diet-binaries/downloads/list
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
amigo
Joined: 02 Apr 2007 Posts: 1757
|
Posted: Thu 20 Jan 2011, 13:24 Post subject:
|
|
Karl, you need to get your CFLAGS all together like this:
CFLAGS="-ffunction-sections -fdata-sections -Os -D _BSD_SOURCE"
Otherwise only the last part is being set.
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2675 Location: Kiel,Germany
|
Posted: Thu 20 Jan 2011, 19:47 Post subject:
|
|
Finally I got me a find-4.1.20 of 92kb (/1.024 /1.024 = 87kb) :
| Code: | ./configure LDFLAGS="-static -Wl,--gc-sections,--as-needed" CFLAGS="-ffunction-sections -fdata-sections -Os -D _BSD_SOURCE" CC="diet gcc -nostdinc"
| - which behaves like before -
| Quote: | l10nflist.c .text._nl_make_l10nflist+0x1b0): undefined reference to `stpcpy'
l10nflist.c .text._nl_make_l10nflist+0x1cc): undefined reference to `stpcpy'
../intl/libintl.a(l10nflist.o):l10nflist.c .text._nl_make_l10nflist+0x1f8): more undefined references to `stpcpy' follow
collect2: ld returned 1 exit status
make[3]: *** [xargs] Error 1
make[3]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20/xargs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20/xargs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20'
make: *** [all] Error 2
23:16 findutils-4.1.20 # strip /COMPILE/FINDUTILS/findutils-4.1.20/find/find
23:25 findutils-4.1.20 # ls -s /COMPILE/FINDUTILS/findutils-4.1.20/find/find
92 /COMPILE/FINDUTILS/findutils-4.1.20/find/find
23:26 findutils-4.1.20 # file /COMPILE/FINDUTILS/findutils-4.1.20/find/find
/COMPILE/FINDUTILS/findutils-4.1.20/find/find: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
23:31 findutils-4.1.20 # |
with outcommented lines for "stpcpy" at getline.h+.c , l10nflist.c , dcigettext.c and for "mbrtowc" at quotearg.c
This find is working though, but locate and xargs did not compile (as quoted above).
And find is still larger than the original initrd.gz-find.
Further it turned out that busybox more and less do not work in the rdsh like they use to at the prompt or in X normally : they rush to the very end of the file. e3 is already a very sophisticated and good editor but e3vi ( trying to exit e3vi with Ctrl-z) gave me a hang and the kernel did not reboot though i passed a panic=40 param to the grub commandline.
The busybox modinfo also needs two tweaks in the init-script :
| Code: | [ "`modinfo aufs | grep vermagic 2>/dev/null`" = "" ]
[ "`modinfo ppa | grep vermagic 2>/dev/null`" != "" ] |
because busybox modinfo does not produce an error exit code if the module is not found .
Also the commands reboot,poweroff and halt do not work simply typed at the commandline. I'tll try again with umount -ar , fusermount -z -u , umount-FULL -i -n -l , kill 0 -3 -9 as it is mentioned at rc.shutdown.
waitmax and fsck are the only binaries that are not used by the scripts (e2fsck bianry is used) and bb-fsck hasn't got ext4 support.
Btw : Which version control system and licence to choose at code.google ? I have a few on skydrive at live/hotmail but to provide source for eg. kernels 50mb are not enough ( splitted into drivers and else ) and the navigation there is quite uncomfortable.
|
|
Back to top
|
|
 |
PANZERKOPF
Joined: 16 Dec 2009 Posts: 249 Location: Earth
|
Posted: Thu 20 Jan 2011, 20:11 Post subject:
|
|
| Karl Godt wrote: |
And find is still larger than the original initrd.gz-find.
|
Because initrd's find is compressed with UPX.
e2fsck, resize2fs,fsck also are compressed with UPX.
You can see an UPX signature at offset 078h-07Ah.
_________________ SUUM CUIQUE.
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Thu 20 Jan 2011, 20:37 Post subject:
|
|
for stpcpy try adding -lcompat to the end of your LDFLAGS and or this in the includes of the referenced .c file
#include <string.h>
for mbrtowc try adding this to the list of includes
#include "dietlocale.h" //maybe
#include <wchar.h> //for sure
#include <errno.h> //maybe
maybe try this busybox patch pack that I cobbled together to use the old full e2fsprogs from various sources using chicken wire and duct tape.
Notes:
It has some compile warnings, but worked ok
Needs updated to new busybox constructs and ext4 support
I didn't add in the full usage text
| Description |
|

Download |
| Filename |
add_e2fsprogs_old.tar.gz |
| Filesize |
254.16 KB |
| Downloaded |
206 Time(s) |
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2675 Location: Kiel,Germany
|
Posted: Thu 20 Jan 2011, 21:53 Post subject:
|
|
| Quote: | | maybe try this busybox patch pack that I put together to use the old full e2fsprogs |
Already wondered how to enable them at the menuconfig .
Think I've found it :
| Quote: | @@ -469,6 +469,10 @@
coreutils/ \
coreutils/libcoreutils/ \
debianutils/ \
+ e2fsprogs/e2p/ \
+ e2fsprogs/ext2fs/ \
+ e2fsprogs/blkid/ \
+ e2fsprogs/uuid/ \
e2fsprogs/ \
editors/ \
findutils/ |
will take me a while to test it .. there are already 17 _install inside the source dir ... I think I've to delete halv of them ... even some DOTconfigs .... I am getting confused
| Quote: | | Because initrd's find is compressed with UPX. |
Next interesting news :
http://upx.sourceforge.net/
upx EXECUTABLE seems to be working pretty good
87kb > 46kb
| Quote: | | for stpcpy try adding -lcompat to the end of your LDFLAGS and or this in the includes of the referenced .c file |
OK : I'll start that again in 10 hours ... need some sleep now .
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2675 Location: Kiel,Germany
|
Posted: Fri 21 Jan 2011, 22:30 Post subject:
|
|
| Code: | | ./configure LDFLAGS="-static -Wl,--gc-sections,--as-needed -lcompat" CFLAGS="-ffunction-sections -fdata-sections -Os -D _BSD_SOURCE" CC="diet gcc -nostdinc" |
and adding #include <string.h> did not help . <string.h> had been only [missing] at getline.c+.h . This time I commented
| Code: | #ifdef _GNU_SOURCE
int vasprintf(char **strp, const char *fmt, va_list ap);
// for FIDUTILS // ssize_t getline(char **lineptr, size_t *n, FILE *stream);
// for FIDUTILS // ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
#endif | at dietlibc/include/stdio.h and commented the static definitions for stpcpy : Find did compile same size 122/87/46kb (staticdietlibc/strip/upx -7) , xargs and locate not
| Quote: | l10nflist.c .text._nl_make_l10nflist+0x1cc): undefined reference to `stpcpy'
../intl/libintl.a(l10nflist.o):l10nflist.c .text._nl_make_l10nflist+0x1f8): more undefined references to `stpcpy' follow
collect2: ld returned 1 exit status
make[3]: *** [xargs] Error 1
make[3]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20/xargs'
make[2]: *** [all-recursive] Error 1 |
I made a "fancy-full-blown--long-options-busybox" of statically 844kb and with lzma compressed drivers the initrd.gz became 1363kb . But busybox less and more seem to need nvidiafb or intel-agp support to work like they normally do even at the prompt. ed is described at the menuconfig from year 1970 and "really evil" and somehow it's true : working, but uncomfortable.
bb modprobe seems to ignore module.alias even if support for modules.alias is enabled ( perhaps just for depmod )
| Code: |
MODALIASES="`cat /sys/bus/pci/devices/*/modalias`" #important, save to variable before loop.
for ONEMODALIAS in $MODALIASES
do
modprobe -v $ONEMODALIAS #-v means verbose.
[ $? -eq 0 ] && echo -n "." > /dev/console
done
for ONEHID in `grep -o 'MODALIAS=hid:[^ ]*' /tmp/uevents.log | cut -f 2 -d '=' | tr '\n' ' '`
do
modprobe $ONEHID
done |
| Quote: | modprobe: module pci:v000010DEd00000182sv0000107Dsd00002922bc03sc00i00 not found in modules.dep
modprobe: module hid:b0003v0000413Cp00002010 not found in modules.dep |
One good new : busybox eject is working with creating a symlink to /dev/sr0 from /dev/cdrom .
Booting time : 10 seconds for loading drivers.ko.lzma , +18 seconds for searching puppy files (500GB/12-83/4-82 partitions) , +45 seconds after [Enter] to load the pupsave-2fs and drivers.ko for reaching jwm .
And this is busybox-linker.sh :
| Code: | #!/bin/bash
cd `pwd`
./busybox > bbcommands
cat bbcommands | sed '/^$/d' > bbcommands2
BEGIN=`cat -n bbcommands2 | grep Currently | tr -s " " | tr "\t" " " | cut -f 2 -d " "`
LINES=`cat -n bbcommands2 | wc -l`
COMMANDBLOCKLINES=`expr $LINES - $BEGIN`
COMMANDBLOCK=`cat bbcommands2 | tail -n $COMMANDBLOCKLINES | tr ',' ' ' | tr -s " " | tr " " "\n" | tr "\t" " " | tr -d " " | sed '/^$/d'`
for ONELINE in $COMMANDBLOCK ; do
ln -s busybox $ONELINE
done
rm bbcommands
rm bbcommands2 |
and bb-unlinker.sh :
| Code: | #!/bin/bash
cd `pwd`
file * | grep symbolic > links
cat links | grep busybox > busyboxlinks
cat busyboxlinks | cut -f 1 -d ':' >busyboxlinks2
BBLINKS=`cat busyboxlinks2`
for ONELINE in "$BBLINKS" ;do
rm $ONELINE
done
rm links
rm busyboxlinks
rm busyboxlinks2 |
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Sat 22 Jan 2011, 00:14 Post subject:
|
|
| Karl Godt wrote: | I made a "fancy-full-blown--long-options-busybox" of statically 844kb and with lzma compressed drivers the initrd.gz became 1363kb . But busybox less and more seem to need nvidiafb or intel-agp support to work like they normally do even at the prompt. ed is described at the menuconfig from year 1970 and "really evil" and somehow it's true : working, but uncomfortable.
bb modprobe seems to ignore module.alias even if support for modules.alias is enabled ( perhaps just for depmod )
| Even if you do allyesconfig, you still need to manually enable full modutils - otherwise it uses the small version which operates differently and thus uses bb.* prefix
Re: look of more/less - I thought Barry's kernels were compiled with vesafb only ... I need to check that, b/c it had prevented me from testing some stuff before.
by the way there is a new feature that wasn't documented very well:
I use this to place all of the links in /usr/local/bin so that if the full version exists, it gets used instead(due to the $PATH precedence)
| Code: | | for x in `busybox --list`; do ln -s busybox $x;done |
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2675 Location: Kiel,Germany
|
Posted: Sat 22 Jan 2011, 07:25 Post subject:
|
|
Really works at 1.17.1 compiled statically and dynamicallly , and it seems with and without --long-options enabled .
The puppy bb-1.15.0 doesn't have it .
bb `umount -l` works nicely at the rdsh to unmount everything one after another for doing the filesystemcheck .
bb `reboot -f` worked , too.
bb `lspci -k` could replace `elspci -l` .
|
|
Back to top
|
|
 |
PANZERKOPF
Joined: 16 Dec 2009 Posts: 249 Location: Earth
|
Posted: Sat 22 Jan 2011, 17:07 Post subject:
|
|
| technosaurus wrote: |
Re: look of more/less - I thought Barry's kernels were compiled with vesafb only |
Barry's kernels were compiled with vesafb but without console framebuffer. When we boot using vga=??? we get a black screen ( we should blindly type "modprobe fbcon" to get a working console.)
Barry's config:
CONFIG_FRAMEBUFFER_CONSOLE=m
Should be:
CONFIG_FRAMEBUFFER_CONSOLE=y
_________________ SUUM CUIQUE.
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Sat 22 Jan 2011, 17:45 Post subject:
|
|
| PANZERKOPF wrote: | Barry's kernels were compiled with vesafb but without console framebuffer. When we boot using vga=??? we get a black screen ( we should blindly type "modprobe fbcon" to get a working console.)
Barry's config:
CONFIG_FRAMEBUFFER_CONSOLE=m
Should be:
CONFIG_FRAMEBUFFER_CONSOLE=y | ahh - so that may be why I could never get SDL-fb, DirectFB, QT-embedded,gtk2-fb, fbui and others to work?
forgot to mention that waitmax can be replace with busybox timeout with a very minor rewrite of the scripts using waitmax
2 more busybox addons (work but still need some work - see notes)
| Description |
|

Download |
| Filename |
add_minimp3.tar.gz |
| Filesize |
25.08 KB |
| Downloaded |
199 Time(s) |
| Description |
|

Download |
| Filename |
add_guess_fstype.tar.gz |
| Filesize |
12.27 KB |
| Downloaded |
195 Time(s) |
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
Last edited by technosaurus on Sat 22 Jan 2011, 20:51; edited 1 time in total
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2675 Location: Kiel,Germany
|
Posted: Sat 22 Jan 2011, 20:40 Post subject:
|
|
Kernel 2.6.30 is really tricky with framebuffer and video drivers . Until now I've compiled .6-.9 at least 11 times and only 2 are working ok with my hardware to show the linux-penguin . This has also additionally the older IDE drives support enabled.
| Description |
|

Download |
| Filename |
DOTconfig-2.6.30.9-KRG-i386-compiled-AcerLaptop-rev2.gz |
| Filesize |
26.74 KB |
| Downloaded |
194 Time(s) |
|
|
Back to top
|
|
 |
PANZERKOPF
Joined: 16 Dec 2009 Posts: 249 Location: Earth
|
Posted: Sun 23 Jan 2011, 10:57 Post subject:
|
|
| technosaurus wrote: | ahh - so that may be why I could never get SDL-fb, DirectFB, QT-embedded,gtk2-fb, fbui and others to work?
|
This may be a reason because each of them needs framebuffer.
I attached my configuration of Barry's kernel 2.6.33.2 used in Quirky and other Puppyes. Framebuffer console is enabled.
| Description |
|

Download |
| Filename |
DOTconfig-K2.6.33.2-PZ.gz |
| Filesize |
22.69 KB |
| Downloaded |
213 Time(s) |
_________________ SUUM CUIQUE.
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2675 Location: Kiel,Germany
|
Posted: Mon 31 Jan 2011, 10:06 Post subject:
|
|
I got `less` and `more` to work in the rdsh :
It needs bb-getty [ and login ] with more than /etc/shadow [ packed group,gshadow,passwd also into it ] .
getty 38400 tty[1-4] changes the output of `tty` from /dev/console to /dev/tty[1-4] and `less/more` are working correctly.
They do not work on '/dev/tty0' though I added /dev/tty and /dev/tty0 to the initrd-archive [ also /dev/video /dev/video0 /dev/fb1 ] .
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2675 Location: Kiel,Germany
|
Posted: Mon 31 Jan 2011, 19:25 Post subject:
|
|
It seems that bb-lspci is not able to replace elspci because it shows [ like lspci-FULL ] only the 4 middle chars of /sys/bus/pci/devices/*/class , while elspci shows the last 6 chars .
| Quote: | #w001 NOTE: in 4.1.2 I use elspci to determine if yenta-socket needs to be loaded.
#if so, need a delay -- i used sleep 2 -- before elspci can be used to detect 0C0310
#pci interface -- in the case of my pccard-usb adaptor, which needs ohci-hcd.
#my new code below will need to be fixed for that situation...
#w003 maybe this will fix... look for 'bc0Csc03i10' in modalias...
MODALIASES="`cat /sys/bus/pci/devices/*/modalias`" #important, save to variable before loop.
if [ "`echo "$MODALIASES" | grep 'bc0Csc03i10'`" != "" ];then
modprobe yenta-socket
[ $? -eq 0 ] && sleep 2
fi |
| Quote: | #v423 k2.6.29.6 dmesg has warning that ehci-hcd should load before uhci-hcd and ohci-hid
# this is contrary to my understanding all these years, but oh well, let's do it...
#ELSPCI="`elspci -l`" #jesses great little utility.
#[ "`echo "$ELSPCI" | grep '0C0320'`" != "" ] && modprobe ehci-hcd |
| Code: | #[ "`echo "$ELSPCI" | grep '0C0310'`" != "" ] && modprobe ohci-hcd
#[ "`echo "$ELSPCI" | grep '0C0300'`" != "" ] && modprobe uhci-hcd |
These two sniplets could replace elspci in the initrd.gz :
| Code: | PCICLASS="`cat /sys/bus/pci/devices/*/class`"
if [ "`echo "$PCICLASS" | grep '0x0c0320'`" != "" ];then
modprobe ehci-hcd
[ $? -eq 0 ] && sleep 2
fi |
or
| Code: | #CURDIR=`pwd`
#cd /sys/bus/pci/devices
#find * -follow -maxdepth 5 -name class -exec realpath {} \; 2>/dev/null > /tmp/FIND-CLASS ## needs bb-realpath enabled
#F=`cat /tmp/FIND-CLASS | sort -u`
#if [ "`for OF in "$F"; do grep '0x0c0320' $OF;done`" != "" ]; then modprobe ehci-hcd; fi
## rm /tmp/FIND-CLASS
#cd "$CURDIR" |
I had a look at the source of bb-lspci and elspci but have no idea how to enable 6/8 char output .
|
|
Back to top
|
|
 |
|