We have 245 guests online

Fanatics Login

Content Feeds

  • Team Blog RSS Feed Team Blog RSS Feed AndroidFanatic - Team Blog RSS Feed
  • Android App Reviews Android App Reviews Applications, unofficial repository, discussion and news from the world of the Android Mobile OS. Join the chat and have your say, ask questions, and buy phones and accessories.
Debian on Android installer released. (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Debian on Android installer released.
#539
malanjary (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:Debian on Android installer released. 1 Year, 7 Months ago Karma: 0  
Well the unionfs stuff is done after debian is up and running, its something I really want. It makes it so that the debian file system also includes the android fs, that way you can access all files from inside debian (ex: /sdcard folder)

In debian terminal
Code:

df
shows that the only disk space I have is the debian img (max 750mb). It just limits the usefulness of having debian. I want to at least download zips so I would really like if I could figure out how unionfs works By the way I think the modprobe solution has to be redone if android terminal shuts down. And does anyone know if a lightweight windows manager/gui would work on this? I added a swap file and wanted to try and push its limits with some apps any suggestions?



 
Report to moderator   Logged Logged  
  The topic has been locked.
#540
dangermouse (Admin)
Admin
Posts: 92
graphgraph
User Offline Click here to see the profile of this user
Re:Debian on Android installer released. 1 Year, 7 Months ago Karma: 9  
Setting up UNIONFS

Ok, so one thing that was unfortunate about all of this is that we pretty much have to make a choice: in Debian, or in Android. This is the kind of choice we really shouldn't have to make, especially given that the two systems pretty much don't overlap. This is where unionfs comes in.

Note that all commands from here on are being executed outside of the Debian chroot we entered earlier, so still over telnet. You can exit with exit or just open a new telnet session. You can then download these commands as a ready-made script.

To run this ready-made script you should already have exported your standard environment variables. If you have the script in your $kit, then you can run it as so with . (so you can avoid issues regarding noexec on /sdcard).

. $kit/unionfs


busybox insmod $kit/unionfs.ko mount -t unionfs -o dirs=$mnt/etc=rw:/etc=ro unionfs /etc

What this does is make /etc contain both the files from Android and the files from Debian. It also sets the system up so that if we modify any files in /etc (or create any new ones) these modifications will get stored in our Debian partition: a feature that now gives us a fully working /etc!

The next problem is that Android and Linux use different naming conventions for their dynamic linker. On Android we have /system/bin/linker, whereas on Linux we have /lib/ld-linux.so.3. This means we get file not found errors just from running valid software. This is easy enough to fix with a symlink.

mount -o remount,rw /
ln -s $mnt/lib /


At first glance this might seem dangerous, but it isn't. While we are modifying the root filesystem of the device (something we aren't supposed to be able to do), it happens to be rootfs: a special instance of the Linux ramfs filesystem. This means that any changes we make to it are undone by a simple reboot.

At this point we should be able to run most Debian programs without entering a chroot by just running the program from $mnt. Unfortunately, not everything is going to work as most of the files are in the wrong place. Let's fix that with some more symlinks.

for x in bin boot home media mnt opt selinux srv usr var do

ln -s $mnt/$x / done


This leaves only a few folders that we need to deal with. The first one is trivial: /root is empty, so we can just get rid of it and replace it with another symlink. Also, as we are now done modifying the filesystem on /, I highly recommend reprotecting this mount as files that end up here directly take up RAM (not flash) and do not get sync'd back to the Debian environment (which is confusing/wrong).

rmdir /root
ln -s $mnt/root /
mount -o remount,ro /


This leaves /sbin and /dev. The former can be handled by a simple unionfs, but the situation with /dev is actually pretty evil. It has a mount underneath it, /dev/pts, that you seemingly can't layer under a unionfs for whatever reason and expect it to still work. The fix for this is to remount it back on top after the union.

mount -t unionfs -o dirs=$mnt/sbin=rw:/sbin=ro unionfs /sbin mount -t unionfs -o dirs=$mnt/dev=rw:/dev=rw unionfs /dev mount -t devpts devpts /dev/pts


At this point we have everything setup well enough that even things like OpenSSH should work, so let's restart it in this environment.

/etc/init.d/ssh restart




 
Report to moderator   Logged Logged  
  The topic has been locked.
#549
blackwinged (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:Debian on Android installer released. 1 Year, 7 Months ago Karma: 0  
are we maybe just missing the file unionfs.ko?
afaik its not contained in the kit...

an xserver with window manager would be cool, but i think a lot can be done by console.



 
Report to moderator   Logged Logged  
  The topic has been locked.
#652
malanjary (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:Debian on Android installer released. 1 Year, 7 Months ago Karma: 0  
Ya I trieds this procedure from here (files included): http://www.saurik.com/id/10

The unionfs.sh gives errors listed in my previous post, and the mount -t part tells me that /etc does not exist. (I'm guessing it means the /data/local/mnt/etc folder)

I have the JF 1.4 version so I think this will not work do to differences in naming? I don't know enough about linux to figure it out.

I just want to access /sdcard from inside debian. Could someone explain what I need to do to get debian to see it? I'm confused on how the android termial and debian interact- is debian like a virtual machine in the android terminal?



 
Report to moderator   Logged Logged  
  The topic has been locked.
#962
blackwinged (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:Debian on Android installer released. 1 Year, 7 Months ago Karma: 0  
right now i´m at the same point like you.
I did one step but don´t know if it is useful at all:
i searched the file unionfs.ko using find -name unionfs.ko on the terminal.
then i symlinked it: cp -s (path)/unionfs.ko /data/local/unionfs.ko.
so i have unionfs.ko in the right folder, but insmod will fail because it tries to create this file.
So i commented this line out and the error was gone.

But the other errors remain : (



 
Report to moderator   Logged Logged  
  The topic has been locked.
#1433
TacticalFart (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:Debian on Android installer released. 1 Year, 6 Months ago Karma: 2  
I read somewhere that it is a good idea to wipe the phone when upgrading to RC33 (which I'm gonna do tonight), so if I do the debian install beforehand, things won't work right so I'm going to do I afterwards. In a response to a post I made elsewhere, I might need an updated unionfs.ko and ext2.ko. Are the modules from the link in the first post okay or should I wait until they are?

And two more questions.
1. If I apt-get openssh-server, would it be possible to use connectbot and connect to 127.0.0.1? This would enable copying and pasting text and commands and such. Also we could find a way to white list the MAC address that the device uses for loopback, to eliminate the possibility of the server being a hack threat.
2. If a file is downloaded in debian, can it be written to the SD card, or does it stay within the debian image?

I'm still a little new to this, but I do have a root RC30.



 
Report to moderator   Logged Logged  
  The topic has been locked.
Go to top Post Reply
get the latest posts directly to your desktop