Linux for Tegra chroot on Shield - Shield Android TV General

I am trying to chroot the Ubuntu 16.04 Image Nvidia has for developing on the shield. I placed it on a sdcard mounted it at /mnt/chroots
I am not able to get apt-get update to work without failing, ping also fails. Help would be appreciated.
cd rootfs
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
mount -o bind /dev/pts dev/pts/
chroot . /bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
Also I added root to the groups:
-----------------------------------------
groupadd -g 3001 aid_net_bt_admin
groupadd -g 3002 aid_net_bt
groupadd -g 3003 aid_inet
groupadd -g 3004 aid_inet_raw
groupadd -g 3005 aid_inet_admin
gpasswd -a root aid_net_bt_admin
gpasswd -a root aid_net_bt
gpasswd -a root aid_inet
gpasswd -a root aid_inet_raw
gpasswd -a root aid_inet_admin
/etc/resolv.conf
nameserver 8.8.8.8
with /etc/init.d/networking start
[email protected]:/# apt-get update
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-updates/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-security/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

I had a similar problem last week with ports.ubuntu.com not resolving, but it seems to have resolved itself (heh.) Are you still having this problem?

Mogster2K said:
I had a similar problem last week with ports.ubuntu.com not resolving, but it seems to have resolved itself (heh.) Are you still having this problem?
Click to expand...
Click to collapse
No its not that its def something else. I have not taken the time to dig through it yet. Its definitely weird.

Related

[Guide] How to get Karmic Koala on your HTC Vision

