Debian Linux one-click installer for Motorola Defy - now with lxde desktop!

xdaid

Inactive Recognized Developer
Jul 12, 2009
514
648
0
@xdaid, what ROM do You use?
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.
 

xdaid

Inactive Recognized Developer
Jul 12, 2009
514
648
0
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.
 

xdaid

Inactive Recognized Developer
Jul 12, 2009
514
648
0
Ok finally back !!!
Looks like we are waiting for a new apk ? Or is it ready for download ?
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
 

silvagroup

Senior Member
Jan 7, 2011
450
54
58
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.
 

silvagroup

Senior Member
Jan 7, 2011
450
54
58
The problem, at least from my BrokeO (bravo) is thus;
my bootdeb script:
Code:
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:

Code:
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.
 

silvagroup

Senior Member
Jan 7, 2011
450
54
58
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:
 

xdaid

Inactive Recognized Developer
Jul 12, 2009
514
648
0
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?
 

kirpeace

Senior Member
Dec 26, 2010
581
39
0
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
 

silvagroup

Senior Member
Jan 7, 2011
450
54
58
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
 

silvagroup

Senior Member
Jan 7, 2011
450
54
58
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.
 

donb123

Senior Member
Jan 3, 2011
130
17
0
no workie

So I just got my shiny new 16gb SDHC class 10 just for this and can't get it to work either. I was going to hack around in the bootdeb to see if I could isolate where it's going wrong, e.g. mounting like it seems to be for others, but I cannot find bootdeb anywhere.

Edit.. the updated apk link is broken also
edit2.. I can confirm that /dev/loop does not exist on my ROM. I create it and the script still doesn't run.. however, if I manually fire off the script commands in a shell from adb it works. I just successfully ran apt-get update

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.."
 
Last edited:

donb123

Senior Member
Jan 3, 2011
130
17
0
So if you add mkdir /dev/loop to the script you should be good to go. The problem I have now is that I cannot find, anywhere, this bootdeb and I was just copy/pasting parts of what I've found thus far. I don't see where it's firing off any init in the chroot'ed environment or launching X or anything. That's where I'm stumped now.
 

xdaid

Inactive Recognized Developer
Jul 12, 2009
514
648
0
So if you add mkdir /dev/loop to the script you should be good to go. The problem I have now is that I cannot find, anywhere, this bootdeb and I was just copy/pasting parts of what I've found thus far. I don't see where it's firing off any init in the chroot'ed environment or launching X or anything. That's where I'm stumped now.
Actually the bootdeb script does not exist in this version. An earlier version was script-based, but now the commands are performed through java code.

I should resume that old version but i'm afraid i deleted the sources..
 

donb123

Senior Member
Jan 3, 2011
130
17
0
Lol.. well I get further along than the java one apparently. Never the less, if you're trying to mount via loop and the device folder doesn't exist in the ROM you'll have the same problem. Perhaps that's where you should look for those of us where it won't work.
 

xdaid

Inactive Recognized Developer
Jul 12, 2009
514
648
0
String[] cmd =
{
"mkdir /data/local/debian",
"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",
"mount -t ext3 -o loop,noatime,nodiratime $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 mount --bind " + sdpath + " $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\" > $mnt/etc/hosts",
"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",
};

These are executed by the program in order to boot the debian image in /sdcard/debian/ (or /mnt/sdcard/debian)
 
  • Like
Reactions: donb123

donb123

Senior Member
Jan 3, 2011
130
17
0
I can say that the none of these worked on my ROM
"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",
"mount -t ext3 -o loop,noatime,nodiratime $img $mnt",

Below worked from adb shell. The two mkdir statements I needed to add for my ROM (jboogie orange) are in UPPERCASE BELOW.

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
MKDIR /DEV/LOOP
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.."
MKDIR /DATA/LOCAL/DEBIAN/MNT/SDCARD
busybox mount --bind /mnt/sdcard/ $mnt/mnt/sdcard
echo "Launching debian.."
export USER=root
busybox chroot $mnt /bin/bash
vncserver -geometry 854x480

So I've found an application- gscript- that will let me save the above as a shell script and run it. I just have to figure how to properly launch vncserver and export USER=root in the chroot environment. After vncserver is launched then I run the VNC client and connect into it.
 
Last edited:
  • Like
Reactions: xdaid