Re: [patch] no output when executing md5sum in back quotes
* Denis Vlasenko <[EMAIL PROTECTED]> [2007-05-17 00:26:52 +0200]: > On Wednesday 16 May 2007 12:25, Daniel Farrugia wrote: > > Hello List, > > > > The md5sum applet included with busybox 1.5.0 seems to have a problem > > when executed inside back quotes. Running the applet directly from the > > shell works fine however when back quotes are used there is no output: > > > > % busybox md5sum busybox[works] > > % echo `busybox md5sum busybox` [no ouput] > > > > It seems that the applet doesn't flush stdout before exiting. The > > trivial patch included below fixed this problem for me. > > Are you using CONFIG_STATIC=y and glibc? Hello Denis, I was in fact statically linking against glibc using the tool chain that comes with Debian Sarge. I re-compiled with the uClibc tool chain and the problem went away. Sorry for the noise. Daniel ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
util-linux/mount.c : lstat / stat ?
Hi, I had to replace lstat with stat in util-linux/mount.c (Busybox 1.4.2) to make mount works with symbolics links. (The patch svn-15788.patch was used to fix it in busybox 1.2.1) Regards. Yann. ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: module autoloading doesn't work: modprobe PATH problem (yes, another one)
Ignacio, On Thursday 17 May 2007 08:44, Ignacio García Pérez wrote: > I'm debugging some problems that have arised when I upgraded the busybox > and kernel versions of my system. Yesterday I struggled with a PATH > problem in udev, and today I stumbled upon another PATH problem, this > time with modprobe, which completely clobbers the module autoloading > feature of the kernel. It rings a bell here. There has been discussion about this issue earlier. Search the archives, I can't remember right now. > When the kernel wants to load a module, it executes > /proc/sys/kernel/modprobe, which by default points to /sbin/modprobe. > The "real" modprobe does everything by itself (resolve dependencies and > load modules), but busybox's modprobe makes external calls to insmod, > relying on the PATH to find the insmod executable. > > The problem is obvious: the kernel does not set up a PATH variable when > calling /sbin/modprobe, and thus modprobe fails miserably. Yes, it does. From linux-2.6.21.1/kernel/[EMAIL PROTECTED]: int request_module(const char *fmt, ...) { va_list args; char module_name[MODULE_NAME_LEN]; unsigned int max_modprobes; int ret; char *argv[] = { modprobe_path, "-q", "--", module_name, NULL }; static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; [--SNIP--] So, the kernel *does* set PATH before calling modprobe. Add this litle snippet of code to modprobe just to check: printf( "%s\n", getenv( "PATH" ) ); > I've done a quick fix by setting the absolute path of insmod and rmmod > inside modprobe.c, but I'm not sure if this is the best solution. > On one hand, setting the absolute path breaks the freedom of the use to > choose where to put his binaries. > On the other hand, we are trying to replicate the functionality of the > "real" modprobe, and it does its work without using external binaries, > thus with the "real" modprobe the user has no freedom to choose which > insmod executable to use anyway. Nah. In fact, modprobe in BusyBox can still work with linux-2.4, which has a substantially more complex way of loading a module. So our modprobe can't replicate the way insmod works for linux-2.4, and thus we must call it. Even in the linux-2.6 case. > Any suggestions? Search the archives first. I can't remember when that was (quite some time ago, if my memory is not that faulty...) but I'm pretty sure we already discussed this issue... Regards, Yann E. MORIN. -- .-..--.. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^| | --==< °_° >==-- °.---: X AGAINST | /e\ There is no | | http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL| """ conspiracy. | °--°---°--°° ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Unable to use nsswitch.conf with Busybox
Hello, I am having some trouble getting Busybox to authenticate against LDAP. I do not see Busybox calling glibc's getpwnam() when I do an ltrace, and consequently I don't see /etc/nsswitch.conf being opened. I only see an open and read of /etc/passwd. This is Busybox 1.4.0 with glibc 2.5, the relevant config options are: CONFIG_FEATURE_SHADOWPASSWDS=y # CONFIG_USE_BB_SHADOW is not set # CONFIG_USE_BB_PWD_GRP is not set I passed the LDFLAG of -lnsl to Busybox, don't know if that is required but I have confirmed that the binary is linked to libnsl. Here is an strace of a login attempt. read(0, "testuser\n", 4096) = 9 open("/etc/passwd", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=221, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dae000 read(4, "root:x:0:0:root:/root:/bin/sh\nss"..., 1024) = 221 read(4, "", 1024) = 0 close(4)= 0 munmap(0xb7dae000, 4096)= 0 time(NULL) = 1179339627 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 nanosleep({3, 0}, {3, 0}) = 0 time(NULL) = 1179339630 write(1, "Login incorrect\n", 16) = 16 How can I make Busybox use nsswitch.conf and look up entries in ldap? I have openssh compiled and working with it so I do not believe this is a configuration issue with the system. Thanks! Jari ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
SSH in busybox
Hi I've been using busybox version 1.1.2. ssh command is not available in busybox. how can i install ssh client in busybox? Thanks in advance pk ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: SSH in busybox
Dropbear is what you want (dbclient) http://matt.ucc.asn.au/dropbear/dropbear.html On 5/17/07, pavankumar kondeti <[EMAIL PROTECTED]> wrote: > Hi > > I've been using busybox version 1.1.2. ssh command is not available in > busybox. how can i install ssh client in busybox? > > Thanks in advance > pk > > ___ > busybox mailing list > busybox@busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > -- Matthew Franz http://www.threatmind.net/ ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: SSH in busybox
On Thursday 17 May 2007 17:17:45 pavankumar kondeti wrote: > Hi > > I've been using busybox version 1.1.2. ssh command is not available in > busybox. how can i install ssh client in busybox? it sounds people usually point to dropbear. http://matt.ucc.asn.au/dropbear/dropbear.html There might be other choices. JC > > Thanks in advance > pk ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
ash: Can't access tty problems (initramfs)
I'm getting the infamous "Can't access tty; job control turned off" message when I try to invoke the ash shell during my initial bootup. I'm using busybox 1.5.0. I also understand that ash requires a controlling tty rather than the console. Though, I don't understand all the reasons. If I don't define a console however, I get a kernel panic from initramfs. Could someone please give me some pointers on how tty and console should be configured? I'm connected via my VGA port (not a serial port). Here is the contents of my initramfs makefile: dir /dev 755 0 0 nod /dev/tty0 666 0 5 c 5 0 nod /dev/tty1 666 0 5 c 4 1 nod /dev/tty2 666 0 5 c 4 2 nod /dev/tty3 666 0 5 c 4 3 nod /dev/tty4 666 0 5 c 4 4 nod /dev/tty5 666 0 5 c 4 5 nod /dev/tty6 666 0 5 c 4 6 nod /dev/tty7 666 0 5 c 4 7 nod /dev/tty8 666 0 5 c 4 8 nod /dev/ttyS0 666 0 5 c 5 0 nod /dev/console 644 0 0 c 5 1 nod /dev/null 666 0 0 c 1 3 nod /dev/hda 660 0 6 b 3 0 nod /dev/hda1 660 0 0 b 3 1 nod /dev/hdb 660 0 6 b 3 0 nod /dev/hdb1 660 0 0 b 3 1 nod /dev/hdf 660 0 6 b 3 0 nod /dev/hdf1 660 0 0 b 3 1 dir /bin 755 1000 1000 file /bin/busybox /home/dallas/initramfs/busybox 755 0 0 slink /bin/ash busybox 777 0 0 slink /bin/mkdir busybox 777 0 0 slink /bin/mount busybox 777 0 0 slink /bin/cat busybox 777 0 0 slink /bin/switch_root busybox 777 0 0 dir /root 700 0 0 dir /proc 755 0 0 dir /sys 755 0 0 dir /var 755 0 0 dir /var/lock 755 0 0 dir /tmp 755 0 0 dir /mnt 755 0 0 dir /mnt/realroot 755 0 0 dir /etc 755 0 0 file /etc/fstab /home/dallas/initramfs/fstab 755 0 0 file /init /home/dallas/initramfs/init.ash 755 0 0 ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
RE: Can't access tty problems (initramfs)
Yes, it was a cut-n-paste mistake. The tty0 should have ended in 4 0. I corrected it, but sadly still getting the "Can't access tty" error message. Thanks for the help. -Original Message- From: Christopher Reder [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 11:39 AM To: [EMAIL PROTECTED] Subject: RE: Can't access tty problems (initramfs) I apologize if I just don't understand it, but are your tty0 and ttyS0 the same? Should that first one tty0 end in 4 0 ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dallas Clement Sent: Thursday, May 17, 2007 11:28 AM To: busybox@busybox.net Subject: ash: Can't access tty problems (initramfs) I'm getting the infamous "Can't access tty; job control turned off" message when I try to invoke the ash shell during my initial bootup. I'm using busybox 1.5.0. I also understand that ash requires a controlling tty rather than the console. Though, I don't understand all the reasons. If I don't define a console however, I get a kernel panic from initramfs. Could someone please give me some pointers on how tty and console should be configured? I'm connected via my VGA port (not a serial port). Here is the contents of my initramfs makefile: dir /dev 755 0 0 nod /dev/tty0 666 0 5 c 5 0 nod /dev/tty1 666 0 5 c 4 1 nod /dev/tty2 666 0 5 c 4 2 nod /dev/tty3 666 0 5 c 4 3 nod /dev/tty4 666 0 5 c 4 4 nod /dev/tty5 666 0 5 c 4 5 nod /dev/tty6 666 0 5 c 4 6 nod /dev/tty7 666 0 5 c 4 7 nod /dev/tty8 666 0 5 c 4 8 nod /dev/ttyS0 666 0 5 c 5 0 nod /dev/console 644 0 0 c 5 1 nod /dev/null 666 0 0 c 1 3 nod /dev/hda 660 0 6 b 3 0 nod /dev/hda1 660 0 0 b 3 1 nod /dev/hdb 660 0 6 b 3 0 nod /dev/hdb1 660 0 0 b 3 1 nod /dev/hdf 660 0 6 b 3 0 nod /dev/hdf1 660 0 0 b 3 1 dir /bin 755 1000 1000 file /bin/busybox /home/dallas/initramfs/busybox 755 0 0 slink /bin/ash busybox 777 0 0 slink /bin/mkdir busybox 777 0 0 slink /bin/mount busybox 777 0 0 slink /bin/cat busybox 777 0 0 slink /bin/switch_root busybox 777 0 0 dir /root 700 0 0 dir /proc 755 0 0 dir /sys 755 0 0 dir /var 755 0 0 dir /var/lock 755 0 0 dir /tmp 755 0 0 dir /mnt 755 0 0 dir /mnt/realroot 755 0 0 dir /etc 755 0 0 file /etc/fstab /home/dallas/initramfs/fstab 755 0 0 file /init /home/dallas/initramfs/init.ash 755 0 0 ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: Unable to use nsswitch.conf with Busybox
On Thu, 17 May 2007 10:01:15 -0400 "Jari Takkala" <[EMAIL PROTECTED]> wrote: > > How can I make Busybox use nsswitch.conf and look up entries in ldap? > I have openssh compiled and working with it so I do not believe this > is a configuration issue with the system. Which libc are you using? IIRC what you want is done by glibc but not uClibc. Regards, Daniel ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: [patch] no output when executing md5sum in back quotes
On Thursday 17 May 2007 10:30, Daniel Farrugia wrote: > * Denis Vlasenko <[EMAIL PROTECTED]> [2007-05-17 00:26:52 +0200]: > > On Wednesday 16 May 2007 12:25, Daniel Farrugia wrote: > > > The md5sum applet included with busybox 1.5.0 seems to have a problem > > > when executed inside back quotes. Running the applet directly from the > > > shell works fine however when back quotes are used there is no output: > > > > > > % busybox md5sum busybox[works] > > > % echo `busybox md5sum busybox` [no ouput] > > > > > > It seems that the applet doesn't flush stdout before exiting. The > > > trivial patch included below fixed this problem for me. > > > > Are you using CONFIG_STATIC=y and glibc? > > Hello Denis, > > I was in fact statically linking against glibc using the tool chain that > comes with Debian Sarge. I re-compiled with the uClibc tool chain and > the problem went away. Sorry for the noise. busybox has to emit big fat warning in this case. Did you see it (maybe we have a bug and message doesn't appear anymore?) -- vda ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
On Thu, May 17, 2007 at 11:28:06AM -0500, Dallas Clement wrote: > I'm getting the infamous "Can't access tty; job control turned off" > message when I try to invoke the ash shell during my initial bootup. > > I'm using busybox 1.5.0. I also understand that ash requires a > controlling tty rather than the console. Though, I don't understand all > the reasons. I saw this too when I upgraded from 1.4.2 from 1.5.0, so I switched back. The same /dev entries work perfectly in 1.4.2. I did not have time/need to debug it. Hamish -- Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
RE: ash: Can't access tty problems (initramfs)
Thanks for the tip! At least I can make progress with it. I'd still like to know why I'm having trouble with 1.5.0. I saw some explanation in the FAQ, but I'm afraid it needs to be translated into noobese with some specific examples of how to setup the tty / console. Regards, Dallas -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hamish Moffatt Sent: Thursday, May 17, 2007 5:29 PM To: busybox@busybox.net Subject: Re: ash: Can't access tty problems (initramfs) On Thu, May 17, 2007 at 11:28:06AM -0500, Dallas Clement wrote: > I'm getting the infamous "Can't access tty; job control turned off" > message when I try to invoke the ash shell during my initial bootup. > > I'm using busybox 1.5.0. I also understand that ash requires a > controlling tty rather than the console. Though, I don't understand all > the reasons. I saw this too when I upgraded from 1.4.2 from 1.5.0, so I switched back. The same /dev entries work perfectly in 1.4.2. I did not have time/need to debug it. Hamish -- Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: e2fsprogs in busybox-1.5.0
On Thursday 17 May 2007 01:23, Nagendra Tomar wrote: > Hi, > I downloaded the busybox-1.5.0 build and noticed that > some of the e2fsprogs, most importantly mke2fs, have > been moved to the old_e2fsprogs directory. I would > like to know the reason behind this. e2fsprogs were added to busybox without sufficient de-bloating, and were staying that way for many months. > Is there a plan to support mke2fs ? > If yes why has it been moved to > old_e2fsprogs, and not being built in the standard build ? > If not why is it not being supported ? Anyone is free to volunteer to do that. So far nobody wanted to do it. What needs to be done: 1) debloat e2fsprogs: use libbb more, remove silly code like uuid generation by reading MAC addresses from all network interfaces. 2) make sure that it is compatible with mainline e2fsprogs, so that our e2fsck do not "repair" (== destroy) ext2/3 filesystems with newer features it doesn't know about. The last thing we want is bug reports "Aieee busybox'e e2fsck ate my disk!!!" If you want to do it but cannot surmount all of e2fsprogs, work in smaller steps - like, resurrect mke2fs only... -- vda ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
On Friday 18 May 2007 00:29, Hamish Moffatt wrote: > On Thu, May 17, 2007 at 11:28:06AM -0500, Dallas Clement wrote: > > I'm getting the infamous "Can't access tty; job control turned off" > > message when I try to invoke the ash shell during my initial bootup. > > > > I'm using busybox 1.5.0. I also understand that ash requires a > > controlling tty rather than the console. Though, I don't understand all > > the reasons. > > I saw this too when I upgraded from 1.4.2 from 1.5.0, so I switched > back. The same /dev entries work perfectly in 1.4.2. I did not have > time/need to debug it. I think there is nothing to "debug", as this is not a bug. /dev/console CANNOT be a controlling tty, and code which was trying to "fix" this was removed from init.c The diff is a bit big: http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/init/init.c?rev=17937&r1=17917&r2=17937 but the core of change is here: static void console_init(void) { - int fd; - int tried = 0; - struct vt_stat vt; struct serial_struct sr; char *s; - if ((s = getenv("CONSOLE")) != NULL || (s = getenv("console")) != NULL) { - safe_strncpy(console_name, s, sizeof(console_name)); - } else { - /* 2.2 kernels: identify the real console backend and try to use it */ - if (ioctl(0, TIOCGSERIAL, &sr) == 0) { - /* this is a serial console */ - snprintf(console_name, sizeof(console_name) - 1, SC_FORMAT, sr.line); - } else if (ioctl(0, VT_GETSTATE, &vt) == 0) { - /* this is linux virtual tty */ - snprintf(console_name, sizeof(console_name) - 1, VC_FORMAT, vt.v_active); - } else { - strcpy(console_name, DEV_CONSOLE); - tried++; - } + s = getenv("CONSOLE"); + if (!s) s = getenv("console"); + if (s) { + int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); + if (fd >= 0) { + dup2(fd, 0); + dup2(fd, 1); + dup2(fd, 2); + while (fd > 2) close(fd--); + } + messageD(L_LOG, "console='%s'", s); } - while ((fd = open(console_name, O_RDONLY | O_NONBLOCK)) < 0 && tried < 2) { - /* Can't open selected console -- try - logical system console and VT_MASTER */ - strcpy(console_name, (tried == 0 ? DEV_CONSOLE : CURRENT_VC)); - tried++; - } - if (fd < 0) { - /* Perhaps we should panic here? */ See those now-removed ioctls and then 'while ((fd = open(console_name...' ? This is the code which tried to close '/dev/console' and open '/dev/ttyN' or '/dev/ttyS0' instead. This is just WRONG. init should not do it. It should just use file descriptors 0, 1, and 2 which were given to it by kernel. -- vda ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
On Thursday 17 May 2007 18:28, Dallas Clement wrote: > I'm getting the infamous "Can't access tty; job control turned off" > message when I try to invoke the ash shell during my initial bootup. > > I'm using busybox 1.5.0. I also understand that ash requires a > controlling tty rather than the console. Though, I don't understand all > the reasons. > > If I don't define a console however, I get a kernel panic from > initramfs. Boot with init=/bin/ash, and you will get "Can't access tty" message. That's because fd# 0,1,2 are opened to /dev/console. Now execute this in ash: # exec /bin/ash /dev/tty1 2>&1 This one will work ok, because fds are opened to /dev/tty0, which can be a controlling tty. Basically that's it. If you want ctty, open some device different from /dev/console -- vda ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: Unable to use nsswitch.conf with Busybox
Hi Jari, On Thursday 17 May 2007 16:01, Jari Takkala wrote: > I am having some trouble getting Busybox to authenticate against LDAP. > I do not see Busybox calling glibc's getpwnam() when I do an ltrace, > and consequently I don't see /etc/nsswitch.conf being opened. > I only see an open and read of /etc/passwd. > > This is Busybox 1.4.0 with glibc 2.5, the relevant config options are: > > CONFIG_FEATURE_SHADOWPASSWDS=y > # CONFIG_USE_BB_SHADOW is not set > # CONFIG_USE_BB_PWD_GRP is not set Huh, indeed... does attached patch help? > I passed the LDFLAG of -lnsl to Busybox, don't know if that is required I don't think it's necessary. -- vda diff -d -urpN busybox.7/libpwdgrp/Kbuild busybox.8/libpwdgrp/Kbuild --- busybox.7/libpwdgrp/Kbuild 2007-05-09 23:43:29.0 +0200 +++ busybox.8/libpwdgrp/Kbuild 2007-05-18 01:43:11.0 +0200 @@ -4,4 +4,6 @@ # # Licensed under the GPL v2, see the file LICENSE in this tarball. -lib-y:=pwd_grp.o uidgid_get.o +lib-y := uidgid_get.o + +lib-$(CONFIG_USE_BB_PWD_GRP) += pwd_grp.o ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
On Friday 18 May 2007 01:28, Denis Vlasenko wrote: > Boot with init=/bin/ash, and you will get "Can't access tty" message. > That's because fd# 0,1,2 are opened to /dev/console. > Now execute this in ash: > > # exec /bin/ash /dev/tty1 2>&1 > > This one will work ok, because fds are opened to /dev/tty0, > which can be a controlling tty. :( please s/tty0/tty1/ above... -- vda ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
On Fri, May 18, 2007 at 01:28:00AM +0200, Denis Vlasenko wrote: > On Thursday 17 May 2007 18:28, Dallas Clement wrote: > > I'm getting the infamous "Can't access tty; job control turned off" > > message when I try to invoke the ash shell during my initial bootup. > > > > I'm using busybox 1.5.0. I also understand that ash requires a > > controlling tty rather than the console. Though, I don't understand all > > the reasons. > > > > If I don't define a console however, I get a kernel panic from > > initramfs. > > Boot with init=/bin/ash, and you will get "Can't access tty" message. > That's because fd# 0,1,2 are opened to /dev/console. > Now execute this in ash: > > # exec /bin/ash /dev/tty1 2>&1 > > This one will work ok, because fds are opened to /dev/tty0, > which can be a controlling tty. > > Basically that's it. If you want ctty, open some device different from > /dev/console I got the controlling tty errors as a result of the following in inittab: ::askfirst:-/bin/sh Do you mean that this is wrong? (According to the documentation, it is an implicit rule if inittab is missing.) Hamish -- Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: util-linux/mount.c : lstat / stat ?
On Thursday 17 May 2007 12:05, Yann Le Doaré wrote: > Hi, > > I had to replace lstat with stat in util-linux/mount.c (Busybox 1.4.2) > to make mount works with symbolics links. Can you elaborate a bit more. I see only one lstat(), here: // Look at the file. (Not found isn't a failure for remount, or for // a synthetic filesystem like proc or sysfs.) if (!lstat(mp->mnt_fsname, &st) && !(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE)) ) { // Do we need to allocate a loopback device for it? if (ENABLE_FEATURE_MOUNT_LOOP && S_ISREG(st.st_mode)) { loopFile = bb_simplify_path(mp->mnt_fsname); mp->mnt_fsname = 0; switch (set_loop(&(mp->mnt_fsname), loopFile, 0)) { case 0: case 1: break; default: bb_error_msg( errno == EPERM || errno == EACCES ? bb_msg_perm_denied_are_you_root : "cannot setup loop device"); return errno; } // Autodetect bind mounts } else if (S_ISDIR(st.st_mode) && !mp->mnt_type) vfsflags |= MS_BIND; } > (The patch svn-15788.patch was used to fix it in busybox 1.2.1) adding/removing/adding of fixes happens when some not obvious code lacks good comment. In this piece of code, for example, I wouldn't see immediately whether we need stat or lstat. -- vda ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
Hamish Moffatt wrote: > On Fri, May 18, 2007 at 01:28:00AM +0200, Denis Vlasenko wrote: >> On Thursday 17 May 2007 18:28, Dallas Clement wrote: >>> I'm getting the infamous "Can't access tty; job control turned off" >>> message when I try to invoke the ash shell during my initial bootup. >>> >>> I'm using busybox 1.5.0. I also understand that ash requires a >>> controlling tty rather than the console. Though, I don't understand all >>> the reasons. >>> >>> If I don't define a console however, I get a kernel panic from >>> initramfs. >> Boot with init=/bin/ash, and you will get "Can't access tty" message. >> That's because fd# 0,1,2 are opened to /dev/console. >> Now execute this in ash: >> >> # exec /bin/ash /dev/tty1 2>&1 >> >> This one will work ok, because fds are opened to /dev/tty0, >> which can be a controlling tty. >> >> Basically that's it. If you want ctty, open some device different from >> /dev/console > > I got the controlling tty errors as a result of the following in > inittab: > > ::askfirst:-/bin/sh > > Do you mean that this is wrong? (According to the documentation, it is an > implicit rule if inittab is missing.) It is incorrect. You should use something like this: ttyS0::askfirst:-/bin/sh That will open the shell on a device that can be a controlling tty (/dev/ttyS0). David Daney ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
On Fri, 2007-05-18 at 01:49 +0200, Denis Vlasenko wrote: > On Friday 18 May 2007 01:28, Denis Vlasenko wrote: > > Boot with init=/bin/ash, and you will get "Can't access tty" message. > > That's because fd# 0,1,2 are opened to /dev/console. > > Now execute this in ash: > > > > # exec /bin/ash /dev/tty1 2>&1 > > > > This one will work ok, because fds are opened to /dev/tty0, > > which can be a controlling tty. > > :( please s/tty0/tty1/ above... > > -- > vda This is what my init.ash contains. I'm still getting the "can't access tty" message. Do you see anything else wrong? -- ##!/bin/ash echo "Mounting real root file system..." mount -t sysfs none /sys mount -t proc none /proc mount -t ext2 /dev/hdf1 /mnt/realroot # Chain to real filesystem echo "Chaining to real file system..." #exec switch_root /mnt/realroot/sbin/init "$@" $/mnt/realroot/dev/console exec /bin/ash /dev/tty0 2>&1 -- My initramfs config for the tty/console devices is: nod /dev/tty0 666 0 5 c 4 0 nod /dev/tty1 666 0 5 c 4 1 nod /dev/tty2 666 0 5 c 4 2 nod /dev/tty3 666 0 5 c 4 3 nod /dev/tty4 666 0 5 c 4 4 nod /dev/tty5 666 0 5 c 4 5 nod /dev/tty6 666 0 5 c 4 6 nod /dev/tty7 666 0 5 c 4 7 nod /dev/tty8 666 0 5 c 4 8 nod /dev/ttyS0 666 0 5 c 5 0 nod /dev/console 644 0 0 c 5 1 ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: ash: Can't access tty problems (initramfs)
On Thu, May 17, 2007 at 05:05:30PM -0700, David Daney wrote: > Hamish Moffatt wrote: > >I got the controlling tty errors as a result of the following in > >inittab: > > > >::askfirst:-/bin/sh > > > >Do you mean that this is wrong? (According to the documentation, it is an > >implicit rule if inittab is missing.) > > It is incorrect. You should use something like this: > > ttyS0::askfirst:-/bin/sh > > That will open the shell on a device that can be a controlling tty > (/dev/ttyS0). Why shouldn't you be able to use console (or ""), so that it follows the console wherever that is? (ttyS0, ttyS1, or a real linux virtual console). Like I said, the documentation says the above is an implicit rule if you have no inittab. The code appears to agree. Hamish -- Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox