ERROR: chroot: can't execute "/bin/bash" no such file or directory on Android - Galaxy Tab 3 Q&A, Help & Troubleshooting

ERROR: chroot: can't execute "/bin/bash" no such file or directory on Android
Hi guys,
I have a problem with "change root" command when I setup ubuntu to run on android. My tablet is Samsung galaxy tab 3 10.1, android 4.4.2 . I followed this tutorial step by step: galaxytabhacks.com/galaxy-tab-10-1-hacks/how-to-install-ubuntu-linux-on-galaxy-tab-10-1-tabuntu(excuse me, I can't post link, please copy and paste help me) but when I run "bootubuntu" script it threw error as title above.
This is bootubuntu script
Code:
#modprobe ext2
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
if [ ! -d /data/local/ubuntu ]
then
mkdir /data/local/ubuntu
fi
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export bbox=/system/xbin/busybox
$bbox mknod /dev/block/loop255 b 7 255
$bbox losetup /dev/block/loop255 /sdcard/ubuntu/ubuntu.img
$bbox mount -t ext2 /dev/block/loop255 /data/local/ubuntu
$bbox mount -t devpts devpts $mnt/dev/pts
$bbox mount -t proc proc $mnt/proc
$bbox mount -t sysfs sysfs $mnt/sys
sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
chroot $mnt /bin/bash #error here
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
$bbox umount $mnt/dev/pts
$bbox umount $mnt/proc
$bbox umount $mnt/sys
$bbox umount $mnt
$bbox losetup -d /dev/block/loop255 &> /dev/null
And this is result
Code:
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
This process does NOT damage Android OS!
Original Installer by Charan Singh
Modified for Ubuntu Chroot by Max Lee at AndroLinux.com ,G2Hacks.com and NexusOneHacks.net
To enter the Ubuntu Linux console just type 'bootubuntu'
[email protected]:/sdcard/ubuntu # bootubuntu
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
Setting localhost on /etc/hosts
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: can't execute '/bin/bash': No such file or directory
Shutting down Ubuntu
1|[email protected]:/sdcard/ubuntu #
I read lot of thread about this error, but it on ubuntu only so I can't solve it.
Can anyone help me? Thanks so much!

this only my suggestion pal but do you have the bash binary

ballerd said:
this only my suggestion pal but do you have the bash binary
Click to expand...
Click to collapse
I don't have bash file and bin dir, I dont know how to find it too

Related

Calibre in Nook Touch

I installed Calibre on my Nook Touch to fetch news and serve contents to reader programs in my Nook Touch. The method can be used with other Android devices. In short, Calibre is installed in Debian 6.0.0 chroot environment in Android 2.1. The steps are as follows:
1. Prepare a Debian 6.0.0 package for an ARM-based CPU using this command in a PC with Debian 6.0.0:
Code:
debootstrap --arch armel --foreign squeeze debian --verbose http://ftp.debian.org/debian
Instead of making the package by yourself, you can download my package from http://www.4shared.com/file/RRuFfjRf/debiantar.html
and uncompress it to the folder “debian”
2. Make an EXT2 partition on an SD card. The partition size should be larger than 1 GB. On a Windows PC, you can use MiniTool Partition Wizard Home Edition. Then use a Debian Live CD or Linux in a virtual machine to copy the folder (in Step 1) to the new partition.
3. Connect to the device
Code:
adb connect 192.168.XXX.XXX
adb shell
4. Mount partition of the SD card to a directory. In my case, I use /data/local/mnt as a mounting point. Note that my partition is at /dev/block/vold/179:21. You may need to find your partition by trial-and-error.
Code:
cd /data/local/
mkdir mnt
mount -t ext2 -o noatime /dev/block/vold/179:21 /data/local/mnt
5. Setup the chroot environment. Read References at the end of this post for details.
Code:
cd /data/local/mnt
chroot debian /bin/bash
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
/debootstrap/debootstrap --second-stage
echo 'nameserver 8.8.8.8' > /etc/resolv.conf
echo 'deb http://ftp.debian.org/debian squeeze main' > /etc/apt/sources.list
apt-get update
6. Install calibre 0.7.7 (larger than 400 MB). The program is installed to /usr/share/calibre/
Code:
apt-get install calibre
apt-get install python-routes
7. Set environment variables in .bashrc
7.1 Copy .bashrc to the local PC.
Code:
adb pull /data/local/mnt/debian/root/.bashrc
7.2 Add the following commands to .bashrc
Code:
export LANG=en_US.UTF-8
export TZ=Asia/Bangkok
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
7.3 Send .bashrc to the device
Code:
adb push .bashrc /data/local/mnt/debian/root/
8. To use Calibre, enter the chroot environment:
Code:
chroot /data/local/mnt/debian /bin/bash
Try the following commands: (My epup files are in /usr/share/calibre/serve/)
Code:
ebook-convert /usr/share/calibre/recipes/cnn.recipe /usr/share/calibre/serve/cnn.epub
calibredb add --duplicates --with-library /var/www/ /usr/share/calibre/serve/cnn.epub
calibre-server --with-library /var/www/ --daemonize
9. There are several ways to access epub files to use in CoolReader, Aldiko, or other readers for Android
- calibre server
- lighttpd webserver
- mounting the directory in the chroot to the SD card
I prefer the third option because I don't need to run the server all the time.To mount the directory in chroot to a mounting point in the SD card, do this:
Code:
mount -o bind /data/local/mnt/debian/usr/share/calibre/serve/ /sdcard/eBooks/Calibre
In Coolreader/Aldiko, epub files can be accessed from /sdcard/eBooks/Calibre.
10. SUMMARY
10.1 When rebooting your device, you will need to input the following commands to mount the partition and directory, and setup chroot. You can use "Terminal Emulator" to do it on your Nook Touch.
Code:
mount -t ext2 -o noatime /dev/block/vold/179:21 /data/local/mnt
mount -o bind /data/local/mnt/debian/usr/share/calibre/serve/ /sdcard/eBooks/Calibre
chroot /data/local/mnt/debian /bin/bash -c "/bin/mount -t devpts devpts /dev/pts"
chroot /data/local/mnt/debian /bin/bash -c "/bin/mount -t proc proc /proc"
chroot /data/local/mnt/debian /bin/bash -c "/bin/mount -t sysfs sysfs /sys"
10.2 Every morning you can fetch news by running Terminal Emulator and enter the following command. When opening CoolReader, the morning news is there
Code:
su
chroot /data/local/mnt/debian /bin/bash
ebook-convert /usr/share/calibre/cnn.recipe /usr/share/calibre/serve/cnn.epub
If you have a cleaner solution for this step (10.2), please share
References
http://kristof.vanhertum.be/?p=132
http://www.nslu2-linux.org/wiki/DS101/Debian
http://evilzone.org/android/debian-on-android/
http://www.saurik.com/id/10
http://packages.python.org/APScheduler/
http://www.read.in.th/node/1164
Hello, I cannot go on after the last line:
cd /data/local/mnt
chroot debian /bin/bash
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
Click to expand...
Click to collapse
When I try to:
mount -t devpts devpts /dev/pts
Click to expand...
Click to collapse
I receive: mount: only root can do that (effective UID is 1000)
If I type "mount" I receive: warning: can't open /etc/mtab: no such file or directory
If I try to skip mount devpts, proc and sysfs and start debootstrap second stage I receive:
W: Failure trying to run: mount -t proc proc /proc
Update:
I used debian.tar.gz. Then I decided to prepare a debian package by myself.
I skip mount devpts, proc and sysfs and start debootstrap second stage:
Code:
/debootstrap/debootstrap --second-stage
The out put is:
I: Installing core packages...
W: Failure trying to run: dpkg --force-depends --install /var/cache/apt/archives/base-files_6.0squeeze5_armel.deb /var/cache/apt/archives/base-passwd_3.5.22_armel.deb
Update2:
Finaly I run: export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
and second stage started.

[Q no /system rw access

I am trying to:
* run backtrack image on my slide the small custom smaller image not the +4gig one for fat32
* get RW to /system for su updated and allow rootkeeper to 'work' http://forum.xda-developers.com/showthread.php?p=21219704
* I seen several tutorials but I am not sure what one to follow .. i have S-ON and I assume I need that off for su to update within clockwork etc ... none of the other root apps work.. the superuser.apk is installed and I allow perms but nothing seems to work.. I am hoping it is a easy fix ..
INFO:
Code:
# CM 7
Linux localhost 2.6.32.17-cyanogenmod-g46ca326 #1 PREEMPT Thu Apr 21 20:36:02 EDT 2011 armv6l GNU/Linux
ESPRESSO PVT SHIP S-ON
HBOOT-1.02.0000
MICROP-0620
When I try to mount loop etc ..
Code:
# losetup /dev/loop254 $kit/bt5.img
losetup /dev/loop254 $kit/bt5.img
losetup: /dev/loop254: No such file or directory
# ls /dev/loop254
ls /dev/loop254
/dev/loop254
# uname -a
uname -a
# busybox mknod /dev/loop2 b 7 0
busybox mknod /dev/loop2 b 7 0
mknod: /dev/loop2: File exists
# mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
mount: can't setup loop device: No such file or directory
# losetup /dev/block/loop7 $kit/bt5.img
losetup /dev/block/loop7 $kit/bt5.img
losetup: /dev/block/loop7: No such file or directory
# losetup /dev/block/loop2 $kit/bt5.img
losetup /dev/block/loop2 $kit/bt5.img
losetup: /dev/block/loop2: No such file or directory
# losetup /dev/loop2 $kit/bt5.img
losetup /dev/loop2 $kit/bt5.img
losetup: /dev/loop2: No such file or directory
# losetup /dev/loop7 $kit/bt5.img
losetup /dev/loop7 $kit/bt5.img
losetup: /dev/loop7: No such file or directory
# ls /dev/loop2
ls /dev/loop2
/dev/loop2
# ls /dev/loop7
ls /dev/loop7
/dev/loop7
#
ah i dont know.. top it for ya~

Backtrack 5 Note 2

Right guys,
I am a bit of a nub and i need some help.
Need bt5 on my note 2 as part of a course.
Had it working fine then exited when done. Wouldnt re-open.
Deleted the BT5 folder i created and started from scratch but all i get is
#sh boot bt
bootbt[30]:syntax error: 'if' unmatched
this is my boot file
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
mount -o remount,rw /dev/block/mmcblk0p5/system
export kit=/sdcard/BT5
export bin=/system/bin
export mnt=/data/local/mnt
export sdcard=/mnt/sdcard
export extsd=/mnt/extSdCard
export USER=root
if [ ! -d "$mnt" ]; then
mkdir $mnt
fi
export PATH=$bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/block/loop255 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop255 b 7 255
fi
#mount -o loop,noatime -t ext2 $kit/BT5.img $mnt
losetup /dev/block/loop255 $kit/bt5.img
mount -t ext2 /dev/block/loop255 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
mount -o bind /mnt/sdcard $sdcard
mount -o bind /mnt/extSdCard $extsd
if [ ! -d "/data/local/mnt/sdcard" ]; then
mkdir /data/local/mnt/sdcard
fi
busybox mount -o bind /sdcard /data/local/mnt/sdcard
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts
echo "Back Track is configured with SSH and VNC servers that can be accessed from the IP:"
ifconfig wlan0
echo " "
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM"
umount $sdcard
umount $extsd
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop255

Busybox command softlinker

Have busybox? Wish you could type "grep foo" instead of "busybox grep foo" ? This simple shell script checks your busybox for supported commands and softlinks them from /system/bin to wherever the first busybox it finds in the $PATH is.
Since I screwed up my links a couple times making this, there's also a script that strips every link to busybox out of /system/bin.
These scripts do basically no error checking. They require root access, but they don't check for it. If you don't know how to read a script to see what it does before you run it, don't run it.
That said, it's handy.
Code:
#!/system/bin/sh
# linky.sh: softlink busybox to all the commands it supports
# Now with zero error checking! Beware :P
# -speef
busybox &>/dev/null || exit 1
bbl=`busybox which busybox`
ready=0
busybox mount -o rw,remount /system
>./linky.log
for cmd in `busybox`
do
cmd=`echo $cmd|busybox awk -F, '{print $1}'`
if [ $ready -eq 0 ]
then
if [ $cmd == "functions:" ]
then
ready=1
continue
else
continue
fi
fi
echo ln -s $bbl /system/bin/$cmd
busybox ln -s $bbl /system/bin/$cmd &>> linky.log
done
busybox mount -o ro,remount /system
echo "see ./linky.log for errors!"
And its counterpart, which removes all links to busybox from /system/bin:
Code:
#!/system/bin/sh
# delinky.sh: remove all busybox links from /system/bin
# Now with zero error checking! Beware :P
# -speef
busybox &>/dev/null || exit 1
busybox mount -o rw,remount /system
for cmd in `busybox find /system/bin -type l -exec ls -l \{\} \; | busybox grep busybox|busybox awk '{print $6}'`
do
echo rm /system/bin/$cmd
busybox rm /system/bin/$cmd
done
busybox mount -o ro,remount /system

BT5 on android( i have tab 2+ pasted bt5.img on ext. card)

perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This Script Needs Root! Type : su";exit;fi
busybox mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/storage/extSdCard/BT5
export bin=/system/bin
export mnt=/data/local/mnt
mkdir -p $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/loop2 ]; then
echo "Loop device exists"
else
busybox mknod /dev/loop2 b 7 0
fi
busybox mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
busybox mount -t devpts devpts $mnt/dev/pts
busybox mount -t proc proc $mnt/proc
busybox mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM For Xoom"
busybox umount $mnt/dev/pts
busybox umount $mnt/proc
busybox umount $mnt/sys
busybox umount $mnt
THIS WORKS ON TAB 2 ....when you have the BT5 folder on external card!!!!!!!!
obv. rooted tab 2 :silly:
mail me for more solutions for your probs !!!!!

Categories

Resources