yashsingh1/xdaforums huggingface dataset:
[Defy Android Development] f4lkon:
Hehe yes i did so the problem must be somewhere else.

EDIT: Its working now. I flashed 3.4.2-155-2. The installation with Debondroid was not possible but this time i could mount debian.img and log in with vnc. So the problem must be related to the tar archiv handling.
[Defy Android Development] xdaid:
The new installer is ready. No more tar/bz2, the image is now into a zip file.

Also the app has been modified, no more calls to "busybox tar ...", but pure java code to perform the installation.

Now it should work with all the Defy's ROMs.
[Defy Android Development] linel90:
it seems that i cant download the installer..

EDIT: NVRM i had to open the link in a new tab for some reason and it worked.
[Defy Android Development] silvagroup:
Not doing this on Defy but Bravo which is a Defy w/o flash and extra search button, tried this and I too get vnc connection failure.

Install did not work, so I did a copy of img from pc.

I put the image in /sdcard/data/local/debian, if I read correctly that's where it belongs.

androidVNC launches but no vnc connection.

Also install does not see zip file maybe new app is not out yet.

Is this the simplified version of this http://www.mayrhofer.eu.org/debian-on-android.
[Defy Android Development] xdaid:
The image must be in /sdcard_root/debian/, typically /sdcard/debian or /mnt/sdcard/debian/

it should be: /sdcard/debian/debian.img

The installer wont work if you put the image in /sdcard/data/local/debian

No, it's not. Interesting stuff but i've never seen that page before. Part of the installer is based, instead, on the cocus tutorial that you can find here in xda-developers.
[Defy Android Development] Zorge.R:
downloaded, installed, but after press "boot debian" and try to connect, conection refused.

and no any mounted to /data/local/debian
[Defy Android Development] silvagroup:
FYI - Still no success.

App wont recognise zip, but if i download zip and unzip and place in /sdcard/debian, app still looking for download and will not allow boot debian.

If I do download from app once download finished never installs debian app says it is but after 24 hours still not installed.

When I place img file in folder I can remove it with app, remove works, or I have the option to stop debian if I select stop it just goes on forever, probably because debian is not running.

Thanks.
[Defy Android Development] xdaid:
@ Zorge and silvagroup

Are you on Froyo or Eclair?

Which ROM is yours exactly?

I repeated the process many times, download - install - boot, at the end i can log into debian without any problem.

I'm wondering whether the ROM running in your phone is able to mount ext3 devices or not, otherwise i have no clue :confused:
[Defy Android Development] Zorge.R:
@xdaid, Froyo PL.

ext3 mounting unsuccess. from terminal to.

which rom i need, to mount ext3?

-------

yep, it's downloaded correctly and unzipped.

btw, added in first post md5sum of zip and img file, i think it's will be useful.
[Defy Android Development] Zorge.R:
-- deleted
[Defy Android Development] silvagroup:
Running stock rom 2.1-update1

Assuming (and we know what happens when one assumes) that the zip and bz are the created img following the chrooting process in cocus tutorial?
[Defy Android Development] silvagroup:
Running stock rom 2.1-update1
[Defy Android Development] xdaid:
Actually, there are many differences from this installer and the method described by cocus, although i took several stuff from there. The app (installer) does not use scripts or extra files (vnc, xstartup), and does not use terminal, i made a class which deals with the linux shell with no user interface. But, you can reproduce what the app does when you click "boot debian" by entering the lines below in the terminal.

mkdir /data/local/debian

* Just in the case the folder in /data/local/ still not exists.

mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system
export bin=/system/bin
export img=SDPATH/debian/debian.img
export mnt=/data/local/debian
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/block/loop5 b 7 0
busybox losetup /dev/block/loop5 $img
busybox mount -t ext3 -o noatime,nodiratime /dev/block/loop5 $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 "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
busybox mount --bind SDPATH $mnt/sdcard
busybox chroot $mnt /bin/bash
if ps -Al | grep vnc > /dev/null
then
echo "vnc detected"
else
export USER=root
rm -r /tmp
mkdir /tmp
vncserver -geometry 854x480
fi
exit
mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system"
console sleep 15000
console close

* the last two lines are not available in the terminal, they're directed to the console class itself. So, instead, wait 15 seconds and close the terminal. At this point connect via vnc.

And, the lines below to do with terminal the stuff the app does when you click "quit debian"

mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system
export PATH=/system/bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox chroot /data/local/debian /bin/bash
if ps -Al | grep vnc > /dev/null
then
vncserver -kill :1
else
echo "vnc not detected"
fi
exit
busybox umount /data/local/debian/sdcard
busybox sysctl -w net.ipv4.ip_forward=0
busybox umount /data/local/debian/dev/pts
busybox umount /data/local/debian/proc
busybox umount /data/local/debian/sys
busybox fuser -km /data/local/debian
console sleep 5000
busybox fuser -km /data/local/debian
console sleep 5000
busybox umount /data/local/debian
busybox losetup -d /dev/block/loop5
mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system

If you have patience enough you can place the .img in /sdcard/debian/ and then try those commands from terminal. Also you could discover where exactly the problem is.

EDIT: SDPATH = /sdcard or /mnt/sdcard

EDIT2: you need root, so first of all type "su"
[Defy Android Development] BravoMotorola:
Hmm, should I still be patient? My phone has been "installing debian" for about 15 minutes...is that regular?
[Defy Android Development] BravoMotorola:
NVM, works GREAT on the Atrix! Great job! I will now start a new thread on the Atrix forums and tell them of the news!

Thanks!
[Defy Android Development] designgears:
Confirmed, works on the Atrix 4G!
[Defy Android Development] silvagroup:
Thanks xdaid for the write up.

There are obviously many ways to do this but I REALLY like the user interface you have here.

I have the app working with the img copied to the sdcard but still get vnc connect failure so I am going to go through it step by step to see where the problem is.

Thanks will post findings.
[Defy Android Development] silvagroup:
Problem

# mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system
# export bin=/system/bin
# export img=SDPATH/debian/debian.img
# export mnt=/data/local/debian
# export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
# export TERM=linux
# export HOME=/root
# busybox mknod /dev/block/loop5 b 7 0
mknod: /dev/block/loop5: File exists
# busybox losetup /dev/block/loop5 $img
losetup: /dev/block/loop5: No such file or directory
[Defy Android Development] busyant:
still not work for me

Hi, xdaid, I have installed the new apk, and put the unziped debian.img to /sdcard/debian. but failed to "boot debian" from the apk.

So I'm trying to manually start it up with your posted commands, but it still not work for me:

seems so many processes locking the loop5 device.

Below are a part of them:

I tried to use "busybox fuser -km /data/local/debian", but the phone shutdown immediately.

My system is Defy Chinese version (android 2.2).

Any suggestion?
[Defy Android Development] J_abba:
My installation seems to fail I gave it enough time to install but it just froze and when booting I can't connect as it fails.
[Defy Android Development] xdaid:
Nice to know! never expected that was working on Atrix :)

So, it looks like some people had troubles due to the mount of loopback device fails. Could it be the loop5 was already busy by another process, before the "boot debian" button was pressed?

Well, i could modify the app to make it mount the loop device in a different way. Btw, busyant, try to replace that line with:

mount -t ext3 -o loop,noatime,nodiratime $img $mnt

* where $img is /sdcard/debian/debian.img (or /mnt/sdcard/debian/debian.img) and $mnt is /data/local/debian

This make no use of loop5, on the other hand, it'll be a bit harder to kill the debian processes once done.
[Defy Android Development] silvagroup:
If mount -t ext3 -o loop,noatime,nodiratime $img $mnt makes it hard to kill the

deb process with the app how about using a free loop device,

busybox losetup -a shows that on my device loop0 is free, cant get a list of loop devices w/busybox but busyant did using bash (have to get that into my device will be googling right after this).

You could look for next free loop device and pass that on as the loop device to use.

I am going to try it with loop0 and see what happens.:eek:
[Defy Android Development] silvagroup:
Too many things going on haven't move on yet but question:

How does android handle the loop devices if I do

busybox ls /dev/loop*
ls: /dev/loop*: No such file or directory

If I do df of course I get a very long list but still no loop devices.

And mount

# mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mmcblk1p21 /system ext3 rw,data=ordered 0 0
/dev/block/mmcblk1p25 /data ext3 rw,nosuid,nodev,errors=continue,data=ordered 0 0
/dev/block/mmcblk1p24 /cache ext3 rw,nosuid,nodev,errors=continue,data=ordered 0 0
tmpfs /tmp tmpfs rw,size=2048k 0 0
/dev/block/mmcblk1p7 /pds ext3 rw,nosuid,nodev,data=ordered 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

