Installation in an Android Chroot

Install Arch Linux ARM on other devices.

Installation in an Android Chroot

Postby crimsonredmk » Fri Jul 15, 2011 4:40 pm

Any rooted ROM should work as long as you install Busybox from the Market.

This guide is intended for experienced users. Back up your data before doing anything listed on this page!

Get into the ADB shell (I prefer SSH with the QuickSSHd Market application), then run:

Code: Select all
su # Allow it on the screen
cd /sdcard
mkdir arch
dd if=/dev/zero of=alarm.img seek=749999999 bs=1 count=1 #750MB image file
mke2fs -F alarm.img
mknod /dev/loop1 b 7 0
losetup /dev/loop1 alarm.img
mount -t ext2 /dev/loop1 arch/
cd arch
wget http://archlinuxarm.org/os/ArchLinuxARM-armv5te-latest.tar.gz
tar xzf ArchLinuxARM-armv5te-*.tar.gz
rm ArchLinuxARM-armv5te-*.tar.gz
mount -o bind /dev/ /sdcard/Arch Linux ARM/dev
chroot . /bin/bash
echo "nameserver 8.8.8.8" > /etc/resolv.conf
mount -t proc proc /proc
mount -t sysfs sysfs /sys
pacman -Syu # upgrades...


Leaving the Chroot
Code: Select all
exit
losetup -d /dev/loop1
Remember, Arch Linux ARM is completely donation-supported, and is totally awesome.
crimsonredmk
Site Admin
 
Posts: 431
Joined: Wed Dec 30, 2009 5:17 pm
Location: #archlinux-arm on irc.freenode.net

Re: Installation in an Android Chroot

Postby sironitomas » Thu Jul 21, 2011 3:50 am

I've followed exactly your steps.

When I try to do:
Code: Select all
mount -t ext2 /dev/loop1 arch/

It says: "mount: Device or resource busy"

Why does it say that?

Regards.
sironitomas
 
Posts: 12
Joined: Sun Jul 17, 2011 3:23 am

Re: Installation in an Android Chroot

Postby bogen » Fri Jul 22, 2011 5:04 am

what is the output of mount (no arguments) ?

It is possible /dev/loop1 is already in use.

If that is the case you will need to create a different loop back device.

loop1 is actually supposed to be 7 1. loop0 - loop7 are 7 0 - 7 7

Code: Select all
mknod /dev/loop7 b 7 7


use loop7 (or whatever is free to use) rather than loop1 if loop1 was already in use.
bogen
 
Posts: 2
Joined: Fri Jul 22, 2011 4:59 am

Re: Installation in an Android Chroot

Postby sironitomas » Fri Jul 22, 2011 6:40 pm

bogen's solution did the trick. Thanks!

However, there are a few problems in the next steps.
Code: Select all
mount -o bind /dev/ /sdcard/Arch Linux ARM/dev

should be
Code: Select all
mount -o bind /dev/ /sdcard/arch/dev


Once I chroot, the $PATH is not correctly set, because the commands don't work. I have to actually type /bin/mount /usr/bin/pacman and so...

There are weird errors like: "error: command failed to execute correctly" or
Code: Select all
[root@localhost /]# /usr/bin/top
TERM environment variable not set.


An off-topic question. Why is the output of pacman so poor?
sironitomas
 
Posts: 12
Joined: Sun Jul 17, 2011 3:23 am

Re: Installation in an Android Chroot

Postby kmihelich » Fri Jul 22, 2011 7:54 pm

Define "poor."
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1067
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinux-arm

Re: Installation in an Android Chroot

Postby sironitomas » Fri Jul 22, 2011 9:27 pm

kmihelich wrote:Define "poor."


Poor compared to the Arch Linux Pacman. This one only show: "downloading [pkgname]".

There is no progression bar, nor percentage, nor installation output. Why?
sironitomas
 
Posts: 12
Joined: Sun Jul 17, 2011 3:23 am

Re: Installation in an Android Chroot

Postby kmihelich » Fri Jul 22, 2011 10:08 pm

That would most likely be in relation to the TERM environment variable not being set, from your output above. Progress bars and all that require a certain type of terminal (or emulation) to actually display. If it doesn't find something compatible, it defaults back to non-pretty mode, which is universally compatible.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1067
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinux-arm

Re: Installation in an Android Chroot

Postby sironitomas » Fri Jul 22, 2011 10:41 pm

kmihelich wrote:That would most likely be in relation to the TERM environment variable not being set, from your output above. Progress bars and all that require a certain type of terminal (or emulation) to actually display. If it doesn't find something compatible, it defaults back to non-pretty mode, which is universally compatible.


I understand. Maybe doing
Code: Select all
 source /etc/profile
could solve the problem? I can't try because I'm not at home right now.

Regards.
sironitomas
 
Posts: 12
Joined: Sun Jul 17, 2011 3:23 am

Re: Installation in an Android Chroot

Postby kmihelich » Fri Jul 22, 2011 11:07 pm

Possibly, if that sets all the required environment parameters. Remember this is only a chroot install, not an actual running copy. It's purpose is more a proof of concept.. "it can be done".. rather than as a standard. As a chroot install it's also bound to whatever limitations of the system you're chrooting from. You're essentially just running a separate root, but you retain the same kernel and devices, and it's not a full system in the same sense as our supported platforms. As such, it's not within the realm of full support from us since it's not an independently running installation on hardware we support and have worked to iron quirks out of. It's something to play with, experiment, but by no means any form of permanent solution.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1067
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinux-arm

Re: Installation in an Android Chroot

Postby sironitomas » Sat Jul 23, 2011 1:51 am

This is what I did after I chrooted:
Code: Select all
source /etc/profile
export TERM=xterm
export HOME=/root
mount /dev/pts    # in order to be able to use ssh (otherwise, "PTY allocation request failed on channel 0")


I think those are all things the arch automatically do through scripts like rc.sysinit, but since we never actually boot here, none of that ever happen.

After that, most of the things work correctly. I could run sshd, vsftpd, etc.

A more experienced user should recommend which scripts to run to simulate a boot and set everything correctly in a chroot installation (since https://wiki.archlinux.org/index.php/Chroot has no further details).

@kmihelich: I understand that, but I don't see why not to run services or even a tightvnc server to be used from a local client. This should have a little bit more support, IMHO.

Thanks.
sironitomas
 
Posts: 12
Joined: Sun Jul 17, 2011 3:23 am

Next

Return to [Please read announcement] Community-Supported Devices

Who is online

Users browsing this forum: No registered users and 2 guests