From vda.linux at googlemail.com Sat Dec 1 17:45:03 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sat, 1 Dec 2007 17:45:03 -0800 Subject: dd return status for write failures In-Reply-To: <1196463343.2955.20.camel@turbo.texmemsys.com> References: <1196463343.2955.20.camel@turbo.texmemsys.com> Message-ID: <200712011745.03861.vda.linux@googlemail.com> On Friday 30 November 2007 14:55, Kevin Cleveland wrote: > Hello, > > I was curious to know the reason why busybox 1.7.3 dd returns > EXIT_SUCCESS after out file write failures? Because it is buggy. -- vda From vda.linux at googlemail.com Sat Dec 1 19:24:48 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sat, 1 Dec 2007 19:24:48 -0800 Subject: cp and BUFSIZ vs. fs block size detection In-Reply-To: <0712010007290.14789@somehost> References: <0712010007290.14789@somehost> Message-ID: <200712011924.48833.vda.linux@googlemail.com> On Friday 30 November 2007 15:52, Cristian Ionescu-Idbohrn wrote: > In my previous post I wrote: > > ,---- > > | I need to do some other optimization too. I'll get back on that later > | in another post. I tested that idea by increasing the BUFSIZ (see > | include/libbb.h) from default 4096 to 8192 using: > | > | CFLAGS += -D"BUFSIZ=8192" > | > | in a wrapper Makefile... > > `---- > > 'cp' is using BUFSIZ (default 4096 bytes). Copying the bb-executable > (360k) from tmpfs to a NOR flash jffs partition takes 8.94s. For > comparison, copying the same file using 'dd bs=8192' takes 5.70s. That is > > >36% better performance. The BUFSIZ=8192 experiment showed (after > > rebuilding bb) that 'cp' performs as good as dd does. > > Globally doubling BUFSIZ might not be the best way to increase 'cp' > performance. But adjusting BUFSIZ 'cp' uses at run time (as gnu-cp does, > I'm told) may be better. > > To achieve that one would find max block size of source and destination > fs, and use that to perform 'cp'. It looks like 'mv' and 'cp' have that > raw copy part in common, so 'mv' would also benefit from it when moving > files between partitions. Copying over nfs uses huge buffer sizes (like > 65536 bytes). > > What do you think? You are right, bigger copy buffers may be useful. See attached patch. -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 5.patch Type: text/x-diff Size: 2291 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20071201/d1340234/attachment.bin From vda.linux at googlemail.com Sat Dec 1 20:17:07 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sat, 1 Dec 2007 20:17:07 -0800 Subject: Questions about licenses In-Reply-To: References: Message-ID: <200712012017.07204.vda.linux@googlemail.com> On Saturday 01 December 2007 19:46, Lu Zhou wrote: > Hi, Denis Vlasenko, > > 1, Do I have to open my source codes for a commercial product if my file > system includes busybox? 2, Actually I want to keep my source codes > private. What options do I have? 3, I subscribed Timesys' BSP that includes > Busybox. Is that OK that I use it in my commercial product? I am not a lawyer, and my answer is not authoritative. My understanding is that if you use busybox in your device, you have to provide users with means to build the same busybox from source. For example, you may do it by placing the following text somewhere on the company's web site: "This device's firmware includes open-source components: * ... * Busybox: We are using patched version of busybox 1.6.2. In order to rebuild it from source, download http://company.site.com/firmware/source/busybox-1.6.2.tar.gz, unpack it to an empty directory, download http://company.site.com/firmware/source/busybox-1.6.2-patch. to the same directory and apply it with this command: patch -p1 References: <474DBA38.1040800@italbrasnet.com.br> <200711292139.18380.vda.linux@googlemail.com> <474FE6C5.9060103@italbrasnet.com.br> Message-ID: <200712012038.00696.vda.linux@googlemail.com> On Friday 30 November 2007 02:32, Guilherme wrote: > Dear Denys, > > our page is in Portuguese. We will fill that page in English as well. > > You can see at you left menu: "Firmware AP Router". > Then you click there and you will find at the bottom of the page this > info: > > C?digo Fonte do Firmware > Certos produtos AP Router incluem softwares de c?digo desenvolvido por > terceiros, incluindo c?digo de software sujeitos a GNU General Public > License ( 'GPL') ou GNU Lesser General Public License (LGPL). Download do > C?digo Fonte do Firmware. > > > Any suggests? I downloaded firmware-source.zip Seems like it contains everything needed to build firmware from source. Looks good to me. (Although I did not actually try to build) Minor nit: these two directories: firmware-source/ToolChain and firmware-source/rtl-11g-ap-GPL.tar.bz2 -> ToolChain look absolutely the same, and thus make your archive 50 mb bigger than it needs to be. Thanks! -- vda From vda.linux at googlemail.com Sat Dec 1 22:59:11 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sat, 1 Dec 2007 22:59:11 -0800 Subject: modprobe problem In-Reply-To: <1196441764.6460.12.camel@beauty> References: <1196441764.6460.12.camel@beauty> Message-ID: <200712012259.11147.vda.linux@googlemail.com> On Friday 30 November 2007 08:56, Josh England wrote: > I'm trying busybox-1.8.2 and running into an issue that used to work > just fine (in busybox-1.2.1). I'm running busybox in an > initrd/initramfs environment and trying to load kernel modules via > modprobe. A correct modules.dep file is in place, and insmod can load > the module just fine, but modprobe returns: > > modprobe: failed to load module > > Any ideas? This is running on a 2.6.18-7 (RedHat-based) kernel. My > busybox .config has: > > # Linux Module Utilities > # > CONFIG_INSMOD=y > CONFIG_FEATURE_INSMOD_VERSION_CHECKING=y > CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS=y > CONFIG_FEATURE_INSMOD_LOADINKMEM=y > # CONFIG_FEATURE_INSMOD_LOAD_MAP is not set > # CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set > CONFIG_RMMOD=y > CONFIG_LSMOD=y > CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y > CONFIG_MODPROBE=y > CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS=y > CONFIG_FEATURE_MODPROBE_FANCY_ALIAS=y > > # > # Options common to multiple modutils > # > CONFIG_FEATURE_CHECK_TAINTED_MODULE=y > CONFIG_FEATURE_2_4_MODULES=y > CONFIG_FEATURE_2_6_MODULES=y > # CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set > > Any ideas? 18.2 with your .config: # strace -f -o strace.log ./busybox modprobe tcrypt succeeds. Can you do the same and post your log? My strace log is: 3572 execve("./busybox", ["./busybox", "modprobe", "tcrypt"], [/* 44 vars */]) = 0 3572 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 3572 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 3572 getuid32() = 0 3572 uname({sys="Linux", node="vda_lt", ...}) = 0 3572 brk(0) = 0x810b000 3572 brk(0x810c000) = 0x810c000 3572 open("/lib/modules/2.6.15-29-686/modules.dep", O_RDONLY|O_LARGEFILE) = 3 3572 read(3, "/lib/modules/2.6.15-29-686/usb/m"..., 1024) = 1024 3572 _llseek(3, -708, [316], SEEK_CUR) = 0 3572 read(3, "/lib/modules/2.6.15-29-686/madwi"..., 1024) = 1024 3572 _llseek(3, -917, [423], SEEK_CUR) = 0 3572 read(3, "/lib/modules/2.6.15-29-686/madwi"..., 1024) = 1024 3572 _llseek(3, -919, [528], SEEK_CUR) = 0 3572 read(3, "/lib/modules/2.6.15-29-686/madwi"..., 1024) = 1024 ... ... ... 3572 _llseek(3, -41, [4916], SEEK_CUR) = 0 3572 read(3, "dm_mod 63256 3 dm_crypt, Live 0x"..., 1024) = 41 3572 read(3, "", 983) = 0 3572 read(3, "", 1024) = 0 3572 close(3) = 0 3572 vfork() = 3573 3572 wait4(3573, 3573 execve("/home/vda/bin/insmod", ["insmod", "/lib/modules/2.6.15-29-686/kerne"...], [/* 44 vars */]) = -1 ENOENT (No such file or directory) 3573 execve("/usr/local/sbin/insmod", ["insmod", "/lib/modules/2.6.15-29-686/kerne"...], [/* 44 vars */]) = -1 ENOENT (No such file or directory) 3573 execve("/usr/local/bin/insmod", ["insmod", "/lib/modules/2.6.15-29-686/kerne"...], [/* 44 vars */]) = -1 ENOENT (No such file or directory) 3573 execve("/usr/sbin/insmod", ["insmod", "/lib/modules/2.6.15-29-686/kerne"...], [/* 44 vars */]) = -1 ENOENT (No such file or directory) 3573 execve("/usr/bin/insmod", ["insmod", "/lib/modules/2.6.15-29-686/kerne"...], [/* 44 vars */]) = -1 ENOENT (No such file or directory) 3573 execve("/sbin/insmod", ["insmod", "/lib/modules/2.6.15-29-686/kerne"...], [/* 44 vars */]) = 0 3573 uname({sys="Linux", node="vda_lt", ...}) = 0 3573 brk(0) = 0x804b000 3573 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa5000 3573 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 3573 old_mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa3000 3573 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) 3573 open("/etc/ld.so.cache", O_RDONLY) = 3 3573 fstat64(3, {st_mode=S_IFREG|0644, st_size=67511, ...}) = 0 3573 old_mmap(NULL, 67511, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f92000 3573 close(3) = 0 3573 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 3573 open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3 3573 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220O\1"..., 512) = 512 3573 fstat64(3, {st_mode=S_IFREG|0755, st_size=1232784, ...}) = 0 3573 old_mmap(NULL, 1238972, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e63000 3573 old_mmap(0xb7f88000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x125000) = 0xb7f88000 3573 old_mmap(0xb7f8f000, 10172, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f8f000 3573 close(3) = 0 3573 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e62000 3573 set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e628e0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 3573 munmap(0xb7f92000, 67511) = 0 3573 brk(0) = 0x804b000 3573 brk(0x806c000) = 0x806c000 3573 create_module(NULL, 0) = -1 ENOSYS (Function not implemented) 3573 open("/lib/modules/2.6.15-29-686/kernel/crypto/tcrypt.ko", O_RDONLY) = 3 3573 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1\0\3\0\1\0\0\0\0\0\0\0"..., 16384) = 16384 3573 read(3, "\ntesting crc32c using incrementa"..., 16384) = 16384 3573 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 32768 3573 read(3, "\0\0\0\0\0\0\30\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65536) = 32779 3573 read(3, "", 32757) = 0 3573 close(3) = 0 3573 init_module(".ELF...", 0x1800b) = 0 3573 exit_group(0) = ? 3572 <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3573 3572 --- SIGCHLD (Child exited) @ 0 (0) --- 3572 _exit(0) -- vda From roberto.foglietta at gmail.com Sun Dec 2 03:35:56 2007 From: roberto.foglietta at gmail.com (Roberto A. Foglietta) Date: Sun, 02 Dec 2007 12:35:56 +0100 Subject: Questions about licenses In-Reply-To: <200712012017.07204.vda.linux@googlemail.com> References: <200712012017.07204.vda.linux@googlemail.com> Message-ID: <4752989C.8010407@gmail.com> Denys Vlasenko wrote: > On Saturday 01 December 2007 19:46, Lu Zhou wrote: >> Hi, Denis Vlasenko, >> >> 1, Do I have to open my source codes for a commercial product if my file >> system includes busybox? 2, Actually I want to keep my source codes >> private. What options do I have? 3, I subscribed Timesys' BSP that includes >> Busybox. Is that OK that I use it in my commercial product? > > I am not a lawyer, and my answer is not authoritative. > > My understanding is that if you use busybox in your device, > you have to provide users with means to build the same busybox > from source. I do not think so. Building the same busybox from sources would be required if GPLv3 has been choosen. In this case distribuitor could choose GPLv2 and release everything under v2 conditions which requires to deliver at quasi-zero costs the source code. You would not release your toolchain and/or cross compiling enviroment. Putting onto the same media (ROM, FLASH, DVD) binary which has been compiled from GPLed source code and from propretary does not propagate licences. GPL terms propagations happens only when source code mix or static compilation happen. In my opinion if you have right to do something you are right to do that. If the device could be easily modified by the user and it could be easy for technical assistance verify any modifications in order to decay the guarantee so you can release all the source and the building environments. Allowing people hacking your device you offer a plus in value and the possibility a community develop around your product. Best regards, Roberto From vda.linux at googlemail.com Sun Dec 2 13:37:47 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sun, 2 Dec 2007 13:37:47 -0800 Subject: Questions about licenses In-Reply-To: <4752989C.8010407@gmail.com> References: <200712012017.07204.vda.linux@googlemail.com> <4752989C.8010407@gmail.com> Message-ID: <200712021337.48208.vda.linux@googlemail.com> On Sunday 02 December 2007 03:35, Roberto A. Foglietta wrote: > Denys Vlasenko wrote: > > I am not a lawyer, and my answer is not authoritative. > > > > My understanding is that if you use busybox in your device, > > you have to provide users with means to build the same busybox > > from source. > > I do not think so. Building the same busybox from sources would be > required if GPLv3 has been choosen. In this case distribuitor could > choose GPLv2 and release everything under v2 conditions which requires > to deliver at quasi-zero costs the source code. You would not release > your toolchain and/or cross compiling enviroment. What's the point in having a license which require that licensee provides *some* sources, but does not require that functionally equivalent busybox binary can be built from this source? Such license would be totally useless, as it is trivially circumvented by providing irrelevant source. Like, providing unmodified busybox-1.3.0 source but actually using patched busybox-1.8.2 one. I think that GPLv2 requires that licensee provides the source they actually use to build their binary, not some semirandom collection of text files with .c and .h extensions. -- vda From vda.linux at googlemail.com Sun Dec 2 13:40:04 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sun, 2 Dec 2007 13:40:04 -0800 Subject: How to request more dhcp-options with udhcpc? In-Reply-To: <475009A8.1030007@the2masters.de> References: <474F5411.7070500@the2masters.de> <200711292052.07841.vda.linux@googlemail.com> <475009A8.1030007@the2masters.de> Message-ID: <200712021340.04363.vda.linux@googlemail.com> On Friday 30 November 2007 05:01, Stefan Hellermann wrote: > Denys Vlasenko schrieb: > > On Thursday 29 November 2007 16:06, Stefan Hellermann wrote: > >> Hello! > >> > >> I'm trying to get a NFS root-path in a initrd with busybox, but I have > >> to change the source to select which DHCP-Options it fetches. > > > > Please be more specific. > > I have clients that use nfs-root and would like to get the NFS rootpath via > DHCP. udhcpc is able to request the rootpath, but doesn't do it by default. > > >> Is there a way without changing networking/udhcp/options.c? Is it > >> possible to create a config-option for custom dhcp-options or a > >> runtime-switch? Or is there enough demand to fetch it by default? > > > > I think it is already there - "rootpath" environment variable should be > > set and passed to script if option 17 (0x11) was in packet from DHCP > > server. > > But usually a DHCP-client asks for a set of options and the DHCP-server > only responds to the requested options. udhcpc request the following: > subnet, router, dns, hostname, domain, broadcast, nisdomain, nissrv, > ntpsrv. (networking/udhcpc/options.c) > > I need the DHCP-option rootpath too, so I have to patch the source: Thanks, will review it. -- vda From vapier at gentoo.org Sun Dec 2 15:04:11 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sun, 2 Dec 2007 18:04:11 -0500 Subject: Questions about licenses In-Reply-To: <200712021337.48208.vda.linux@googlemail.com> References: <4752989C.8010407@gmail.com> <200712021337.48208.vda.linux@googlemail.com> Message-ID: <200712021804.13455.vapier@gentoo.org> On Sunday 02 December 2007, Denys Vlasenko wrote: > On Sunday 02 December 2007 03:35, Roberto A. Foglietta wrote: > > Denys Vlasenko wrote: > > > I am not a lawyer, and my answer is not authoritative. > > > > > > My understanding is that if you use busybox in your device, > > > you have to provide users with means to build the same busybox > > > from source. > > > > I do not think so. Building the same busybox from sources would be > > required if GPLv3 has been choosen. In this case distribuitor could > > choose GPLv2 and release everything under v2 conditions which requires > > to deliver at quasi-zero costs the source code. You would not release > > your toolchain and/or cross compiling enviroment. > > What's the point in having a license which require that licensee > provides *some* sources, but does not require that functionally equivalent > busybox binary can be built from this source? > > Such license would be totally useless, as it is trivially circumvented by > providing irrelevant source. > Like, providing unmodified busybox-1.3.0 source but actually using patched > busybox-1.8.2 one. > > I think that GPLv2 requires that licensee provides the source they actually > use to build their binary, not some semirandom collection of text files > with .c and .h extensions. not sure where that weird interpretation came from ... as Denys indicates, you need to provide the sources to the binaries you shipped. versioning and such is irrelevant. you provided binary $foo whose sources are under GPL-2 which means you must provide the exact source code which produced $foo. but really, people shouldnt be asking for licensing help from a list that contains no lawyers. go pay some lawyer to figure out what you need to do in order to comply with the licenses of the source code you're too lazy to write yourself ;). -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20071202/4de0af41/attachment.pgp From vapier at gentoo.org Sun Dec 2 15:52:41 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sun, 2 Dec 2007 18:52:41 -0500 Subject: usage of -funsigned-char Message-ID: <200712021852.42519.vapier@gentoo.org> can we analyze the usage of -funsigned-char in Makefile.flags ? i feel like this is the wrong way to go for anything ... -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20071202/2696e1d7/attachment.pgp From alexander.griesser at lkh-vil.or.at Sun Dec 2 23:45:00 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Mon, 03 Dec 2007 08:45:00 +0100 Subject: Different keymaps (??) on my ttys In-Reply-To: <473D4B0E.70008@lkh-vil.or.at> References: <473438CC.4090506@lkh-vil.or.at> <200711131102.28697.vda.linux@googlemail.com> <473C3997.9020404@lkh-vil.or.at> <200711150900.03243.vda.linux@googlemail.com> <473D4B0E.70008@lkh-vil.or.at> Message-ID: <4753B3FC.2090202@lkh-vil.or.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alexander Griesser wrote: > Denys Vlasenko wrote: >> I saw a similar problem with font loading. Loading font once >> worked on text-mode VTs, but on framebuffer console based VTs >> I needed to do it on each VT. Which makes more sense anyway - >> VTs are supposed to be independent devices, right? > > Yes, it definetly makes sense, but it behaved differently on > earlier kernel/busybox versions so I didn't think about that. Well, I think I have more details now after my vacation ;) It seems as if `login` breaks stuff. I added `read` and `/bin/sh` invocations to all of my startup scripts (at the beginning, at the end, etc.) and tried to enter the '#' symbol. It worked everytime I tried it (the loading of the keymap - doesn't matter if I use `loadkmap` or `loadkeys` - does _NOT_ seem to be the problem, because it seems to work otherwise). login otherwise works great, but two keycodes are not accepted: The '@' character (AltGr + q) behaves as CTRL-U does (e.g. erases the whole line). The '#' character behaves like Backspace, e.g. deletes one character back. I had a look at login.c and it seems as if the problem occurs in get_username_or_die(), but I can't make heads or tails of it. At first I suspected the getchar() function to be the problem, but then I compiled a small program which was started as the last startup script and it did work fine too: - ---------------------------- 8< ------------------------- #include int main() { int c; c = getchar(); printf("Your input was: %c\n", c); return 0; } - ---------------------------- 8< ------------------------- I'm out of ideas now, please help in debugging this one. The big problem is that I can't login because my root password contained a '#' symbol, so for testing purposes, I changed the root password and then I could login. After I got to the login shell, all was back normal, so I could enter the '#' sign on the command line as usual, '@' works too. When I then `exit` the shell to come back to the login prompt, the problem remains (still unable to use '#' in my password). ciao, - -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHU7P866HVD6KUm1oRAj1TAJ969rN37i1LkHOzv+wpO2O9fVBRXwCfboS7 UzRyYAK0lA7DDd1/jfequck= =RXA4 -----END PGP SIGNATURE----- From roberto.foglietta at gmail.com Mon Dec 3 00:11:28 2007 From: roberto.foglietta at gmail.com (Roberto A. Foglietta) Date: Mon, 3 Dec 2007 09:11:28 +0100 Subject: Questions about licenses In-Reply-To: <200712021337.48208.vda.linux@googlemail.com> References: <200712012017.07204.vda.linux@googlemail.com> <4752989C.8010407@gmail.com> <200712021337.48208.vda.linux@googlemail.com> Message-ID: 2007/12/2, Denys Vlasenko : > On Sunday 02 December 2007 03:35, Roberto A. Foglietta wrote: > > Denys Vlasenko wrote: > > > I am not a lawyer, and my answer is not authoritative. > > > > > > My understanding is that if you use busybox in your device, > > > you have to provide users with means to build the same busybox > > > from source. > > > > I do not think so. Building the same busybox from sources would be > > required if GPLv3 has been choosen. In this case distribuitor could > > choose GPLv2 and release everything under v2 conditions which requires > > to deliver at quasi-zero costs the source code. You would not release > > your toolchain and/or cross compiling enviroment. > > What's the point in having a license which require that licensee > provides *some* sources, but does not require that functionally equivalent > busybox binary can be built from this source? > > Such license would be totally useless, as it is trivially circumvented by > providing irrelevant source. > Like, providing unmodified busybox-1.3.0 source but actually using patched > busybox-1.8.2 one. > > I think that GPLv2 requires that licensee provides the source they actually > use to build their binary, not some semirandom collection of text files > with .c and .h extensions. Yes, you are right but... From the same source but by two different compilers you could generate two different binaries. A great problem of GPLv3 in embedded field is that it forces to realeas all the source of the toolchains and cross-compiler in order to let the end-user to run the binary in the same enviroment. GPLv2 requires only the soruce code of the binary should released. This differece is fundamental between v2 and v3 because I can release patches and sorces of modified busybox but if I do not release the compiler too you could not run it on my own device/cpu. I hope this helps in understanding my previous mail. About Mike: we are not lawyer. Yes we are not but we have to know and understand in order to choose the licence. IMHO another missed point about v3 is: if we can not offer worldwide free of royalties patents coverage we cannot deliver source/binary too. But in Europe and others part of the world software patent has not any legal value and still be possibile delivery source code by v2 for those countries. The freedom of die in v3 did not take in account that there is a third possibility among die free or live in slavish: change the country. Even in the worst possible world still exist a freeland. :-) Cheers, -- /roberto From vda.linux at googlemail.com Mon Dec 3 02:56:54 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Mon, 3 Dec 2007 02:56:54 -0800 Subject: usage of -funsigned-char In-Reply-To: <200712021852.42519.vapier@gentoo.org> References: <200712021852.42519.vapier@gentoo.org> Message-ID: <200712030256.54498.vda.linux@googlemail.com> On Sunday 02 December 2007 15:52, Mike Frysinger wrote: > can we analyze the usage of -funsigned-char in Makefile.flags ? i feel > like this is the wrong way to go for anything ... I think it is a great way to avoid all sorts of stupid bugs when char is inadvertently sign-extended. I try to write code such that it will work with signed char, but at the same time -funsigned-char gives additional protection - even if some code is potentially buggy wrt signed char, it will actually work. (vi was particularly bad in that regard) -- vda From alexander.griesser at lkh-vil.or.at Mon Dec 3 05:32:24 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Mon, 03 Dec 2007 14:32:24 +0100 Subject: Different keymaps (??) on my ttys In-Reply-To: <4753B3FC.2090202@lkh-vil.or.at> References: <473438CC.4090506@lkh-vil.or.at> <200711131102.28697.vda.linux@googlemail.com> <473C3997.9020404@lkh-vil.or.at> <200711150900.03243.vda.linux@googlemail.com> <473D4B0E.70008@lkh-vil.or.at> <4753B3FC.2090202@lkh-vil.or.at> Message-ID: <47540568.5090209@lkh-vil.or.at> Alexander Griesser wrote: > Well, I think I have more details now after my vacation ;) > It seems as if `login` breaks stuff. Sorry for followin up on my own posting that often, but I think I found the cause for this now finally. Somewhere down in getty.c it says: ------------------------ 8< --------------------- static char *get_logname(char *logname, unsigned size_logname, struct options *op, struct chardata *cp, struct termios *tp) [...] case BS: case DEL: case '#': cp->erase = ascval; /* set erase character */ if (bp > logname) { write(1, erase[cp->parity], 3); bp--; } break; case CTL('U'): case '@': cp->kill = ascval; /* set kill character */ while (bp > logname) { write(1, erase[cp->parity], 3); bp--; } break; [...] ----------------------- 8< ----------------------- Which is _EXACTLY_ what I'm experiencing. Is there some reasoning behind that? And why didn't I recognize this with future versions of busybox/the kernel/glibc (still don't know what broke it actually). ciao, -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 From alexander.griesser at lkh-vil.or.at Mon Dec 3 05:48:43 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Mon, 03 Dec 2007 14:48:43 +0100 Subject: Different keymaps (??) on my ttys In-Reply-To: <47540568.5090209@lkh-vil.or.at> References: <473438CC.4090506@lkh-vil.or.at> <200711131102.28697.vda.linux@googlemail.com> <473C3997.9020404@lkh-vil.or.at> <200711150900.03243.vda.linux@googlemail.com> <473D4B0E.70008@lkh-vil.or.at> <4753B3FC.2090202@lkh-vil.or.at> <47540568.5090209@lkh-vil.or.at> Message-ID: <4754093B.400@lkh-vil.or.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alexander Griesser wrote: >> Well, I think I have more details now after my vacation ;) >> It seems as if `login` breaks stuff. > > Sorry for followin up on my own posting that often, but I think I > found the cause for this now finally. Somewhere down in getty.c > it says: ... So, everything is fixed now. Somehow during the upgrade process from earlier busybox versions (I always do backup the bb-config and copy it over to the new version, afterwards do a `make oldconfig`) the shadow password feature wasn't enabled anymore. I tracked this down when using `strace` to debug my above mentioned problem and after re-enabling it, everything is fine again. I didn't know that the '#' and '@' characters are treated specially on the login prompt and therefore I thought that that's the reason why I can't login. Currently, '#' and '@' still behave the same, but the password itself gets accepted flawlessly (even if it contains '#' and '@'), so sorry for the confusion I produced in here... ciao, - -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHVAk766HVD6KUm1oRAkWdAJ97Xlr2KxXjdBKvoWgVUGiBi0rYXgCeO65O qie/+JH79uwqhTqiB4BLsUw= =vLUb -----END PGP SIGNATURE----- From pgf at brightstareng.com Mon Dec 3 06:01:42 2007 From: pgf at brightstareng.com (Paul Fox) Date: Mon, 03 Dec 2007 09:01:42 -0500 Subject: Different keymaps (??) on my ttys In-Reply-To: alexander.griesser's message of Mon, 03 Dec 2007 14:32:24 +0100. <47540568.5090209@lkh-vil.or.at> Message-ID: <30716.1196690502@brightstareng.com> > Alexander Griesser wrote: > > Well, I think I have more details now after my vacation ;) > > It seems as if `login` breaks stuff. > > Sorry for followin up on my own posting that often, but I think I > found the cause for this now finally. Somewhere down in getty.c > it says: > > ------------------------ 8< --------------------- > static char *get_logname(char *logname, unsigned size_logname, > struct options *op, struct chardata *cp, struct termios *tp) > [...] > case BS: > case DEL: > case '#': > cp->erase = ascval; /* set erase character */ > if (bp > logname) { > write(1, erase[cp->parity], 3); > bp--; > } > break; > case CTL('U'): > case '@': > cp->kill = ascval; /* set kill character */ > while (bp > logname) { > write(1, erase[cp->parity], 3); > bp--; > } > break; > [...] > ----------------------- 8< ----------------------- > > Which is _EXACTLY_ what I'm experiencing. Is there some reasoning > behind that? yes. it's _very_ historical reasoning, however. back in the distant pass, when "glass" terminals were not common, the backspace and line-kill characters on unix were '#' and '@' by default. this way if you mistyped a word, you could see your corrections on the paper of your terminal: helo#lo and if you waxyd to replace@ and if you wanted to replace a whole line, that was obvious too. (this same kind of reasoning is why login will put your terminal into upper-case-translation mode if you type all uppercase characters very early -- it thinks you're on a terminal that _can't_ do lowercase input.) it wasn't until the 80's that the erase/kill characters changed to backspace (or DEL, in BSD's case) and ^U by default. getting these characters set correctly early is an advantage for the user, since otherwise they can't correct their mistakes, and since traditional ascii/english usernames did not contain the '#' or '@' characters, it was reasonable to set the erase and kill characters during the login phase if they were typed, since there would be no other reason to type them. clearly this code has no place in login or getty in 2007. (i'm less convinced about BS vs. DEL -- that might still be useful.) paul =--------------------- paul fox, pgf at brightstareng.com From wharms at bfs.de Mon Dec 3 10:20:27 2007 From: wharms at bfs.de (walter harms) Date: Mon, 03 Dec 2007 19:20:27 +0100 Subject: Different keymaps (??) on my ttys In-Reply-To: <30716.1196690502@brightstareng.com> References: <30716.1196690502@brightstareng.com> Message-ID: <475448EB.4020601@bfs.de> Paul Fox wrote: > > Alexander Griesser wrote: > > > Well, I think I have more details now after my vacation ;) > > > It seems as if `login` breaks stuff. > > > > Sorry for followin up on my own posting that often, but I think I > > found the cause for this now finally. Somewhere down in getty.c > > it says: > > > > ------------------------ 8< --------------------- > > static char *get_logname(char *logname, unsigned size_logname, > > struct options *op, struct chardata *cp, struct termios *tp) > > [...] > > case BS: > > case DEL: > > case '#': > > cp->erase = ascval; /* set erase character */ > > if (bp > logname) { > > write(1, erase[cp->parity], 3); > > bp--; > > } > > break; > > case CTL('U'): > > case '@': > > cp->kill = ascval; /* set kill character */ > > while (bp > logname) { > > write(1, erase[cp->parity], 3); > > bp--; > > } > > break; > > [...] > > ----------------------- 8< ----------------------- > > > > Which is _EXACTLY_ what I'm experiencing. Is there some reasoning > > behind that? > > yes. it's _very_ historical reasoning, however. > > back in the distant pass, when "glass" terminals were not common, > the backspace and line-kill characters on unix were '#' and '@' > by default. this way if you mistyped a word, you could see your > corrections on the paper of your terminal: > helo#lo > and if you waxyd to replace@ > and if you wanted to replace a whole line, that was obvious too. > > (this same kind of reasoning is why login will put your terminal into > upper-case-translation mode if you type all uppercase characters very > early -- it thinks you're on a terminal that _can't_ do lowercase input.) > > it wasn't until the 80's that the erase/kill characters changed > to backspace (or DEL, in BSD's case) and ^U by default. > > getting these characters set correctly early is an advantage for > the user, since otherwise they can't correct their mistakes, > and since traditional ascii/english usernames did not > contain the '#' or '@' characters, it was reasonable to set the > erase and kill characters during the login phase if they were typed, > since there would be no other reason to type them. > > clearly this code has no place in login or getty in 2007. (i'm less > convinced about BS vs. DEL -- that might still be useful.) > > paul hi paul, i am unix admin for > 10 years now and i never heard about that. thx. ntl: can we please disable that stuff ? like: #if USE_ANCIENT_KEY_CODE #define ANCIENT_KEY_CODE_DEL case '#': #define ANCIENT_KEY_CODE_KILL case '@': #endif I do not like to remove it completely since in some corner cases it may turnout useful. re, wh From vapier at gentoo.org Mon Dec 3 21:58:54 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Tue, 4 Dec 2007 00:58:54 -0500 Subject: svn commit: trunk/busybox: coreutils libbb procps In-Reply-To: <20070501200733.8A13B4859E@busybox.net> References: <20070501200733.8A13B4859E@busybox.net> Message-ID: <200712040058.55499.vapier@gentoo.org> On Tuesday 01 May 2007, vda at busybox.net wrote: > Author: vda > Date: 2007-05-01 13:07:29 -0700 (Tue, 01 May 2007) > New Revision: 18534 > > Log: > test: code size saving, no logic changes > ps: fix warning, make a bit smaller > kill -l: make smaller & know much more signals > > Modified: trunk/busybox/libbb/u_signal_names.c > =================================================================== > --- trunk/busybox/libbb/u_signal_names.c 2007-04-30 21:23:22 UTC (rev > 18533) +++ trunk/busybox/libbb/u_signal_names.c 2007-05-01 20:07:29 UTC > (rev 18534) @@ -9,20 +9,111 @@ > > #include "libbb.h" > > -static const struct signal_name { > - int number; > - char name[5]; > -} signals[] = { > +static const char signals[32][7] = { > // SUSv3 says kill must support these, and specifies the numerical > values, // > http://www.opengroup.org/onlinepubs/009695399/utilities/kill.html // TODO: > "[SIG]EXIT" shouldn't work for kill, right? > - {0, "EXIT"}, {1, "HUP"}, {2, "INT"}, {3, "QUIT"}, {6, "ABRT"}, {9, > "KILL"}, - {14, "ALRM"}, {15, "TERM"}, > + // {0, "EXIT"}, {1, "HUP"}, {2, "INT"}, {3, "QUIT"}, > + // {6, "ABRT"}, {9, "KILL"}, {14, "ALRM"}, {15, "TERM"} > // And Posix adds the following: > - {SIGILL, "ILL"}, {SIGTRAP, "TRAP"}, {SIGFPE, "FPE"}, {SIGUSR1, "USR1"}, > - {SIGSEGV, "SEGV"}, {SIGUSR2, "USR2"}, {SIGPIPE, "PIPE"}, {SIGCHLD, > "CHLD"}, - {SIGCONT, "CONT"}, {SIGSTOP, "STOP"}, {SIGTSTP, "TSTP"}, > {SIGTTIN, "TTIN"}, - {SIGTTOU, "TTOU"} > + // {SIGILL, "ILL"}, {SIGTRAP, "TRAP"}, {SIGFPE, "FPE"}, {SIGUSR1, > "USR1"}, + // {SIGSEGV, "SEGV"}, {SIGUSR2, "USR2"}, {SIGPIPE, "PIPE"}, > {SIGCHLD, "CHLD"}, + // {SIGCONT, "CONT"}, {SIGSTOP, "STOP"}, {SIGTSTP, > "TSTP"}, {SIGTTIN, "TTIN"}, + // {SIGTTOU, "TTOU"} > + [0] = "EXIT", > +#ifdef SIGHUP > + [SIGHUP ] = "HUP", > +#endif > +#ifdef SIGINT > + [SIGINT ] = "INT", > +#endif > +#ifdef SIGQUIT > + [SIGQUIT ] = "QUIT", > +#endif > +#ifdef SIGILL > + [SIGILL ] = "ILL", > +#endif > +#ifdef SIGTRAP > + [SIGTRAP ] = "TRAP", > +#endif > +#ifdef SIGABRT > + [SIGABRT ] = "ABRT", > +#endif > +#ifdef SIGBUS > + [SIGBUS ] = "BUS", > +#endif > +#ifdef SIGFPE > + [SIGFPE ] = "FPE", > +#endif > +#ifdef SIGKILL > + [SIGKILL ] = "KILL", > +#endif > +#ifdef SIGUSR1 > + [SIGUSR1 ] = "USR1", > +#endif > +#ifdef SIGSEGV > + [SIGSEGV ] = "SEGV", > +#endif > +#ifdef SIGUSR2 > + [SIGUSR2 ] = "USR2", > +#endif > +#ifdef SIGPIPE > + [SIGPIPE ] = "PIPE", > +#endif > +#ifdef SIGALRM > + [SIGALRM ] = "ALRM", > +#endif > +#ifdef SIGTERM > + [SIGTERM ] = "TERM", > +#endif > +#ifdef SIGSTKFLT > + [SIGSTKFLT] = "STKFLT", > +#endif > +#ifdef SIGCHLD > + [SIGCHLD ] = "CHLD", > +#endif > +#ifdef SIGCONT > + [SIGCONT ] = "CONT", > +#endif > +#ifdef SIGSTOP > + [SIGSTOP ] = "STOP", > +#endif > +#ifdef SIGTSTP > + [SIGTSTP ] = "TSTP", > +#endif > +#ifdef SIGTTIN > + [SIGTTIN ] = "TTIN", > +#endif > +#ifdef SIGTTOU > + [SIGTTOU ] = "TTOU", > +#endif > +#ifdef SIGURG > + [SIGURG ] = "URG", > +#endif > +#ifdef SIGXCPU > + [SIGXCPU ] = "XCPU", > +#endif > +#ifdef SIGXFSZ > + [SIGXFSZ ] = "XFSZ", > +#endif > +#ifdef SIGVTALRM > + [SIGVTALRM] = "VTALRM", > +#endif > +#ifdef SIGPROF > + [SIGPROF ] = "PROF", > +#endif > +#ifdef SIGWINCH > + [SIGWINCH ] = "WINCH", > +#endif > +#ifdef SIGPOLL > + [SIGPOLL ] = "POLL", > +#endif > +#ifdef SIGPWR > + [SIGPWR ] = "PWR", > +#endif > +#ifdef SIGSYS > + [SIGSYS ] = "SYS", > +#endif > }; > > // Convert signal name to number. > @@ -32,12 +123,28 @@ > int i; > > i = bb_strtou(name, NULL, 10); > - if (!errno) return i; > - for (i = 0; i < sizeof(signals) / sizeof(struct signal_name); i++) > - if (strcasecmp(name, signals[i].name) == 0 > - || (strncasecmp(name, "SIG", 3) == 0 > - && strcasecmp(&name[3], signals[i].name) == 0)) > - return signals[i].number; > + if (!errno) > + return i; > + if (strncasecmp(name, "SIG", 3) == 0) > + name += 3; > + for (i = 0; i < sizeof(signals) / sizeof(signals[0]); i++) > + if (strcasecmp(name, signals[i]) == 0) > + return i; > + > +#if ENABLE_DESKTOP && (defined(SIGIOT) || defined(SIGIO)) > + /* These are aliased to other names */ > + if ((name[0] | 0x20) == 'i' && (name[1] | 0x20) == 'o') { > +#ifdef SIGIO > + if (!name[2]) > + return SIGIO; > +#endif > +#ifdef SIGIOT > + if ((name[2] | 0x20) == 't' && !name[3]) > + return SIGIOT; > +#endif > + } > +#endif > + > return -1; > } > > @@ -45,12 +152,9 @@ > > const char *get_signame(int number) > { > - int i; > - > - for (i=0; i < sizeof(signals) / sizeof(struct signal_name); i++) { > - if (number == signals[i].number) { > - return signals[i].name; > - } > + if ((unsigned)number < sizeof(signals) / sizeof(signals[0])) { > + if (signals[number][0]) /* if it's not an empty str */ > + return signals[number]; > } > > return itoa(number); > while this would be nice, the code relies on extended assumptions which the POSIX spec does not require and in some cases, this fails consider HPPA who defines SIGSTKFLT as 36 ... this define isnt in POSIX and is clearly beyond the "32" limit here ... and SUSv3 does not state that `kill` needs to support this signal ... perhaps the #if checks should be changed to something like: #if defined(SIGSTKFLT) && SIGSTKFLT < KILL_MAX_SIG and we'll change the array to: #define KILL_MAX_SIG 32 static const char signals[KILL_MAX_SIG][7] = { -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20071204/d60423d5/attachment.pgp From vapier at gentoo.org Mon Dec 3 22:06:28 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Tue, 4 Dec 2007 01:06:28 -0500 Subject: usage of -funsigned-char In-Reply-To: <200712030256.54498.vda.linux@googlemail.com> References: <200712021852.42519.vapier@gentoo.org> <200712030256.54498.vda.linux@googlemail.com> Message-ID: <200712040106.29783.vapier@gentoo.org> On Monday 03 December 2007, Denys Vlasenko wrote: > On Sunday 02 December 2007 15:52, Mike Frysinger wrote: > > can we analyze the usage of -funsigned-char in Makefile.flags ? i feel > > like this is the wrong way to go for anything ... > > I think it is a great way to avoid all sorts of stupid bugs > when char is inadvertently sign-extended. > > I try to write code such that it will work with signed char, > but at the same time -funsigned-char gives additional protection - > even if some code is potentially buggy wrt signed char, it > will actually work. while in general, i can understand this ... but it's my understanding that the signedness of the char may be tied to the ISA and it can actually be a severe determinate to optimization capabilities where forcing the signedness to the opposite of the default ISA ... -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20071204/755eaf96/attachment.pgp From vda.linux at googlemail.com Tue Dec 4 01:51:29 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 4 Dec 2007 01:51:29 -0800 Subject: Different keymaps (??) on my ttys In-Reply-To: <475448EB.4020601@bfs.de> References: <30716.1196690502@brightstareng.com> <475448EB.4020601@bfs.de> Message-ID: <200712040151.29281.vda.linux@googlemail.com> On Monday 03 December 2007 10:20, walter harms wrote: > > clearly this code has no place in login or getty in 2007. (i'm less > > convinced about BS vs. DEL -- that might still be useful.) > > > > paul > > hi paul, > i am unix admin for > 10 years now and i never heard about that. thx. > > ntl: can we please disable that stuff ? > like: > > #if USE_ANCIENT_KEY_CODE > #define ANCIENT_KEY_CODE_DEL case '#': > #define ANCIENT_KEY_CODE_KILL case '@': > #endif > > I do not like to remove it completely since in some corner cases it may > turnout useful. Done. Also removed other cruft - line double ndelay_off... Thanks Alex. -- vda From marc.leeman at gmail.com Tue Dec 4 01:47:24 2007 From: marc.leeman at gmail.com (Marc Leeman) Date: Tue, 4 Dec 2007 10:47:24 +0100 Subject: [PATCH]: trivial patch to create zcip.devX.pid Message-ID: <1f729c480712040147p3c9e0dccodf7f13a229386ce6@mail.gmail.com> This trivial patch creates a /var/run/zcip.devX.pid pid file in the same way udchp does. This enables easier firmware controlled 'complex' network configuration and re-configuration. -- ash nazg durbatul?k, ash nazg gimbatul, ash nazg thrakatul?k agh burzum-ishi krimpatul -------------- next part -------------- A non-text attachment was scrubbed... Name: zcippid.diff Type: text/x-patch Size: 864 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20071204/e3c15c11/attachment.bin From vda.linux at googlemail.com Tue Dec 4 02:06:47 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 4 Dec 2007 02:06:47 -0800 Subject: svn commit: trunk/busybox: coreutils libbb procps In-Reply-To: <200712040058.55499.vapier@gentoo.org> References: <20070501200733.8A13B4859E@busybox.net> <200712040058.55499.vapier@gentoo.org> Message-ID: <200712040206.47756.vda.linux@googlemail.com> On Monday 03 December 2007 21:58, Mike Frysinger wrote: > On Tuesday 01 May 2007, vda at busybox.net wrote: > > Author: vda > > Date: 2007-05-01 13:07:29 -0700 (Tue, 01 May 2007) > > New Revision: 18534 > > > > Log: > > test: code size saving, no logic changes > > ps: fix warning, make a bit smaller > > kill -l: make smaller & know much more signals > > ... > > +static const char signals[32][7] = { > > + [0] = "EXIT", > > +#ifdef SIGHUP > > + [SIGHUP ] = "HUP", > > +#endif > > +#ifdef SIGINT > > + [SIGINT ] = "INT", > > +#endif ... > > +#ifdef SIGPWR > > + [SIGPWR ] = "PWR", > > +#endif > > +#ifdef SIGSYS > > + [SIGSYS ] = "SYS", > > +#endif > > }; > > while this would be nice, the code relies on extended assumptions which the > POSIX spec does not require and in some cases, this fails > > consider HPPA who defines SIGSTKFLT as 36 ... this define isnt in POSIX and > is clearly beyond the "32" limit here ... and SUSv3 does not state that > `kill` needs to support this signal ... > > perhaps the #if checks should be changed to something like: > #if defined(SIGSTKFLT) && SIGSTKFLT < KILL_MAX_SIG > and we'll change the array to: > #define KILL_MAX_SIG 32 > static const char signals[KILL_MAX_SIG][7] = { > -mike Fixed in svn, thanks. -- vda From wharms at bfs.de Tue Dec 4 02:14:49 2007 From: wharms at bfs.de (walter harms) Date: Tue, 04 Dec 2007 11:14:49 +0100 Subject: [PATCH]: trivial patch to create zcip.devX.pid In-Reply-To: <1f729c480712040147p3c9e0dccodf7f13a229386ce6@mail.gmail.com> References: <1f729c480712040147p3c9e0dccodf7f13a229386ce6@mail.gmail.com> Message-ID: <47552899.2000808@bfs.de> hi marc, can you guarantee that sprintf(pidbuf,"/var/run/zcip.%s.pid",intf); will not overflow ? it may be more convenient to use xasprintf() an free the resulting buffer after open(). re, wh idea: since this construct is used often it may be useful to have a fvaropen() ? Marc Leeman wrote: > This trivial patch creates a /var/run/zcip.devX.pid pid file in the > same way udchp does. > > This enables easier firmware controlled 'complex' network > configuration and re-configuration. > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox From alexander.griesser at lkh-vil.or.at Tue Dec 4 02:12:12 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Tue, 04 Dec 2007 11:12:12 +0100 Subject: Different keymaps (??) on my ttys In-Reply-To: <200712040151.29281.vda.linux@googlemail.com> References: <30716.1196690502@brightstareng.com> <475448EB.4020601@bfs.de> <200712040151.29281.vda.linux@googlemail.com> Message-ID: <475527FC.6040603@lkh-vil.or.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Denys Vlasenko wrote: >> ntl: can we please disable that stuff ? >> like: >> >> #if USE_ANCIENT_KEY_CODE >> #define ANCIENT_KEY_CODE_DEL case '#': >> #define ANCIENT_KEY_CODE_KILL case '@': >> #endif >> >> I do not like to remove it completely since in some corner cases it may >> turnout useful. ACK, that would be the best solution, of course disable by default. > Thanks Alex. That's nothing, I have to say thank you :) ciao, - -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHVSf866HVD6KUm1oRAnaHAJ0ckXDe06zjZAd4KHbv1RXfh6rQXACeNqjm IygFS25NfxNBahZ+Y10Ezuc= =4mz3 -----END PGP SIGNATURE----- From vda.linux at googlemail.com Tue Dec 4 02:25:42 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 4 Dec 2007 02:25:42 -0800 Subject: [PATCH]: trivial patch to create zcip.devX.pid In-Reply-To: <1f729c480712040147p3c9e0dccodf7f13a229386ce6@mail.gmail.com> References: <1f729c480712040147p3c9e0dccodf7f13a229386ce6@mail.gmail.com> Message-ID: <200712040225.42579.vda.linux@googlemail.com> On Tuesday 04 December 2007 01:47, Marc Leeman wrote: > This trivial patch creates a /var/run/zcip.devX.pid pid file in the > same way udchp does. + char pidbuf[BUFSIZ]; + FILE *fp; This may eat up to 8k of stack with some libc's /* Ugly trick, but I want these zeroed in one go */ struct { @@ -269,6 +271,15 @@ bb_info_msg("start, interface %s", intf); } + /* create pid file that contains the interface name */ + memset(pidbuf,0x0,BUFSIZ); + sprintf(pidbuf,"/var/run/zcip.%s.pid",intf); The memset is totally pointless. + if(fp = fopen_or_warn(pidbuf,"w")){ + fprintf(fp,"%d\n",getpid()); + fclose(fp); + } We have write_pidfile("name"), please use that. > This enables easier firmware controlled 'complex' network > configuration and re-configuration. Can you give a hypothetical example where this is useful? -- vda From marc.leeman at gmail.com Tue Dec 4 04:06:12 2007 From: marc.leeman at gmail.com (Marc Leeman) Date: Tue, 4 Dec 2007 13:06:12 +0100 Subject: [PATCH]: trivial patch to create zcip.devX.pid In-Reply-To: <200712040225.42579.vda.linux@googlemail.com> References: <1f729c480712040147p3c9e0dccodf7f13a229386ce6@mail.gmail.com> <200712040225.42579.vda.linux@googlemail.com> Message-ID: <1f729c480712040406r59ec1f48r6a28d4574d6d1058@mail.gmail.com> > We have write_pidfile("name"), please use that. tnx. > > This enables easier firmware controlled 'complex' network > > configuration and re-configuration. > > Can you give a hypothetical example where this is useful? the boards boot with dhcp and fallback to zcip when no dhcp server is on the network. When a board gets an API call to reconfigure some network interface (e.g. to static) that is running zcip, the zcip daemon keeps on overriding the new network settings. Killing the zcip daemon instance and then reconfiguring the network seems to be the most easy way to do so. I guess it must be a similar reasoning as udhcpd has. -- ash nazg durbatul?k, ash nazg gimbatul, ash nazg thrakatul?k agh burzum-ishi krimpatul From fabien.fb at gmail.com Tue Dec 4 08:26:25 2007 From: fabien.fb at gmail.com (fabien) Date: Tue, 4 Dec 2007 17:26:25 +0100 Subject: how can i get backspace working ? Message-ID: Hi, I've compiled busybox with allnoconfig and apply myself a custom configuration. The system works but the backspace doesn't work properly i get : ^h I've configured to use ash, i've also modified the inittab to work with my CPM driver /dev/ttyCPM0. My kernel is a 2.6.23 and busybox 1.8.1 compiled with ?Clibc. If someone could give me the way or a clue to solve this problem. My busybox config is like this : CONFIG_HAVE_DOT_CONFIG=y CONFIG_FEATURE_SYSLOG=y CONFIG_STATIC=y CONFIG_NO_DEBUG_LIB=y CONFIG_INSTALL_APPLET_SYMLINKS=y CONFIG_BASENAME=y CONFIG_CAT=y CONFIG_CHMOD=y CONFIG_CHOWN=y CONFIG_CP=y CONFIG_DATE=y CONFIG_FEATURE_DATE_ISOFMT=y CONFIG_DF=y CONFIG_DU=y CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y CONFIG_ECHO=y CONFIG_FEATURE_FANCY_ECHO=y CONFIG_HEAD=y CONFIG_ID=y CONFIG_LN=y CONFIG_LS=y CONFIG_FEATURE_LS_FILETYPES=y CONFIG_FEATURE_LS_FOLLOWLINKS=y CONFIG_FEATURE_LS_RECURSIVE=y CONFIG_FEATURE_LS_SORTFILES=y CONFIG_FEATURE_LS_TIMESTAMPS=y CONFIG_FEATURE_LS_USERNAME=y CONFIG_MKDIR=y CONFIG_MKNOD=y CONFIG_MV=y CONFIG_NICE=y CONFIG_PWD=y CONFIG_RM=y CONFIG_TEST=y CONFIG_TTY=y CONFIG_UNAME=y CONFIG_WHO=y CONFIG_FEATURE_AUTOWIDTH=y CONFIG_LOADKMAP=y CONFIG_INIT=y CONFIG_FEATURE_USE_INITTAB=y CONFIG_HALT=y CONFIG_GETTY=y CONFIG_FEATURE_UTMP=y CONFIG_MOUNT=y CONFIG_FEATURE_MOUNT_FLAGS=y CONFIG_FEATURE_MOUNT_FSTAB=y CONFIG_UMOUNT=y CONFIG_FREE=y CONFIG_KILL=y CONFIG_PIDOF=y CONFIG_PS=y CONFIG_TOP=y CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y CONFIG_UPTIME=y CONFIG_FEATURE_SH_IS_ASH=y CONFIG_ASH=y CONFIG_ASH_JOB_CONTROL=y CONFIG_ASH_ALIAS=y CONFIG_ASH_MATH_SUPPORT=y CONFIG_ASH_BUILTIN_ECHO=y CONFIG_ASH_BUILTIN_TEST=y CONFIG_ASH_MAIL=y CONFIG_ASH_OPTIMIZE_FOR_SIZE=y CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox" my etc/inittab : ::sysinit:/etc/init.d/rcS ttyCPM0::askfirst:-/bin/sh ::restart:/sbin/init ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r ::shutdown:/sbin/swapoff -a In rcS there is just a mount proc command. Best regards From wharms at bfs.de Tue Dec 4 08:56:02 2007 From: wharms at bfs.de (walter harms) Date: Tue, 04 Dec 2007 17:56:02 +0100 Subject: how can i get backspace working ? In-Reply-To: References: Message-ID: <475586A2.8060001@bfs.de> stty erase ^h re, wh fabien wrote: > Hi, > I've compiled busybox with allnoconfig and apply myself a custom configuration. > The system works but the backspace doesn't work properly i get : ^h > I've configured to use ash, i've also modified the inittab to work > with my CPM driver /dev/ttyCPM0. > My kernel is a 2.6.23 and busybox 1.8.1 compiled with ?Clibc. > If someone could give me the way or a clue to solve this problem. > > My busybox config is like this : > CONFIG_HAVE_DOT_CONFIG=y > CONFIG_FEATURE_SYSLOG=y > CONFIG_STATIC=y > CONFIG_NO_DEBUG_LIB=y > CONFIG_INSTALL_APPLET_SYMLINKS=y > CONFIG_BASENAME=y > CONFIG_CAT=y > CONFIG_CHMOD=y > CONFIG_CHOWN=y > CONFIG_CP=y > CONFIG_DATE=y > CONFIG_FEATURE_DATE_ISOFMT=y > CONFIG_DF=y > CONFIG_DU=y > CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y > CONFIG_ECHO=y > CONFIG_FEATURE_FANCY_ECHO=y > CONFIG_HEAD=y > CONFIG_ID=y > CONFIG_LN=y > CONFIG_LS=y > CONFIG_FEATURE_LS_FILETYPES=y > CONFIG_FEATURE_LS_FOLLOWLINKS=y > CONFIG_FEATURE_LS_RECURSIVE=y > CONFIG_FEATURE_LS_SORTFILES=y > CONFIG_FEATURE_LS_TIMESTAMPS=y > CONFIG_FEATURE_LS_USERNAME=y > CONFIG_MKDIR=y > CONFIG_MKNOD=y > CONFIG_MV=y > CONFIG_NICE=y > CONFIG_PWD=y > CONFIG_RM=y > CONFIG_TEST=y > CONFIG_TTY=y > CONFIG_UNAME=y > CONFIG_WHO=y > CONFIG_FEATURE_AUTOWIDTH=y > CONFIG_LOADKMAP=y > CONFIG_INIT=y > CONFIG_FEATURE_USE_INITTAB=y > CONFIG_HALT=y > CONFIG_GETTY=y > CONFIG_FEATURE_UTMP=y > CONFIG_MOUNT=y > CONFIG_FEATURE_MOUNT_FLAGS=y > CONFIG_FEATURE_MOUNT_FSTAB=y > CONFIG_UMOUNT=y > CONFIG_FREE=y > CONFIG_KILL=y > CONFIG_PIDOF=y > CONFIG_PS=y > CONFIG_TOP=y > CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y > CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y > CONFIG_UPTIME=y > CONFIG_FEATURE_SH_IS_ASH=y > CONFIG_ASH=y > CONFIG_ASH_JOB_CONTROL=y > CONFIG_ASH_ALIAS=y > CONFIG_ASH_MATH_SUPPORT=y > CONFIG_ASH_BUILTIN_ECHO=y > CONFIG_ASH_BUILTIN_TEST=y > CONFIG_ASH_MAIL=y > CONFIG_ASH_OPTIMIZE_FOR_SIZE=y > CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox" > > my etc/inittab : > ::sysinit:/etc/init.d/rcS > ttyCPM0::askfirst:-/bin/sh > ::restart:/sbin/init > ::ctrlaltdel:/sbin/reboot > ::shutdown:/bin/umount -a -r > ::shutdown:/sbin/swapoff -a > > In rcS there is just a mount proc command. > > Best regards > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From vda.linux at googlemail.com Tue Dec 4 10:05:50 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 4 Dec 2007 10:05:50 -0800 Subject: init hangs In-Reply-To: References: <200711211620.50784.schane@osmozis.com> <200711292136.08079.vda.linux@googlemail.com> Message-ID: <200712041005.50901.vda.linux@googlemail.com> On Monday 03 December 2007 09:01, saravanan chanemouganandam wrote: > Hi, > > I have finally built the toolchain and rootfs using buildroot for the arm > target. Using init=/bin/ash I endup with the prompt. Now, I have a small > problem in using "sysvinit" built with the busybox package to use run level > configurations. Sidenote: busybox init doesn't support runlevels. It's not my idea to make it so, but I agree with it. SysV init's runlevels was a wrong design decision in the first place. > The init starts well and uses /etc/inittab but doesn't run > the /etc/init.d/rcS script. Is it similar to http://busybox.net/bugs/view.php?id=1244 ? > I have replaced buildoot /etc with existing > /etc to incude run levels. Just replacing /etc scripts cannot make runlevels work. You need different init (not busybox's one). > IP-Config: Complete:device=eth0, addr=192.168.6.243, mask=255.255.255.0, > gw=192.168.6.1,host=cm-x270, domain=, > nis-domain=(none),bootserver=192.168.6.1, rootserver=192.168.6.1, > rootpath=Looking up port of RPC 100003/2 on 192.168.6.1Looking up port of > RPC 100005/1 on 192.168.6.1VFS: Mounted root (nfs filesystem).Freeing init > memory: 108KINIT: version 2.86 bootingINIT: Entering runlevel: 2 Debian > GNU/Linux 3.1 ttySA0 login: rootPassword: any idea why init doesn't > starts the rcS script. (Something is wrong with mail program you are using. It all looksjumbledtogether.) If you will show your /etc/inittab and /etc/*rc_scripts_you_are_using*, somebody on the list may have easier time trying to reproduce it. -- vda From vda.linux at googlemail.com Tue Dec 4 10:10:05 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 4 Dec 2007 10:10:05 -0800 Subject: usage of -funsigned-char In-Reply-To: <200712040106.29783.vapier@gentoo.org> References: <200712021852.42519.vapier@gentoo.org> <200712030256.54498.vda.linux@googlemail.com> <200712040106.29783.vapier@gentoo.org> Message-ID: <200712041010.05659.vda.linux@googlemail.com> On Monday 03 December 2007 22:06, Mike Frysinger wrote: > On Monday 03 December 2007, Denys Vlasenko wrote: > > On Sunday 02 December 2007 15:52, Mike Frysinger wrote: > > > can we analyze the usage of -funsigned-char in Makefile.flags ? i feel > > > like this is the wrong way to go for anything ... > > > > I think it is a great way to avoid all sorts of stupid bugs > > when char is inadvertently sign-extended. > > > > I try to write code such that it will work with signed char, > > but at the same time -funsigned-char gives additional protection - > > even if some code is potentially buggy wrt signed char, it > > will actually work. > > while in general, i can understand this ... but it's my understanding that > the signedness of the char may be tied to the ISA and it can actually be a > severe determinate to optimization capabilities where forcing the > signedness to the opposite of the default ISA ... Are there such CPUs currently in active use? If yes, I'll move -funsigned-char to arch/i386/Makefile. Hmm, and other arches will need the same treatment... -- vda From hersonls at gmail.com Tue Dec 4 12:33:17 2007 From: hersonls at gmail.com (Herson Leite) Date: Tue, 4 Dec 2007 17:33:17 -0300 Subject: Help in busybox external softwares Message-ID: i execute exernal sofwares in busybox and dont work -------------- # ipconfig sh: ipconfig: not found -------------- ipconfig within /bin/ipconfig tanks, hersonls -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20071204/ec35b08f/attachment.htm From supinlick at yahoo.com Tue Dec 4 12:46:03 2007 From: supinlick at yahoo.com (Sean Parker) Date: Tue, 4 Dec 2007 12:46:03 -0800 (PST) Subject: Help in busybox external softwares In-Reply-To: Message-ID: <620569.6883.qm@web51907.mail.re2.yahoo.com> Hello Herson - According to my copy of the busybox command-set manual, ipconfig is not supported. Perhaps if you look through it you may be able to find the appropriate commands... http://busybox.net/downloads/BusyBox.html Cheers Sean --- Herson Leite wrote: > i execute exernal sofwares in busybox and dont work > > -------------- > # ipconfig > sh: ipconfig: not found > > -------------- > > ipconfig within /bin/ipconfig > > tanks, hersonls > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox God Bless Sean Parker ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From vda.linux at googlemail.com Tue Dec 4 13:51:34 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Tue, 4 Dec 2007 13:51:34 -0800 Subject: Help in busybox external softwares In-Reply-To: References: Message-ID: <200712041351.34117.vda.linux@googlemail.com> On Tuesday 04 December 2007 12:33, Herson Leite wrote: > i execute exernal sofwares in busybox and dont work > > -------------- > # ipconfig > sh: ipconfig: not found > > -------------- > > ipconfig within /bin/ipconfig > > tanks, hersonls I looked up its manpage on the Web: NAME ipconfig -- view and control IP configuration state SYNOPSIS ipconfig waitall ipconfig getifaddr interface-name ipconfig ifcount ipconfig getoption interface-name (option-name | option-code) ipconfig getpacket interface-name ipconfig set interface-name NONE ipconfig set interface-name (DHCP | BOOTP) ipconfig set interface-name (MANUAL | INFORM) ip-address subnet-mask ipconfig setverbose level DESCRIPTION ipconfig is a utility that communicates with the IPConfiguration agent to retrieve and set IP configuration parameters. It should only be used in a test and debug context. Using it for any other purpose is strongly discouraged. Public API's in the SystemConfiguration framework are cur- rently the only supported way to access and control the state of IPCon- figuration. The IPConfiguration agent is responsible for configuring and managing the IP addresses on direct, connectionless interfaces such as IEEE 802.3 Eth- ernet and IEEE 1394 FireWire. The IPConfiguration agent is a program bundle that is loaded and executed by the configd(8) process. No, busybox doesn't have it, and probably never will. An utility which "communicates with agent" to "retrieve IP address"?? This is too simple, why not throw a few more layers in between? Let's retrieve IP addresses of our own machines by email! Let's store them in Oracle database (dedicated solely for the purposes of storing IPs - you know, it's possible to have thousands of IPs on one machine)! And let's backup that database! And lets store the imformation about backup results and schedule into a backup catalog (another database)! -- vda From rajeevb at intoto.com Tue Dec 4 21:37:01 2007 From: rajeevb at intoto.com (Rajeev Bansal) Date: Wed, 05 Dec 2007 11:07:01 +0530 Subject: Busybox Init Message-ID: <475638FD.5060500@intoto.com> Hi All, I am trying to boot Ubuntu Kernel using custom root file system. I am using Busybox's (Version 1.7.0) init for initing my box. I am observing init is not remounting my system root which is /dev/sda2 in my case on /. After booting up I observe it has mounted /dev/root on /, which is also working fine for me. But I want it should remount the system root (/dev/sda2 ) on /. I am writing my init script which kernel is executes during init process, and the output of the mount command just let me know if I am missing something there. My Init file looks like that: #!/bin/nash mount -t proc /proc /proc setquiet echo Mounting proc filesystem echo Mounting sysfs filesystem mount -t sysfs /sys /sys echo Creating /dev mount -o mode=0755 -t tmpfs /dev /dev mkdir /dev/pts mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts mkdir /dev/shm mkdir /dev/mapper echo Creating initial device nodes mknod /dev/null c 1 3 mknod /dev/zero c 1 5 mknod /dev/systty c 4 0 mknod /dev/tty c 5 0 mknod /dev/console c 5 1 mknod /dev/ptmx c 5 2 mknod /dev/rtc c 10 135 mknod /dev/tty0 c 4 0 mknod /dev/tty1 c 4 1 mknod /dev/tty2 c 4 2 mknod /dev/tty3 c 4 3 mknod /dev/tty4 c 4 4 mknod /dev/tty5 c 4 5 mknod /dev/tty6 c 4 6 mknod /dev/tty7 c 4 7 mknod /dev/tty8 c 4 8 mknod /dev/tty9 c 4 9 mknod /dev/tty10 c 4 10 mknod /dev/tty11 c 4 11 mknod /dev/tty12 c 4 12 mknod /dev/ttyS0 c 4 64 mknod /dev/ttyS1 c 4 65 mknod /dev/ttyS2 c 4 66 mknod /dev/ttyS3 c 4 67 echo Creating block device nodes. mkblkdevs echo "Loading usbcore.ko module" insmod /lib/usbcore.ko echo "Loading uhci-hcd.ko module" insmod /lib/uhci-hcd.ko echo "Loading ohci-hcd.ko module" insmod /lib/ohci-hcd.ko echo "Loading ehci-hcd.ko module" insmod /lib/ehci-hcd.ko mount -t usbfs /proc/bus/usb /proc/bus/usb echo "Loading mbcache.ko module" insmod /lib/mbcache.ko echo "Loading jbd.ko module" insmod /lib/jbd.ko echo "Loading ext3.ko module" insmod /lib/ext3.ko echo "Loading scsi_mod.ko module" insmod /lib/scsi_mod.ko echo "Loading sd_mod.ko module" insmod /lib/sd_mod.ko echo "Loading sg.ko module" insmod /lib/sg.ko echo "Loading libata.ko module" insmod /lib/libata.ko echo "Loading ata_generic.ko module" insmod /lib/ata_generic.ko echo "Loading ata_piix.ko module" insmod /lib/ata_piix.ko echo Waiting for driver initialization. stabilized --hash --interval 250 /proc/scsi/scsi insmod /lib/scsi_wait_scan.ko rmmod scsi_wait_scan mkblkdevs resume LABEL=SWAP-sda2 echo Creating root device. mkrootdev -t ext3 -o defaults,rw sda1 echo Mounting root filesystem. mount /sysroot echo Setting up other filesystems. setuproot echo Switching to new root and running init. switchroot echo Booting has failed. sleep -1 Output of the Mount command: [root@/] #mount rootfs on / type rootfs (rw) /dev/root on / type ext3 (rw,data=ordered) /dev on /dev type tmpfs (rw) /proc on /proc type proc (rw) /sys on /sys type sysfs (rw) /dev/sda1 on /boot type ext3 (rw,data=ordered) tmpfs on /dev/shm type tmpfs (rw) devpts on /dev/pts type devpts (rw) Thanks Rajeev Bansal ******************************************************************************** This email message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential, proprietary and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately notify the sender by reply email and destroy all copies of the original message. Thank you. Intoto Inc. From vapier at gentoo.org Tue Dec 4 23:02:32 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 5 Dec 2007 02:02:32 -0500 Subject: Busybox Init In-Reply-To: <475638FD.5060500@intoto.com> References: <475638FD.5060500@intoto.com> Message-ID: <200712050202.33796.vapier@gentoo.org> On Wednesday 05 December 2007, Rajeev Bansal wrote: > I am trying to boot Ubuntu Kernel using custom root file system. I am > using Busybox's (Version 1.7.0) init for initing my box. I am observing > init is not remounting my system root which is /dev/sda2 in my case on > /. why do you think init should be doing anything even remotely like that ? that is not the job of init, that is the job of your scripts. > After booting up I observe it has mounted /dev/root on /, which is > also working fine for me. But I want it should remount the system root > (/dev/sda2 ) on /. I am writing my init script which kernel is executes > during init process, and the output of the mount command just let me > know if I am missing something there. /dev/root is whatever you set root= when booting the kernel this really isnt a busybox issue. please take your question to 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: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20071205/6ea16fdc/attachment.pgp From rajeevb at intoto.com Wed Dec 5 00:54:50 2007 From: rajeevb at intoto.com (Rajeev Bansal) Date: Wed, 05 Dec 2007 14:24:50 +0530 Subject: Busybox Init In-Reply-To: <200712050202.33796.vapier@gentoo.org> References: <475638FD.5060500@intoto.com> <200712050202.33796.vapier@gentoo.org> Message-ID: <4756675A.6030605@intoto.com> Hi Mike, Thanks for replying the query. I am not sure about this but don't you think when you run the command switchroot in init script, then its Init's job to remount the previous mounted root with read-write options. Thanks -Rajeev Mike Frysinger wrote: > On Wednesday 05 December 2007, Rajeev Bansal wrote: > >> I am trying to boot Ubuntu Kernel using custom root file system. I am >> using Busybox's (Version 1.7.0) init for initing my box. I am observing >> init is not remounting my system root which is /dev/sda2 in my case on >> /. >> > > why do you think init should be doing anything even remotely like that ? that > is not the job of init, that is the job of your scripts. > > >> After booting up I observe it has mounted /dev/root on /, which is >> also working fine for me. But I want it should remount the system root >> (/dev/sda2 ) on /. I am writing my init script which kernel is executes >> during init process, and the output of the mount command just let me >> know if I am missing something there. >> > > /dev/root is whatever you set root= when booting the kernel > > this really isnt a busybox issue. please take your question to a Linux From > Scratch mailing list. > -mike > ******************************************************************************** This email message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential, proprietary and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately notify the sender by reply email and destroy all copies of the original message. Thank you. Intoto Inc. From wharms at bfs.de Wed Dec 5 01:52:07 2007 From: wharms at bfs.de (walter harms) Date: Wed, 05 Dec 2007 10:52:07 +0100 Subject: Busybox Init In-Reply-To: <4756675A.6030605@intoto.com> References: <475638FD.5060500@intoto.com> <200712050202.33796.vapier@gentoo.org> <4756675A.6030605@intoto.com> Message-ID: <475674C7.80306@bfs.de> Rajeev Bansal wrote: > Hi Mike, > > Thanks for replying the query. > > I am not sure about this but don't you think when you run the command > switchroot in init script, then its Init's job to remount the previous > mounted root with read-write options. > > Thanks > -Rajeev > hi Rajeev, from 'man init' Init is the parent of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab (see init- tab(5)). This file usually has entries which cause init to spawn get- tys on each line that users can log in. It also controls autonomous processes required by any particular system. obviously it is NOT the job of init to mount anything or even to know about mounting. he is starting and supervising processes nothing more. doing a UNIX from scratch is a huge undertaking. People from "linux from scratch" are much more prepared (and capable) than the busybox ml to explain details of a system start-up. see: http://www.linuxfromscratch.org/ re, wh From rajeevb at intoto.com Wed Dec 5 02:38:00 2007 From: rajeevb at intoto.com (Rajeev Bansal) Date: Wed, 05 Dec 2007 16:08:00 +0530 Subject: Busybox Init In-Reply-To: <475674C7.80306@bfs.de> References: <475638FD.5060500@intoto.com> <200712050202.33796.vapier@gentoo.org> <4756675A.6030605@intoto.com> <475674C7.80306@bfs.de> Message-ID: <47567F88.4030005@intoto.com> Hello Walter, Please see below mentioned text which I extracted from "ramfs-rootfs-initramfs.txt" What is initramfs? 83 ------------------ 84 85 All 2.6 Linux kernels contain a gzipped "cpio" format archive, which is 86 extracted into rootfs when the kernel boots up. After extracting, the kernel 87 checks to see if rootfs contains a file "init", and if so it executes it as PID 88 1. _*If found, this init process is responsible for bringing the system the 89 rest of the way up, including locating and mounting the real root device (if 90 any).*_ If rootfs does not contain an init program after the embedded cpio 91 archive is extracted into it, the kernel will fall through to the older code 92 to locate and mount a root partition, then exec some variant of /sbin/init 93 out of that. So according to them , its init responsibility to mount the real root device, I think VI init works in that way, but not sure about the busybox Init. Can anyone clarify me that? I have post my question to LFS also. Thanks Rajeev Bansal. walter harms wrote: > Rajeev Bansal wrote: > >> Hi Mike, >> >> Thanks for replying the query. >> >> I am not sure about this but don't you think when you run the command >> switchroot in init script, then its Init's job to remount the previous >> mounted root with read-write options. >> >> Thanks >> -Rajeev >> >> > > > hi Rajeev, > from 'man init' > Init is the parent of all processes. Its primary role is to create > processes from a script stored in the file /etc/inittab (see init- > tab(5)). This file usually has entries which cause init to spawn get- > tys on each line that users can log in. It also controls autonomous > processes required by any particular system. > > obviously it is NOT the job of init to mount anything or even to know about mounting. > he is starting and supervising processes nothing more. doing a UNIX from scratch is > a huge undertaking. People from "linux from scratch" are much more prepared (and > capable) than the busybox ml to explain details of a system start-up. > see: http://www.linuxfromscratch.org/ > > re, > wh > > > ******************************************************************************** This email message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential, proprietary and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately notify the sender by reply email and destroy all copies of the original message. Thank you. Intoto Inc. From obelix0 at yahoo.fr Wed Dec 5 04:56:16 2007 From: obelix0 at yahoo.fr (Obelix) Date: Wed, 5 Dec 2007 04:56:16 -0800 (PST) Subject: BB 1.0 & in.telnetd Message-ID: <431930.26461.qm@web53111.mail.re2.yahoo.com> Hi everybody ! I'm using BB 1.0 on JFFS2 file system. Telnet daemon works fine,I have : - in /etc/rc.sysinit : "console:3:once:/sbin/inetd -R 1000" - in /etc/inetd.conf : "telnet stream tcp nowait root /sbin/in.telnetd in.telnetd" Now I changed my file system to cramfs, so in readonly and telnet doesn't work anymore :( I start telnetd with "/sbin/in.telnetd -debug" and I try a connection... ------------------------------------------------ ~$ telnet 10.2.0.1 Trying 10.2.0.1... Connected to 10.2.0.1. Escape character is '^]'. Connection closed by foreign host. ------------------------------------------------ I can't connect and I have a segmentation fault in console ------------------------------------------------ / # /sbin/in.telnetd -debug Segmentation fault ------------------------------------------------ This test work fine on a JFFS2 file system and not with cramfs ! Do you know why ? thanks for your help Best reagards Obelix _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail From schane at osmozis.com Wed Dec 5 05:20:22 2007 From: schane at osmozis.com (chanemouganandam saravanan) Date: Wed, 5 Dec 2007 14:20:22 +0100 Subject: init hangs References: <200711211620.50784.schane@osmozis.com> <200711292136.08079.vda.linux@googlemail.com> <200712041005.50901.vda.linux@googlemail.com> Message-ID: <01b701c83741$98d75570$0701a8c0@Sara> Hi , Excuse me for the jumbled mail problem and I will fix it. Yes, I am clear that busybox "init" doesn't support run levels. /etc/inittab says use sysvinit for runlevels and to use run level, in the Buildroot ( using gcc 4.1.2 , binuitls 2.17 and uClibc 0.9.29 version) busybox package selection, I have enabled "Hide application that are provided by busybox" to select "sysvinit" which builts and installs sysVinit version 2.86 in the final rootfs. In the rootfs, I have modified a bit in /etc/inittab and created rc2.d in /etc to test the run level 2 . Finally, the bootup message ..... Looking up port of RPC 100003/2 on 192.168.6.1 Looking up port of RPC 100005/1 on 192.168.6.1 VFS: Mounted root (nfs filesystem). Freeing init memory: 108K INIT: version 2.86 booting INIT: Entering runlevel: 2 uClibc login: shows that init doesn't execute /etc/init.d/rcS or /etc/init.d/rc. If there is a syntax error or missing run level in the inittab then "init" throws the respective error message. Here is my /etc/inittab and rc2.d for further analysis # /etc/inittab # # Copyright (C) 2001 Erik Andersen # # Note: BusyBox init doesn't support runlevels. The runlevels field is # completely ignored by BusyBox init. If you want runlevels, use # sysvinit. # The default runlevel. id:2:initdefault: # Startup the system l1::sysinit:/bin/mount -o remount,rw / l2::sysinit:/bin/mount -t proc proc /proc l3::sysinit:/bin/mount -a # now run any rc scripts si::sysinit:/etc/init.d/rcS ( this is not invoked ) # /etc/init.d executes the S and K scripts upon change # of runlevel. l4:2:wait:/etc/init.d/rc 2 ( this is not called after entering runlevel 2) # Set up a couple of getty's #tty1::respawn:/sbin/getty 38400 tty1 #tty2::respawn:/sbin/getty 38400 tty2 # Put a getty on the serial port T1::respawn:/sbin/getty -L ttySA0 38400 vt100 ( respawn getty for login prompt) I went through the http://busybox.net/bugs/view.php?id=1244 bug tracking and seems to be bit similar. I have also performed some test discussed like echo TEST >/dev/tty echo TEST >/dev/console and i got TEST msg printed out on the console. Executing the scripts individually inside the prompt works well. I use the rootfs built by buildroot using . Its strange that init desn't execute the /etc/initd.rcS and /etc/init.d/rc ? At the least it should execute /etc/init.d/rcS. Did I missed something very important to make init work? Sara ----- Original Message ----- From: "Denys Vlasenko" To: "saravanan chanemouganandam" Cc: "Saravanan Chanemouganandam" ; "Brian Austin" ; Sent: Tuesday, December 04, 2007 7:05 PM Subject: Re: init hangs > On Monday 03 December 2007 09:01, saravanan chanemouganandam wrote: >> Hi, >> >> I have finally built the toolchain and rootfs using buildroot for the arm >> target. Using init=/bin/ash I endup with the prompt. Now, I have a small >> problem in using "sysvinit" built with the busybox package to use run >> level >> configurations. > > Sidenote: busybox init doesn't support runlevels. > It's not my idea to make it so, but I agree with it. > SysV init's runlevels was a wrong design decision in the first place. > >> The init starts well and uses /etc/inittab but doesn't run >> the /etc/init.d/rcS script. > > Is it similar to http://busybox.net/bugs/view.php?id=1244 ? > >> I have replaced buildoot /etc with existing >> /etc to incude run levels. > > Just replacing /etc scripts cannot make runlevels work. > You need different init (not busybox's one). > >> IP-Config: Complete:device=eth0, addr=192.168.6.243, mask=255.255.255.0, >> gw=192.168.6.1,host=cm-x270, domain=, >> nis-domain=(none),bootserver=192.168.6.1, rootserver=192.168.6.1, >> rootpath=Looking up port of RPC 100003/2 on 192.168.6.1Looking up port of >> RPC 100005/1 on 192.168.6.1VFS: Mounted root (nfs filesystem).Freeing >> init >> memory: 108KINIT: version 2.86 bootingINIT: Entering runlevel: 2 Debian >> GNU/Linux 3.1 ttySA0 login: rootPassword: any idea why init doesn't >> starts the rcS script. > > (Something is wrong with mail program you are using. > It all looksjumbledtogether.) > > If you will show your /etc/inittab and /etc/*rc_scripts_you_are_using*, > somebody on the list may have easier time trying to reproduce it. > -- > vda > From obelix0 at yahoo.fr Wed Dec 5 05:28:32 2007 From: obelix0 at yahoo.fr (Obelix) Date: Wed, 5 Dec 2007 05:28:32 -0800 (PST) Subject: BB 1.0 & in.telnetd Message-ID: <462475.38666.qm@web53111.mail.re2.yahoo.com> I would like to add that if I try to start telned whitout -debug, I have this message : ------------------------------------------------ / # in.telnetd in.telnetd: getpeername: Socket operation on non-socket ------------------------------------------------ I found that it's a problem without /dev but I have all my devices mount with devfs thanks again ----- Message d'origine ---- De : Obelix ? : busybox at busybox.net Envoy? le : Mercredi, 5 D?cembre 2007, 13h56mn 16s Objet : BB 1.0 & in.telnetd Hi everybody ! I'm using BB 1.0 on JFFS2 file system. Telnet daemon works fine,I have : - in /etc/rc.sysinit : "console:3:once:/sbin/inetd -R 1000" - in /etc/inetd.conf : "telnet stream tcp nowait root /sbin/in.telnetd in.telnetd" Now I changed my file system to cramfs, so in readonly and telnet doesn't work anymore :( I start telnetd with "/sbin/in.telnetd -debug" and I try a connection... ------------------------------------------------ ~$ telnet 10.2.0.1 Trying 10.2.0.1... Connected to 10.2.0.1. Escape character is '^]'. Connection closed by foreign host. ------------------------------------------------ I can't connect and I have a segmentation fault in console ------------------------------------------------ / # /sbin/in.telnetd -debug Segmentation fault ------------------------------------------------ This test work fine on a JFFS2 file system and not with cramfs ! Do you know why ? thanks for your help Best reagards Obelix _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail From loic.grenie at gmail.com Wed Dec 5 05:32:20 2007 From: loic.grenie at gmail.com (=?ISO-8859-1?Q?Lo=EFc_Greni=E9?=) Date: Wed, 5 Dec 2007 14:32:20 +0100 Subject: Busybox Init In-Reply-To: <47567F88.4030005@intoto.com> References: <475638FD.5060500@intoto.com> <200712050202.33796.vapier@gentoo.org> <4756675A.6030605@intoto.com> <475674C7.80306@bfs.de> <47567F88.4030005@intoto.com> Message-ID: <9b06e8d20712050532w3b5f8f89seb53b031a1d7821e@mail.gmail.com> 2007/12/5, Rajeev Bansal : > Hello Walter, > > Please see below mentioned text which I extracted from > "ramfs-rootfs-initramfs.txt" > > What is initramfs? [snip] > So according to them , it's init responsibility to mount the real root > device, I think VI init works in that way, but not sure about the > busybox Init. Can anyone clarify me that? In the initramfs system you have no real init, in the usual UNIX sense. There is a program that does some initialization of the software, often loads module and mount real root file system, and launch /sbin/init of the real root filesystem. This are two conceptually different things, which unfortunately share the same name. The "init" that is present in BB is not the one to put on an initramfs. You should really try another mailing-list, because this one is not the correct one. Lo?c Greni? From wharms at bfs.de Wed Dec 5 06:10:54 2007 From: wharms at bfs.de (walter harms) Date: Wed, 05 Dec 2007 15:10:54 +0100 Subject: BB 1.0 & in.telnetd In-Reply-To: <462475.38666.qm@web53111.mail.re2.yahoo.com> References: <462475.38666.qm@web53111.mail.re2.yahoo.com> Message-ID: <4756B16E.6030806@bfs.de> Hi Obelix, its nice that you found a solution but NTL you are using a very ancient BusyBox Version. There is a good change that things have changed to the better since the last releases. please try a newer release. re, walter Obelix wrote: > I would like to add that if I try to start telned whitout -debug, I have this message : > ------------------------------------------------ > / # in.telnetd > in.telnetd: getpeername: Socket operation on non-socket > ------------------------------------------------ > > I found that it's a problem without /dev but I have all my devices mount with devfs > > thanks again > > > ----- Message d'origine ---- > De : Obelix > ? : busybox at busybox.net > Envoy? le : Mercredi, 5 D?cembre 2007, 13h56mn 16s > Objet : BB 1.0 & in.telnetd > > Hi everybody ! > > I'm using BB 1.0 on JFFS2 file system. Telnet daemon works fine,I have > : > - in /etc/rc.sysinit : "console:3:once:/sbin/inetd -R 1000" > - in /etc/inetd.conf : "telnet stream tcp nowait root > /sbin/in.telnetd in.telnetd" > > Now I changed my file system to cramfs, so in readonly and telnet > doesn't work anymore :( > > I start telnetd with "/sbin/in.telnetd -debug" and I try a > connection... > ------------------------------------------------ > ~$ telnet 10.2.0.1 > Trying 10.2.0.1... > Connected to 10.2.0.1. > Escape character is '^]'. > Connection closed by foreign host. > ------------------------------------------------ > > I can't connect and I have a segmentation fault in console > > ------------------------------------------------ > / # /sbin/in.telnetd -debug > Segmentation fault > ------------------------------------------------ > > This test work fine on a JFFS2 file system and not with cramfs ! > > Do you know why ? > > thanks for your help > > Best reagards > > Obelix > > > > > > _____________________________________________________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! > Mail > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > > > > _____________________________________________________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From wharms at bfs.de Wed Dec 5 06:11:14 2007 From: wharms at bfs.de (walter harms) Date: Wed, 05 Dec 2007 15:11:14 +0100 Subject: Busybox Init In-Reply-To: <47567F88.4030005@intoto.com> References: <475638FD.5060500@intoto.com> <200712050202.33796.vapier@gentoo.org> <4756675A.6030605@intoto.com> <475674C7.80306@bfs.de> <47567F88.4030005@intoto.com> Message-ID: <4756B182.1020705@bfs.de> Rajeev Bansal wrote: > Hello Walter, > > > > So according to them , its init responsibility to mount the real root you an it does so by calling *a script* that does the actual work. E.g on my desktop its called "boot.localfs" on your system it can be called totally different to mirror different needs. > device, I think VI init works in that way, but not sure about the > busybox Init. Can anyone clarify me that? > > I have post my question to LFS also. > please do not send questions that belong clearly into LFS-ML into busybox ml. re, wh From rajeevb at intoto.com Wed Dec 5 06:19:21 2007 From: rajeevb at intoto.com (Rajeev Bansal) Date: Wed, 05 Dec 2007 19:49:21 +0530 Subject: Busybox Init In-Reply-To: <9b06e8d20712050532w3b5f8f89seb53b031a1d7821e@mail.gmail.com> References: <475638FD.5060500@intoto.com> <200712050202.33796.vapier@gentoo.org> <4756675A.6030605@intoto.com> <475674C7.80306@bfs.de> <47567F88.4030005@intoto.com> <9b06e8d20712050532w3b5f8f89seb53b031a1d7821e@mail.gmail.com> Message-ID: <4756B369.6040703@intoto.com> Hi All, I could find the problem in my init script, actually I was using switchroot command to move from my old root to new root. But busybox gives switch_root in place of switchroot. So when I replaced the switchroot with switch_root command, I could see it was mounting the new root fs that is /dev/sda2 in my case. But after that it was giving me the Kernel panic. I don't know why it was behaving like that. Ideally kernel should go and execute /sbin/init. I am mentioning below my new init script. #!/bin/nash mount -t proc /proc /proc setquiet echo Mounting proc filesystem echo Mounting sysfs filesystem mount -t sysfs /sys /sys echo Creating /dev mount -o mode=0755 -t tmpfs /dev /dev mkdir /dev/pts mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts mkdir /dev/shm mkdir /dev/mapper echo Creating initial device nodes mknod /dev/null c 1 3 mknod /dev/zero c 1 5 mknod /dev/systty c 4 0 mknod /dev/tty c 5 0 mknod /dev/console c 5 1 mknod /dev/ptmx c 5 2 mknod /dev/rtc c 10 135 mknod /dev/tty0 c 4 0 mknod /dev/tty1 c 4 1 mknod /dev/tty2 c 4 2 mknod /dev/tty3 c 4 3 mknod /dev/tty4 c 4 4 mknod /dev/tty5 c 4 5 mknod /dev/tty6 c 4 6 mknod /dev/tty7 c 4 7 mknod /dev/tty8 c 4 8 mknod /dev/tty9 c 4 9 mknod /dev/tty10 c 4 10 mknod /dev/tty11 c 4 11 mknod /dev/tty12 c 4 12 mknod /dev/ttyS0 c 4 64 mknod /dev/ttyS1 c 4 65 mknod /dev/ttyS2 c 4 66 mknod /dev/ttyS3 c 4 67 echo Creating block device nodes. mkblkdevs echo "Loading usbcore.ko module" insmod /lib/usbcore.ko echo "Loading uhci-hcd.ko module" insmod /lib/uhci-hcd.ko echo "Loading ohci-hcd.ko module" insmod /lib/ohci-hcd.ko echo "Loading ehci-hcd.ko module" insmod /lib/ehci-hcd.ko mount -t usbfs /proc/bus/usb /proc/bus/usb echo "Loading mbcache.ko module" insmod /lib/mbcache.ko echo "Loading jbd.ko module" insmod /lib/jbd.ko echo "Loading ext3.ko module" insmod /lib/ext3.ko echo "Loading scsi_mod.ko module" insmod /lib/scsi_mod.ko echo "Loading sd_mod.ko module" insmod /lib/sd_mod.ko echo "Loading sg.ko module" insmod /lib/sg.ko echo "Loading libata.ko module" insmod /lib/libata.ko echo "Loading ata_generic.ko module" insmod /lib/ata_generic.ko echo "Loading ata_piix.ko module" insmod /lib/ata_piix.ko echo Waiting for driver initialization. stabilized --hash --interval 250 /proc/scsi/scsi insmod /lib/scsi_wait_scan.ko rmmod scsi_wait_scan mkblkdevs echo Creating root device. mkrootdev -t ext3 -o defaults,ro sda2 echo Mounting root filesystem. mount /sysroot echo Switching to new root and running init. switch_root /dev/sda2 /sbin/init ------------------------> I tried switch_root with or without arguments also. ls -l echo Booting has failed. sleep -1 Thanks Rajeev Bansal. Lo?c Greni? wrote: > 2007/12/5, Rajeev Bansal : > >> Hello Walter, >> >> Please see below mentioned text which I extracted from >> "ramfs-rootfs-initramfs.txt" >> >> What is initramfs? >> > > [snip] > > >> So according to them , it's init responsibility to mount the real root >> device, I think VI init works in that way, but not sure about the >> busybox Init. Can anyone clarify me that? >> > > In the initramfs system you have no real init, in the usual UNIX sense. > There is a program that does some initialization of the software, often > loads module and mount real root file system, and launch /sbin/init > of the real root filesystem. This are two conceptually different things, > which unfortunately share the same name. The "init" that is present > in BB is not the one to put on an initramfs. You should really try another > mailing-list, because this one is not the correct one. > > Lo?c Greni? > > > ******************************************************************************** This email message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential, proprietary and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately notify the sender by reply email and destroy all copies of the original message. Thank you. Intoto Inc. From obelix0 at yahoo.fr Wed Dec 5 06:19:30 2007 From: obelix0 at yahoo.fr (Obelix) Date: Wed, 5 Dec 2007 06:19:30 -0800 (PST) Subject: BB 1.0 & in.telnetd Message-ID: <417501.86916.qm@web53108.mail.re2.yahoo.com> Thanks for your reply... I know that I can use last version of BB but I would like to understant why it works in JFFS2 and not in CRAMFS ! in the config file to compile busybox, I never add this option : +# CONFIG_FEATURE_TELNETD_INETD is not set but maybe I need it ? thanks again Obelix ----- Message d'origine ---- De : walter harms ? : Obelix Cc : busybox at busybox.net Envoy? le : Mercredi, 5 D?cembre 2007, 15h10mn 54s Objet : Re: Re : BB 1.0 & in.telnetd Hi Obelix, its nice that you found a solution but NTL you are using a very ancient BusyBox Version. There is a good change that things have changed to the better since the last releases. please try a newer release. re, walter Obelix wrote: > I would like to add that if I try to start telned whitout -debug, I have this message : > ------------------------------------------------ > / # in.telnetd > in.telnetd: getpeername: Socket operation on non-socket > ------------------------------------------------ > > I found that it's a problem without /dev but I have all my devices mount with devfs > > thanks again > > > ----- Message d'origine ---- > De : Obelix > ? : busybox at busybox.net > Envoy? le : Mercredi, 5 D?cembre 2007, 13h56mn 16s > Objet : BB 1.0 & in.telnetd > > Hi everybody ! > > I'm using BB 1.0 on JFFS2 file system. Telnet daemon works fine,I have > : > - in /etc/rc.sysinit : "console:3:once:/sbin/inetd -R 1000" > - in /etc/inetd.conf : "telnet stream tcp nowait root > /sbin/in.telnetd in.telnetd" > > Now I changed my file system to cramfs, so in readonly and telnet > doesn't work anymore :( > > I start telnetd with "/sbin/in.telnetd -debug" and I try a > connection... > ------------------------------------------------ > ~$ telnet 10.2.0.1 > Trying 10.2.0.1... > Connected to 10.2.0.1. > Escape character is '^]'. > Connection closed by foreign host. > ------------------------------------------------ > > I can't connect and I have a segmentation fault in console > > ------------------------------------------------ > / # /sbin/in.telnetd -debug > Segmentation fault > ------------------------------------------------ > > This test work fine on a JFFS2 file system and not with cramfs ! > > Do you know why ? > > thanks for your help > > Best reagards > > Obelix > > > > > > _____________________________________________________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! > Mail > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > > > > _____________________________________________________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail From obelix0 at yahoo.fr Wed Dec 5 06:46:09 2007 From: obelix0 at yahoo.fr (Obelix) Date: Wed, 5 Dec 2007 06:46:09 -0800 (PST) Subject: BB 1.0 & in.telnetd Message-ID: <19919.60983.qm@web53103.mail.re2.yahoo.com> Why not... I search in the bugs database to be sure but I didn't find :( have you got a bug report about it ? It's a problem for me because I can't change of version ! Thanks for your help > Thanks for your reply... > > I know that I can use last version of BB but I would like to understant why > it works in JFFS2 and not in CRAMFS ! It could be a bug in ancient BB telnetd that tries to open something r/w, cannot on cramfs and crashes. Lo?c ______________________________________________________________________________ Yahoo! Mail : un mail innovant avec Messenger compatible Windows Live + stockage illimit?. http://mail.yahoo.fr From alexander.griesser at lkh-vil.or.at Wed Dec 5 07:13:52 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Wed, 05 Dec 2007 16:13:52 +0100 Subject: ash: command line editing question Message-ID: <4756C030.305@lkh-vil.or.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi folks! I don't really know what's the correct english word for it, so let me please rephrase it :) When I do the following on bash, I can either quit with CTRL-C or complete the command by adding the last parantheses: - ---------------------- 8< --------------------- vi-edv003:~# VAR=2 vi-edv003:~# echo $(( $VAR + $VAR ) > ) - -su: 2: command not found vi-edv003:~# - ---------------------- 8< ---------------------- The calculation doesn't work (don't know why, but that isn't the problem now) but after entering the missing parantheses on the second line, the command gets executed and drops me back to the shell. Using busybox' ash, I experience the following problem: - ---------------------- 8< --------------------- [lxtcv18beta - ~ #] VAR=2 [lxtcv18beta - ~ #] echo $(( $VAR + $VAR ) > ) > ) > ) > ) [...] - ---------------------- 8< --------------------- As you might guess, I'm unable to stop this now. Neither Ctrl-C, nor Ctrl-Z or anything else works besides killing the shell. Can anyone reproduce this? P.S.: Why does the calculation above not work (even in bash)? As far as I understood it, it should be the same as: # VAR=2 # echo $(( $VAR + $VAR )) No matter if there's a line break betweeen or not, right? ciao, - -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHVsAw66HVD6KUm1oRAouaAJ9SmMTeSerHEmGWVoT6oI8bdJiWSACgjHZ7 mr/SRuhLnuA2OS73WL2CjSk= =c77h -----END PGP SIGNATURE----- From cristian.ionescu-idbohrn at axis.com Wed Dec 5 07:24:02 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Wed, 5 Dec 2007 16:24:02 +0100 (CET) Subject: [solved?] Re: vi segfaults (bb 1.8.2) In-Reply-To: <0711301710140.7950@somehost> References: <0711261617220.7950@somehost> <200711270118.43417.vda.linux@googlemail.com> <0711271027520.7950@somehost> <0711271225190.7950@somehost> <0711301710140.7950@somehost> Message-ID: <0712041533260.6148@somehost> I think I found the problem. It seems to be caused by the poor correlation control between BUFSIZ, COMMON_BUFSIZE and MAX_LINELEN and somewhat poor choice of macro names. In this case: ,---- [ include/libbb.h ] | 1101: #ifndef BUFSIZ | 1102: #define BUFSIZ 4096 | 1103: #endif `---- BUFSIZ is present in bb 1.8.2 but seems to have gone away on svn-head. What happens is that uclibc (in my case 0.9.27) also has a BUFSIZ macro. And it's value is set to 256 (in my code tree). Building bb with uclibc (configured that way) could have unpleasent side effects, like segfaults. In my 'vi' segfault case, the following macros are involved: BUFSIZ=256, COMMON_BUFSIZE=1024, CONFIG_FEATURE_VI_MAX_LEN=2048, MAX_LINELEN=2048 COMMON_BUFSIZE is set to 1024 by: ,---- [ include/libbb.h ] | 1105: enum { COMMON_BUFSIZE = (BUFSIZ >= 256*sizeof(void*) ? BUFSIZ+1 : 256*sizeof(void*)) }; `---- At run time, these buffers (pointer values below) are involved: readbuffer=0x000dfad8 ptr_to_globals=0x000e0008 and n=1. On this line: ,---- [ editors/vi.c ] | 2257 memmove(readbuffer, readbuffer + n, MAX_LINELEN - n); `---- in function 'readit', when 'readbuffer' is shifted 1 byte down, 2047 bytes get shifted instead of 1023, and (part of) 'globals' gets also shifted, as in my case 'globals' starts some 1460 away from 'readbuffer'. I guess there may be risks, in various places, for potentional breakage, as I can see lots of other macros like: include/libbb.h:#ifndef PATH_MAX include/libbb.h-#define PATH_MAX 256 include/libbb.h-#endif or findutils/xargs.c:#ifndef ARG_MAX findutils/xargs.c-#define ARG_MAX 470 findutils/xargs.c-#endif that could possibly be overriden with values beyond control (from wrapper Makefiles for example, CFLAGS += -D"PATH_MAX=12345"). A possible solution might be better macro naming chioce and more macros correlation control. In order to avoid this brakage without changing the code (still talking about bb 1.8.2), the workaround, in my case, is to both set BUFSIZ to a reasonable value in my wrapper Makefile and also correlate that with a good value for CONFIG_FEATURE_VI_MAX_LEN in bb .config. BUFSIZ=4096 and CONFIG_FEATURE_VI_MAX_LEN=1024 (actually the default) work well, and BUFSIZ will not be overriden. Cheers, -- Cristian From supinlick at yahoo.com Wed Dec 5 07:24:48 2007 From: supinlick at yahoo.com (Sean Parker) Date: Wed, 5 Dec 2007 07:24:48 -0800 (PST) Subject: ash: command line editing question In-Reply-To: <4756C030.305@lkh-vil.or.at> Message-ID: <64920.49268.qm@web51912.mail.re2.yahoo.com> Hello - I think you can say "let var2=$(( $VAR + $VAR )); echo $var2" - spaces between '$((' and '$VAR' req'd Hope this helps/works/is best Sean --- Alexander Griesser wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi folks! > > I don't really know what's the correct english word for > it, so let me > please rephrase it :) > > When I do the following on bash, I can either quit with > CTRL-C or > complete the command by adding the last parantheses: > > - ---------------------- 8< --------------------- > vi-edv003:~# VAR=2 > vi-edv003:~# echo $(( $VAR + $VAR ) > > ) > - -su: 2: command not found > > vi-edv003:~# > - ---------------------- 8< ---------------------- > > The calculation doesn't work (don't know why, but that > isn't the > problem now) but after entering the missing parantheses > on the > second line, the command gets executed and drops me back > to the > shell. > > Using busybox' ash, I experience the following problem: > > - ---------------------- 8< --------------------- > [lxtcv18beta - ~ #] VAR=2 > [lxtcv18beta - ~ #] echo $(( $VAR + $VAR ) > > ) > > ) > > ) > > ) > [...] > - ---------------------- 8< --------------------- > > As you might guess, I'm unable to stop this now. Neither > Ctrl-C, nor > Ctrl-Z or anything else works besides killing the shell. > > Can anyone reproduce this? > > P.S.: Why does the calculation above not work (even in > bash)? > As far as I understood it, it should be the same > as: > > > # VAR=2 > # echo $(( $VAR + $VAR )) > > No matter if there's a line break betweeen or not, > right? > > ciao, > - -- > Alexander Griesser (Netzwerkadministration) > E-Mail: alexander.griesser at lkh-vil.or.at | Web: > http://www.lkh-vil.or.at > KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach > Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - > http://enigmail.mozdev.org > > iD8DBQFHVsAw66HVD6KUm1oRAouaAJ9SmMTeSerHEmGWVoT6oI8bdJiWSACgjHZ7 > mr/SRuhLnuA2OS73WL2CjSk= > =c77h > -----END PGP SIGNATURE----- > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > God Bless Sean Parker ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From cristian.ionescu-idbohrn at axis.com Wed Dec 5 08:59:31 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Wed, 5 Dec 2007 17:59:31 +0100 (CET) Subject: ash: command line editing question In-Reply-To: <64920.49268.qm@web51912.mail.re2.yahoo.com> References: <64920.49268.qm@web51912.mail.re2.yahoo.com> Message-ID: <0712051754190.9460@somehost> On Wed, 5 Dec 2007, Sean Parker wrote: > I think you can say "let var2=$(( $VAR + $VAR )); echo > $var2" - spaces between '$((' and '$VAR' req'd No need for those spaces, at least since bb 1.1.3 (possibly earlier). Cheers, -- Cristian From wharms at bfs.de Wed Dec 5 09:26:05 2007 From: wharms at bfs.de (walter harms) Date: Wed, 05 Dec 2007 18:26:05 +0100 Subject: [solved?] Re: vi segfaults (bb 1.8.2) In-Reply-To: <0712041533260.6148@somehost> References: <0711261617220.7950@somehost> <200711270118.43417.vda.linux@googlemail.com> <0711271027520.7950@somehost> <0711271225190.7950@somehost> <0711301710140.7950@somehost> <0712041533260.6148@somehost> Message-ID: <4756DF2D.40900@bfs.de> hi Cristian, BUFSIZ is used in stdio.h #ifndef BUFSIZ # define BUFSIZ _IO_BUFSIZ #endif so the proper is to use ulibc size and calculate everything depending on that value. This is obviously not done. the easy way is to s/BUFSIZ/BBBUFSIZ/g and thats it. ntl: nice work re, wh Cristian Ionescu-Idbohrn wrote: > I think I found the problem. > > It seems to be caused by the poor correlation control between BUFSIZ, > COMMON_BUFSIZE and MAX_LINELEN and somewhat poor choice of macro > names. In this case: > > ,---- [ include/libbb.h ] > | 1101: #ifndef BUFSIZ > | 1102: #define BUFSIZ 4096 > | 1103: #endif > `---- > > BUFSIZ is present in bb 1.8.2 but seems to have gone away on svn-head. > > What happens is that uclibc (in my case 0.9.27) also has a BUFSIZ > macro. And it's value is set to 256 (in my code tree). Building bb > with uclibc (configured that way) could have unpleasent side effects, > like segfaults. > > In my 'vi' segfault case, the following macros are involved: > > BUFSIZ=256, COMMON_BUFSIZE=1024, > CONFIG_FEATURE_VI_MAX_LEN=2048, MAX_LINELEN=2048 > > COMMON_BUFSIZE is set to 1024 by: > > ,---- [ include/libbb.h ] > | 1105: enum { COMMON_BUFSIZE = (BUFSIZ >= 256*sizeof(void*) ? BUFSIZ+1 : 256*sizeof(void*)) }; > `---- > > At run time, these buffers (pointer values below) are involved: > > readbuffer=0x000dfad8 > ptr_to_globals=0x000e0008 > > and n=1. > > On this line: > > ,---- [ editors/vi.c ] > | 2257 memmove(readbuffer, readbuffer + n, MAX_LINELEN - n); > `---- > > in function 'readit', when 'readbuffer' is shifted 1 byte down, 2047 > bytes get shifted instead of 1023, and (part of) 'globals' gets also > shifted, as in my case 'globals' starts some 1460 away from > 'readbuffer'. > > I guess there may be risks, in various places, for potentional > breakage, as I can see lots of other macros like: > > include/libbb.h:#ifndef PATH_MAX > include/libbb.h-#define PATH_MAX 256 > include/libbb.h-#endif > > or > > findutils/xargs.c:#ifndef ARG_MAX > findutils/xargs.c-#define ARG_MAX 470 > findutils/xargs.c-#endif > > that could possibly be overriden with values beyond control (from > wrapper Makefiles for example, CFLAGS += -D"PATH_MAX=12345"). > > A possible solution might be better macro naming chioce and more > macros correlation control. > > In order to avoid this brakage without changing the code (still > talking about bb 1.8.2), the workaround, in my case, is to both set > BUFSIZ to a reasonable value in my wrapper Makefile and also correlate > that with a good value for CONFIG_FEATURE_VI_MAX_LEN in bb .config. > > BUFSIZ=4096 and CONFIG_FEATURE_VI_MAX_LEN=1024 (actually the default) > work well, and BUFSIZ will not be overriden. > > > Cheers, > From cristian.ionescu-idbohrn at axis.com Wed Dec 5 09:54:54 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Wed, 5 Dec 2007 18:54:54 +0100 (CET) Subject: [solved?] Re: vi segfaults (bb 1.8.2) In-Reply-To: <4756DF2D.40900@bfs.de> References: <0711261617220.7950@somehost> <200711270118.43417.vda.linux@googlemail.com> <0711271027520.7950@somehost> <0711271225190.7950@somehost> <0711301710140.7950@somehost> <0712041533260.6148@somehost> <4756DF2D.40900@bfs.de> Message-ID: <0712051850510.9460@somehost> On Wed, 5 Dec 2007, walter harms wrote: > BUFSIZ is used in stdio.h Yes. > #ifndef BUFSIZ > # define BUFSIZ _IO_BUFSIZ > #endif > > so the proper is to use ulibc size and calculate everything > depending on that value. This is obviously not done. Right. > the easy way is to s/BUFSIZ/BBBUFSIZ/g and thats it. Or similar. Of course. > ntl: nice work Thamks. But I don't deserve all the honor. I got collegue's help ;) Cheers, -- Cristian From alexander.griesser at lkh-vil.or.at Wed Dec 5 15:03:46 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Thu, 06 Dec 2007 00:03:46 +0100 Subject: ash: command line editing question In-Reply-To: <64920.49268.qm@web51912.mail.re2.yahoo.com> References: <64920.49268.qm@web51912.mail.re2.yahoo.com> Message-ID: <47572E52.80700@lkh-vil.or.at> Sean Parker wrote: > I think you can say "let var2=$(( $VAR + $VAR )); echo > $var2" - spaces between '$((' and '$VAR' req'd Yeah, I know, but that's not the question ;) The calculation works when everything gets written in one line. If I hit return faster than the second closing brace, I can't continue to work on this console. It's stuck in the command line editing mode where I can't even use CTRL-C to get out of it as shown in my examples above. Basically, this happens with all unfinished commands, the calculation above was just mentioned because it happened to me while I was working on a formula to calculate battery lifetime indicators. ciao, Alex From vapier at gentoo.org Wed Dec 5 16:42:00 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 5 Dec 2007 19:42:00 -0500 Subject: Busybox Init In-Reply-To: <4756B182.1020705@bfs.de> References: <475638FD.5060500@intoto.com> <47567F88.4030005@intoto.com> <4756B182.1020705@bfs.de> Message-ID: <200712051942.01815.vapier@gentoo.org> On Wednesday 05 December 2007, walter harms wrote: > Rajeev Bansal wrote: > > I have post my question to LFS also. > > please do not send questions that belong clearly into LFS-ML into busybox > ml. indeed. this has nothing to do with busybox. the LFS guys should be able to explain to you the problems in your understanding of how the system works. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20071205/5dd17784/attachment.pgp From alexander.griesser at lkh-vil.or.at Thu Dec 6 00:21:05 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Thu, 06 Dec 2007 09:21:05 +0100 Subject: ash: command line editing question In-Reply-To: <9b06e8d20712051852x5606a320u9e10f1f494566b4d@mail.gmail.com> References: <64920.49268.qm@web51912.mail.re2.yahoo.com> <47572E52.80700@lkh-vil.or.at> <9b06e8d20712051852x5606a320u9e10f1f494566b4d@mail.gmail.com> Message-ID: <4757B0F1.6090900@lkh-vil.or.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lo?c Greni? wrote: >> Basically, this happens with all unfinished commands, the >> calculation above was just mentioned because it happened >> to me while I was working on a formula to calculate battery >> lifetime indicators. >> > > One ) is probably considered part of the fomula (even though the > formula will result sintactically incorrect) while one )) ends the > formula. That sounds reasonable, but I tried `dash` today (busybox ash seems to behave similar than dash in most things) and dash does the following: - ------------------------[ dash ] ----------------------- $ VAR=2 $ echo $(( $VAR + $VAR )) 4 $ echo $(( $VAR + $VAR ) > ) > ) > $ - --------------------------------------------------------- As you can see, the first try works because I did everything right, in the second try I "forgot" to add the last parantheses and the '>' prompt appears. dash behaves similar than ash in that it doesn't let me finish this command by simply adding the missing parantheses in the next line which is perfectly fine (I don't demand that it should work like this), _BUT_ (and that's the big difference) dash lets me exit this editing mode by simply hitting CTRL-C as you can see in the last line of the above output. Again, busybox ash doesn't do this, but I found out another interesting thing. bash, dash and ash seem to act very differently wrt arithmetic parsing: - -------------------------[ bash ]--------------------------- $ VAR=2 $ echo $(( $VAR + $VAR ) > )) bash: syntax error near unexpected token `)' $ echo $(( $VAR + $VAR ) > ) bash: 2: command not found $ - ------------------------------------------------------------- There's no obvious way to let the arith complete successfully. - -------------------------[ dash ] --------------------------- $ VAR=2 $ echo $(( $VAR + $VAR ) > ) > [CTRL-C] $ echo $(( $VAR + $VAR ) > )) 4 $ - -------------------------------------------------------------- One single paren doesn't help, but two parens let the arith complete successfully and will bring me back to the shell prompt. - -------------------------[ busybox ash ]---------------------- $ VAR=2 $ echo $(( $VAR + $VAR) > ) > )) ash: syntax error: 2 + 2 ) $ - -------------------------------------------------------------- No reaction on a single paren in the second line, but a double closing paren seems to do what dash does, but the arith itself throws a syntax error afterwards. So, what's the desired behaviour? ciao, - -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHV7Dx66HVD6KUm1oRAnOkAJ9vEPY91pQ2mFVCvSVlYkPqP3Hw/QCgo+d1 j9xATMo71mZfOvIc17gtHTs= =JiLZ -----END PGP SIGNATURE----- From loic.grenie at gmail.com Thu Dec 6 00:41:13 2007 From: loic.grenie at gmail.com (=?ISO-8859-1?Q?Lo=EFc_Greni=E9?=) Date: Thu, 6 Dec 2007 09:41:13 +0100 Subject: ash: command line editing question In-Reply-To: <4757B0F1.6090900@lkh-vil.or.at> References: <64920.49268.qm@web51912.mail.re2.yahoo.com> <47572E52.80700@lkh-vil.or.at> <9b06e8d20712051852x5606a320u9e10f1f494566b4d@mail.gmail.com> <4757B0F1.6090900@lkh-vil.or.at> Message-ID: <9b06e8d20712060041o325958eau30d8dab49f1c16cf@mail.gmail.com> 2007/12/6, Alexander Griesser : > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Lo?c Greni? wrote: > >> Basically, this happens with all unfinished commands, the > >> calculation above was just mentioned because it happened > >> to me while I was working on a formula to calculate battery > >> lifetime indicators. > >> > > > > One ) is probably considered part of the fomula (even though the > > formula will result sintactically incorrect) while one )) ends the > > formula. > > That sounds reasonable, but I tried `dash` today (busybox ash seems to > behave similar than dash in most things) and dash does the following: > > - ------------------------[ dash ] ----------------------- > $ VAR=2 > $ echo $(( $VAR + $VAR )) > 4 > $ echo $(( $VAR + $VAR ) > > ) > > ) > > > $ > - --------------------------------------------------------- > > As you can see, the first try works because I did everything right, in > the second try I "forgot" to add the last parantheses and the '>' prompt > appears. > > dash behaves similar than ash in that it doesn't let me finish this > command by simply adding the missing parantheses in the next line which > is perfectly fine (I don't demand that it should work like this), _BUT_ > (and that's the big difference) dash lets me exit this editing mode by > simply hitting CTRL-C as you can see in the last line of the above > output. > Again, busybox ash doesn't do this Indeed, but Ctrl-D let you out. Lo?c Greni? From alexander.griesser at lkh-vil.or.at Thu Dec 6 00:38:19 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Thu, 06 Dec 2007 09:38:19 +0100 Subject: ash: command line editing question In-Reply-To: <9b06e8d20712060041o325958eau30d8dab49f1c16cf@mail.gmail.com> References: <64920.49268.qm@web51912.mail.re2.yahoo.com> <47572E52.80700@lkh-vil.or.at> <9b06e8d20712051852x5606a320u9e10f1f494566b4d@mail.gmail.com> <4757B0F1.6090900@lkh-vil.or.at> <9b06e8d20712060041o325958eau30d8dab49f1c16cf@mail.gmail.com> Message-ID: <4757B4FB.8050702@lkh-vil.or.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lo?c Greni? wrote: >> dash behaves similar than ash in that it doesn't let me finish this >> command by simply adding the missing parantheses in the next line which >> is perfectly fine (I don't demand that it should work like this), _BUT_ >> (and that's the big difference) dash lets me exit this editing mode by >> simply hitting CTRL-C as you can see in the last line of the above >> output. > >> Again, busybox ash doesn't do this > > Indeed, but Ctrl-D let you out. Ah, you're right. I didn't try that, thanks. But I still think that this behaviour can be improved a bit, hm? ciao, - -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHV7T766HVD6KUm1oRApLuAJ0R1T2KhEbRRNDsuaDQ2BWEyCUOAACcCCQC jOpHSolY1ww17RpWTFmEsh8= =ytXo -----END PGP SIGNATURE----- From alexander.griesser at lkh-vil.or.at Thu Dec 6 01:07:13 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Thu, 06 Dec 2007 10:07:13 +0100 Subject: Patch to add the "-iname" option to find Message-ID: <4757BBC1.4010409@lkh-vil.or.at> Hi! I always wondered why the "-iname" option isn't supported by busybox's find and as I'm using it heavily I've written a small patch to get it in. I'm sure that this patch isn't optimal as it simply duplicates the action function for the "-name" parameter, but I don't know of any other way to do that. The significant change is to add the flag FNM_CASEFOLD to the fnmatch function call. Any objections? ciao, -- Alexander Griesser (Netzwerkadministration) E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 -------------- next part -------------- A non-text attachment was scrubbed... Name: find_-iname.diff Type: text/x-patch Size: 2560 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20071206/84245ba1/attachment.bin From rep.dot.nop at gmail.com Thu Dec 6 03:04:59 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 6 Dec 2007 12:04:59 +0100 Subject: Patch to add the "-iname" option to find In-Reply-To: <4757BBC1.4010409@lkh-vil.or.at> References: <4757BBC1.4010409@lkh-vil.or.at> Message-ID: <20071206110459.GA5600@aon.at> On Thu, Dec 06, 2007 at 10:07:13AM +0100, Alexander Griesser wrote: >Hi! > >I always wondered why the "-iname" option isn't supported by busybox's >find and as I'm using it heavily I've written a small patch to get it in. > >I'm sure that this patch isn't optimal as it simply duplicates the >action function for the "-name" parameter, but I don't know of any >other way to do that. The significant change is to add the flag >FNM_CASEFOLD to the fnmatch function call. > >Any objections? > >ciao, >-- >Alexander Griesser (Netzwerkadministration) >E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at >KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach >Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061 >diff -Nur old/findutils/find.c new/findutils/find.c >--- old/findutils/find.c 2007-12-06 10:04:10.000000000 +0100 >+++ new/findutils/find.c 2007-12-06 10:04:25.000000000 +0100 >@@ -77,6 +77,7 @@ > #define ACTF(name) static int func_##name(const char *fileName, struct stat *statbuf, action_##name* ap) > ACTS(print) > ACTS(name, const char *pattern;) >+ ACTS(iname, const char *pattern;) > USE_FEATURE_FIND_PATH( ACTS(path, const char *pattern;)) > USE_FEATURE_FIND_REGEX( ACTS(regex, regex_t compiled_pattern;)) > USE_FEATURE_FIND_PRINT0( ACTS(print0)) >@@ -190,6 +191,20 @@ > } > return fnmatch(ap->pattern, tmp, FNM_PERIOD) == 0; > } >+ >+ACTF(iname) >+{ >+ const char *tmp = bb_basename(fileName); >+ if (tmp != fileName && !*tmp) { >+ tmp--; >+ while (tmp != fileName && *--tmp != '/') >+ continue; >+ if (*tmp == '/') >+ tmp++; >+ } >+ return fnmatch(ap->pattern, tmp, FNM_PERIOD | FNM_CASEFOLD) == 0; >+} >+ > #if ENABLE_FEATURE_FIND_PATH > ACTF(path) > { >@@ -458,6 +473,7 @@ > USE_FEATURE_FIND_PAREN( PARM_char_brace,) > /* All options starting from here require argument */ > PARM_name , >+ PARM_iname , > USE_FEATURE_FIND_PATH( PARM_path ,) > USE_FEATURE_FIND_REGEX( PARM_regex ,) > USE_FEATURE_FIND_TYPE( PARM_type ,) >@@ -490,6 +506,7 @@ > USE_FEATURE_FIND_PAREN( "(\0" ) > /* All options starting from here require argument */ > "-name\0" >+ "-iname\0" > USE_FEATURE_FIND_PATH( "-path\0" ) > USE_FEATURE_FIND_REGEX( "-regex\0" ) > USE_FEATURE_FIND_TYPE( "-type\0" ) >@@ -659,6 +676,11 @@ > ap = ALLOC_ACTION(name); > ap->pattern = arg1; > } >+ else if (parm == PARM_iname) { >+ action_iname *ap; >+ ap = ALLOC_ACTION(iname); >+ ap->pattern = arg1; >+ } > #if ENABLE_FEATURE_FIND_PATH > else if (parm == PARM_path) { > action_path *ap; >diff -Nur old/include/usage.h new/include/usage.h >--- old/include/usage.h 2007-12-06 10:04:02.000000000 +0100 >+++ new/include/usage.h 2007-12-06 10:04:20.000000000 +0100 >@@ -998,6 +998,7 @@ > "\n -maxdepth N Descend at most N levels. -maxdepth 0 applies" \ > "\n tests/actions to command line arguments only") \ > "\n -name PATTERN File name (w/o directory name) matches PATTERN" \ ->+ "\n -iname PATTERN File name (w/o directory name) matches PATTERN (case insensitive)" \ +>+ "\n -iname PATTERN Like -name but case insensitive" \ Is shorter and as easy to understand. What's the bloatcheck for this change? Not sure if reusing ACTF(name) and trying to deduce FNM_CASEFOLD somehow would be smaller or cleaner.. From alexander.griesser at lkh-vil.or.at Thu Dec 6 03:40:59 2007 From: alexander.griesser at lkh-vil.or.at (Alexander Griesser) Date: Thu, 06 Dec 2007 12:40:59 +0100 Subject: Patch to add the "-iname" option to find In-Reply-To: <20071206110459.GA5600@aon.at> References: <4757BBC1.4010409@lkh-vil.or.at> <20071206110459.GA5600@aon.at> Message-ID: <4757DFCB.1080905@lkh-vil.or.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bernhard Fischer wrote: > ->+ "\n -iname PATTERN File name (w/o directory name) matches PATTERN (case insensitive)" \ > +>+ "\n -iname PATTERN Like -name but case insensitive" \ > Is shorter and as easy to understand. ACK, good idea. > What's the bloatcheck for this change? Dunno. How to do that?? I found "scripts/bloat-o-meter" and used that for checking (if that's suitable) and it reports (with your patch applied): function old new delta .rodata 51208 51248 +40 - -------------------------------------------------