rootfile system porting for FPGA [/bin/sh: can't access tty; job control turned off]

Adam Lee adam8157 at gmail.com
Tue May 8 09:03:47 EDT 2012


On Tue, May 08, 2012 at 06:13:10PM +0530, pcuser p wrote:
> Thanks all for ur replies.
> I gave a try to create a new rootfile system (ext2) by following the procedure
> in free-electrons.com and examples in the busybox folder.
> Surprisingly, it got built properly and run upto the same point and doesn't
> accept any commands i'm typing.
> I haven't added serial related stuff (gettty) in the inittab/rcS file as I am
> still not much clear about it.
> 
> My query is:
> At later point after file system mounted, is this same console used for login?
> (i'm having only one UART port in my board -> ttySAC0)
> Am I getting this err (/bin/sh: can't access tty; job control turned off)
> because console is locked already for printk's?
> What changes are needed in the inittab & /etc/init.d/rcS file to get the
> working shell prompt for this scenario?

Because *your* /bin/sh is running on /dev/console

> below are the console messages:
> RAMDISK: ext2 filesystem found at block 0
> RAMDISK: Loading 3072KiB [1 disk] into ram disk... \
> done.
> VFS: Mounted root (ext2 filesystem) readonly on device 1:0.
> Freeing init memory: 80K
> /bin/sh: can't access tty; job control turned off
> / #
> 
>  /etc/inittab file contents
> # This is run first script
> ::sysinit:/etc/init.d/rcS
> # Start an "askfirst" shell on the console
> ::askfirst:­/bin/sh
> # Stuff to do when restarting the init process
> ::restart:/sbin/init
> # Stuff to do before rebooting
> ::ctrlaltdel:/sbin/reboot
> ::shutdown:/bin/umount ­a ­r
> 
> /etc/init.d/rcS file contents
> #!/bin/sh
> mount ­t proc none /proc
> mount ­t sysfs none /sys
> exec /sbin/sh
> /bin/sh

Remove the last two lines and add a line "exec /bin/sh" might works.


And, I suggest you write rcS as examples/bootfloppy/etc/inittab in
busybox src tree, and do not drop sh lines in rcS

# examples/bootfloppy/etc/inittab:
::sysinit:/etc/init.d/rcS
::respawn:-/bin/sh
tty2::askfirst:-/bin/sh
::ctrlaltdel:/bin/umount -a -r

-- 
Regards,
Adam Lee
--------------------------------
E-mail: adam8157 at gmail.com
Website: http://adam8157.info
--------------------------------



More information about the Kernelnewbies mailing list