From dishui at gmail.com Sun Apr 1 20:08:13 2007 From: dishui at gmail.com (kaimi) Date: Mon, 2 Apr 2007 11:08:13 +0800 Subject: login success only once In-Reply-To: <200703301903.30874.vda.linux@googlemail.com> References: <200703301903.30874.vda.linux@googlemail.com> Message-ID: On 3/31/07, Denis Vlasenko wrote: > > On Friday 30 March 2007 04:44, kaimi wrote: > > hi, all > > in my inittab, "tts/0::respawn:/bin/login" works well at the > startup, > > but in the shell, if run login manually, there's promption for user > name, > > after input the user name, there's no promption for password, the system > is > > zombie, the inittab is followed, any ideas? thanks > > > > tts/0::respawn:/bin/login > > hmm... works for me: > > shadow:~# login root > Password: > Linux 2.6.18.1_64smp_ipv6. > <*> Executing /etc/profile from '-bash'. Command line: '' > * PATH=/bin:/usr/bin > * Setting umask: 022 > * Setting some environment variables > * Setting default shell prompts > <*> Finished /etc/profile > <*> Executing ~/.profile from '-bash'. Command line: '' > * PATH='/root/bin:/bin:/usr/bin' > * Locale: russian koi8r > <*> Finished ~/.profile > shadow:~# exit > logout > shadow:~# > > Also works: > > shadow:~# login > shadow login: root > Password: > Linux 2.6.18.1_64smp_ipv6. > <*> Executing /etc/profile from '-bash'. Command line: '' > ...same... > > Can you dig a bit deeper? Where exactly it fails for you? > -- > vda > my /etc/profile followed: export LD_LIBRARY_PATH=/lib:/usr/lib echo "export PATH in /etc/profile" export PATH=/bin:/sbin:/usr/bin:/usr/sbin the startup messages followed: ARM login: root Password: export PATH in /etc/profile [root at ARM ~]# logout ARM login: root Password: export PATH in /etc/profile [root at ARM ~]# login ARM login: root you can see, at startup, login works, it works after logout as well, but it's failed if login on shell prompts. how to trace the exact point? thanks -- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070402/381dc52b/attachment.htm From levend.sayar at karel.com.tr Mon Apr 2 02:05:22 2007 From: levend.sayar at karel.com.tr (Levend Sayar) Date: Mon, 2 Apr 2007 12:05:22 +0300 Subject: Where is my shell ? Message-ID: <007701c77506$0f58f450$6402a8c0@nucleus> Hi, all I am trying to port Linux 2.4.32 to 386ex based embedded board. This is my very first attempt. I am using 4MB initrd image as root fs. Everything goes fine. I compiled busybox as a static image and install to my initrd image. I want to get a shell but nothing written to my console from busybox. AFAIK, /sbin/init is loaded by the kernel successfully, since I added some printk messages to trace what's going on. I deleted that lines from the log below for clearity. But somehow I couldn't get a user space app to write anything to the console. gcc 3.3.3 Busybox 1.1.0 glibc 2.4 etc/inittab content : ::sysinit:/etc/init.d/rcS ::respawn:-/bin/sh etc/init.d/rcS content : #!/bin/sh /bin/mount -t proc proc /proc console output : Uncompressing Linux... Ok, booting the kernel. Linux version 2.4.32 (root at ds300)(gcc version 3.3.3 (SuSE Linux)) #35 Wed Mar 28 15:13:39 EEST 2007 BIOS-provided physical RAM map: BIOS-e801: 0000000000000000 - 000000000009f000 (usable) BIOS-e801: 0000000000100000 - 0000000000a00000 (usable) 10MB LOWMEM available. On node 0 totalpages: 2560 zone(0): 2560 pages. zone(1): 0 pages. zone(2): 0 pages. DMI not present. Kernel command line: root=/dev/ram rw Initializing CPU#0 Calibrating delay loop... 4.04 BogoMIPS Memory: 4832k/10240k available (507k kernel code, 5020k reserved, 93k data, 40k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... No. Dentry cache hash table entries: 2048 (order: 2, 16384 bytes) Inode cache hash table entries: 1024 (order: 1, 8192 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 4096 (order: 2, 16384 bytes) CPU: 386 Checking 'hlt' instruction... disabled Checking for popad bug... OK. POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Starting kswapd pty: 256 Unix98 ptys configured Serial driver version 5.05c (2001-07-08) with no serial options enabled ttyS00 at 0x03f8 (irq = 4) is a 16450 ttyS01 at 0x02f8 (irq = 3) is a 16450 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize RAMDISK: ext2 filesystem found at block 0 RAMDISK: Loading 4096 blocks [1 disk] into ram disk... done. Freeing initrd memory: 4096k freed EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended VFS: Mounted root (ext2 filesystem). Freeing unused kernel memory: 40k freed --Nothing written anymore from this point ... _lvnd_ (^_^) ----------------------------------------------------------------------- Bu mesaj Karel MailScanner ile tehlikeli icerik ve virus kontrolunden gecirilmistir. KAREL A.S. - Bilgi Teknolojileri Bolumu This message has been scanned for viruses and dangerous content by Karel MailScanner, and is believed to be clean. KAREL A.S. - Information Technologies Department From jsimmons at infradead.org Mon Apr 2 13:00:07 2007 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Apr 2007 21:00:07 +0100 (BST) Subject: busybox lockups. In-Reply-To: <200703301914.49781.vda.linux@googlemail.com> References: <200703301914.49781.vda.linux@googlemail.com> Message-ID: > On Thursday 29 March 2007 22:23, James Simmons wrote: > > I'm compiling busy box 1.4.2 with glibc 2.3.6 on a cramfs image. I can > > run the commands but once the command is done executing it just locks > > up before exiting the application. This is a on a ARM TS 7200 board. Any > > ideas why? > > Can you give more info - like, what shell do you use? > Does busybox with same .config work on i386? etc... > > If all else fails, add debug prints into simplest attlet > (like sleep) and find out where it stops. Sorry about the delayed response. The shell I'm using is ash. Yes it does with 1.4.2 on i386. Busybox will work with uClibc as well with no problem. The issue is only ARM with glibc 2.3.6 and busybox 1.4.2. I also back pedel to busybox 1.00 and it worked with glibc 2.3.6. From natanael.copa at gmail.com Tue Apr 3 02:31:07 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Tue, 03 Apr 2007 11:31:07 +0200 Subject: [PATCH] Support for find -group Message-ID: <1175592667.3668.28.camel@localhost> Hi! Attatched is a patch for support of find -group. One patch is against release 1.5.0 and the other is against current svn. While I was there, I changed the uid type from int to uid_t and fixed the compiler warning below (just declare the func as static fixed it). findutils/find.c: In function `parse_params': findutils/find.c:417: warning: no previous prototype for 'alloc_action' Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.5.0-find-group.patch Type: text/x-patch Size: 2250 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070403/2e2eff5a/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-svn-find-group.patch Type: text/x-patch Size: 2261 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070403/2e2eff5a/attachment-0001.bin From mats.andersson64 at comhem.se Tue Apr 3 11:43:32 2007 From: mats.andersson64 at comhem.se (Mats Erik Andersson) Date: Tue, 03 Apr 2007 20:43:32 +0200 Subject: [REWRITE] hexdump.c rewritten to use getopt32 Message-ID: <1175625812.7124.40.camel@localhost> Fellow code workers, let me post a recoding of hexdump.c that now uses the functionality of getopt32. Since the difference file is slightly larger than the rewritten code, I post the full source. Using bloat-o-meter, a decrease of 47 bytes is calculated. However, due to the inherent construction of getopt32, which scrambles any order of option flags, this version of hexdump will only allow one hard coded ordering for output: at present -b -c -d -o -x, one row after the other. Is this really a serious shortcoming? For the moment I offer the code as a starting point for further discussion. Mats E Andersson -------------- next part -------------- A non-text attachment was scrubbed... Name: hexdump.c Type: text/x-csrc Size: 2816 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070403/83dace4b/attachment.c From natanael.copa at gmail.com Wed Apr 4 01:50:59 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 04 Apr 2007 10:50:59 +0200 Subject: [PATCH] find -group (update) -depth Message-ID: <1175676659.10538.13.camel@localhost> Hi, The attatched patch contains a minor update to the previous find -group patch I posted: http://www.busybox.net/lists/busybox/2007-April/026976.html The change is that it now uses if (parm == PARM_group) instead of if (strcmp(arg, "-group") == 0) I didn't notice that change in the svn before. Sorry. This patch also adds the -depth option to process contens in dirs before processing the dir itself (useful when deleting stuff) I intend to look at -delete and -path/-wholename but i dont know if I should post incremental patches or one big with all additions? Or should I wait until this patch have been commited? Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: find-group-depth.patch Type: text/x-patch Size: 3643 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070404/9771db66/attachment.bin From mwigge at marcant.net Wed Apr 4 04:53:59 2007 From: mwigge at marcant.net (Markus Wigge) Date: Wed, 04 Apr 2007 13:53:59 +0200 Subject: add FreeWRT to Pruducts list Message-ID: <461391D7.9010905@marcant.net> Hi, I just had a look at your products list and found OpenWRT mentioned there. As FreeWRT is a fork of it maybe someone can place a link to it too. (www.freewrt.org) bye, Markus From Steven.Geerts at thomson.net Wed Apr 4 05:41:46 2007 From: Steven.Geerts at thomson.net (Geerts Steven) Date: Wed, 4 Apr 2007 14:41:46 +0200 Subject: adding applications Message-ID: <1F5308C5923F3B4DAA51D189BF255006021B3ABD@edgmsmail01.eu.thmulti.com> All I would like to know how I can add dependencies when building extra packages. For example I need to build an appilication, but before building this application I need to have a certain library. Is this been taking care of by buildroot or do I need to specify this. Is the following possible to be sure that the libxxx is build before building the test application? ifeq ($(strip $(BR2_PACKAGE_TEST)),y) TARGETS+= libxxx test Endif Or is this specified in the Config.in? Best regards steven -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070404/2811f523/attachment.htm From strong.qu at amd.com Wed Apr 4 07:07:47 2007 From: strong.qu at amd.com (Strong Qu) Date: Wed, 4 Apr 2007 10:07:47 -0400 Subject: mount permission denied though server side already authenticated the request Message-ID: <5A15D86EDE7573448683D46FC9FC8DD6014CB577@torcaexmb4.atitech.com> I'm new of using busybox. Detail as follow: ARM V6 platform Linux 2.6.10, Busybox 1.01, ash shell, server side is Ubuntu 6.10, nfs exports *(rw, all_squash) On target platform run: # mount -o nolock 192.168.1.2:/home/user_1/share /mnt/shannon Root has read/write/exec right in /mnt/pool. 192.168.1.2 is IP of shannon, the nfs server. I got error as: mount: permission denied. (are you root?) On the server side I run: # tail -f /var/log/syslog It shows: Mar 30 11:01:13 shannon mounted[4330]: authenticated mount from 192.168.1.3 for /home/user_1/share (/home/user_1/share) And on other x86/linux I can mount the nfs without any trouble. I did not find nfsmount on the target board. Is it a must for nfs mount? Thanks. -Strong -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070404/4c520de5/attachment.htm From niteblade at gmx.net Wed Apr 4 10:15:05 2007 From: niteblade at gmx.net (Kai Schwenzfeier) Date: Wed, 4 Apr 2007 19:15:05 +0200 Subject: [PATCH] un-desktopize find Message-ID: <20070404171505.GS12102@Moria.local> 15:45 hi there 15:52 i've got a problem with building busybox from within a busybox environment. the Makefiles use -prune option with find, but the busybox find implementation doesnt seem to understand -prune 15:52 any ideas? ^^ 15:56 kasc, USE_DESKTOP( ACTS(prune)) 15:56 kasc, do away with this silly CONFIG_DESKTOP thing for find and instead add an option for the args of find that are currently hidden with DESKTOP 16:07 kasc, the same for all other args of find that are hidden below DESKTOP 16:08 kasc, then, after cursory testing, send the patch to the mailing-list, please so here is the patch ;) (applies to 1.5.0 release, tested to works-for-me-and-fixed-my-problem status) greetings, Kai From niteblade at gmx.net Wed Apr 4 10:20:45 2007 From: niteblade at gmx.net (Kai Schwenzfeier) Date: Wed, 4 Apr 2007 19:20:45 +0200 Subject: [PATCH] now with patch attached Message-ID: <20070404172045.GT12102@Moria.local> :) -------------- next part -------------- --- ./findutils/find.c~ 2007-03-22 21:21:37.000000000 +0100 +++ ./findutils/find.c 2007-04-04 16:24:00.000000000 +0200 @@ -72,9 +72,9 @@ USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;)) USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; unsigned int *subst_count; int exec_argc;)) USE_FEATURE_FIND_USER( ACTS(user, int uid;)) -USE_DESKTOP( ACTS(paren, action ***subexpr;)) -USE_DESKTOP( ACTS(size, off_t size;)) -USE_DESKTOP( ACTS(prune)) +USE_FEATURE_FIND_PAREN( ACTS(paren, action ***subexpr;)) +USE_FEATURE_FIND_SIZE( ACTS(size, off_t size;)) +USE_FEATURE_FIND_PRUNE( ACTS(prune)) static action ***actions; static smalluint need_print = 1; @@ -245,12 +245,14 @@ return TRUE; } -#if ENABLE_DESKTOP +#if ENABLE_FEATURE_FIND_PAREN ACTF(paren) { return exec_actions(ap->subexpr, fileName, statbuf); } +#endif +#if ENABLE_FEATURE_FIND_SIZE /* * -prune: if -depth is not given, return true and do not descend * current dir; if -depth is given, return false with no effect. @@ -261,7 +263,9 @@ { return SKIP; } +#endif +#if ENABLE_FEATURE_FIND_PRUNE ACTF(size) { return statbuf->st_size == ap->size; @@ -527,7 +531,7 @@ ap->uid = xuname2uid(arg1); } #endif -#if ENABLE_DESKTOP +#if ENABLE_FEATURE_FIND_PAREN else if (LONE_CHAR(arg, '(')) { action_paren *ap; char **endarg; @@ -549,10 +553,14 @@ *endarg = (char*) ")"; /* restore NULLed parameter */ argv = endarg; } +#endif +#if ENABLE_FEATURE_FIND_PRUNE else if (strcmp(arg, "-prune") == 0) { USE_FEATURE_FIND_NOT( invert_flag = 0; ) (void) ALLOC_ACTION(prune); } +#endif +#if ENABLE_FEATURE_FIND_SIZE else if (strcmp(arg, "-size") == 0) { action_size *ap; if (!*++argv) @@ -584,7 +592,7 @@ break; if (ENABLE_FEATURE_FIND_NOT && LONE_CHAR(argv[firstopt], '!')) break; -#if ENABLE_DESKTOP +#if ENABLE_FEATURE_FIND_PAREN if (LONE_CHAR(argv[firstopt], '(')) break; #endif --- ./findutils/Config.in~ 2007-03-22 21:21:37.000000000 +0100 +++ ./findutils/Config.in 2007-04-04 16:39:10.000000000 +0200 @@ -99,6 +99,28 @@ full-blown desktop' is enabled, then will also support the non-POSIX notation '-not'. +config FEATURE_FIND_PAREN + bool "Enable parens in options" + default y + depends on FIND + help + Enable usage of parens '(' to specify logical order of arguments. + +config FEATURE_FIND_SIZE + bool "Enable (-size) option allowing matching for file size" + default y + depends on FIND + help + Support the 'find -size' option for searching by file size. + +config FEATURE_FIND_PRUNE + bool "Enable (-prune) option allowing to exclude subdirectories" + default y + depends on FIND + help + If the file is a directory, dont descend into it. Useful for + exclusion .svn and CVS directories. + config GREP bool "grep" default n --- ./include/usage.h~ 2007-03-22 21:21:35.000000000 +0100 +++ ./include/usage.h 2007-04-04 17:03:16.000000000 +0200 @@ -958,9 +958,11 @@ ) USE_FEATURE_FIND_EXEC( \ "\n -exec CMD Execute CMD with all instances of {} replaced by the" \ "\n files matching EXPRESSION" \ - ) USE_DESKTOP( \ + ) USE_FEATURE_FIND_SIZE( \ "\n -size N File size is N" \ + ) USE_FEATURE_FIND_PRUNE( \ "\n -prune Stop traversing current subtree" \ + ) USE_FEATURE_FIND_PAREN( \ "\n (expr) Group" \ ) From natanael.copa at gmail.com Wed Apr 4 10:34:25 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 04 Apr 2007 19:34:25 +0200 Subject: bug in busybox find -prune? Message-ID: <1175708065.10538.52.camel@localhost> Hi, I think I have found a bug in busybox. It's atleast a differnet behaviour than GNU find. The problem is that "find -prune " seems to ignore the prune and parse the subdir anyway. To reproduce: ncopa at nc ~/wrk/src/busybox/svn/busybox $ ./busybox_unstripped find findutils/ -prune -name 'f*' findutils/.svn/text-base/find.c.svn-base findutils/.svn/format findutils/find.c findutils/find.o Expected behaviour: ncopa at nc ~/wrk/src/busybox/svn/busybox $ /usr/bin/find findutils/ -prune -name 'f*' findutils/ I have no idea how to fix it. Natanael Copa From uberlord at gentoo.org Wed Apr 4 10:10:13 2007 From: uberlord at gentoo.org (Roy Marples) Date: Wed, 4 Apr 2007 18:10:13 +0100 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount Message-ID: <20070404181013.55828223@uberlaptop.marples.name> Hi List I'm busy working on baselayout-2, Gentoo's init system. One of the goals is to allow busybox to be used as a default shell. This requires the use of the -t fstype option for mount/umount, which the attached patch allows. Both umount.c and mount.c statically define the match_fstype function, which is probably a little bloatly, but I'm unsure of the busybox build system and where would be a good alternative to put it. Pointers welcome :) Thanks Roy -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-mount-types.patch Type: text/x-patch Size: 3559 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070404/45219a74/attachment.bin From natanael.copa at gmail.com Wed Apr 4 10:56:40 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 04 Apr 2007 19:56:40 +0200 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <20070404181013.55828223@uberlaptop.marples.name> References: <20070404181013.55828223@uberlaptop.marples.name> Message-ID: <1175709400.10538.59.camel@localhost> On Wed, 2007-04-04 at 18:10 +0100, Roy Marples wrote: > Hi List > > I'm busy working on baselayout-2, Gentoo's init system. One of the > goals is to allow busybox to be used as a default shell. > > This requires the use of the -t fstype option for mount/umount, which > the attached patch allows. Both umount.c and mount.c statically define > the match_fstype function, which is probably a little bloatly, but I'm > unsure of the busybox build system and where would be a good > alternative to put it. Pointers welcome :) > > Thanks > > Roy > > > > > > > differences > between files > attachment > (busybox-mount-types.patch) > > diff -ur busybox-1.5.0.orig/util-linux/mount.c > busybox-1.5.0/util-linux/mount.c > --- busybox-1.5.0.orig/util-linux/mount.c 2007-03-22 > 20:21:39.000000000 +0000 > +++ busybox-1.5.0/util-linux/mount.c 2007-04-04 17:25:37.000000000 > +0100 > @@ -77,6 +77,7 @@ > {"defaults", 0}, > /* {"quiet", 0}, - do not filter out, vfat wants to > see it */ > {"noauto", MOUNT_NOAUTO}, > + {"sw", MOUNT_SWAP}, > {"swap", MOUNT_SWAP}, > USE_DESKTOP({"user", MOUNT_USERS},) > USE_DESKTOP({"users", MOUNT_USERS},) > @@ -1528,6 +1529,33 @@ > return rc; > } > > +static int match_fstype (struct mntent *mt, const char *fstype) > +{ > + bool no = false; > + char *fst, *p, *token; > + int retval = 0; > + > + if (!mt || ! fstype) > + return -1; > + > + fst = p = xstrdup (fstype); > + if (strlen (p) > 2 && p[0] == 'n' && p[1] == 'o') { > + no = true; > + p += 2; > + } Shouldn't the test for 'no...' be done on the token inside the look below? mount -t nonfs,noshm,ext3,no... > + > + while ((token = strsep (&p, ","))) { > + if (strcmp (token, mt->mnt_type) == 0) { > + if (! no) > + retval = 0; > + break; > + } > + } Will this really work? seems like only time the func returns anything else but 0 is when either mt or fstype is NULL. > + > + free (fst); > + return (retval); > +} > + > // Parse options, if necessary parse fstab/mtab, and call singlemount > for > // each directory to be mounted. From uberlord at gentoo.org Wed Apr 4 11:47:49 2007 From: uberlord at gentoo.org (Roy Marples) Date: Wed, 4 Apr 2007 19:47:49 +0100 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <1175709400.10538.59.camel@localhost> References: <20070404181013.55828223@uberlaptop.marples.name> <1175709400.10538.59.camel@localhost> Message-ID: <20070404194749.3a1cde63@uberpc.marples.name> On Wed, 04 Apr 2007 19:56:40 +0200 Natanael Copa wrote: > > +static int match_fstype (struct mntent *mt, const char *fstype) > > +{ > > + bool no = false; > > + char *fst, *p, *token; > > + int retval = 0; > > + > > + if (!mt || ! fstype) > > + return -1; > > + > > + fst = p = xstrdup (fstype); > > + if (strlen (p) > 2 && p[0] == 'n' && p[1] == 'o') { > > + no = true; > > + p += 2; > > + } > > Shouldn't the test for 'no...' be done on the token inside the look > below? mount -t nonfs,noshm,ext3,no... Not really. GNU mount allows nonofs,noshm, whereas BSD mount only accepts nonfs,shm. I prefer the BSD approach because you can then have a fs name starting with "no" like so mount -at ,noddy Also, commenting on my own code strlen (p) > 2 && p[0] == 'n' && p[1] == 'o' could also be written as strncmp (p, "no", 2) which may be more readable. > > > + > > + while ((token = strsep (&p, ","))) { > > + if (strcmp (token, mt->mnt_type) == 0) { > > + if (! no) > > + retval = 0; > > + break; > > + } > > + } > > Will this really work? seems like only time the func returns anything > else but 0 is when either mt or fstype is NULL. Yes, it works. Basically we tokenize the fstype list by , If a token matches the fstype then If list prefixed with no, return -1 otherwise 0. If no match found return -1. I also for forgot to mention that the patch also matches the sw option to denote swap as well as swap. Thanks From coleman.brumley at comcast.net Wed Apr 4 11:42:46 2007 From: coleman.brumley at comcast.net (Coleman Brumley) Date: Wed, 04 Apr 2007 14:42:46 -0400 Subject: BusyBox 1.2.1 piping issue Message-ID: <4613F1A6.8080406@comcast.net> Hello. I'm having an issue with BusyBox v1.21 and piping. It seems as though piping is causing busybox to restart/crash. For example: /# echo abcd | grep a BusyBox v1.2.1 (2007.03.26-18:36+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands./ Has anyone run into this or anything similar? TIA, Coleman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070404/ccb95330/attachment.htm From natanael.copa at gmail.com Wed Apr 4 12:22:40 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 04 Apr 2007 21:22:40 +0200 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <20070404181013.55828223@uberlaptop.marples.name> References: <20070404181013.55828223@uberlaptop.marples.name> Message-ID: <1175714560.10538.61.camel@localhost> On Wed, 2007-04-04 at 18:10 +0100, Roy Marples wrote: > > @@ -1608,6 +1636,7 @@ > // argument when we get it. > > if (argc == 2) { > + printf ("ss\n"); > if (nonroot) > bb_error_msg_and_die(must_be_root); > mtpair->mnt_fsname = argv[0]; > @@ -1703,9 +1732,7 @@ I believe this hunk shouldnt be there. I wondered where those 'ss' came from :-) Natanael Copa From rep.dot.nop at gmail.com Wed Apr 4 12:44:04 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Wed, 4 Apr 2007 21:44:04 +0200 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <20070404194749.3a1cde63@uberpc.marples.name> References: <20070404181013.55828223@uberlaptop.marples.name> <1175709400.10538.59.camel@localhost> <20070404194749.3a1cde63@uberpc.marples.name> Message-ID: <20070404194404.GA8103@aon.at> On Wed, Apr 04, 2007 at 07:47:49PM +0100, Roy Marples wrote: >On Wed, 04 Apr 2007 19:56:40 +0200 >Natanael Copa wrote: >> > +static int match_fstype (struct mntent *mt, const char *fstype) >> > +{ >> > + bool no = false; >> > + char *fst, *p, *token; >> > + int retval = 0; >> > + >> > + if (!mt || ! fstype) >> > + return -1; >> > + >> > + fst = p = xstrdup (fstype); >> > + if (strlen (p) > 2 && p[0] == 'n' && p[1] == 'o') { >> > + no = true; >> > + p += 2; >> > + } >> >> Shouldn't the test for 'no...' be done on the token inside the look >> below? mount -t nonfs,noshm,ext3,no... > >Not really. GNU mount allows nonofs,noshm, whereas BSD mount only >accepts nonfs,shm. I prefer the BSD approach because you can then >have a fs name starting with "no" like so > >mount -at ,noddy > >Also, commenting on my own code >strlen (p) > 2 && p[0] == 'n' && p[1] == 'o' >could also be written as >strncmp (p, "no", 2) >which may be more readable. a) put common funcs into libbb/*.c, see loop.c as an example. b) both strncmp as well as strlen are most likely much bloatier than needed. Let me point to current trunk's coreutils/dd.c and there the block below "what == OP_conv". An alternative to strstr is of course memchr(,,64) or the like. Care to send an updated patch? cheers, > >> >> > + >> > + while ((token = strsep (&p, ","))) { >> > + if (strcmp (token, mt->mnt_type) == 0) { >> > + if (! no) >> > + retval = 0; >> > + break; >> > + } >> > + } >> >> Will this really work? seems like only time the func returns anything >> else but 0 is when either mt or fstype is NULL. > >Yes, it works. >Basically we tokenize the fstype list by , >If a token matches the fstype then > If list prefixed with no, return -1 otherwise 0. >If no match found return -1. > > >I also for forgot to mention that the patch also matches the sw option >to denote swap as well as swap. > >Thanks > >_______________________________________________ >busybox mailing list >busybox at busybox.net >http://busybox.net/cgi-bin/mailman/listinfo/busybox > From uberlord at gentoo.org Wed Apr 4 12:50:21 2007 From: uberlord at gentoo.org (Roy Marples) Date: Wed, 4 Apr 2007 20:50:21 +0100 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <1175714560.10538.61.camel@localhost> References: <20070404181013.55828223@uberlaptop.marples.name> <1175714560.10538.61.camel@localhost> Message-ID: <20070404205021.41cd8036@uberpc.marples.name> On Wed, 04 Apr 2007 21:22:40 +0200 Natanael Copa wrote: > On Wed, 2007-04-04 at 18:10 +0100, Roy Marples wrote: > > > > @@ -1608,6 +1636,7 @@ > > // argument when we get it. > > > > if (argc == 2) { > > + printf ("ss\n"); > > if (nonroot) > > bb_error_msg_and_die(must_be_root); > > mtpair->mnt_fsname = argv[0]; > > @@ -1703,9 +1732,7 @@ > > I believe this hunk shouldnt be there. > > I wondered where those 'ss' came from :-) > > Natanael Copa > Testing - heh There was a bug in the patch, you were right. I should have defaulted retval to -1. Ah well Thanks Roy From jsimmons at infradead.org Wed Apr 4 13:59:28 2007 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Apr 2007 21:59:28 +0100 (BST) Subject: ash problems. Message-ID: What do you need to get ash working. I have a embedded ARM system using uClibc. Now I have set my init to busybox directly. I even called mount to set if will try to run it as init. It does. The problem is calling ash. When ash is init all that happens is silence. Am I missing something? From uberlord at gentoo.org Wed Apr 4 14:36:16 2007 From: uberlord at gentoo.org (Roy Marples) Date: Wed, 4 Apr 2007 22:36:16 +0100 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <20070404194404.GA8103@aon.at> References: <20070404181013.55828223@uberlaptop.marples.name> <1175709400.10538.59.camel@localhost> <20070404194749.3a1cde63@uberpc.marples.name> <20070404194404.GA8103@aon.at> Message-ID: <20070404223616.71f584bd@uberpc.marples.name> On Wed, 4 Apr 2007 21:44:04 +0200 Bernhard Fischer wrote: > a) put common funcs into libbb/*.c, see loop.c as an example. > b) both strncmp as well as strlen are most likely much bloatier than > needed. Let me point to current trunk's coreutils/dd.c and there the > block below "what == OP_conv". An alternative to strstr is of course > memchr(,,64) or the like. Revised patch attached. Thanks Roy -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.5.0-mount-types.patch Type: text/x-patch Size: 4273 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070404/a6ac9540/attachment.bin From uberlord at gentoo.org Wed Apr 4 15:03:02 2007 From: uberlord at gentoo.org (Roy Marples) Date: Wed, 4 Apr 2007 23:03:02 +0100 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <20070404223616.71f584bd@uberpc.marples.name> References: <20070404181013.55828223@uberlaptop.marples.name> <1175709400.10538.59.camel@localhost> <20070404194749.3a1cde63@uberpc.marples.name> <20070404194404.GA8103@aon.at> <20070404223616.71f584bd@uberpc.marples.name> Message-ID: <20070404230302.760ccdbd@uberpc.marples.name> On Wed, 4 Apr 2007 22:36:16 +0100 Roy Marples wrote: > On Wed, 4 Apr 2007 21:44:04 +0200 > Bernhard Fischer wrote: > > a) put common funcs into libbb/*.c, see loop.c as an example. > > b) both strncmp as well as strlen are most likely much bloatier than > > needed. Let me point to current trunk's coreutils/dd.c and there the > > block below "what == OP_conv". An alternative to strstr is of course > > memchr(,,64) or the like. > > Revised patch attached. Of course it would help if it sent the right value if nothing matched - heh. This should work will all situations I can think of. Thanks Roy -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.5.0-mount-types.patch Type: text/x-patch Size: 4324 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070404/b6701ac7/attachment.bin From niteblade at gmx.net Wed Apr 4 15:08:59 2007 From: niteblade at gmx.net (Kai Schwenzfeier) Date: Thu, 5 Apr 2007 00:08:59 +0200 Subject: [PATCH] un-desktopize find rediffed Message-ID: <20070404220859.GU12102@Moria.local> This patch is rediffed to fit svn trunk. The last hunk is optional. It makes FEATURE_FIND_PRUNE dependent on FEATURE_FIND_PAREN, since this is probably the way -prune is usually used. I could not make heads and tails from the PARAM_* stuff, so you probably want to recheck what I did there. The long versions -and, -or, and -not still depend on DESKTOP. greetings, Kai -------------- next part -------------- --- ./findutils/Config.in 2007-03-22 21:21:37.000000000 +0100 +++ ./findutils/Config.in 2007-04-04 16:39:10.000000000 +0200 @@ -99,6 +99,28 @@ full-blown desktop' is enabled, then will also support the non-POSIX notation '-not'. +config FEATURE_FIND_PAREN + bool "Enable parens in options" + default y + depends on FIND + help + Enable usage of parens '(' to specify logical order of arguments. + +config FEATURE_FIND_SIZE + bool "Enable (-size) option allowing matching for file size" + default y + depends on FIND + help + Support the 'find -size' option for searching by file size. + +config FEATURE_FIND_PRUNE + bool "Enable (-prune) option allowing to exclude subdirectories" + default y + depends on FIND + help + If the file is a directory, dont descend into it. Useful for + exclusion .svn and CVS directories. + config GREP bool "grep" default n --- ./include/usage.h 2007-03-22 21:21:35.000000000 +0100 +++ ./include/usage.h 2007-04-04 17:03:16.000000000 +0200 @@ -958,9 +958,11 @@ ) USE_FEATURE_FIND_EXEC( \ "\n -exec CMD Execute CMD with all instances of {} replaced by the" \ "\n files matching EXPRESSION" \ - ) USE_DESKTOP( \ + ) USE_FEATURE_FIND_SIZE( \ "\n -size N File size is N" \ + ) USE_FEATURE_FIND_PRUNE( \ "\n -prune Stop traversing current subtree" \ + ) USE_FEATURE_FIND_PAREN( \ "\n (expr) Group" \ ) --- ./findutils/find.c 2007-04-04 23:18:26.000000000 +0200 +++ ./findutils/find.c 2007-04-04 23:58:37.000000000 +0200 @@ -72,9 +72,9 @@ USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;)) USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; unsigned int *subst_count; int exec_argc;)) USE_FEATURE_FIND_USER( ACTS(user, int uid;)) -USE_DESKTOP( ACTS(paren, action ***subexpr;)) -USE_DESKTOP( ACTS(size, off_t size;)) -USE_DESKTOP( ACTS(prune)) +USE_FEATURE_FIND_PAREN( ACTS(paren, action ***subexpr;)) +USE_FEATURE_FIND_SIZE( ACTS(size, off_t size;)) +USE_FEATURE_FIND_PRUNE( ACTS(prune)) static action ***actions; static bool need_print = 1; @@ -245,12 +245,14 @@ return TRUE; } -#if ENABLE_DESKTOP +#if ENABLE_FEATURE_FIND_PAREN ACTF(paren) { return exec_actions(ap->subexpr, fileName, statbuf); } +#endif +#if ENABLE_FEATURE_FIND_PRUNE /* * -prune: if -depth is not given, return true and do not descend * current dir; if -depth is given, return false with no effect. @@ -261,7 +263,9 @@ { return SKIP; } +#endif +#if ENABLE_FEATURE_FIND_SIZE ACTF(size) { return statbuf->st_size == ap->size; @@ -345,9 +349,10 @@ #define PARM_and (PARM_user + 1) #define PARM_or (PARM_and + 1) #define PARM_not (PARM_or + ENABLE_FEATURE_FIND_NOT) -#define PARM_char_brace (PARM_not + 1) -#define PARM_prune (PARM_char_brace + 1) -#define PARM_size (PARM_prune + 1) +#endif +#define PARM_char_brace (PARM_not + ENABLE_FEATURE_FIND_PAREN) +#define PARM_prune (PARM_char_brace + ENABLE_FEATURE_FIND_PRUNE) +#define PARM_size (PARM_prune + ENABLE_FEATURE_FIND_SIZE) #endif static action*** parse_params(char **argv) { @@ -396,8 +401,14 @@ # if ENABLE_FEATURE_FIND_NOT "-not", # endif +#endif +#if ENABLE_FEATURE_FIND_PAREN "(", +#endif +#if ENABLE_FEATURE_FIND_PRUNE "-prune", +#endif +#if ENABLE_FEATURE_FIND_SIZE "-size", #endif NULL @@ -593,7 +604,7 @@ ap->uid = xuname2uid(arg1); } #endif -#if ENABLE_DESKTOP +#if ENABLE_FEATURE_FIND_PAREN else if (parm == PARM_char_brace) { action_paren *ap; @@ -616,11 +627,15 @@ *endarg = (char*) ")"; /* restore NULLed parameter */ argv = endarg; } +#endif +#if ENABLE_FEATURE_FIND_PRUNE else if (parm == PARM_prune) { USE_FEATURE_FIND_NOT( invert_flag = 0; ) (void) ALLOC_ACTION(prune); } +#endif +#if ENABLE_FEATURE_FIND_SIZE else if (parm == PARM_size) { action_size *ap; @@ -657,7 +672,7 @@ break; if (ENABLE_FEATURE_FIND_NOT && LONE_CHAR(argv[firstopt], '!')) break; -#if ENABLE_DESKTOP +#if ENABLE_FEATURE_FIND_PAREN if (LONE_CHAR(argv[firstopt], '(')) break; #endif --- ./findutils/Config.in 2007-04-05 00:00:57.000000000 +0200 +++ ./findutils/Config.in 2007-04-05 00:02:01.000000000 +0200 @@ -116,7 +116,7 @@ config FEATURE_FIND_PRUNE bool "Enable (-prune) option allowing to exclude subdirectories" default y - depends on FIND + depends on FEATURE_FIND_PAREN help If the file is a directory, dont descend into it. Useful for exclusion .svn and CVS directories. From vda.linux at googlemail.com Wed Apr 4 15:29:41 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 00:29:41 +0200 Subject: login success only once In-Reply-To: References: <200703301903.30874.vda.linux@googlemail.com> Message-ID: <200704050029.41984.vda.linux@googlemail.com> On Monday 02 April 2007 05:08, kaimi wrote: > > Can you dig a bit deeper? Where exactly it fails for you? > > my /etc/profile followed: > export LD_LIBRARY_PATH=/lib:/usr/lib > echo "export PATH in /etc/profile" > export PATH=/bin:/sbin:/usr/bin:/usr/sbin > > the startup messages followed: > ARM login: root > Password: > export PATH in /etc/profile > [root at ARM ~]# logout > ARM login: root > Password: > export PATH in /etc/profile > [root at ARM ~]# login > ARM login: root > > you can see, at startup, login works, it works after logout as well, but > it's failed if login on shell prompts. how to trace the exact point? thanks You can add printf("marker N\n") into login in various places and find out where it stops. -- vda From vda.linux at googlemail.com Wed Apr 4 15:32:29 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 00:32:29 +0200 Subject: Where is my shell ? In-Reply-To: <007701c77506$0f58f450$6402a8c0@nucleus> References: <007701c77506$0f58f450$6402a8c0@nucleus> Message-ID: <200704050032.29935.vda.linux@googlemail.com> On Monday 02 April 2007 11:05, Levend Sayar wrote: > Hi, all > I am trying to port Linux 2.4.32 to 386ex based embedded board. This is my > very first attempt. I am using 4MB initrd image as root fs. Everything goes > fine. I compiled busybox as a static image and install to my initrd image. I > want to get a shell but nothing written to my console from busybox. AFAIK, > /sbin/init is loaded by the kernel successfully, since I added some printk > messages to trace what's going on. I deleted that lines from the log below > for clearity. But somehow I couldn't get a user space app to write anything > to the console. In init, does exec() which starts /bin/sh (as configured in your inittab) succeeds? > gcc 3.3.3 > Busybox 1.1.0 > glibc 2.4 Can you try newer busybox? > etc/inittab content : > ::sysinit:/etc/init.d/rcS > ::respawn:-/bin/sh > > etc/init.d/rcS content : > #!/bin/sh > /bin/mount -t proc proc /proc > > console output : > > Uncompressing Linux... Ok, booting the kernel. > Linux version 2.4.32 (root at ds300)(gcc version 3.3.3 (SuSE Linux)) #35 Wed ... > EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended > VFS: Mounted root (ext2 filesystem). > Freeing unused kernel memory: 40k freed > > --Nothing written anymore from this point ... Does it boot with kernel parameter init=/bin/sh? -- vda From vda.linux at googlemail.com Wed Apr 4 16:24:35 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 01:24:35 +0200 Subject: [PATCH] find -group (update) -depth In-Reply-To: <1175676659.10538.13.camel@localhost> References: <1175676659.10538.13.camel@localhost> Message-ID: <200704050124.35513.vda.linux@googlemail.com> On Wednesday 04 April 2007 10:50, Natanael Copa wrote: > The attatched patch contains a minor update to the previous find -group > patch I posted: > http://www.busybox.net/lists/busybox/2007-April/026976.html > > The change is that it now uses > > if (parm == PARM_group) > > instead of > > if (strcmp(arg, "-group") == 0) > > I didn't notice that change in the svn before. Sorry. > > This patch also adds the -depth option to process contens in dirs before > processing the dir itself (useful when deleting stuff) > > I intend to look at -delete and -path/-wholename but i dont know if I > should post incremental patches or one big with all additions? I find it easier to see one bigger patch. > Or should I wait until this patch have been commited? I am testing your patch and will apply in a few minutes. Base your work on current svn. Thanks! -- vda From vda.linux at googlemail.com Wed Apr 4 16:28:23 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 01:28:23 +0200 Subject: [PATCH] un-desktopize find In-Reply-To: <20070404171505.GS12102@Moria.local> References: <20070404171505.GS12102@Moria.local> Message-ID: <200704050128.23924.vda.linux@googlemail.com> On Wednesday 04 April 2007 19:15, Kai Schwenzfeier wrote: > 15:45 hi there > 15:52 i've got a problem with building busybox from within a busybox environment. the Makefiles use -prune option with > find, but the busybox find implementation doesnt seem to understand -prune > 15:52 any ideas? ^^ > 15:56 kasc, USE_DESKTOP( ACTS(prune)) > 15:56 kasc, do away with this silly CONFIG_DESKTOP thing for find and instead add an option for the args of find > that are currently hidden with DESKTOP > 16:07 kasc, the same for all other args of find that are hidden below DESKTOP > 16:08 kasc, then, after cursory testing, send the patch to the mailing-list, please blindvt is absolutely correct. Whenever you see something under CONFIG_DESKTOP which you need, but you don't want to enable CONFIG_DESKTOP, make a patch and send it to the list. I'm applying your patch, thanks! -- vda From vda.linux at googlemail.com Wed Apr 4 16:31:37 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 01:31:37 +0200 Subject: BusyBox 1.2.1 piping issue In-Reply-To: <4613F1A6.8080406@comcast.net> References: <4613F1A6.8080406@comcast.net> Message-ID: <200704050131.37639.vda.linux@googlemail.com> On Wednesday 04 April 2007 20:42, Coleman Brumley wrote: > Hello. > > I'm having an issue with BusyBox v1.21 and piping. It seems as though > piping is causing busybox to restart/crash. > > For example: > /# echo abcd | grep a > > > BusyBox v1.2.1 (2007.03.26-18:36+0000) Built-in shell (ash) > Enter 'help' for a list of built-in commands./ > > Has anyone run into this or anything similar? Did you test later versions? Do you have strace output of misbehaving command? strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' .config? On which arch are you? Does it happen on i386? -- vda From vapier at gentoo.org Wed Apr 4 17:09:03 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 4 Apr 2007 20:09:03 -0400 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <20070404194749.3a1cde63@uberpc.marples.name> References: <20070404181013.55828223@uberlaptop.marples.name> <1175709400.10538.59.camel@localhost> <20070404194749.3a1cde63@uberpc.marples.name> Message-ID: <200704042009.03789.vapier@gentoo.org> On Wednesday 04 April 2007, Roy Marples wrote: > Not really. GNU mount allows nonofs,noshm, whereas BSD mount only > accepts nonfs,shm. I prefer the BSD approach because you can then > have a fs name starting with "no" like so considering busybox tends to be a replacement for the GNU userland, not BSD, this should at least be a build option where the default behavior lines up with util-linux's mount -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070404/6c6e0ed4/attachment.pgp From vapier at gentoo.org Wed Apr 4 17:11:00 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 4 Apr 2007 20:11:00 -0400 Subject: BusyBox 1.2.1 piping issue In-Reply-To: <200704050131.37639.vda.linux@googlemail.com> References: <4613F1A6.8080406@comcast.net> <200704050131.37639.vda.linux@googlemail.com> Message-ID: <200704042011.01576.vapier@gentoo.org> On Wednesday 04 April 2007, Denis Vlasenko wrote: > On Wednesday 04 April 2007 20:42, Coleman Brumley wrote: > > Hello. > > > > I'm having an issue with BusyBox v1.21 and piping. It seems as though > > piping is causing busybox to restart/crash. > > > > For example: > > /# echo abcd | grep a > > > > > > BusyBox v1.2.1 (2007.03.26-18:36+0000) Built-in shell (ash) > > Enter 'help' for a list of built-in commands./ > > > > Has anyone run into this or anything similar? > > Did you test later versions? Do you have strace output > of misbehaving command? > > strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' > > .config? On which arch are you? Does it happen on i386? heh, actually we just noticed this ourselves with busybox 1.4.2 on blackfin: echo "" | grep . grep seems to crash -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070404/312d36c0/attachment.pgp From vda.linux at googlemail.com Wed Apr 4 17:28:11 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 02:28:11 +0200 Subject: bug in busybox find -prune? In-Reply-To: <1175708065.10538.52.camel@localhost> References: <1175708065.10538.52.camel@localhost> Message-ID: <200704050228.11327.vda.linux@googlemail.com> On Wednesday 04 April 2007 19:34, Natanael Copa wrote: > To reproduce: > > ncopa at nc ~/wrk/src/busybox/svn/busybox $ ./busybox_unstripped find > findutils/ -prune -name 'f*' > findutils/.svn/text-base/find.c.svn-base > findutils/.svn/format > findutils/find.c > findutils/find.o > > Expected behaviour: > > ncopa at nc ~/wrk/src/busybox/svn/busybox $ /usr/bin/find findutils/ -prune > -name 'f*' > findutils/a > > I have no idea how to fix it. Yup. Two bugs here... does attached version work for you? -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: find.c Type: text/x-csrc Size: 19077 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070405/d1a2d341/attachment-0001.c From vda.linux at googlemail.com Wed Apr 4 17:32:39 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 02:32:39 +0200 Subject: mount permission denied though server side already authenticated the request In-Reply-To: <5A15D86EDE7573448683D46FC9FC8DD6014CB577@torcaexmb4.atitech.com> References: <5A15D86EDE7573448683D46FC9FC8DD6014CB577@torcaexmb4.atitech.com> Message-ID: <200704050232.39957.vda.linux@googlemail.com> On Wednesday 04 April 2007 16:07, Strong Qu wrote: > ARM V6 platform Linux 2.6.10, Busybox 1.01, ash shell, server side is > Ubuntu 6.10, nfs exports *(rw, all_squash) Can you try something newer than 1.01? > On target platform run: > > # mount -o nolock 192.168.1.2:/home/user_1/share /mnt/shannon > > Root has read/write/exec right in /mnt/pool. 192.168.1.2 is IP of > shannon, the nfs server. > > I got error as: > > mount: permission denied. (are you root?) Can you strace it? strace -f -o mnt.log mount -o nolock 192.168.1.2:/home/user_1/share /mnt/shannon > On the server side I run: > > # tail -f /var/log/syslog > > It shows: > > Mar 30 11:01:13 shannon mounted[4330]: authenticated mount from > 192.168.1.3 for /home/user_1/share (/home/user_1/share) > > And on other x86/linux I can mount the nfs without any trouble. > > I did not find nfsmount on the target board. Is it a must for nfs mount? No, current busybox's mount doesn't need nfsmount, it does NFS mounts internally. -- vda From vda.linux at googlemail.com Wed Apr 4 17:38:21 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 02:38:21 +0200 Subject: svn commit: trunk/busybox/coreutils In-Reply-To: <20070404135834.9511148084@busybox.net> References: <20070404135834.9511148084@busybox.net> Message-ID: <200704050238.22003.vda.linux@googlemail.com> Hi, On Wednesday 04 April 2007 15:58, aldot at busybox.net wrote: > @@ -66,9 +68,9 @@ > static char const *human_fstype(long f_type) > { > int i; > - static const struct types { > + const struct types { > long type; Why did you remove 'static' here? -- vda From vda.linux at googlemail.com Wed Apr 4 17:44:42 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 02:44:42 +0200 Subject: svn commit: trunk/busybox/coreutils In-Reply-To: <20070404140124.7AFA448097@busybox.net> References: <20070404140124.7AFA448097@busybox.net> Message-ID: <200704050244.42451.vda.linux@googlemail.com> On Wednesday 04 April 2007 16:01, aldot at busybox.net wrote: > +#define OP_bs 0 + 1 > +#define OP_count OP_bs + 1 > +#define OP_seek OP_count + 1 > +#define OP_skip OP_seek + 1 > +#define OP_if OP_skip + 1 > +#define OP_of OP_if + 1 > +#define OP_ibs OP_of + ENABLE_FEATURE_DD_IBS_OBS > +#define OP_obs OP_ibs + ENABLE_FEATURE_DD_IBS_OBS > +#define OP_conv OP_obs + ENABLE_FEATURE_DD_IBS_OBS > +#define OP_conv_notrunc OP_conv + ENABLE_FEATURE_DD_IBS_OBS > +#define OP_conv_sync OP_conv_notrunc + ENABLE_FEATURE_DD_IBS_OBS > +#define OP_conv_noerror OP_conv_sync + ENABLE_FEATURE_DD_IBS_OBS You do not use (), this is dangerous. This can be done better with enum. Example from find: enum { PARM_a , PARM_o , USE_FEATURE_FIND_NOT( PARM_char_not ,) PARM_print , USE_FEATURE_FIND_PRINT0(PARM_print0 ,) PARM_name , USE_FEATURE_FIND_TYPE( PARM_type ,) USE_FEATURE_FIND_PERM( PARM_perm ,) USE_FEATURE_FIND_MTIME( PARM_mtime ,) USE_FEATURE_FIND_MMIN( PARM_mmin ,) USE_FEATURE_FIND_NEWER( PARM_newer ,) USE_FEATURE_FIND_INUM( PARM_inum ,) USE_FEATURE_FIND_EXEC( PARM_exec ,) USE_FEATURE_FIND_USER( PARM_user ,) USE_FEATURE_FIND_GROUP( PARM_group ,) USE_FEATURE_FIND_DEPTH( PARM_depth ,) USE_FEATURE_FIND_PAREN( PARM_char_brace,) USE_FEATURE_FIND_SIZE( PARM_prune ,) USE_FEATURE_FIND_PRUNE( PARM_size ,) #if ENABLE_DESKTOP PARM_and , PARM_or , USE_FEATURE_FIND_NOT( PARM_not ,) #endif }; This way adjacent lines are not "linked" together by referencing first line from the second - OP_of here: > +#define OP_of OP_if + 1 > +#define OP_ibs OP_of + ENABLE_FEATURE_DD_IBS_OBS and thus it's easier to reorder lines without adding bugs. Also, OP_conv_noerror with not expand to 0 + 1 + 1 + 1 + 1 + 0 + ... + 1 but to simple named integer constant. -- vda From coleman.brumley at comcast.net Wed Apr 4 17:49:10 2007 From: coleman.brumley at comcast.net (Coleman Brumley) Date: Wed, 04 Apr 2007 20:49:10 -0400 Subject: BusyBox 1.2.1 piping issue In-Reply-To: <200704042011.01576.vapier@gentoo.org> References: <4613F1A6.8080406@comcast.net> <200704050131.37639.vda.linux@googlemail.com> <200704042011.01576.vapier@gentoo.org> Message-ID: <46144786.4080306@comcast.net> Mike Frysinger wrote: > On Wednesday 04 April 2007, Denis Vlasenko wrote: > >> On Wednesday 04 April 2007 20:42, Coleman Brumley wrote: >> >>> Hello. >>> >>> I'm having an issue with BusyBox v1.21 and piping. It seems as though >>> piping is causing busybox to restart/crash. >>> >>> For example: >>> /# echo abcd | grep a >>> >>> >>> BusyBox v1.2.1 (2007.03.26-18:36+0000) Built-in shell (ash) >>> Enter 'help' for a list of built-in commands./ >>> >>> Has anyone run into this or anything similar? >>> >> Did you test later versions? Do you have strace output >> of misbehaving command? >> >> strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' >> >> .config? On which arch are you? Does it happen on i386? >> > > heh, actually we just noticed this ourselves with busybox 1.4.2 on blackfin: > echo "" | grep . > grep seems to crash > -mike > > Thanks, Mike and Denis. It seems to be the "|" for me, since this also crashes: echo $x | cut -d"=" -f1 | tr 'A-Z' 'a-z' > strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' I don't have strace installed as part of my busybox build. What setting in .config turns that on? Or did you mean to run the strace command on my desktop? This is for an arm platform cross compiled using gcc v3.4.1. I don't know if it happens on i386, since I haven't built for that arch, just arm. My .config is attached. > ------------------------------------------------------------------------ > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070404/97dc1e44/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: .config Type: application/xml Size: 15697 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070404/97dc1e44/attachment-0001.xml From Jan-Evert.van.Grootheest at Vialis.nl Wed Apr 4 22:03:45 2007 From: Jan-Evert.van.Grootheest at Vialis.nl (Jan Evert van Grootheest) Date: Thu, 5 Apr 2007 07:03:45 +0200 Subject: mount permission denied though server side already authenticated therequest Message-ID: >-----Oorspronkelijk bericht----- >Van: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] Namens Strong Qu >Verzonden: woensdag 4 april 2007 16:08 >Aan: busybox at busybox.net >Onderwerp: mount permission denied though server side already authenticated therequest > > >I'm new of using busybox. Detail as follow: >ARM V6 platform Linux 2.6.10, Busybox 1.01, ash shell, server side is Ubuntu 6.10, nfs exports *(rw, all_squash) >On target platform run: ># mount -o nolock 192.168.1.2:/home/user_1/share /mnt/shannon >Root has read/write/exec right in /mnt/pool. 192.168.1.2 is IP of shannon, the nfs server. >I got error as: >mount: permission denied. (are you root?) >On the server side I run: ># tail -f /var/log/syslog >It shows: >Mar 30 11:01:13 shannon mounted[4330]: authenticated mount from 192.168.1.3 for /home/user_1/share (/home/user_1/share) >And on other x86/linux I can mount the nfs without any trouble. >I did not find nfsmount on the target board. Is it a must for nfs mount? >Thanks. >-Strong You do have a portmap running? I had this once too (the permission denied) because I forgot to start the portmapper. -- Jan Evert The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. Vialis is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. From farmatito at tiscali.it Wed Apr 4 23:33:03 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 5 Apr 2007 08:33:03 +0200 Subject: [PATCH - RESEND] addgroup code cleanup, size reduction and feature enhancement Message-ID: <200704050833.03440.farmatito@tiscali.it> Hi, maybe this post went unnoticed so i'll resend it one time ;-) Denis any interest in it or should i drop it? Comments and critics are as always welcome. Ciao, Tito Hi to all, this patch cleans up addgroup, reduces the size, removes a crippled feature, and re-adds it as optional fully functional feature. 1) code cleanup and size reduction (with make defconfig; make): scripts/bloat-o-meter busybox_old busybox_unstripped function ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? old ? ? new ? delta packed_usage ? ? ? ? ? ? ? ? ? ? ? ? ? ? 22068 ? 22058 ? ? -10 bb_internal_fgetgrent_r ? ? ? ? ? ? ? ? ? ? ?51 ? ? ? ? ?- ? ? ?-51 .rodata ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?124387 124323 ? ? -64 addgroup_main ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 380 ? ? ? 237 ? -143 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/3 up/down: 0/-268) ? ? ? ? ? Total: -268 bytes ? The size reduction was achieved through an almost complete rewrite of the functions group_study and addgroup and a tighter integration with libbb. 2) crippled function removal: the current addgroup applet when called with 2 arguments permits only to add an existing user to an still to be created group. This seems to me a crippled behavior as it could be used just one time at group creation time: root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova tito root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova dina addgroup: prova: group already in use 3) the above mentioned feature was re-added as optional ? ? function enabled by ENABLE_FEATURE_ADDUSER_TO_GROUP. ? ? Now ? ?if ?called ?with two non-option arguments, addgroup will add an existing ? ? user to an existing group like the full blown addgroup does (at least on my system). ????????addgroup dina prova ????????Adding user `dina' to group `prova'... ????????Done. ????????./busybox_unstripped addgroup prova ????????./busybox_unstripped addgroup dina prova ????????./busybox_unstripped addgroup tito prova ????????prova:x:1004:dina,tito ????????prova:!::dina,tito Bloat-o-meter says: scripts/bloat-o-meter busybox_old busybox_unstripped function ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? old ? ? ? new ? delta add_user_to_group ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ? 237 ?+237 packed_usage ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 22068 ?22058 ? ? ?-10 addgroup_main ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 380 ? ? 354 ? ? ? -26 .rodata ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?124387 124355 ? ? -32 bb_internal_fgetgrent_r ? ? ? ? ? ? ? ? ? ? ? 51 ? ? ? ? ? ?- ? ? -51 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/3 up/down: 237/-119) ? ? ? ? ?Total: 118 bytes This feature is turned of by default. This patch is tested and seems to work as expected. Comments and critics are as always welcome. Please apply if you like it. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: addgroup.patch Type: text/x-diff Size: 6591 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070405/7dba500b/attachment.bin From natanael.copa at gmail.com Wed Apr 4 23:43:57 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 05 Apr 2007 08:43:57 +0200 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <200704042009.03789.vapier@gentoo.org> References: <20070404181013.55828223@uberlaptop.marples.name> <1175709400.10538.59.camel@localhost> <20070404194749.3a1cde63@uberpc.marples.name> <200704042009.03789.vapier@gentoo.org> Message-ID: <1175755437.10538.76.camel@localhost> On Wed, 2007-04-04 at 20:09 -0400, Mike Frysinger wrote: > On Wednesday 04 April 2007, Roy Marples wrote: > > Not really. GNU mount allows nonofs,noshm, whereas BSD mount only > > accepts nonfs,shm. I prefer the BSD approach because you can then > > have a fs name starting with "no" like so > > considering busybox tends to be a replacement for the GNU userland, not BSD, > this should at least be a build option where the default behavior lines up > with util-linux's mount > -mike >From GNU mount man page: More than one type may be specified in a comma separated list. The list of file system types can be prefixed with no to specify the file system types on which no action should be taken. (This can be meaningful with the -a option.) For example, the command: mount -a -t nomsdos,ext mounts all file systems except those of type msdos and ext. So according the manpage, the entire list should be prefixed with 'no' and not every entry. I'm perfectly happy with this behaviour. Thanks! Natanael Copa From levend.sayar at karel.com.tr Wed Apr 4 23:26:23 2007 From: levend.sayar at karel.com.tr (Levend Sayar) Date: Thu, 5 Apr 2007 09:26:23 +0300 Subject: Where is my shell ? References: <007701c77506$0f58f450$6402a8c0@nucleus> <200704050032.29935.vda.linux@googlemail.com> Message-ID: <007e01c7774b$64941f70$6402a8c0@nucleus> >In init, does exec() which starts /bin/sh (as configured in your inittab) >succeeds? In fact I don't know what is going on the user-land. Since ,as the log I posted show, nothing can be seen but kernel printk's. I tried kernel parameter init=/bin/sh also. And I tried init=myinit (myinit is an app written by me and just open(/dev/console) and writes something) as a last try. Again result is failure. Somehow nothing can be written to console from user-land. I tried my initrd image on the PC with pivot_root and chroot. There, busybox runs OK. Shell comes. >Can you try newer busybox? I will try to use another linux box that runs 2.4 kernel to compile busybox. While doing that I can also upgrade busybox. _lvnd_ (^_^) ----------------------------------------------------------------------- Bu mesaj Karel MailScanner ile tehlikeli icerik ve virus kontrolunden gecirilmistir. KAREL A.S. - Bilgi Teknolojileri Bolumu This message has been scanned for viruses and dangerous content by Karel MailScanner, and is believed to be clean. KAREL A.S. - Information Technologies Department From natanael.copa at gmail.com Thu Apr 5 00:52:01 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 05 Apr 2007 09:52:01 +0200 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <20070404230302.760ccdbd@uberpc.marples.name> References: <20070404181013.55828223@uberlaptop.marples.name> <1175709400.10538.59.camel@localhost> <20070404194749.3a1cde63@uberpc.marples.name> <20070404194404.GA8103@aon.at> <20070404223616.71f584bd@uberpc.marples.name> <20070404230302.760ccdbd@uberpc.marples.name> Message-ID: <1175759521.10538.87.camel@localhost> On Wed, 2007-04-04 at 23:03 +0100, Roy Marples wrote: > On Wed, 4 Apr 2007 22:36:16 +0100 > Roy Marples wrote: > > > On Wed, 4 Apr 2007 21:44:04 +0200 > > Bernhard Fischer wrote: > > > a) put common funcs into libbb/*.c, see loop.c as an example. > > > b) both strncmp as well as strlen are most likely much bloatier than > > > needed. Let me point to current trunk's coreutils/dd.c and there the > > > block below "what == OP_conv". An alternative to strstr is of course > > > memchr(,,64) or the like. > > > > Revised patch attached. > > Of course it would help if it sent the right value if nothing matched - > heh. > > This should work will all situations I can think of. Patch works for me and fixes a long time annoyance. Denis, could it please be added to 1.5.0 fixes? I can rework the patch to have a config option for svn if you want. Thanks! Natanael Copa From natanael.copa at gmail.com Thu Apr 5 01:43:10 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 05 Apr 2007 10:43:10 +0200 Subject: [PATCH - RESEND] addgroup code cleanup, size reduction and feature enhancement In-Reply-To: <200704050833.03440.farmatito@tiscali.it> References: <200704050833.03440.farmatito@tiscali.it> Message-ID: <1175762590.10538.98.camel@localhost> On Thu, 2007-04-05 at 08:33 +0200, Tito wrote: > 2) crippled function removal: > the current addgroup applet when called with 2 arguments > permits only to add an existing user to an still to be created group. > This seems to me a crippled behavior as it could be used just one time > at group creation time: > > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova tito > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova dina > addgroup: prova: group already in use > > 3) the above mentioned feature was re-added as optional > function enabled by ENABLE_FEATURE_ADDUSER_TO_GROUP. > Now if called with two non-option arguments, addgroup will add an existing > user to an existing group like the full blown addgroup does (at least on my system). What system do you use? None of mine systems (Gentoo, Ubuntu, Debian, FreeBSD, OpenBSD) have an addgroup (or groupadd) that allows me to add a user to an existing group. Anyway... the patch is better than what we have today so it would be nice to see it committed. Natanael Copa From rep.dot.nop at gmail.com Thu Apr 5 02:24:49 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 5 Apr 2007 11:24:49 +0200 Subject: svn commit: trunk/busybox/coreutils In-Reply-To: <200704050244.42451.vda.linux@googlemail.com> References: <20070404140124.7AFA448097@busybox.net> <200704050244.42451.vda.linux@googlemail.com> Message-ID: <20070405092449.GB15883@aon.at> On Thu, Apr 05, 2007 at 02:44:42AM +0200, Denis Vlasenko wrote: >On Wednesday 04 April 2007 16:01, aldot at busybox.net wrote: >> +#define OP_bs 0 + 1 >> +#define OP_count OP_bs + 1 >> +#define OP_seek OP_count + 1 >> +#define OP_skip OP_seek + 1 >> +#define OP_if OP_skip + 1 >> +#define OP_of OP_if + 1 >> +#define OP_ibs OP_of + ENABLE_FEATURE_DD_IBS_OBS >> +#define OP_obs OP_ibs + ENABLE_FEATURE_DD_IBS_OBS >> +#define OP_conv OP_obs + ENABLE_FEATURE_DD_IBS_OBS >> +#define OP_conv_notrunc OP_conv + ENABLE_FEATURE_DD_IBS_OBS >> +#define OP_conv_sync OP_conv_notrunc + ENABLE_FEATURE_DD_IBS_OBS >> +#define OP_conv_noerror OP_conv_sync + ENABLE_FEATURE_DD_IBS_OBS > >You do not use (), this is dangerous. ouch, forgot those, yes. > >This can be done better with enum. Example from find: Yes, that's better. I'll keep this in mind in the future. Thanks for the heads-up. From rep.dot.nop at gmail.com Thu Apr 5 02:26:16 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 5 Apr 2007 11:26:16 +0200 Subject: svn commit: trunk/busybox/coreutils In-Reply-To: <200704050238.22003.vda.linux@googlemail.com> References: <20070404135834.9511148084@busybox.net> <200704050238.22003.vda.linux@googlemail.com> Message-ID: <20070405092616.GC15883@aon.at> On Thu, Apr 05, 2007 at 02:38:21AM +0200, Denis Vlasenko wrote: >Hi, > >On Wednesday 04 April 2007 15:58, aldot at busybox.net wrote: >> @@ -66,9 +68,9 @@ >> static char const *human_fstype(long f_type) >> { >> int i; >> - static const struct types { >> + const struct types { >> long type; > >Why did you remove 'static' here? It went into bss which i thought should be avoided? From natanael.copa at gmail.com Thu Apr 5 02:49:12 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 05 Apr 2007 11:49:12 +0200 Subject: [PATCH] find usage for -user, -group and -depts Message-ID: <1175766552.10538.104.camel@localhost> Attatched is a patch to update the usage for 'find'. Those are added: -user NAME File is owned by user NAME (numeric user ID allowed) -group NAME File belongs to group NAME (numeric group ID allowed) -depth Process directory after traversing it This is updated (use capitals like the other places): (EXPR) Group an expression -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-find-user-group-usage-depth.patch Type: text/x-patch Size: 949 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070405/a6af67c7/attachment.bin From aurel at gnuage.org Thu Apr 5 03:42:56 2007 From: aurel at gnuage.org (Aurelien Jacobs) Date: Thu, 5 Apr 2007 12:42:56 +0200 Subject: [PATCH - RESEND] addgroup code cleanup, size reduction and feature enhancement In-Reply-To: <1175762590.10538.98.camel@localhost> References: <200704050833.03440.farmatito@tiscali.it> <1175762590.10538.98.camel@localhost> Message-ID: <20070405124256.ea96619b.aurel@gnuage.org> On Thu, 05 Apr 2007 10:43:10 +0200 Natanael Copa wrote: > On Thu, 2007-04-05 at 08:33 +0200, Tito wrote: > > > 2) crippled function removal: > > the current addgroup applet when called with 2 arguments > > permits only to add an existing user to an still to be created group. > > This seems to me a crippled behavior as it could be used just one time > > at group creation time: > > > > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova tito > > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova dina > > addgroup: prova: group already in use > > > > 3) the above mentioned feature was re-added as optional > > function enabled by ENABLE_FEATURE_ADDUSER_TO_GROUP. > > Now if called with two non-option arguments, addgroup will add an existing > > user to an existing group like the full blown addgroup does (at least on my system). > > What system do you use? None of mine systems (Gentoo, Ubuntu, Debian, > FreeBSD, OpenBSD) have an addgroup (or groupadd) that allows me to add a > user to an existing group. I've already used this feature at least on Debian and Ubuntu: addgroup username groupname which adds username into the existing groupname. Aurel From peter.korsgaard at barco.com Thu Apr 5 04:31:08 2007 From: peter.korsgaard at barco.com (Peter Korsgaard) Date: Thu, 05 Apr 2007 13:31:08 +0200 Subject: [PATCH] diff: handle empty dirs Message-ID: <87fy7foy6b.fsf@sleipner.barco.com> Hi, diff currently segfaults on empty dirs as dl is null at the assignment at line 1100. The following tiny patch fixes it. Index: coreutils/diff.c =================================================================== --- coreutils/diff.c (revision 18333) +++ coreutils/diff.c (working copy) @@ -1070,7 +1070,7 @@ static char **get_dir(char *path) { dl_count = 0; - dl = NULL; + dl = xmalloc(sizeof(dl[0])); /* If -r has been set, then the recursive_action function will be * used. Unfortunately, this outputs the root directory along with -- Bye, Peter Korsgaard From bestleehj at hotmail.com Thu Apr 5 04:40:07 2007 From: bestleehj at hotmail.com (leebestleehj) Date: Thu, 5 Apr 2007 19:40:07 +0800 Subject: Segmentation fault Message-ID: Hi ; I'm sorry to bother you. When i use the busybox1.2.2 to ping and telnet some host ,i always see Segmentation fault; I want to know what happened.Then i trace the code into the create_icmp_socket.c[22]. proto = getprotobyname("icmp"); caused the error. I fand that it didn't protocols in the etc. but i copy the /etc/protocols to my ramdisk.i also meet it? i don't know? Someone help me. Other cmd is right! # ping 192.168.0.175 /home/bestlihj/kernel/busybox-1.2.2/networking/ping.c[437] ping_main ### /home/bestlihj/kernel/busybox-1.2.2/networking/ping.c[333] ping ###192.168.0.175 /home/bestlihj/kernel/busybox-1.2.2/libbb/create_icmp_socket.c[22] create_icmp_socket ###Segmentation fault ====================inittab====::sysinit:/etc/init.d/rcS::respawn:-/bin/sh#tty2::askfirst:-/bin/sh::ctrlaltdel:/bin/umount -a -r ==================== rcS=== #! /bin/sh/bin/mount -a/sbin/inetd /etc/inetd.conf/bin/echo endrcs ====inetd.conf===== echo stream tcp nowait root internalecho dgram udp wait root internal#discard stream tcp nowait root internal#discard dgram udp wait root internaldaytime stream tcp nowait root internaldaytime dgram udp wait root internal#chargen stream tcp nowait root internal#chargen dgram udp wait root internaltime stream tcp nowait root internaltime dgram udp wait root internal # These are standard services.##ftp stream tcp nowait root /usr/sbin/tcpd in.ftpdtelnet stream tcp nowait root /sbin/telnetd /sbin/telnetd =========fstab proc /proc proc defaults 0 0none /dev/pts devpts mode=0622 0 0 =========services telnet 23/tcp _________________________________________________________________ ?? Windows Vista ??? http://search.live.com/results.aspx?q=windows+vista&mkt=zh-cn&FORM=LIVSOP -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070405/caee2ac6/attachment.htm From farmatito at tiscali.it Thu Apr 5 04:44:58 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 5 Apr 2007 13:44:58 +0200 Subject: [PATCH - RESEND] addgroup code cleanup, size reduction and feature enhancement In-Reply-To: <1175762590.10538.98.camel@localhost> References: <200704050833.03440.farmatito@tiscali.it> <1175762590.10538.98.camel@localhost> Message-ID: <200704051344.58321.farmatito@tiscali.it> On Thursday 05 April 2007 10:43:10 you wrote: > On Thu, 2007-04-05 at 08:33 +0200, Tito wrote: > > > 2) crippled function removal: > > the current addgroup applet when called with 2 arguments > > permits only to add an existing user to an still to be created group. > > This seems to me a crippled behavior as it could be used just one time > > at group creation time: > > > > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova tito > > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova dina > > addgroup: prova: group already in use > > > > 3) the above mentioned feature was re-added as optional > > function enabled by ENABLE_FEATURE_ADDUSER_TO_GROUP. > > Now if called with two non-option arguments, addgroup will add an existing > > user to an existing group like the full blown addgroup does (at least on my system). > > What system do you use? None of mine systems (Gentoo, Ubuntu, Debian, > FreeBSD, OpenBSD) have an addgroup (or groupadd) that allows me to add a > user to an existing group. (k)Ubuntu 6.10 ls -la /usr/sbin/addgroup lrwxrwxrwx 1 root root 7 2007-03-06 15:13 /usr/sbin/addgroup -> adduser Ciao, Tito > Anyway... the patch is better than what we have today so it would be > nice to see it committed. > > Natanael Copa > > From peter.korsgaard at barco.com Thu Apr 5 05:40:32 2007 From: peter.korsgaard at barco.com (Peter Korsgaard) Date: Thu, 05 Apr 2007 14:40:32 +0200 Subject: [PATCH] patch: don't remove same file twice Message-ID: <87bqi3ouyn.fsf@sleipner.barco.com> Hi, patch fails on patches removing files if original and new filename is the same because the 2nd unlink fails. The following tiny patch fixes it. Index: editors/patch.c =================================================================== --- editors/patch.c (revision 18333) +++ editors/patch.c (working copy) @@ -263,7 +263,8 @@ if (unlink(new_filename) == -1) { bb_perror_msg_and_die("cannot remove file %s", new_filename); } - if (unlink(original_filename) == -1) { + if (strcmp(new_filename, original_filename) + && (unlink(original_filename) == -1)) { bb_perror_msg_and_die("cannot remove original file %s", new_filename); } } -- Bye, Peter Korsgaard From rep.dot.nop at gmail.com Thu Apr 5 06:12:43 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 5 Apr 2007 15:12:43 +0200 Subject: [PATCH - RESEND] addgroup code cleanup, size reduction and feature enhancement In-Reply-To: <200704051344.58321.farmatito@tiscali.it> References: <200704050833.03440.farmatito@tiscali.it> <1175762590.10538.98.camel@localhost> <200704051344.58321.farmatito@tiscali.it> Message-ID: <20070405131243.GA17508@aon.at> On Thu, Apr 05, 2007 at 01:44:58PM +0200, Tito wrote: >On Thursday 05 April 2007 10:43:10 you wrote: >> On Thu, 2007-04-05 at 08:33 +0200, Tito wrote: >> >> > 2) crippled function removal: >> > the current addgroup applet when called with 2 arguments >> > permits only to add an existing user to an still to be created group. >> > This seems to me a crippled behavior as it could be used just one time >> > at group creation time: >> > >> > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova tito >> > root at localhost:~/Desktop/busybox.new# ./busybox_old addgroup prova dina >> > addgroup: prova: group already in use >> > >> > 3) the above mentioned feature was re-added as optional >> > function enabled by ENABLE_FEATURE_ADDUSER_TO_GROUP. >> > Now if called with two non-option arguments, addgroup will add an existing >> > user to an existing group like the full blown addgroup does (at least on my system). >> >> What system do you use? None of mine systems (Gentoo, Ubuntu, Debian, >> FreeBSD, OpenBSD) have an addgroup (or groupadd) that allows me to add a >> user to an existing group. > >(k)Ubuntu 6.10 > >ls -la /usr/sbin/addgroup lrwxrwxrwx 1 root root 7 2007-03-06 15:13 /usr/sbin/addgroup -> adduser > >Ciao, >Tito >> Anyway... the patch is better than what we have today so it would be >> nice to see it committed. Merged. Thanks, Tito! From natanael.copa at gmail.com Thu Apr 5 07:59:47 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 05 Apr 2007 16:59:47 +0200 Subject: bug in busybox find -prune? In-Reply-To: <200704050228.11327.vda.linux@googlemail.com> References: <1175708065.10538.52.camel@localhost> <200704050228.11327.vda.linux@googlemail.com> Message-ID: <1175785187.10538.126.camel@localhost> On Thu, 2007-04-05 at 02:28 +0200, Denis Vlasenko wrote: > On Wednesday 04 April 2007 19:34, Natanael Copa wrote: > > To reproduce: > > > > ncopa at nc ~/wrk/src/busybox/svn/busybox $ ./busybox_unstripped find > > findutils/ -prune -name 'f*' > > findutils/.svn/text-base/find.c.svn-base > > findutils/.svn/format > > findutils/find.c > > findutils/find.o > > > > Expected behaviour: > > > > ncopa at nc ~/wrk/src/busybox/svn/busybox $ /usr/bin/find findutils/ -prune > > -name 'f*' > > findutils/a > > > > I have no idea how to fix it. > > Yup. Two bugs here... does attached version work for you? Still has a bug: al-1.5 trunk # ./busybox_unstripped find * -prune -name 'f*' applets/.svn/format arch/.svn/format arch/i386/.svn/format archival/.svn/format archival/libunarchive/.svn/text-base/filter_accept_list.c.svn-base ... al-1.5 trunk # find * -prune -name 'f*' findutils Natanael Copa From coleman.brumley at comcast.net Thu Apr 5 12:02:20 2007 From: coleman.brumley at comcast.net (Coleman Brumley) Date: Thu, 05 Apr 2007 15:02:20 -0400 Subject: httpd logout Message-ID: <461547BC.4030801@comcast.net> Does anyone have an idea of how I could determine an httpd logout? I'm using Basic Auth, and would like to determine when a user logs out. For example, a user logs in and modifies something using a CGI page. In this case, I have "/cgi-bin:user:password" in my httpd.conf. Is there a way, our could someone recommend a way, to determine if "user" has become inactive for, say, 10 seconds? As a test, I tried using SIGALARM, but in hind sight that won't work because of the forked handling of connections. From vda.linux at googlemail.com Thu Apr 5 14:01:30 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:01:30 +0200 Subject: [PATCH] find usage for -user, -group and -depts In-Reply-To: <1175766552.10538.104.camel@localhost> References: <1175766552.10538.104.camel@localhost> Message-ID: <200704052301.30935.vda.linux@googlemail.com> On Thursday 05 April 2007 11:49, Natanael Copa wrote: > Attatched is a patch to update the usage for 'find'. > > Those are added: > -user NAME File is owned by user NAME (numeric user ID allowed) > -group NAME File belongs to group NAME (numeric group ID allowed) > -depth Process directory after traversing it > > This is updated (use capitals like the other places): > (EXPR) Group an expression Thanks, committed to svn. -- vda From vda.linux at googlemail.com Thu Apr 5 14:04:50 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:04:50 +0200 Subject: httpd logout In-Reply-To: <461547BC.4030801@comcast.net> References: <461547BC.4030801@comcast.net> Message-ID: <200704052304.50720.vda.linux@googlemail.com> On Thursday 05 April 2007 21:02, Coleman Brumley wrote: > Does anyone have an idea of how I could determine an httpd logout? > > I'm using Basic Auth, and would like to determine when a user logs out. > For example, a user logs in and modifies something using a CGI page. In > this case, I have "/cgi-bin:user:password" in my httpd.conf. Is there a > way, our could someone recommend a way, to determine if "user" has > become inactive for, say, 10 seconds? As a test, I tried using > SIGALARM, but in hind sight that won't work because of the forked > handling of connections. One solution can be keeping server-side timestamps: ([user,ip], last_time). -- vda From vda.linux at googlemail.com Thu Apr 5 14:22:07 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:22:07 +0200 Subject: [PATCH] patch: don't remove same file twice In-Reply-To: <87bqi3ouyn.fsf@sleipner.barco.com> References: <87bqi3ouyn.fsf@sleipner.barco.com> Message-ID: <200704052322.07806.vda.linux@googlemail.com> On Thursday 05 April 2007 14:40, Peter Korsgaard wrote: > Hi, > > patch fails on patches removing files if original and new filename is > the same because the 2nd unlink fails. The following tiny patch fixes > it. Thanks, applying. Also introducing xunlink() - it's time. -- vda From vda.linux at googlemail.com Thu Apr 5 14:29:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:29:57 +0200 Subject: [PATCH] diff: handle empty dirs In-Reply-To: <87fy7foy6b.fsf@sleipner.barco.com> References: <87fy7foy6b.fsf@sleipner.barco.com> Message-ID: <200704052329.57297.vda.linux@googlemail.com> On Thursday 05 April 2007 13:31, Peter Korsgaard wrote: > Hi, > > diff currently segfaults on empty dirs as dl is null at the assignment > at line 1100. The following tiny patch fixes it. Thanks, applied. -- vda From coleman.brumley at comcast.net Thu Apr 5 14:38:21 2007 From: coleman.brumley at comcast.net (Coleman Brumley) Date: Thu, 05 Apr 2007 17:38:21 -0400 Subject: httpd logout In-Reply-To: <200704052304.50720.vda.linux@googlemail.com> References: <461547BC.4030801@comcast.net> <200704052304.50720.vda.linux@googlemail.com> Message-ID: <46156C4D.1040902@comcast.net> Denis Vlasenko wrote: > On Thursday 05 April 2007 21:02, Coleman Brumley wrote: > >> Does anyone have an idea of how I could determine an httpd logout? >> >> I'm using Basic Auth, and would like to determine when a user logs out. >> For example, a user logs in and modifies something using a CGI page. In >> this case, I have "/cgi-bin:user:password" in my httpd.conf. Is there a >> way, our could someone recommend a way, to determine if "user" has >> become inactive for, say, 10 seconds? As a test, I tried using >> SIGALARM, but in hind sight that won't work because of the forked >> handling of connections. >> > > One solution can be keeping server-side timestamps: ([user,ip], last_time). > -- > vda > > Thanks. That's what I ended up doing, although I split it into 3 stamps, prevuser, previp, prevtime. This is done in checkPerms. - Coleman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070405/70273d1a/attachment.htm From vda.linux at googlemail.com Thu Apr 5 14:40:12 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:40:12 +0200 Subject: BusyBox 1.2.1 piping issue In-Reply-To: <46144786.4080306@comcast.net> References: <4613F1A6.8080406@comcast.net> <200704042011.01576.vapier@gentoo.org> <46144786.4080306@comcast.net> Message-ID: <200704052340.12282.vda.linux@googlemail.com> On Thursday 05 April 2007 02:49, Coleman Brumley wrote: > >> Did you test later versions? Do you have strace output > >> of misbehaving command? > >> > >> strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' > >> > >> .config? On which arch are you? Does it happen on i386? > >> > > > > heh, actually we just noticed this ourselves with busybox 1.4.2 on blackfin: > > echo "" | grep . > > grep seems to crash > > -mike > > > Thanks, Mike and Denis. > > It seems to be the "|" for me, since this also crashes: > > echo $x | cut -d"=" -f1 | tr 'A-Z' 'a-z' > > > strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' > > I don't have strace installed as part of my busybox build. What setting > in .config turns that on? Or did you mean to run the strace command on > my desktop? strace is not in busybox, it's separate package. You can try building strace for the target. Or you can try to collect more data by building busybox on desktop machine, with same .config, and test it. IOW: we need more data points. -- vda From coleman.brumley at comcast.net Thu Apr 5 14:31:17 2007 From: coleman.brumley at comcast.net (Coleman Brumley) Date: Thu, 05 Apr 2007 17:31:17 -0400 Subject: BusyBox 1.2.1 piping issue In-Reply-To: <46144786.4080306@comcast.net> References: <4613F1A6.8080406@comcast.net> <200704050131.37639.vda.linux@googlemail.com> <200704042011.01576.vapier@gentoo.org> <46144786.4080306@comcast.net> Message-ID: <46156AA5.6080601@comcast.net> Coleman Brumley wrote: > > Mike Frysinger wrote: >> On Wednesday 04 April 2007, Denis Vlasenko wrote: >> >>> On Wednesday 04 April 2007 20:42, Coleman Brumley wrote: >>> >>>> Hello. >>>> >>>> I'm having an issue with BusyBox v1.21 and piping. It seems as though >>>> piping is causing busybox to restart/crash. >>>> >>>> For example: >>>> /# echo abcd | grep a >>>> >>>> >>>> BusyBox v1.2.1 (2007.03.26-18:36+0000) Built-in shell (ash) >>>> Enter 'help' for a list of built-in commands./ >>>> >>>> Has anyone run into this or anything similar? >>>> >>> Did you test later versions? Do you have strace output >>> of misbehaving command? >>> >>> strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' >>> >>> .config? On which arch are you? Does it happen on i386? >>> >> >> heh, actually we just noticed this ourselves with busybox 1.4.2 on blackfin: >> echo "" | grep . >> grep seems to crash >> -mike >> >> > Thanks, Mike and Denis. > > It seems to be the "|" for me, since this also crashes: > > echo $x | cut -d"=" -f1 | tr 'A-Z' 'a-z' > > > strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' > > I don't have strace installed as part of my busybox build. What > setting in .config turns that on? Or did you mean to run the strace > command on my desktop? > > This is for an arm platform cross compiled using gcc v3.4.1. I don't > know if it happens on i386, since I haven't built for that arch, just > arm. My .config is attached. > FYI, I recompiled with "CONFIG_TR=y" in my .config and the pipe is working now. find . -name *.c -exec grep -Hi "CONFIG_TR" {} \; doesn't result in anything, so I'm not sure where the dependency is, if there even is one. - Coleman > >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> busybox mailing list >> busybox at busybox.net >> http://busybox.net/cgi-bin/mailman/listinfo/busybox > ------------------------------------------------------------------------ > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070405/d8f7a1e6/attachment.htm From vda.linux at googlemail.com Thu Apr 5 14:41:28 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:41:28 +0200 Subject: svn commit: trunk/busybox/coreutils In-Reply-To: <20070405092616.GC15883@aon.at> References: <20070404135834.9511148084@busybox.net> <200704050238.22003.vda.linux@googlemail.com> <20070405092616.GC15883@aon.at> Message-ID: <200704052341.28174.vda.linux@googlemail.com> On Thursday 05 April 2007 11:26, Bernhard Fischer wrote: > On Thu, Apr 05, 2007 at 02:38:21AM +0200, Denis Vlasenko wrote: > >On Wednesday 04 April 2007 15:58, aldot at busybox.net wrote: > >> @@ -66,9 +68,9 @@ > >> static char const *human_fstype(long f_type) > >> { > >> int i; > >> - static const struct types { > >> + const struct types { > >> long type; > > > >Why did you remove 'static' here? > > It went into bss which i thought should be avoided? No, constants go to rodata. -- vda From coleman.brumley at comcast.net Thu Apr 5 14:51:11 2007 From: coleman.brumley at comcast.net (Coleman Brumley) Date: Thu, 05 Apr 2007 17:51:11 -0400 Subject: BusyBox 1.2.1 piping issue In-Reply-To: <200704052340.12282.vda.linux@googlemail.com> References: <4613F1A6.8080406@comcast.net> <200704042011.01576.vapier@gentoo.org> <46144786.4080306@comcast.net> <200704052340.12282.vda.linux@googlemail.com> Message-ID: <46156F4F.3020209@comcast.net> Denis Vlasenko wrote: > On Thursday 05 April 2007 02:49, Coleman Brumley wrote: > >>>> Did you test later versions? Do you have strace output >>>> of misbehaving command? >>>> >>>> strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' >>>> >>>> .config? On which arch are you? Does it happen on i386? >>>> >>>> >>> heh, actually we just noticed this ourselves with busybox 1.4.2 on blackfin: >>> echo "" | grep . >>> grep seems to crash >>> -mike >>> >>> >> Thanks, Mike and Denis. >> >> It seems to be the "|" for me, since this also crashes: >> >> echo $x | cut -d"=" -f1 | tr 'A-Z' 'a-z' >> >> >>> strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' >>> >> I don't have strace installed as part of my busybox build. What setting >> in .config turns that on? Or did you mean to run the strace command on >> my desktop? >> > > strace is not in busybox, it's separate package. > You can try building strace for the target. > > Or you can try to collect more data by building busybox > on desktop machine, with same .config, and test it. > > IOW: we need more data points. > -- > vda > > Believe me, I understand. "It's broke" isn't very helpful. If I get a chance to compile strace for my arch, I'll provide the log. Would it really be useful to get an strace off my desktop since that's a different compiler, etc.? - Coleman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070405/9248843b/attachment-0001.htm From vda.linux at googlemail.com Thu Apr 5 14:56:08 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:56:08 +0200 Subject: Where is my shell ? In-Reply-To: <007e01c7774b$64941f70$6402a8c0@nucleus> References: <007701c77506$0f58f450$6402a8c0@nucleus> <200704050032.29935.vda.linux@googlemail.com> <007e01c7774b$64941f70$6402a8c0@nucleus> Message-ID: <200704052356.08307.vda.linux@googlemail.com> On Thursday 05 April 2007 08:26, Levend Sayar wrote: > >In init, does exec() which starts /bin/sh (as configured in your inittab) > >succeeds? > > In fact I don't know what is going on the user-land. Since ,as the log I > posted show, nothing can be seen but kernel printk's. I tried kernel > parameter init=/bin/sh also. And I tried init=myinit (myinit is an app > written by me and just open(/dev/console) and writes something) > as a last try. Again result is failure. Don't open /dev/console. Kernel already supplies open fds #0,1,2. Just do: write(1, "hello?", 6); write(2, "world?", 6); compile and boot with init=/helloworld. If this doesn't work, you have a problem with toolchain. -- vda From vda.linux at googlemail.com Thu Apr 5 14:59:46 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Apr 2007 23:59:46 +0200 Subject: [PATCH] Add -t noproc,tmpfs options to mount/umount In-Reply-To: <1175759521.10538.87.camel@localhost> References: <20070404181013.55828223@uberlaptop.marples.name> <20070404230302.760ccdbd@uberpc.marples.name> <1175759521.10538.87.camel@localhost> Message-ID: <200704052359.46069.vda.linux@googlemail.com> On Thursday 05 April 2007 09:52, Natanael Copa wrote: > On Wed, 2007-04-04 at 23:03 +0100, Roy Marples wrote: > > On Wed, 4 Apr 2007 22:36:16 +0100 > > Roy Marples wrote: > > > > > On Wed, 4 Apr 2007 21:44:04 +0200 > > > Bernhard Fischer wrote: > > > > a) put common funcs into libbb/*.c, see loop.c as an example. > > > > b) both strncmp as well as strlen are most likely much bloatier than > > > > needed. Let me point to current trunk's coreutils/dd.c and there the > > > > block below "what == OP_conv". An alternative to strstr is of course > > > > memchr(,,64) or the like. > > > > > > Revised patch attached. > > > > Of course it would help if it sent the right value if nothing matched - > > heh. > > > > This should work will all situations I can think of. > > Patch works for me and fixes a long time annoyance. Cool. Applying to svn. > Denis, could it please be added to 1.5.0 fixes? Well... I'd rather not put in fixes stuff which is not a fix for regression or serious bug. -- vda From vda.linux at googlemail.com Thu Apr 5 15:17:00 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Apr 2007 00:17:00 +0200 Subject: BusyBox 1.2.1 piping issue In-Reply-To: <46156AA5.6080601@comcast.net> References: <4613F1A6.8080406@comcast.net> <46144786.4080306@comcast.net> <46156AA5.6080601@comcast.net> Message-ID: <200704060017.00865.vda.linux@googlemail.com> On Thursday 05 April 2007 23:31, Coleman Brumley wrote: > >>> strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' > >>> > >>> .config? On which arch are you? Does it happen on i386? > >> > >> heh, actually we just noticed this ourselves with busybox 1.4.2 on blackfin: > >> echo "" | grep . > >> grep seems to crash > >> -mike > >> > > Thanks, Mike and Denis. > > > > It seems to be the "|" for me, since this also crashes: > > > > echo $x | cut -d"=" -f1 | tr 'A-Z' 'a-z' > > > > > strace -f -o file.log ./busybox ash -c 'echo abcd | grep a' > > > > I don't have strace installed as part of my busybox build. What > > setting in .config turns that on? Or did you mean to run the strace > > command on my desktop? > > > > This is for an arm platform cross compiled using gcc v3.4.1. I don't > > know if it happens on i386, since I haven't built for that arch, just > > arm. My .config is attached. This .config seems to work on i386 on current svn: # ./busybox ash BusyBox v1.6.0.svn (2007-04-06 00:11:23 CEST) Built-in shell (ash) Enter 'help' for a list of built-in commands. # echo hi | cat | dd | cat | dd | cat | dd | cat | dd | cat | dd | wc -l 0+1 records in 0+1 records out 0+1 records in 0+1 records out 0+1 records in 0+1 records out 0+1 records in 0+1 records out 0+1 records in 0+1 records out 1 # echo hi | cat | dd | cat | dd | cat | dd | cat | dd | cat | dd | sed 's/i/o/' 0+1 records in 0+1 records out 0+1 records in 0+1 records out 0+1 records in 0+1 records out 0+1 records in 0+1 records out 0+1 records in 0+1 records out ho > FYI, I recompiled with "CONFIG_TR=y" in my .config and the pipe is > working now. > > find . -name *.c -exec grep -Hi "CONFIG_TR" {} \; doesn't result in > anything, so I'm not sure where the dependency is, if there even is one. Also ENABLE_TR, USE_TR, SKIP_TR... Re stracing: it is likely to end up not showing anything useful, so don't try very hard. Think about other ways to find it, like inserting fprintf(stderr,"i am here\n") - type debug prints. -- vda From mats.andersson64 at comhem.se Thu Apr 5 17:11:30 2007 From: mats.andersson64 at comhem.se (Mats Erik Andersson) Date: Fri, 06 Apr 2007 02:11:30 +0200 Subject: [PATCH] Two trivial space savers: cmp.c and uname.c Message-ID: <1175818290.4102.11.camel@localhost> Hi there, replacing two static string constants for macro strings, saves a mediocre 3 + 8 bytes. Not much, but could be considered. Regards Mats E A -------------- next part -------------- A non-text attachment was scrubbed... Name: trivialize_options.diff Type: text/x-patch Size: 615 bytes Desc: Url : http://busybox.net/lists/busybox/attachments/20070406/f7555f1f/attachment.bin From bestleehj at hotmail.com Fri Apr 6 02:25:19 2007 From: bestleehj at hotmail.com (leebestleehj) Date: Fri, 6 Apr 2007 17:25:19 +0800 Subject: Can't telnetd Message-ID: Hi; I want to use the telnetd, and follow the configure ;but i meet the fault: ......................... Trying 192.168.0.141...Connected to 192.168.0.141 (192.168.0.141).Escape character is '^]'.Connection closed by foreign host. Could someone tell me what i do next? ///////////////////////////////////////////// My configure: ====linux kernel Character devices [*] Unix98 PTY support (32) Maximum number of Unix98 PTYs in use (0-2048) === linux kernel File systems [*] /proc file system support x x[*] /dev file system support (EXPERIMENTAL) x x[ ] Automatically mount at boot x x[ ] Debug devfs x x[*] /dev/pts file system for Unix98 PTYs ================buybox config [*] Use the devpts filesystem for Unix98 PTYs [*] telnetd [*] Support call from inetd only =======================/etd/* ==== fstab init.d nsswitch.conf protocolsgroup inittab passwd servicesinetd.conf profile ===inetd.conftelnet stream tcp nowait root /sbin/telnetd telnetd -l /bin/login ===init.d/rcS #! /bin/sh/bin/mount -a/sbin/inetd /etc/inetd.conf ====cat inittab::sysinit:/etc/init.d/rcS::respawn:-/bin/sh::ctrlaltdel:/bin/umount -a -r ====services telnet 23/tcp _________________________________________________________________ ?? Live.com ??????????????????? http://www.live.com/getstarted.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070406/7ea3c681/attachment.htm From levend.sayar at karel.com.tr Fri Apr 6 07:45:32 2007 From: levend.sayar at karel.com.tr (Levend Sayar) Date: Fri, 6 Apr 2007 17:45:32 +0300 Subject: Where is my shell ? (Static vs. Dynamic) References: <007701c77506$0f58f450$6402a8c0@nucleus> <200704050032.29935.vda.linux@googlemail.com> <007e01c7774b$64941f70$6402a8c0@nucleus> <200704052356.08307.vda.linux@googlemail.com> Message-ID: <014701c7785a$3cbe4240$6402a8c0@nucleus> I changed my toolchain completely and upgraded busybox. Current configuration: Host : gcc 3.2.2 kernel 2.4.20 glibc 2.3.2 binutils 2.13 This is the linux box I compile everything, kernel,busybox,etc On my target I am using kernel 2.4.32 busybox 1.4.2 libc-2.3.2 ld-2.3.2 I have 2 problems: 1)At last, I succeeded an user app to write something to my console. But if I compile it as static, not dynamic. This is true for busybox also. Why dynamc linking stuff does not work? 2) Yes , busybox writes its banner to console. Even the shel writes the banner below: BusyBox v1.4.2 (2007-04-05 14:53:35 EEST) Built-in shell (ash) Enter 'help' for a list of built-in commands. # But unfortunately, the shell does not receive my commands. When you write "ls" for example, nothing written. _lvnd_ (^_^) ----------------------------------------------------------------------- Bu mesaj Karel MailScanner ile tehlikeli icerik ve virus kontrolunden gecirilmistir. KAREL A.S. - Bilgi Teknolojileri Bolumu This message has been scanned for viruses and dangerous content by Karel MailScanner, and is believed to be clean. KAREL A.S. - Information Technologies Department From rep.dot.nop at gmail.com Fri Apr 6 08:06:44 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Fri, 6 Apr 2007 17:06:44 +0200 Subject: [PATCH] shrink wget a bit; use skip_non_whitespace some more Message-ID: <20070406150644.GA5324@aon.at> Hi vda, all Attached patch shrinks wget a little bit and uses skip_non_whitespace in some additional places. vda, please checkin if you like it. TIA PS: statistics: text data bss dec hex filename 612469 2764 18416 633649 9ab31 bb_un.r18346-4.1 612389 2764 18416 633569 9aae1 busybox_unstripped -------------- next part -------------- A non-text attachment was scrubbed... Name: bb.wget-shrinkage.00.diff Type: text/x-diff Size: 10629 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070406/836831eb/attachment-0001.bin From dlclark at chtech.com Fri Apr 6 09:29:37 2007 From: dlclark at chtech.com (dlclark at chtech.com) Date: Fri, 06 Apr 2007 12:29:37 -0400 Subject: =?US-ASCII?B?emNpcCB3b3JrcyBpbiBmb3JlZ3JvdW5kIGJ1dCBmYWlscyBhcyBkYWVtb24=?= Message-ID: <200704061629.l36GTd57064396@mmm2634.sbc-webhosting.com> What am I missing? Running zcip from the command prompt with the ?f or ?v option gets me an IP address, but if I run it as a daemon it does not. Unfortunately it does not give me any indication why. I suspect that syslog may give me more info but I don?t have it up and running. I figure this is something simple. I?ve tried two scripts as seen below. David Clark <<<<<<<<<<<<< zcip.script >>>>>>>>>>>>>>>>> #!/bin/ash # only for use as a "zcip" callback script if [ "x$interface" = x ] then exit 1 fi # zcip should start on boot/resume and various media changes case "$1" in init) # for now, zcip requires the link to be already up, # and it drops links when they go down. that isn't # the most robust model... exit 0 ;; config) if [ "x$ip" = x ] then exit 1 fi exec ip address add dev $interface \ scope link local "$ip/16" broadcast + exit 0 ;; deconfig) if [ x$ip = x ] then exit 1 fi exec ip address del dev $interface local $ip exit 0 ;; esac exit 1 <<<<<<<<<<<<< zcip-2.script >>>>>>>>>>>>>>>>> #!/bin/ash # only for use as a "zcip" callback script if [ "x$interface" = x ] then exit 1 fi # zcip should start on boot/resume and various media changes case "$1" in init) # for now, zcip requires the link to be already up, # and it drops links when they go down. that isn't # the most robust model... /sbin/ifconfig $interface up exit 0 ;; config) if [ "x$ip" = x ] then exit 1 fi /sbin/ifconfig $interface $ip netmask 255.255.0.0 exit 0 ;; deconfig) if [ x$ip = x ] then exit 1 fi /sbin/ifconfig $interface down exit 0 ;; esac exit 1 From ddaney at avtrex.com Fri Apr 6 10:13:58 2007 From: ddaney at avtrex.com (David Daney) Date: Fri, 06 Apr 2007 10:13:58 -0700 Subject: zcip works in foreground but fails as daemon In-Reply-To: <200704061629.l36GTd57064396@mmm2634.sbc-webhosting.com> References: <200704061629.l36GTd57064396@mmm2634.sbc-webhosting.com> Message-ID: <46167FD6.4070601@avtrex.com> dlclark at chtech.com wrote: > What am I missing? Running zcip from the command prompt with the ?f or ?v option gets me an IP address, but if I run it as a daemon it does not. Unfortunately it does not give me any indication why. I suspect that syslog may give me more info but I don?t have it up and running. I figure this is something simple. I?ve tried two scripts as seen below. > You don't say which version of busybox/zcip. It could be this problem: http://www.busybox.net/lists/busybox/2007-February/026359.html > David Clark > > <<<<<<<<<<<<< zcip.script >>>>>>>>>>>>>>>>> > #!/bin/ash > > # only for use as a "zcip" callback script > if [ "x$interface" = x ] > then > exit 1 > fi > > # zcip should start on boot/resume and various media changes > case "$1" in > init) > # for now, zcip requires the link to be already up, > # and it drops links when they go down. that isn't > # the most robust model... > exit 0 > ;; > config) > if [ "x$ip" = x ] > then > exit 1 > fi > exec ip address add dev $interface \ > scope link local "$ip/16" broadcast + > exit 0 > ;; > deconfig) > if [ x$ip = x ] > then > exit 1 > fi > exec ip address del dev $interface local $ip > exit 0 > ;; > esac > exit 1 > > <<<<<<<<<<<<< zcip-2.script >>>>>>>>>>>>>>>>> > #!/bin/ash > > # only for use as a "zcip" callback script > if [ "x$interface" = x ] > then > exit 1 > fi > > # zcip should start on boot/resume and various media changes > case "$1" in > init) > # for now, zcip requires the link to be already up, > # and it drops links when they go down. that isn't > # the most robust model... > /sbin/ifconfig $interface up > exit 0 > ;; > config) > if [ "x$ip" = x ] > then > exit 1 > fi > /sbin/ifconfig $interface $ip netmask 255.255.0.0 > exit 0 > ;; > deconfig) > if [ x$ip = x ] > then > exit 1 > fi > /sbin/ifconfig $interface down > exit 0 > ;; > esac > exit 1 > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox From vda.linux at googlemail.com Fri Apr 6 18:21:23 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 7 Apr 2007 03:21:23 +0200 Subject: Can't telnetd In-Reply-To: References: Message-ID: <200704070321.23863.vda.linux@googlemail.com> On Friday 06 April 2007 11:25, leebestleehj wrote: > Hi; > I want to use the telnetd, and follow the configure ;but i meet the fault: > ......................... > Trying 192.168.0.141...Connected to 192.168.0.141 (192.168.0.141).Escape character is '^]'.Connection closed by foreign host. > > Could someone tell me what i do next? You should describe problem in more details. Is telnetd on the server from busybox? Which version? etc... -- vda From vda.linux at googlemail.com Fri Apr 6 18:33:14 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 7 Apr 2007 03:33:14 +0200 Subject: [REWRITE] hexdump.c rewritten to use getopt32 In-Reply-To: <1175625812.7124.40.camel@localhost> References: <1175625812.7124.40.camel@localhost> Message-ID: <200704070333.14514.vda.linux@googlemail.com> Hi Mats, Thanks for your work! On Tuesday 03 April 2007 20:43, Mats Erik Andersson wrote: > Fellow code workers, > > let me post a recoding of hexdump.c that now uses > the functionality of getopt32. Since the difference > file is slightly larger than the rewritten code, > I post the full source. > > Using bloat-o-meter, a decrease of 47 bytes is calculated. getopt32() is cute, eh? :) > However, due to the inherent construction of getopt32, > which scrambles any order of option flags, this version > of hexdump will only allow one hard coded ordering for > output: at present -b -c -d -o -x, one row after the other. > Is this really a serious shortcoming? There bound to be people who depend on that. I'm afraid getting rid of getopt() in this applet is not worth the regression. If we will ever have getopt32 without getopt used beneath, hexdump can be either deselected in .config or, if getopt-less compilation can be detected (introduce CONFIG_GETOPT?), it can be coditionally compiled: #if ENABLE_GETOPT while ((ch = getopt(argc, argv, hexdump_opts)) > 0) { p = strchr(hexdump_opts, ch); if (!p) bb_show_usage(); if ((p - hexdump_opts) < 5) { bb_dump_add(add_first); bb_dump_add(add_strings[(int)(p - hexdump_opts)]); } else if (ch == 'C') { ... #else ch = getopt32(argc, argv, "bcdoxCe:f:n:s:v", // hexdump_opts, &e_arg, &f_arg, &n_arg, &s_arg); for (pcnt=0, oflg=1; pcnt < 5; pcnt++, oflg <<= 1) { if (ch & oflg) { bb_dump_add(add_first); bb_dump_add(add_fmthead); bb_dump_add(add_strings[pcnt]); } } if (ch & OPT_C) { bb_dump_add("\"%08.8_Ax\n\""); bb_dump_add("\"%08.8_ax \" 8/1 \"%02x \" \" \" 8/1 \"%02x \" "); bb_dump_add("\" |\" 16/1 \"%_p\" \"|\\n\""); } ... #endif Care to do it? -- vda From rep.dot.nop at gmail.com Sat Apr 7 02:26:02 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Sat, 7 Apr 2007 11:26:02 +0200 Subject: CFLAGS for debug info In-Reply-To: <20070407033842.22578.qmail@web63707.mail.re1.yahoo.com> References: <20070407033842.22578.qmail@web63707.mail.re1.yahoo.com> Message-ID: <20070407092602.GA23570@aon.at> On Fri, Apr 06, 2007 at 08:38:42PM -0700, Maria Arpa wrote: >Hello, > I want to add debugging information to busybox build. Please tell me how can I add -g flag to the build. Busybox Settings ---> Debugging Options ---> [*] Build BusyBox with extra Debugging symbols From vda.linux at googlemail.com Sat Apr 7 03:59:41 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 7 Apr 2007 12:59:41 +0200 Subject: [PATCH] shrink wget a bit; use skip_non_whitespace some more In-Reply-To: <20070406150644.GA5324@aon.at> References: <20070406150644.GA5324@aon.at> Message-ID: <200704071259.41782.vda.linux@googlemail.com> On Friday 06 April 2007 17:06, Bernhard Fischer wrote: > Hi vda, all > > Attached patch shrinks wget a little bit and uses skip_non_whitespace in > some additional places. > > vda, please checkin if you like it. --- libbb/str_tolower.c (revision 0) +++ libbb/str_tolower.c (revision 0) @@ -0,0 +1,11 @@ +/* vi set: sw=4 ts=4: */ +/* Licensed under GPLv2 or, at your opinion, any later version */ +//XXX: use default blob above +#include "libbb.h" My built-in English translator failed here. What this XXX means? > TIA > > PS: statistics: > text data bss dec hex filename > 612469 2764 18416 633649 9ab31 bb_un.r18346-4.1 > 612389 2764 18416 633569 9aae1 busybox_unstripped Looks good to me. Please feel free to apply. Thanks! -- vda From vda.linux at googlemail.com Sat Apr 7 04:02:08 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 7 Apr 2007 13:02:08 +0200 Subject: [PATCH] Two trivial space savers: cmp.c and uname.c In-Reply-To: <1175818290.4102.11.camel@localhost> References: <1175818290.4102.11.camel@localhost> Message-ID: <200704071302.08378.vda.linux@googlemail.com> On Friday 06 April 2007 02:11, Mats Erik Andersson wrote: > Hi there, > > replacing two static string constants for > macro strings, saves a mediocre 3 + 8 bytes. > Not much, but could be considered. I'm afraid not. bloatcheck simply don't see anonymous const strings, but they are still there in rodata. do "size old.o new.o" and you will see. -- vda From vapier at gentoo.org Sat Apr 7 04:17:46 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sat, 7 Apr 2007 07:17:46 -0400 Subject: help needed to bringup init and shell In-Reply-To: <20070407033620.43554.qmail@web63710.mail.re1.yahoo.com> References: <20070407033620.43554.qmail@web63710.mail.re1.yahoo.com> Message-ID: <200704070717.48869.vapier@gentoo.org> On Friday 06 April 2007, Maria Arpa wrote: > I need your help in bringing up busybox on my arm9 based platform. (1) dont e-mail busybox-cvs ... this not a list for people to post to (2) you should seek help on a Linux From Scratch mailing list -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070407/03ff67d5/attachment.pgp From vda.linux at googlemail.com Sat Apr 7 13:35:00 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 7 Apr 2007 22:35:00 +0200 Subject: bug in busybox find -prune? In-Reply-To: <1175785187.10538.126.camel@localhost> References: <1175708065.10538.52.camel@localhost> <200704050228.11327.vda.linux@googlemail.com> <1175785187.10538.126.camel@localhost> Message-ID: <200704072235.00044.vda.linux@googlemail.com> On Thursday 05 April 2007 16:59, Natanael Copa wrote: > > > Expected behaviour: > > > > > > ncopa at nc ~/wrk/src/busybox/svn/busybox $ /usr/bin/find findutils/ -prune > > > -name 'f*' > > > findutils/a > > > > > > I have no idea how to fix it. > > > > Yup. Two bugs here... does attached version work for you? > > Still has a bug: > al-1.5 trunk # ./busybox_unstripped find * -prune -name 'f*' > applets/.svn/format > arch/.svn/format > arch/i386/.svn/format > archival/.svn/format > archival/libunarchive/.svn/text-base/filter_accept_list.c.svn-base > ... > > al-1.5 trunk # find * -prune -name 'f*' > findutils Please try this one. (patch and drop-in replacement are attached, they are the same). -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 6.patch Type: text/x-diff Size: 4678 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070407/178eca56/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: find_fixed_prune2.c Type: text/x-csrc Size: 19338 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070407/178eca56/attachment.c From vda.linux at googlemail.com Sat Apr 7 14:08:40 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 7 Apr 2007 23:08:40 +0200 Subject: help needed to bringup init and shell In-Reply-To: <20070407033620.43554.qmail@web63710.mail.re1.yahoo.com> References: <20070407033620.43554.qmail@web63710.mail.re1.yahoo.com> Message-ID: <200704072308.40607.vda.linux@googlemail.com> On Saturday 07 April 2007 05:36, Maria Arpa wrote: > Hello, > I need your help in bringing up busybox on my arm9 based platform. Here are some details: > 1- I have Linux kernel 2.6.17 brought up on my arm9 based platform. I am able to put a small > program and get it executed as /sbin/init. This program opens a file descriptor at > "/dev/ttyS1" and is able to read and write. > 2- My next step is to bringup a shell on my platform. I want to use busybox for this. > Following are some details: > - I use ramdisk. > Directories and files: > /etc/inittab > /etc/init.d/rcS > /dev/console > /dev/ttyS0 > /dev/ttyS1 > /sbin/init [symlink to busybox program in /bin/busybox] > /sbin/getty [symlink to busybox program in /bin/busybox] > /bin/busybox > /bin/* [commonly used programs - symlink to busybox] Do you have working /bin/sh? > - inittab file details > null::sysinit:/bin/mount -o remount,rw / > null::sysinit:/bin/mount -t proc proc /proc > null::sysinit:/bin/mount -a > ttyS1::sysinit:/etc/init.d/rcS > ttyS1::respawn:/sbin/getty 57600 ttyS1 > > - init.d/rcS file > #!/bin/sh > #nothing more here > 3- I am stuck at following place: > I have kernel boot up and give control to init. I have busybox as my init. I donot see > the starting init message and the prompt doesn't come. I have a strange print as below, > sh: appl > (n Looks like init says "sh: applet not found" (or tries to). Please boot with init=/bin/sh and try to run sysinit actions by hand. Does "/etc/init.d/rcS" work, for example? -- vda From vda.linux at googlemail.com Sun Apr 8 09:01:18 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 8 Apr 2007 18:01:18 +0200 Subject: smallint usage guidelines Message-ID: <1158166a0704080901l215d93a2k3fb4225504a96673@mail.gmail.com> Hi Bernhart, smalluint i = index_in_str_array(params, name) + 1; if (i == 0) return 0; if (!(i == 4 || i == 5)) i |= 0x80; return i; I think that this optimization is wrong. index_in_str_array returns int. At best, compiler will use it as-is. At worst, compiler will try to make sure that it is properly casted into byte, which probably results in "n = n & 0xff" on many architectures. You save nothing on space here because i is not stored on-stack, gcc will keep it in register. And even it is *is* stored, it is *stack* storage, which is cheap (unlike data/bss). small[u]ints are useful _mostly_ for: (a) flag variables (a1) global flag variables - make data/bss smaller (a2) local flag variables - "a = 5", "a |= 0x40" are smaller for bytes than for full integers. Example: on i386, there is no widening constant store instruction for some types of address modes, thus movl $0x0,(%eax) is "c7 00 00 00 00 00" movb $0x0,(%eax) is "c6 00 00" (b) small integer structure members, when you have many such structures allocated, or when these are global objects of this structure type small[u]ints are *NOT* useful for: (a) function parameters and return values - they are pushed on-stack or stored in registers, bytes here are *harder* to deal with than ints (b) "computational" variables - "a++", "a = b*3 + 7" may take more code to do on bytes than on ints on some architectires. Comments? -- vda From vda.linux at googlemail.com Sun Apr 8 20:24:51 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 9 Apr 2007 05:24:51 +0200 Subject: help needed to bringup init and shell In-Reply-To: <20070408124658.92390.qmail@web63704.mail.re1.yahoo.com> References: <20070408124658.92390.qmail@web63704.mail.re1.yahoo.com> Message-ID: <200704090524.51226.vda.linux@googlemail.com> On Sunday 08 April 2007 14:46, Maria Arpa wrote: > Hello Denis, > First very very thanks for replying. One gentleman > asked me not to email such queries on this mailing > list, so I am sending you personal email. I am sorry > for this but need your help badly. He probably means that your question is not about busybox per se, but more like "how to make my embedded system boot". > I am using Codesourcery toolchain to build static > busybox. I tried giving init=/bin/sh to linux kernel > as boot param, with /bin/sh being a symlink to > busybox. However, I don't see anything coming out on > serial port "/dev/ttyS1". I wrote a small app to do > read and write on /dev/ttyS1 and it works fine. > How do I tell busybox to print on /dev/ttyS1. I think > it uses inittab for this but with that also it doesnt > print. I think there is a kernel option for that. Documentation/kernel-parameters.txt" console= [KNL] Output console Console device and comm spec (speed, control, parity). 30 seconds of Googling produced this: http://www.vanemery.com/Linux/Serial/serial-console.html Looks like it is explained there. > When do we get "sh: applet not found" print and what > can be wrong for it to suddenly vanish in the middle, > any thoughts will help me move forward. This is what basically happens: # ./busybox sdfgsdfg sdfgsdfg: applet not found With symlink: # ln -s busybox sdfgsdfg # ./sdfgsdfg sdfgsdfg: applet not found You have the similar situation with "sh". Your busybox simply doesn't know what is "sh"! Please show your .config and ls -l /bin. -- vda From levend.sayar at karel.com.tr Mon Apr 9 02:04:34 2007 From: levend.sayar at karel.com.tr (Levend Sayar) Date: Mon, 9 Apr 2007 12:04:34 +0300 Subject: Non-interactive interactive shell !! Message-ID: <007201c77a86$24b0c780$6402a8c0@nucleus> Hi, all My current problem with busybox is getting a really interactive shell. Since my shell does not respond to any command. I posted my log coming from my embedded board console. Below you will see lines starting with "LS:". They are belong to printk's inserted into kernel code by me. And also I added a driver KLOG into the kernel (Not module). It simply printk whatever written to it from user-space. It is a gateway from user-space to kernel ring buffer. So I changed ash.c to use my device, not trace into "./trace" file. My motive was to see what's going on when ash shell started to run,since it has built-in trace code when you define DEBUG as 2. Please refer to my last post with subject "Where is my shell ? (Static vs. Dynamic)" to see my configuration. TIA Uncompressing Linux... Ok, booting the kernel. Linux version 2.4.32 (root at soft2000) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #48 Fri Apr 6 20:21:58 EEST 2007 BIOS-provided physical RAM map: BIOS-e801: 0000000000000000 - 000000000009f000 (usable) BIOS-e801: 0000000000100000 - 0000000000a00000 (usable) 10MB LOWMEM available. On node 0 totalpages: 2560 zone(0): 2560 pages. zone(1): 0 pages. zone(2): 0 pages. DMI not present. Kernel command line: root=/dev/ram rw Initializing CPU#0 Calibrating delay loop... 4.04 BogoMIPS Memory: 4824k/10240k available (511k kernel code, 5028k reserved, 101k data, 40k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... No. Dentry cache hash table entries: 2048 (order: 2, 16384 bytes) Inode cache hash table entries: 1024 (order: 1, 8192 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 4096 (order: 2, 16384 bytes) CPU: 386 Checking 'hlt' instruction... disabled Checking for popad bug... OK. POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Starting kswapd pty: 256 Unix98 ptys configured KLOG: Initializing (Build: Apr 5 2007 - 20:17:21) Serial driver version 5.05c (2001-07-08) with no serial options enabled ttyS00 at 0x03f8 (irq = 4) is a 16450 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize LS:sys_open(/dev/ram) LS:sys_open(/dev/ram)->0 LS:sys_open(/dev/initrd) LS:sys_open(/dev/initrd)->1 RAMDISK: ext2 filesystem found at block 0 RAMDISK: Loading 4096 blocks [1 disk] into ram disk... done. LS:sys_close(1) Freeing initrd memory: 4096k freed LS:sys_close(0) EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended VFS: Mounted root (ext2 filesystem). Freeing unused kernel memory: 40k freed LS:sys_open(/dev/console) LS:sys_open(/dev/console)->0 LS:run_init_process(/sbin/init) LS:do_execve(/sbin/init) LS:sys_close(3) LS:sys_open(/dev/klog) KLOG: Opened LS:sys_open(/dev/klog)->3 KLOG: main at busybox.c LS:sys_close(3) KLOG: Released LS:sys_open(/dev/ttyS0) LS:sys_open(/dev/ttyS0)->3 LS:sys_close(3) LS:sys_open(/dev/ttyS0) LS:sys_open(/dev/ttyS0)->3 console=/dev/ttyS0 LS:sys_close(0) LS:sys_close(1) LS:sys_close(2) LS:sys_open(/dev/ttyS0) LS:sys_open(/dev/ttyS0)->0 LS:sys_close(0) init started: BusyBox v1.4.2 (2007-04-09 10:09:53 EEST) multi-call binary LS:sys_open(/dev/console) LS:sys_open(/dev/console)->0 init started: BusyBox v1.4.2 (2007-04-09 10:09:53 EEST) multi-call binary LS:sys_close(0) LS:sys_open(/etc/inittab) LS:sys_open(/etc/inittab)->0 command='/etc/init.d/rcS' action='1' terminal='/dev/ttyS0' LS:sys_open(/dev/console) LS:sys_open(/dev/console)->1 command='/etc/init.d/rcS' action='1' terminal='/dev/ttyS0' LS:sys_close(1) command='-/bin/sh -i' action='2' terminal='/dev/ttyS0' LS:sys_open(/dev/console) LS:sys_open(/dev/console)->1 command='-/bin/sh -i' action='2' terminal='/dev/ttyS0' LS:sys_close(1) LS:sys_close(0) LS:sys_close(0) LS:sys_close(1) LS:sys_close(2) LS:sys_open(/dev/ttyS0) LS:sys_open(/dev/ttyS0)->0 Starting pid 8, console /dev/ttyS0: '/etc/init.d/rcS' LS:do_execve(/etc/init.d/rcS) LS:sys_close(3) LS:sys_close(4) LS:sys_open(/dev/klog) KLOG: Opened LS:sys_open(/dev/klog)->3 KLOG: main at busybox.c LS:sys_close(3) KLOG: Released LS:sys_open(/etc/init.d/rcS) LS:sys_open(/etc/init.d/rcS)->3 LS:sys_close(3) LS:sys_open(/dev/klog) KLOG: Opened LS:sys_open(/dev/klog)->3 KLOG: KLOG: Tracing started. KLOG: LS:interactive(0) KLOG: cmdloop(1) called KLOG: token newline KLOG: evaltree(NULL) called KLOG: token newline KLOG: evaltree(NULL) called KLOG: token word /bin/mount KLOG: pipeline: entered KLOG: reread token word /bin/mount KLOG: reread token word /bin/mount KLOG: reread token word /bin/mount KLOG: token word -a KLOG: token newline KLOG: reread token newline KLOG: reread token newline KLOG: reread token newline KLOG: pid 8, evaltree(0x80d73bc: 0, 0) called KLOG: evalcommand(0x80d73bc, 0) called KLOG: evalcommand arg: /bin/mount KLOG: evalcommand arg: -a KLOG: makejob(0x80d73bc, 1) returns %1 KLOG: forkshell(%1, 0x80d73bc, 0) called KLOG: Child shell 9 LS:sys_close(10) LS:do_execve(/bin/mount) LS:sys_close(4) LS:sys_open(/dev/klog) KLOG: Opened LS:sys_open(/dev/klog)->4 KLOG: main at busybox.c LS:sys_close(4) KLOG: Released LS:sys_open(/etc/fstab) LS:sys_open(/etc/fstab)->4 KLOG: In parent shell: child = 9 KLOG: waitforjob(%1) called KLOG: dowait(1) called LS:do_exit(pid:9,comm:mount) KLOG: wait returns pid 9, status=0 KLOG: Job 1: changing status of proc 9 from 0xffffffff to 0x0 KLOG: Job 1: changing state from 0 to 2 KLOG: getstatus: job 1, nproc 1, status 0, retval 0 KLOG: token newline KLOG: evaltree(NULL) called KLOG: token newline KLOG: evaltree(NULL) called KLOG: token newline KLOG: evaltree(NULL) called KLOG: token end of file KLOG: pid 8, exitshell(0) LS:do_exit(pid:8,comm:rcS) KLOG: Released LS:do_exit(pid:10,comm:init) LS:do_exit(pid:7,comm:init) LS:sys_close(0) LS:sys_close(1) LS:sys_close(2) LS:sys_open(/dev/ttyS0) LS:sys_open(/dev/ttyS0)->0 LS:do_execve(/bin/sh) LS:sys_close(3) LS:sys_close(4) LS:sys_open(/dev/klog) KLOG: Opened LS:sys_open(/dev/klog)->3 KLOG: main at busybox.c LS:sys_close(3) KLOG: Released LS:sys_open(/dev/klog) KLOG: Opened LS:sys_open(/dev/klog)->3 KLOG: KLOG: Tracing started. BusyBox v1.4.2 (2007-04-09 10:09:53 EEST) Built-in shell (ash) Enter 'help' for a list of built-in commands. KLOG: LS:interactive(1) LS:sys_open(/etc/profile) LS:sys_open(/etc/profile)->4 LS:sys_close(4) KLOG: cmdloop(0) called KLOG: token newline KLOG: evaltree(NULL) called KLOG: token newline KLOG: evaltree(NULL) called KLOG: token word PATH=/bin:/sbin:/usr/bin:/usr/sbin KLOG: pipeline: entered KLOG: reread token word PATH=/bin:/sbin:/usr/bin:/usr/sbin KLOG: reread token word PATH=/bin:/sbin:/usr/bin:/usr/sbin KLOG: reread token word PATH=/bin:/sbin:/usr/bin:/usr/sbin KLOG: token newline KLOG: reread token newline KLOG: reread token newline KLOG: reread token newline KLOG: pid 11, evaltree(0x80d73bc: 0, 0) called KLOG: evalcommand(0x80d73bc, 0) called KLOG: token word export KLOG: pipeline: entered KLOG: reread token word export KLOG: reread token word export KLOG: reread token word export KLOG: token word PATH KLOG: token newline KLOG: reread token newline KLOG: reread token newline KLOG: reread token newline KLOG: pid 11, evaltree(0x80d73b4: 0, 0) called KLOG: evalcommand(0x80d73b4, 0) called KLOG: evalcommand arg: export KLOG: evalcommand arg: PATH KLOG: token newline KLOG: evaltree(NULL) called KLOG: token end of file LS:sys_close(10) LS:sys_open(.profile) LS:sys_open(.profile)->-2 KLOG: cmdloop(1) called # _lvnd_ (^_^) ----------------------------------------------------------------------- Bu mesaj Karel MailScanner ile tehlikeli icerik ve virus kontrolunden gecirilmistir. KAREL A.S. - Bilgi Teknolojileri Bolumu This message has been scanned for viruses and dangerous content by Karel MailScanner, and is believed to be clean. KAREL A.S. - Information Technologies Department From natanael.copa at gmail.com Mon Apr 9 02:45:40 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Mon, 09 Apr 2007 11:45:40 +0200 Subject: smallint usage guidelines In-Reply-To: <1158166a0704080901l215d93a2k3fb4225504a96673@mail.gmail.com> References: <1158166a0704080901l215d93a2k3fb4225504a96673@mail.gmail.com> Message-ID: <1176111940.10533.30.camel@localhost> On Sun, 2007-04-08 at 18:01 +0200, Denis Vlasenko wrote: > Hi Bernhart, > > smalluint i = index_in_str_array(params, name) + 1; > if (i == 0) > return 0; > if (!(i == 4 || i == 5)) > i |= 0x80; > > return i; > > I think that this optimization is wrong. > index_in_str_array returns int. At best, compiler will use it as-is. > At worst, compiler will try to make sure that it is properly casted into byte, > which probably results in "n = n & 0xff" on many architectures. > > You save nothing on space here because i is not stored on-stack, > gcc will keep it in register. And even it is *is* stored, > it is *stack* storage, which is cheap (unlike data/bss). > > small[u]ints are useful _mostly_ for: > (a) flag variables > (a1) global flag variables - make data/bss smaller > (a2) local flag variables - "a = 5", "a |= 0x40" are smaller > for bytes than for full integers. > Example: > on i386, there is no widening constant store instruc