Just curious why loop5 is busy, would be nice to see what loop devices are being used and for what.
[Defy Android Development] silvagroup:
Cant seem to do anything with loop devices, tried using mknod /dev/block/loop0 b 7 0 since losetup -f shows it as next available and then I get File Exists so tried to set it up as $img and it says /dev/block/loop0: No such device or address.

Tried loop8 no messages, tried settting $img to loop8 :No such device or address.

Frustrating to say the least.

Any suggestions?
[Defy Android Development] xdaid:
Try this out:

DebOnDroid-loopfix

Unzip, install this modified apk (uninstall the previous one first). Don't worry, you don't need to download another debian.img, just use the one you have.
[Defy Android Development] busyant:
Succeed with these commands, just commented out loopback devices commands:

then connected vnc with androidVNC, and also succeeded connect from my laptop via wifi. see attached file is screenshot.

Then lunch the apk, click "quit debian", everything went back.

Great job Xdaid!
[Defy Android Development] busyant:
BTW, xdaid, the newest loopfix apk still not work for me, so I manually start debian with adb shell.

I will use script manager to run these commands in script file.

Thank you xdaid again!
[Defy Android Development] busyant:
Again.

I found if I mount the img with -o loop option(without losetup steps), the system mount the device /dev/loop25 on /data/local/debian.
[Defy Android Development] xdaid:
@busyant and silvagroup

Could you try this please?

Once you boot debian with the apk loopfix version, wait 5-10 seconds before clicking "Connect" on vnc.

Tested on China 0.26 too, if i boot and immediately click "Connect", sometimes it fails. If i wait a bit (just the time to let some debian stuff load) then it's ok.

But first of all, reboot the phone.

Let me know, thanks
[Defy Android Development] silvagroup:
Turned off phone, took out the battery started up again waited for the phone to get 3G connection then started DbeOnDroid-loopfix.apk waited one minute still get VNC cnnection failed.

Will try downloading everything again later this evening just to make sure there nothing wrong there.

If that doesn't work will try using step by step and replacing loop device to see if I can get through the whole process.
[Defy Android Development] texasice:
here's another mirror for ya

http://dogsr.us/debian-img.zip
[Defy Android Development] xdaid:
Thank you!

i will add that link to the first post
[Defy Android Development] busyant:
Sorry, I have forgotten my phone in home today, and I'm in 20 days vacation since tomorrow.

but anyway I will try again if I'm free.

If I recall correct, I have tried few times click [boot debian], the VNC started automatically and failed, then I turn back to apk, I noticed the "booting debian" tips is still rotating, but when it's done, the 'boot debian' highlight/click-able again.

--------------

BTW, who knows how to run a script by a widget or a GUI software? I have tried "script manager" and Gscript, both are not work correctly. the former shows the script is alway running, and cannot be killed, the later one needs write all commands in one line, separate by semicolon , such a fool!!!
[Defy Android Development] silvagroup:
Well running step by step and problem again:

# mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system
# export bin=/system/bin
# export img=/sdcard/debian/debian.img
# export mnt=/data/local/debian
# export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
# export TERM=linux
# export HOME=/root
# busybox mount -t ext3 -o loop,noatime,nodiratime $img $mnt
mount: mounting /dev/loop0 on /data/local/debian failed: Invalid argument

this thing doesn't want anything to do with loop devices it seems.
[Defy Android Development] HEADEKBATEH:
Hello,

I have been trying to install this debian, but it keep give me "VNC connection failed!". I have tried the new apk with loopfix but is the same.

So far I have try to download debina.img to my computer and then put it in the SD card, try to download it via wifi but is the same.

Please if someone have this issue and know how to fix it let me know ;)

Thank you in advance.
[Defy Android Development] silvagroup:
HEADEKBATEH its a work in progress, best thing is read prior post to see what is transpiring and post with as much info as possible, it's getting there, so hang in there.

Some how not sure got past mount ext3 to run into this:

