Debian on the X10

Search This thread

samaldis

Member
Apr 26, 2009
8
2
Huawei P40
ASUS ROG Phone 3
[MESSAGE TO MODS, I could not include urls so have added spaces to pass spam filter.. please change?]
Well now we finally have root on our shiny devices I decided to crack open
the beers and get to work getting debian running on the X10..
the process is actually pretty straight-forward.
(as it turns out the x10's kernel already has support for most things needed
such as the ext2 filesystem)


-- step 1--
firstly we need to create a debian image for the phone, there are a few already out there but you can use the following to create your own
Code:
apt-get install debootstrap
dd if=/dev/zero of=debian.img seek=749999999 bs=1 count=1
mke2fs -F debian.img
mkdir debian
mount -o loop debian.img debian
debootstrap --verbose --arch armel --foreign lenny debian [ht]tp:[//]ftp. de. debian. org/debian
umount debian

how ever if you would prefer to use a ready built one (recomended for less techies ;) ) you can get one from: rapidshare. com/files/161776007/debian-armel-750.img.bz2

(had to include spaces in the url to pass spam filter, could a mod please change this?)

now copy this too the root of your sdcard and make sure its called debian.img

-- step 2 --

I have created a script to do most of the other work for you:

Code:
alias b=busybox
export PATH=/data/local/bin:/usr/bin:/usr/sbin:/bin:$PATH
b mknod /dev/loop0 b 7 0
b mount -o loop,noatime /sdcard/debian.img /data/local/mnt
echo 'nameserver 4.2.2.2' >data/local/mnt/etc/resolv.conf
b chroot /data/local/mnt
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab

put this in your sdcard to.

-- step 3 --

Finally in any terminal emulator cd to the location of the startdeb.sh file
and do the following:
Code:
chmod  777 ./startdeb.sh
./startdeb.sh


!! and your done !!
you should now be within the debian system.. i suggest running
Code:
apt-get update
and installing what ever apps you want
(my first choices were gcc, python and tightvncserver)


[ EXTRA ]
now your on debian you can use
Code:
apt-get install tightvncserver
to get the xwindow system and the vnc server
now set both your HOME and USER variables
Code:
export HOME=/root
export USER=root
(or what ever user you choose)
and run
Code:
tightvncserver
(your also gonna have to download lxde and do a few other bits of setup
have a look around for X11 "Ported" to android post on these forums)
you could also change the config so that the desktop is displayed
at the right size for the screen :)
just use a vnc client from the market to connect to your GUI :D
 
Last edited:
  • Like
Reactions: 7h3d

mootmaina

Senior Member
Feb 18, 2008
196
8
Kool. I had ubuntu running on my htc touch pro once but wasnt really worth having apart from the cool factor. This looks promising.............. ill wait a while till I play around, the rooting factor is still new and I dont see the major gain to root yet.
 

j4mm3r

Senior Member
May 12, 2010
248
74
Nice work, will give this a try after I get the R2B rooted on my phone.

Next step for me would be to get the arm cross compilation toolchain and start porting goodies for the android....
 

aget1

Member
Jul 10, 2008
20
0
when i try mounting debian.img using ur cmd i got following error
Code:
Usage: mount [-r] [-w] [-o options] [-t type] device directory
seems my mount requires -t parameters, so i try again, but still having error
Code:
mount -o loop,noatime -t ext2 /sdcard/debian.img /data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy

please help thanks!
 

ddewbofh

Senior Member
Jun 9, 2009
632
1
Göteborg
when i try mounting debian.img using ur cmd i got following error
Code:
Usage: mount [-r] [-w] [-o options] [-t type] device directory
seems my mount requires -t parameters, so i try again, but still having error
Code:
mount -o loop,noatime -t ext2 /sdcard/debian.img /data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy

please help thanks!

Are you running the script as root? If you not you might wanna try that.
 

Keegan_P

Senior Member
Jun 30, 2010
144
0
Calgary
This may sound kind of noobish, but would this be a dual-boot (I.e. running both android and debian on different boots of the phone, or would this be debian, until you reset the phone to be android again.

Sent from my X10a using XDA App
 

aget1

Member
Jul 10, 2008
20
0
And I assume you're either running the script or doing those commands manually? Including the mknod part?
i run the script and found no luck, so i type in both adb and console, of coz mknod is done, either mkdir /data/local/mnt is done or not gives the same result, tried also mounting without loop,noatime and gives
Code:
mount: Block device required
would it be rooting problem or mount problem?

also tried losetup -d /dev/loop0, no luck
Code:
losetup: /dev/loop0: Device or resource busy
 
Last edited:

aget1

Member
Jul 10, 2008
20
0
This may sound kind of noobish, but would this be a dual-boot (I.e. running both android and debian on different boots of the phone, or would this be debian, until you reset the phone to be android again.

Sent from my X10a using XDA App

i see this to be a remounting of debian system on your phone, no modification on your phone so no, no dual boot
 

MrPappy86

Senior Member
Dec 13, 2008
231
4
anybody can post a video tutorial please?
and the debian and android works together or just debian?

thx
 

samaldis

Member
Apr 26, 2009
8
2
Huawei P40
ASUS ROG Phone 3
I will upload a video tutorial asap but at the moment I am having to use a 3G dongle for my internet (just moved out, am poor.. all donations to [email protected] on paypal ;-)) also this runs along side (or on top of) android so you'll still be able to get your texts and calls.. finally there are already a lot of debian apps compiled for ARM systems so have a look to see if the app you want is on apt (make sure you've run apt-get update first) please pm me if you have any problems :)
Thanks,
Sam Aldis
 

