kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: adam8157@gmail.com (Adam Lee)
To: kernelnewbies@lists.kernelnewbies.org
Subject: rootfile system porting for FPGA [/bin/sh: can't access tty; job control turned off]
Date: Tue, 8 May 2012 21:03:47 +0800	[thread overview]
Message-ID: <20120508130347.GA4550@adam-laptop> (raw)
In-Reply-To: <CAFxuAackYQcZ62Zr_WaSt0d1mThcMmLT2Q7QyJ4-bgAkCOOcTg@mail.gmail.com>

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
--------------------------------

      reply	other threads:[~2012-05-08 13:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07 12:51 rootfile system porting for FPGA [/bin/sh: can't access tty; job control turned off] pcuser p
2012-05-07 13:42 ` Anirban Roy
2012-05-07 13:42 ` Mandeep Sandhu
2012-05-07 14:01 ` Adam Lee
2012-05-08 12:43   ` pcuser p
2012-05-08 13:03     ` Adam Lee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120508130347.GA4550@adam-laptop \
    --to=adam8157@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).