# busybox mount -t ext3 -o loop,noatime,nodiratime $img $mnt
/dev/block/mmcblk1p21 on /system type ext3 (rw,data=ordered)
/dev/block/mmcblk1p25 on /data type ext3 (rw,nosuid,nodev,errors=continue,data=ordered)
/dev/block/mmcblk1p24 on /cache type ext3 (rw,nosuid,nodev,errors=continue,data=ordered)
/dev/block/mmcblk1p7 on /pds type ext3 (rw,nosuid,nodev,data=ordered)
# busybox mount -t devpts devpts $mnt/dev/pts
mount: mounting devpts on /dev/pts failed: Device or resource busy
# busybox mount -t devpts devpts $mnt/dev/pts
mount: mounting devpts on /dev/pts failed: Device or resource busy

Any suggestions? And thank you all for the fabulous effort and help !!!!!!!!!!!!!

mount gives me this:

# mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mmcblk1p21 /system ext3 rw,data=ordered 0 0
/dev/block/mmcblk1p25 /data ext3 rw,nosuid,nodev,errors=continue,data=ordered 0 0
/dev/block/mmcblk1p24 /cache ext3 rw,nosuid,nodev,errors=continue,data=ordered 0 0
tmpfs /tmp tmpfs rw,size=2048k 0 0
/dev/block/mmcblk1p7 /pds ext3 rw,nosuid,nodev,data=ordered 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
[Defy Android Development] xdaid:
Look at the red line.

Well, make sure the folder /debian/local/debian exists, then try:

"mount -t ext3 -o loop,noatime,nodiratime $img"

without "busybox".

That's quite crazy i know, no much sense, but i got it working in this way, at that point busybox just fails .
[Defy Android Development] xdaid:
@ the other guys who get vnc failure:

as silvagroup said, work in progress.

Actually i have no issue, i can boot debian every time, but it looks like some Defy ROMs have troubles in mounting loopback devices in the way i did.