So, for all of you guys down here that are Debian junkies, then you're gonna love this. I managed to get Ubuntu Karmic Koala on my G2 after a bit of messing around with adb. This is my first tutorial on xda-developers, so please tell me how I'm doing. Remember to hit the Thanks button at the bottom if you're satisfied
Code:
#Your warranty has been voided
#I am not the cause of any damage done to your device
#Should you accuse me, I will laugh at you
Reasons why you should follow this tutorial:
- It allows you to make use wide array of applications available in Debian/Ubuntu's repos.
- It doesn't overwrite the current Android operating system.
- It'll allow you to turn your G2, Desire Z, etc. into more than just a sub-par cellphone.
- If you're developing software/applications, this will give you the proper environment for you test them on, if you don't care for Virtualbox or don't have access to a computer at the current moment.
- This tutorial will make the best use of Android and Linux's open-source nature.
Please note that this DOES NOT replace Android nor is it a port of Ubuntu/Debian. Ubuntu/Debian support ARM EABI which is the underlying architecture of Android.
READ EVERYTHING BEFORE DOING ANYTHING. I KNOW IT'S LONG, I WROTE THIS TUTORIAL
For those of you that can't use, can't set it up, or don't care for adb, you can still get Ubuntu to work on your device using a Terminal Emulator app, but you're probably gonna be stuck at the command line. I haven't actually tried setting up the GUI using the Terminal, so I'm not 100% sure. Now, before I start the tutorial, you NEED to be rooted.
NOTE: Whenever you see a $ or a # sign, those are indicators for the next command. Please do not enter them as you're typing in the commands. The same goes for the "[email protected]:/#" sign.
Before we begin we will need the following:
On your phone, have the following installed and/or readily available
-androidVNC application
-Terminal Emulator app (use this to boot into Ubuntu shell)
-Busybox (preferably, the latest one. If you rooted your phone using the method on the xda wiki OR your custom ROM has it pre-installed, then continue)
- At least 2GB space free on your microSD card
- Loopdevice support for your ROM. I think Cyanogen and another kernel should do the trick.
On your computer have the following installed and/or on the desktop:
-Ubuntu Karmic Koala image. If you don't have it, download it from this link ->http://bit.ly/moghJ3
-adb installed and fully functioning on your computer
EDIT 4 June, 2011: For those of you having troubles getting the shell to boot up, I found an alternative bootubuntu file. Extract it and replace the one that comes with the image with this one http://bit.ly/j7zORF
Let's begin, shall we?
Step 1: Connect your phone to your computer. Make sure you have "USB Debugging" checked off in "Settings -> Applications -> Development", then mount your sd card.
Step 2: Transfer the extracted "ubuntu" folder to the root of your sd card [NOT IN ANY FOLDERS, JUST the sd card itself, for those of you who don't know]. It might take a few minutes, so you might wanna make yourself a little snack for the wait.
Step 3: When the file transfer is done, disable the USB connection, so we can make use of adb. This is where USB Debugging is CRUCIAL. Open up a command window/terminal, go to where adb is located and enter the following commands:
Code:
$ adb shell
$ cd /sdcard/ubuntu
# su
# sh ./ubuntu.sh
# bootubuntu
At this point, you've set up the Ubuntu shell, as indicated by the "[email protected]:/#" sign.
However, our shell is still incomplete. We're gonna need a GUI for actual usage. If you're fine with using the command line then stop here. If you want to give yourself a PC-like experience, then please continue. You might wanna connect to WiFi if you're in an area where your mobile data is inconsistent or restricted to an EDGE connection.
Step 4: With the command prompt/terminal window that contains your adb/ubuntu shell, let's continue entering some commands to get our GUI set up.
Code:
[email protected]:/# apt-get update
[email protected]:/# apt-get install tightvncserver
[email protected]:/# apt-get install lxde
[email protected]:/# export USER=root
[email protected]:/# vncserver -geometry 1024x800
After entering the last command, you'll be prompted to enter a password. It'll ask you to set up a second one, just press "n" then continue.
For the second and third commands, press "y" when prompted to then hit ENTER, so you can install the packages. The reason why we set the VNC server's resolution is because even though the G2/Dz's resolution is 800x480, a higher resolution will provide a better viewing experience. If you want it set up to your phone's resolution, then swap it with "800x480" to scale the server's resolution to your phone's screen size.
Step 5: Enter the following commands. After entering the first command, you'll notice there's no user indicator at the left side. DON'T PANIC. Just continue entering the following commands:
Code:
[email protected]:# cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
Then, press Ctrl+D twice and press enter. You'll be back at "[email protected]:/#" (Conversely, if you're on Mac OS or Linux, just press Ctrl+D once)
Step 6: Go to your phone, and open up the androidVNC app. We're gonna need this to view our desktop. set the nickname to "root" and enter the password you set earlier. Set the port to "5901" and press connect.
Step 7a: And bam! You've got your own cool GNOME desktop! (Though in my experience, it switches over to lxde after a few uses.) Now, we need to get the VNC app to open up every time we boot into our shell. We need to enter a few more commands (yeah I know, it's getting a bit tedious at this point.)
Code:
[email protected]:/# cat > front
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1024×800
Again, you can replace "1024x800" with any screen resolution you desire.
Step 7b: Enter just a few more commands [trust me, we're almost done ]
Code:
[email protected]:/# cat front /root/.bashrc > temp
[email protected]:/# cp temp /root/.bashrc
Step 8: To check that everything is working, enter the following commands in your command prompt/terminal window that contains our adb/ubuntu shell that I hope you kept open all this time.
Code:
[email protected]:/# exit
# bootubuntu
And you're done! Give yourself a round of applause and a pat on the back, because now you have Ubuntu Linux running alongside Android. Yay!!!!!!
To boot into your shell AFTER you're done, use the Terminal Emulator app to access your shell:
Code:
$ su
# bootubuntu
That's it, you're finished.
Now, I don't know why this happens, but after rebooting your phone, it'll take a few extra seconds for your devices to start up. I think it's because of all the files that are in the phone's internal memory. I'm not sure. Also, the VNC server might not open up after you're done with the tutorial. It's only a minor setback, you can still manually open it yourself which is in itself relatively quick.
When you're done with the tutorial, be sure to type in "exit" in the terminal and press enter for a clean kill of Ubuntu. Otherwise, you're gonna have to redo the entire procedure.
If you have any questions, please email me at [email protected]
FAQ
- I don't have adb, can I still follow this tutorial?
A: Yes you can. However, you're probably going to be stuck at Step 3 with the command line. You can still use the shell, but you won't have a GUI.
- Why does my phone show a black screen after rebooting?
A: It's probably because of all the modding that's a result of the commands we entered.
Don't worry, Your phone will boot up normally. However, if this goes on longer than usual, you might have to install a different ROM. I've tested it on CM7 (Stable and Nightly), Stock G2 ROM, Virtuous 1.0.2, Virtuous G-Lite 1.0.2, and their respective ROM bases with no problems.
- I get an error that won't let me boot into the Ubuntu shell. Help me!!!!!
A: Yeah, you probably either downloaded an incomplete image OR you entered an important command wrong. I suggest deleting the ubuntu image from your sdcard and then copy the image you extracted onto your sdcard. Then what you have to do is redo the entire tutorial.
Interesting...
Sent from my T-Mobile G2 using XDA Premium App
Spastic909 said:
Interesting...
Sent from my T-Mobile G2 using XDA Premium App
Click to expand...
Click to collapse
What's interesting about this?
Edit: can't wait to try this!
Ouch. . .
It's my first tutorial. . .
I just want to know what he found interesting about this tutorial. No need to get so defensive over a comment some other guy made.
Sent from my T-Mobile G2 using XDA Premium App
Didn't mean any offense dude especially if you weren't trying to be rude. You know how the internet doesn't portray emotion very well in text. Just sounded snappy. Back on topic. Can't wait to try this!
Sent from my HTC Vision using XDA Premium App
I'm not much of a software junky, so what exactly would this do? It looks easy enough to accomplish, since most of it is done through terminal, but I kinda wanna know what this DOES xD
Sent from my HTC Vision using XDA Premium App
xsteven77x said:
Didn't mean any offense dude especially if you weren't trying to be rude. You know how the internet doesn't portray emotion very well in text. Just sounded snappy. Back on topic. Can't wait to try this!
Sent from my HTC Vision using XDA Premium App
Click to expand...
Click to collapse
Edit: Remember to hit that thanks button!
ohshootrawr said:
I'm not much of a software junky, so what exactly would this do? It looks easy enough to accomplish, since most of it is done through terminal, but I kinda wanna know what this DOES xD
Sent from my HTC Vision using XDA Premium App
Click to expand...
Click to collapse
Well, Ubuntu is a distribution of the Debian family of Linux.
Essentially, you have access to the plethora of apps that exist in Ubuntu/Debian's repos, and it's also possible to use this shell as a test monkey for applications that you might be developing.
Any idea if this will work with the new Ubuntu 11.04? Though I do hate the new layout
boost3d23 said:
Any idea if this will work with the new Ubuntu 11.04? Though I do hate the new layout
Click to expand...
Click to collapse
in theory, yes if the image has been compiled properly. also, the new layout technically can get overwritten with lxde or whatever desktop environment you installed.
reserved for future use.
im getting some errors in terminal when trying to set this up, im running mexdroid v3 android 2.3.4
C:\push\tools>adb shell
# cd /sdcard/ubuntu
cd /sdcard/ubuntu
# su
su
# sh ./ubuntu.sh
sh ./ubuntu.sh
modprobe: module 'ext2' not found
←[H←[Jmkdir: can't create directory '/data/local/mnt': File exists
←[H←[Jchmod: bootubuntu: Operation not permitted
chmod: fsrw: Operation not permitted
chmod: mountonly: Operation not permitted
chmod: ubuntu.img: Operation not permitted
chmod: ubuntu.sh: Operation not permitted
chmod: unionfs: Operation not permitted
←[H←[J
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 NexusOn
eHacks.net
To enter the Ubuntu Linux console just type 'bootubuntu'
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
losetup: /dev/block/loop1: No such file or directory
mount: mounting /dev/block/loop1 on /data/local/ubuntu failed: Device or resourc
e busy
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or dir
ectory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or director
y
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or director
y
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
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
umount: can't umount /data/local/ubuntu/dev/pts: No such file or directory
umount: can't umount /data/local/ubuntu/proc: No such file or directory
umount: can't umount /data/local/ubuntu/sys: No such file or directory
umount: can't umount /data/local/ubuntu: Invalid argument
losetup: /dev/block/loop1: Device or resource busy
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
losetup: /dev/block/loop1: No such file or directory
mount: mounting /dev/block/loop1 on /data/local/ubuntu failed: Device or resourc
e busy
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or dir
ectory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or director
y
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or director
y
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
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
umount: can't umount /data/local/ubuntu/dev/pts: No such file or directory
umount: can't umount /data/local/ubuntu/proc: No such file or directory
umount: can't umount /data/local/ubuntu/sys: No such file or directory
umount: can't umount /data/local/ubuntu: Invalid argument
losetup: /dev/block/loop1: Device or resource busy
#
teh5abiking said:
Well, Ubuntu is a distribution of the Debian family of Linux.
Essentially, you have access to the plethora of apps that exist in Ubuntu/Debian's repos, and it's also possible to use this shell as a test monkey for applications that you might be developing.
Click to expand...
Click to collapse
Seriously? Mmm, okay. I'm gonna try it sometime this week ;D
Sent from my HTC Vision using XDA Premium App
strker45 said:
im getting some errors in terminal when trying to set this up, im running mexdroid v3 android 2.3.4
C:\push\tools>adb shell
# cd /sdcard/ubuntu
cd /sdcard/ubuntu
# su
su
# sh ./ubuntu.sh
sh ./ubuntu.sh
modprobe: module 'ext2' not found
←[H←[Jmkdir: can't create directory '/data/local/mnt': File exists
←[H←[Jchmod: bootubuntu: Operation not permitted
chmod: fsrw: Operation not permitted
chmod: mountonly: Operation not permitted
chmod: ubuntu.img: Operation not permitted
chmod: ubuntu.sh: Operation not permitted
chmod: unionfs: Operation not permitted
←[H←[J
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 NexusOn
eHacks.net
To enter the Ubuntu Linux console just type 'bootubuntu'
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
losetup: /dev/block/loop1: No such file or directory
mount: mounting /dev/block/loop1 on /data/local/ubuntu failed: Device or resourc
e busy
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or dir
ectory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or director
y
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or director
y
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
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
umount: can't umount /data/local/ubuntu/dev/pts: No such file or directory
umount: can't umount /data/local/ubuntu/proc: No such file or directory
umount: can't umount /data/local/ubuntu/sys: No such file or directory
umount: can't umount /data/local/ubuntu: Invalid argument
losetup: /dev/block/loop1: Device or resource busy
# bootubuntu
bootubuntu
mknod: /dev/loop1: File exists
losetup: /dev/block/loop1: No such file or directory
mount: mounting /dev/block/loop1 on /data/local/ubuntu failed: Device or resourc
e busy
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or dir
ectory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or director
y
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or director
y
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexist
ent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
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
umount: can't umount /data/local/ubuntu/dev/pts: No such file or directory
umount: can't umount /data/local/ubuntu/proc: No such file or directory
umount: can't umount /data/local/ubuntu/sys: No such file or directory
umount: can't umount /data/local/ubuntu: Invalid argument
losetup: /dev/block/loop1: Device or resource busy
#
Click to expand...
Click to collapse
I had this issue aswell.
To solve it firts fix your permissions in Rom manager.
Then install busy box.
This should then allow you to install ubuntu. (atleast it did with me)
Hope this is some help to you
teh5abiking said:
What's interesting about this?
Click to expand...
Click to collapse
The post dude.. would you rather I said boring? Settle down
Do u know what interesting means? It means I am interested in this..didn't think you could mistake that but guess I was wrong
Sent from my T-Mobile G2 using XDA Premium App
Spastic909 said:
The post dude.. would you rather I said boring? Settle down
Do u know what interesting means? It means I am interested in this..didn't think you could mistake that but guess I was wrong
Sent from my T-Mobile G2 using XDA Premium App
Click to expand...
Click to collapse
hey man, i just wanna know what you found interesting about the tutorial.
i wasn't trying to be3 a smart aleck.
I really don't know **** about linux except for the few times I've had to run it on a virtual machine for rooting certain phones or to check out a few programs. With linux installed on my phone,
does that mean that I would be able to run any linux based program? For example aircrack or something like it?
Edit: I basically want to know what the purpose of doing this would be. What it would enable me to do
* I'm just sayin......
gazlufc said:
I had this issue aswell.
To solve it firts fix your permissions in Rom manager.
Then install busy box.
This should then allow you to install ubuntu. (atleast it did with me)
Hope this is some help to you
Click to expand...
Click to collapse
installed newest version of busybox 1.19.0 and fixed permissions and still received the same errors :/
strker45 said:
installed newest version of busybox 1.19.0 and fixed permissions and still received the same errors :/
Click to expand...
Click to collapse
.
Create a backup of you current rom using Rom manager.
Then install a new rom from the developer section of the G2/Desire z
First install busybox.
Second fix permissions.
Third is reboot
open adb and now try the process this should now allow you to install ubuntu.

[Q] Custom kernel with loopback support

I'm looking for a custom kernel with loopback support (possibility mount img files).
I've tried: cyanogenmod kernel, tiamat - there's no it.
What img files u want mount?
Sent from my HTC Desire
I've got debian linux in .img file and I can't mount it on my HTC Desire - cause kernel doesn't support it.
Hm... weird.
Code:
# zcat /proc/config.gz | grep -i loop
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_RC_LOOPBACK is not set
Code:
# mknod /dev/block/loop0 b 7 0
and still:
Code:
mount: can't setup loop device: No such file or directory
P.S.: Sorry for double-post, I don't see delete or merge option.
I found a solution. The problem was non-existent device, try with different numbers for /dev/loop.
Example:
Code:
# mknod /dev/block/loop0 b 7 0
# mknod /dev/block/loop2 b 7 0
# mknod /dev/block/loop255 b 7 0

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.

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

ERROR: chroot: can't execute "/bin/bash" no such file or directory on Android

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

Categories

Resources