alx5962

Senior Member
Jun 5, 2007
247
109
Lille
www.pixel-emotion.fr
I tried to run it on the latest firmware and it seems loop device kernel module is not available in it.

Also the script is not fully functional :
you need to 'mkdir /data/local/mnt/'
also it's '/data/local' instead of 'data/local'

I haven't spend much time on this, so it's not working for now on my phone.
So help is welcome :)
 

aget1

Member
Jul 10, 2008
20
0
sorry for stupid me, i don't know i can create loop device more than loop 0
i create loop0,loop1,loop2,loop7 and try mounting again, it success this time
so here is my script:
Code:
#!/system/bin/bash
export PATH=/data/local/bin:/usr/bin:/usr/sbin:/bin:$PATH
if [ ! -d /data/local/mnt ]
  then
	mkdir /data/local/mnt
fi

if [ ! -b /dev/loop2 ]
  then
  	mknod /dev/loop0 b 7 0
	mknod /dev/loop1 b 7 0
	mknod /dev/loop2 b 7 0
	mknod /dev/loop7 b 7 0
fi

if [ ! -d /data/local/mnt/bin ]
  then
	mount -o loop,noatime /sdcard/debian.img /data/local/mnt
fi
echo "nameserver 4.2.2.2" >data/local/mnt/etc/resolv.conf
chroot /data/local/mnt
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab

Edited:
I just brick my device after some more work, every command even ls do no output, reboot machine freezes at sony ericsson logo, now i am re rooting the device......

Edited 2:
Should be not the problem of debian, seems working fine.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    [MESSAGE TO MODS, I could not include urls so have added spaces to pass spam filter.. please change?]
    Well now we finally have root on our shiny devices I decided to crack open
    the beers and get to work getting debian running on the X10..
    the process is actually pretty straight-forward.
    (as it turns out the x10's kernel already has support for most things needed
    such as the ext2 filesystem)


    -- step 1--
    firstly we need to create a debian image for the phone, there are a few already out there but you can use the following to create your own
    Code:
    apt-get install debootstrap
    dd if=/dev/zero of=debian.img seek=749999999 bs=1 count=1
    mke2fs -F debian.img
    mkdir debian
    mount -o loop debian.img debian
    debootstrap --verbose --arch armel --foreign lenny debian [ht]tp:[//]ftp. de. debian. org/debian
    umount debian

    how ever if you would prefer to use a ready built one (recomended for less techies ;) ) you can get one from: rapidshare. com/files/161776007/debian-armel-750.img.bz2

    (had to include spaces in the url to pass spam filter, could a mod please change this?)

    now copy this too the root of your sdcard and make sure its called debian.img

    -- step 2 --

    I have created a script to do most of the other work for you:

    Code:
    alias b=busybox
    export PATH=/data/local/bin:/usr/bin:/usr/sbin:/bin:$PATH
    b mknod /dev/loop0 b 7 0
    b mount -o loop,noatime /sdcard/debian.img /data/local/mnt
    echo 'nameserver 4.2.2.2' >data/local/mnt/etc/resolv.conf
    b chroot /data/local/mnt
    mount -t devpts devpts /dev/pts
    mount -t proc proc /proc
    mount -t sysfs sysfs /sys
    rm -f /etc/mtab
    ln -s /proc/mounts /etc/mtab

    put this in your sdcard to.

    -- step 3 --

    Finally in any terminal emulator cd to the location of the startdeb.sh file
    and do the following:
    Code:
    chmod  777 ./startdeb.sh
    ./startdeb.sh


    !! and your done !!
    you should now be within the debian system.. i suggest running
    Code:
    apt-get update
    and installing what ever apps you want
    (my first choices were gcc, python and tightvncserver)


    [ EXTRA ]
    now your on debian you can use
    Code:
    apt-get install tightvncserver
    to get the xwindow system and the vnc server
    now set both your HOME and USER variables
    Code:
    export HOME=/root
    export USER=root
    (or what ever user you choose)
    and run
    Code:
    tightvncserver
    (your also gonna have to download lxde and do a few other bits of setup
    have a look around for X11 "Ported" to android post on these forums)
    you could also change the config so that the desktop is displayed
    at the right size for the screen :)
    just use a vnc client from the market to connect to your GUI :D