The debian.img will not change (you won't need to download it again), i will try some other fix for the installer.
[Defy Android Development] Djazin:
Cool, will keep an eye out, though quick question whats the installation directory debain installs to on the device wanna try wiping it completely see if that helps me any will post results?
[Defy Android Development] xdaid:
/data/local/debian

This folder is used as mounting point for debian image.

But, once you quit debian (or debian is not running), you should see just an empty folder since no data is left on main storage, all goes within the image.

Instead, if debian is booted you can access that folder and see the filesystem directories (bin, usr, etc..). Actually what you see is the image content.
[Defy Android Development] silvagroup:
Tried mount w/o busybox still saying device busy.

I will be extremely busy for the next few days, so don't think I have dropped out, I am still committed to getting this working, I will hot and heavy on it again by Monday.

xdaid my unit is a Bravo, could be that although they are essentially the same unit that Moto has something else going on in the Bravo that is causing some of the problems. From what I can see Defy is a non US version and has a flash and search button on face plate.

Question:

to others having problems, are you using a Defy or another phone????
[Defy Android Development] Zorge.R:
@xdaid, what ROM do You use?
[Defy Android Development] xdaid:
Firstly i used Eclair 2.21, afterwards a Froyo China 0.26 heavily deblurred by me. DebOnDroid was mainly tested on that rom, the 0.26 one.

But now, i went for barebones 1.2 (btw, great rom), flashed yesterday, DebOnDroid does not work with this rom!

So, there's some rom-dependent issue here, now i'm trying to get it working, hopefully if i succeed with the installer on this new rom i'll be able to apply the proper fix to the app.
[Defy Android Development] xdaid:
Ok, suceeded with barebones 1.2 (Froyo CEE 3.4.2-155) now testing on Froyo Finnland and then, if all goes, i will upload the new apk.
[Defy Android Development] silvagroup:
Ok finally back !!!

Looks like we are waiting for a new apk ? Or is it ready for download ?
[Defy Android Development] xdaid:
The apk is new.

It has been successfully tested on three froyo roms, so, it should work... unless i got a different kind of Defy than the others :eek:

Let me how it goes on your Bravo, thanks
[Defy Android Development] silvagroup:
Unfortunately it's the same thing "VNC connection failed".

I believe there is a major rom difference between the Defy and Bravo.

I have a problem doing ANY kind of loop device so not sure what if the new apk is still using loop devices.

I am assuming (I know bad thing) that the img is one created using cocus process so I am going to try that process from after image creation to see if I have any success at all with this.:(

Will report back findings.
[Defy Android Development] kirpeace:
i am getting vnc connection failed
[Defy Android Development] insestito:
VNC conection failed...

vv
[Defy Android Development] silvagroup:
The problem, at least from my BrokeO (bravo) is thus;

my bootdeb script:

mount -o remount,rw -t yaffs2 /dev/block/mmcblk1p21 /system
echo "Setting up paths.."
export bin=/system/bin
export img=/mnt/sdcard/debian/debian.img
export mnt=/data/local/debian
export OLDPATH=$PATH
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
echo "Mounting Linux image.."
busybox mount -t ext3 -o loop /sdcard/debian/debian.img /data/local/debian
busybox mount -t devpts devpts $mnt/dev/pts
busybox mount -t proc proc $mnt/proc
busybox mount -t sysfs sysfs $mnt/sys
echo "Setting up network.."
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" > $mnt/etc/hosts
echo "Mounting sdcard.."
busybox mount --bind /mnt/sdcard/ $mnt/mnt/sdcard
echo "Launching debian.."
echo " "
echo "------------------------------"
echo " Make sure to exit properly"
echo " Type EXIT to close session"
echo "------------------------------"
echo " "
busybox chroot $mnt /bin/bash
echo " "
echo "Shutting down.."
busybox umount $mnt/mnt/sdcard
busybox sysctl -w net.ipv4.ip_forward=0
busybox umount $mnt/dev/pts
busybox umount $mnt/proc
busybox umount $mnt/sys
busybox umount $mnt
busybox losetup -d /dev/block/loop5
export PATH=$OLDPATH
mount -o remount,ro -t yaffs2 /dev/block/mmcblk1p21 /system

My terminal output:

Setting up paths..
Mounting Linux image..
[COLOR="Red"]mount: mounting /dev/loop0 on /data/local/debian failed: Invalid argument[/COLOR]
mount: mounting devpts on /data/local/debian/dev/pts failed: No such file or directory
mount: mounting proc on /data/local/debian/proc failed: No such file or directory
mount: mounting sysfs on /data/local/debian/sys failed: No such file or directory
Setting up network..
net.ipv4.ip_forward = 1
bootdeb_new: cannot create /data/local/debian/etc/resolv.conf: directory nonexistent
bootdeb_new: cannot create /data/local/debian/etc/resolv.conf: directory nonexistent
bootdeb_new: cannot create /data/local/debian/etc/hosts: directory nonexistent
Mounting sdcard..
mount: mounting /mnt/sdcard/ on /data/local/debian/mnt/sdcard failed: No such file or directory
Launching debian..

------------------------------
Make sure to exit properly
Type EXIT to close session
------------------------------

chroot: can't execute '/bin/bash': No such file or directory

Shutting down..
umount: can't umount /data/local/debian/mnt/sdcard: No such file or directory
net.ipv4.ip_forward = 0
umount: can't umount /data/local/debian/dev/pts: No such file or directory
umount: can't umount /data/local/debian/proc: No such file or directory
umount: can't umount /data/local/debian/sys: No such file or directory
umount: can't umount /data/local/debian: Invalid argument
losetup: /dev/block/loop5: No such device or address

It's still all about loop devices, mounting loop undeclared finds first available loop which is loop0 but why is it calling mount loop0 an invalid argument ?

That's where it's booming out here.
[Defy Android Development] silvagroup:
Have tried several variations of the mount command for loop with same results, I believe that either Motorola or AT&T are doing some bs on the os.:mad:
[Defy Android Development] xdaid:
Hi there

Back to working on DebOnDroid, again lol.

I'd like to make it working for the people who can't use it now.. but i have no clue of what actually fails... is there any different setup in my phone? i can't locate the problem easily cause it just works for me.

But, let's see what i can do..

P.S. @ insestito, kirpeace: did you provide password/address/port to connect?
[Defy Android Development] insestito:
Yes, Password, adress and port...

And error...
[Defy Android Development] kirpeace:
me too. can it be done that if vnc does not connect debian need not be closed. otherwise i have to close debian everytime eventhough vnc does not connect
[Defy Android Development] silvagroup:
for everone getting vnc failue what rom version are you running and are you trying step by step process so we can see if we are all getting stuck on mount: mounting /dev/loop0 on /data/local/debian failed: Invalid argument
[Defy Android Development] silvagroup:
Been very busy lately but in free time have been trying to resolve this but haven't had much success in figuring this one out. Even googling hasn't been very helpful.