Page 1 of 1

cannot find /bin/sh

Posted: Sun Feb 17, 2019 11:04 pm
by dexternl
after rooting my toon my dad wanted his toon also rooted. So i did the same steps as before (connect the toon to a pi and kicking of the root script). Everything looks fine but when he tries to reboot the toon it doesnt boot anymore. If i check using minicom what the toon is telling it ends in a panic with error cannot find /bin/sh.

So i tried following the manual of marcel and try to boot of a nfs image. it looks like its booting a bit but i dont get a shell i end up with these lines:

Code: Select all

eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:10, irq=-1)
ADDRCONF(NETDEV_UP): eth0: link is not ready
IP-Config: Complete:
     device=eth0, addr=172.16.0.100, mask=255.255.255.0, gw=172.16.0.1,
     host=toon, domain=, nis-domain=(none),
     bootserver=172.16.0.13, rootserver=172.16.0.13, rootpath=
Looking up port of RPC 100003/3 on 172.16.0.13
PHY: 1:10 - Link is Up - 100/Full
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Looking up port of RPC 100005/3 on 172.16.0.13
VFS: Mounted root (nfs filesystem) on device 0:13.
Freeing init memory: 116K
/bin/sh: can't access tty; job control turned off
/ # eth0: no IPv6 routers present

nfs: server 172.16.0.13 not responding, still trying
my exports file on the nfs server looks like this:

Code: Select all

/tftpboot/toon/rootfs    *(rw,sync,no_root_squash,no_subtree_check)
/tftpboot/toon           *(rw,sync,no_root_squash,no_subtree_check)
I can mount the nfs share via another server using nfs. And i am using ubuntu as nfs server. What can is do besides buying my dad a new Toon?

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 9:26 am
by TheHogNL

Code: Select all

/bin/sh: can't access tty; job control turned off
/ # eth0: no IPv6 routers present
This is normal. There is no TTY support on the nfs booted Toon. You are presented the / # prompt from where you can go futher. Can't you type anything there?

Code: Select all

nfs: server 172.16.0.13 not responding, still trying
This is something to look at. Why did your toon boot from nfs but after booting it is not responding?

About how it happened,.. did you use an older version of the rooter? The newest version has a replaced dropbear package with no depencies. Probably you older package tried to update the libc also (from a ready to install 5.0.4).
Or do you have any other idea what happened during rooting?

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 10:20 am
by dexternl
Thanks for the quick response. No i cannot type anything thats what i find strange. I will try to install the tftp and nfs on a pi which i use for the serial connection and let you know. What are the best steps to take when i have a shell prompt? I have the feeling that i am only missing the sh. So is there an option to only restore the shell without wiping the partition?

For the rooting part i have used the latest version of the rooter from Github. I noticed that he tried installing the dropbear and another package which i dont know by head. But he failed both because he couldnt use sh anymore.

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 12:37 pm
by mAiden
Do not even understand the NFS boot at all. If Toon gives the notification: "/bin/sh: can't access tty; job control turned off" then you can edit your inittab and iptables and passwd files?
Be careful that inittab does not empty, otherwise Toon will not start up.

If you can't type anything, than you have to switch RxD and TxD cables (RxD goes to TxD, and TxD goes to RxD), i think. :)

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 12:57 pm
by dexternl
the tty message is presented when i boot the toon via nfs. when i normally boot my broken toon i get a kernel panic.
The RX and TX must be correct because i can enter command until the moment of booting via nfs.

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 12:58 pm
by aabre
dexternl wrote:/tftpboot/toon/rootfs *(rw,sync,no_root_squash,no_subtree_check)
/tftpboot/toon *(rw,sync,no_root_squash,no_subtree_check)

Hoi dexternl
Check your path on your rpi /tftpboot
I had some problems too with the configuration and the path
My file system (image-base-qb2.tar.gz) is located in /tftpboot/rootfs and not in /tftpboot/toon/rootfs

hope it wil help :-)

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 1:44 pm
by mAiden
dexternl wrote:the tty message is presented when i boot the toon via nfs. when i normally boot my broken toon i get a kernel panic.
The RX and TX must be correct because i can enter command until the moment of booting via nfs.
Oke..
What is the error that Kernel Panic gives you? :)

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 2:40 pm
by marcelr
Probably VFS error, can't find the root filesystem, or something along these lines?

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 2:56 pm
by TheHogNL
dexternl wrote: For the rooting part i have used the latest version of the rooter from Github. I noticed that he tried installing the dropbear and another package which i dont know by head. But he failed both because he couldnt use sh anymore.
I think you are hitting the same as Aabre did in this post: viewtopic.php?f=101&t=11230&p=89178#p89178
Does that look familiar?

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 7:00 pm
by TheHogNL
Also for you, check my post at viewtopic.php?f=101&t=11230&p=89640#p89640

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 9:48 pm
by dexternl
TheHogNL wrote:Also for you, check my post at viewtopic.php?f=101&t=11230&p=89640#p89640
Thanks if i use your image as rootfs and boot via nfs i get a toon screen but i am now a bit confused how to proceed.

If i boot the toon normally i get the following kernel panic:

Code: Select all

UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   117833728 bytes (115072 KiB, 112 MiB, 928 LEBs)
UBIFS: journal size:       9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)
usb 2-1: new high speed USB device using mxc-ehci and address 2
VFS: Mounted root (ubifs filesystem) on device 0:13.
Freeing init memory: 104K
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
[<c00273d0>] (unwind_backtrace+0x0/0xf0) from [<c029e720>] (panic+0x60/0x190)
[<c029e720>] (panic+0x60/0x190) from [<c00223dc>] (init_post+0x78/0xc4)
[<c00223dc>] (init_post+0x78/0xc4) from [<c0008b54>] (kernel_init+0x110/0x14c)
[<c0008b54>] (kernel_init+0x110/0x14c) from [<c00238ec>] (kernel_thread_exit+0x)

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 9:57 pm
by TheHogNL
You first need to boot from the NFS image as you did before and mount your broken rootfs again (under /mnt/rootfs or something like that).
Then, after making a backup (especially a backup of (/mnt/rootfs)/etc/openvpn) remove everything in that folder and unpack my image there.

You might also just copy the /lib and /usr/lib files from my image to your broken rootfs.

Re: cannot find /bin/sh

Posted: Mon Feb 18, 2019 10:58 pm
by dexternl
You are all the best i managed to restore the toon. But before i break it again. Do i need to do something to root it or is this image already rooted?

Re: cannot find /bin/sh

Posted: Tue Feb 19, 2019 1:10 pm
by TheHogNL
Image already rooted. Password 'toon'