Installing Debian + Gnome, KDE, IceWM or LXDE Desktop on your rooted G1!

Search This thread

Faud

Senior Member
Jan 11, 2009
58
0
to domenukk:

Ive been able to install this on your rom the old way. It shouldnt present any problems. Once you extract everything to /sdcard/debian just chmod and then sh installer.sh then run sh bootdeb
 

ChrisDos

Senior Member
Sep 5, 2009
336
85
Denver
Google Pixel 6 Pro
How to put Debian on it's own partition

It looks like Cyanogenmod 4.2.15.1 has problems with mounting loop devices. Since I'm a long time Linux and Debian user (since '93), I wanted to get Debian and X11 working.

I should mention that these instructions are not for neophytes but for advanced Linux users.

So I made some changes to my phone and the Debian install to get this to work:

I have 4 partitions on my Class 6 8GB micro sdhc card now:
Part 1: 5GB FAT32 - For the /sdcard mount
Part 2: 512MB Ext4 - For apps2sd
Part 3: 512MB Swap (I can't stress enough how much this has improved the response and usability of my phone)
Part 4: 2GB Ext4 - For Debian

I used my laptop running Linux to copy the files from the debian.img loopback file to the partition. You could probably use a Linux LiveCD such as Knoppix, SysRescCD, or Finnix if you don't have access to a Linux machine.

I copied the debian.img file to /tmp/
mkdir /tmp/debloop
mkdir /tmp/debpart
mount -o loop /tmp/debian.img /tmp/debloop
mount /dev/mmcblk0p4 /tmp/debpart
rsync -av --progress /tmp/debloop/* /tmp/debpart/
umount /tmp/debloop
umount /tmp/debpart

I updated the installer.sh file to use the partition instead of the loop device:

# New installer.sh
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3;
echo "Filesytem remounted as read/write";
rm /system/bin/fsrw;
rm /system/bin/bootdeb;
rm /system/bin/unionfs;
rm /system/bin/installer.sh;
rm /system/bin/mountonly;
echo "Removed old Installation Files"
sleep 1;
mkdir /data/local/mnt;
echo "Made /data/local/mnt";
sleep 1;
cp /sdcard/debian/fsrw /system/bin;
cp /sdcard/debian/bootdeb /system/bin;
cp /sdcard/debian/unionfs /system/bin;
cp /sdcard/debian/installer.sh /system/bin;
cp /sdcard/debian/mountonly /system/bin;
echo "Copied new Installation Files";
echo " ";
echo "VERSION 2.2";
echo "Custom Debian Bootloader is now installed!";
echo "This process does NO damage to your Android OS!";
echo " ";
echo "Courtesy of http://www.myhangoutonline.com";
echo "Installer by WhiteMonster84";
echo " ";
echo "To enter the Debian Linux console just type 'sh bootdeb'";
echo "PS: Be sure to run 'sh /scripts/onetime.sh' as root from the shell after your FIRST 'boot'.";


Here is the updated bootdeb:

# Based on Saurik's remount.sh - modified by WhiteMonster84 of http://www.myhangoutonline.com
# Email whitemonster84@gmail.com

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3;
echo "Android Filesytem remounted as read/write"

export bin=/system/bin;
export mnt=/data/local/mnt;
echo "Exported Path set #1"

export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH;
export TERM=linux;
export HOME=/root;
echo "Exported Path set #2"


echo " "
echo " a888a "
echo " d888888b "
echo " 8P YP Y88 "
echo " 8|o||o|88 "
echo " 8. .88 "
echo " 8 ._. Y8. "
echo " d/ 8b. "
echo " .dP . Y8b. "
echo " d8: ::88b. "
echo " d8 Y88b "
echo " :8P :888 "
echo " 8a. : _a88P "
echo " ._/ Yaa_ : .| 88P| "
echo " \ YP | 8P \. "
echo " / \._____.d| .| "
echo " --..__)888888P ._.|"
echo " "
echo " THE PENGUIN IS ALIVE "

mount /dev/block/mmcblk0p4 $mnt;

mount -t devpts devpts $mnt/dev/pts;

mount -t proc proc $mnt/proc;

mount -t sysfs sysfs $mnt/sys;

echo "Custom Linux Pseudo Bootstrapper V2.2 - by WhiteMonster84"
echo "WEB: http://www.myhangoutonline.com"
echo " "
sleep 1
echo "Starting init process"
sleep 1
echo "INIT: Debian booting....."
sleep 1
echo "Running Linux Kernel"
sysctl -w net.ipv4.ip_forward=1;
sleep 1
echo "AutoMounter started"
sleep 1
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean kill of Debian!"
echo " "
sleep 1
chroot $mnt /bin/bash;



After you run /scripts/onetime.sh (Choose a good password, you don't want to get rooted when the ssh daemon is running) once logging in for the first time, you might want to change your /etc/apt/sources.list to:
deb http://ftp.us.debian.org/debian lenny main contrib non-free
deb http://security.debian.org/ lenny/updates main contrib non-free

I modified /root/.bashrc to the following:
# ~/.bashrc: executed by bash(1) for non-login shells.
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/bin"
export SHELL=/bin/bash
hostname yourhostname

export PS1='\h:\w\$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
export USER=root


You should now probably update the phone and install some apps. But you might want to do this from a ssh shell first.
So run: /etc/init.d/ssh start
Look up your ip address with: ifconfig
ssh to your phone (Windows users can use putty)
Now update your phone:
apt-get update
apt-get -u upgrade
apt-get install vim lxde tightvncserver locales tsclient pptp-linux

Locales might still be broken, so choose your locale by running:
dpkg-reconfigure locales

I set up a init file that I run after logging each time called myinit.sh that I placed in /root/bin/

#!/bin/bash
rm -fr /tmp
mkdir /tmp
chmod 777 /tmp
/usr/local/bin/vncstart
/etc/init.d/ssh start

I created a vncstart script at /usr/local/bin:
#!/bin/bash
vncserver -kill :0
sleep 2
kill -9 $(ps ax | grep vnc | grep -v grep | grep -v vncstart | awk {'print $1'})
sleep 2
rm -fr /tmp/.X0-lock /tmp/.X11-unix/X0
vncserver :0 -geometry 1024x768

Note that I made the vncserver screen larger than the display of the phone. I primarily use the Debian to run security tools and to take control of other servers. The tiny 320x480 screen isn't enough. The open source android-vnc has excellent scaling and panning.

I'm also running PPTP connection from the command line inside of Debian just fine. If there is enough interest, I'll post instructions on how to do that.

So I know have Debian running on my phone. Everything runs great and the Android system still responds perfectly fine with the large swap file. I think you could drop the swap file down to 256MB though without any issues. Iceweasel (firefox) is very slow though. I guess I'll just have to wait for the mobile version.
 

CrazyEye

Senior Member
Jul 30, 2009
267
1
Vegas, Nevada
I can't chmod the files

Code:
chmod 4755 *

Operation not Permitted

I have root, and put in su, permission denied..
:confused::confused::confused:


Code:
su chmod 4755 *

Permission denied.
 
Last edited:

clvv

New member
Feb 27, 2010
2
0
Beijing
en.wei23.net
Tried LXDE via VNC on my G1, and found it SUPER slow and unresponsive. But what is the point of using a DE on G1 anyways? A full functioning debian terminal on G1 via Connect Bot is just AWESOME!! with all those packages available thru apt, especially GCC, Vim, Python, Ruby and etc. :)
 

Faud

Senior Member
Jan 11, 2009
58
0
What partition type?

Unless it's Ext*, then forget it. Fat* doesn't suppose mode changing. Just ignore the error.

You should be able to ignore the errors and just continue on. After you run the script it may seem like nothing happens then exit and you it should tell you to use bootdeb
 

sic08869

Member
Apr 22, 2009
33
0
I just used this method to install on CM5 test 2 and it is running fast, smooth and without issue. I wanted to thank you for the walkthrough and time spent. All other forms of installation were failing miserable for me.

It looks like Cyanogenmod 4.2.15.1 has problems with mounting loop devices. Since I'm a long time Linux and Debian user (since '93), I wanted to get Debian and X11 working.

I should mention that these instructions are not for neophytes but for advanced Linux users.

So I made some changes to my phone and the Debian install to get this to work:

I have 4 partitions on my Class 6 8GB micro sdhc card now:
Part 1: 5GB FAT32 - For the /sdcard mount
Part 2: 512MB Ext4 - For apps2sd
Part 3: 512MB Swap (I can't stress enough how much this has improved the response and usability of my phone)
Part 4: 2GB Ext4 - For Debian

I used my laptop running Linux to copy the files from the debian.img loopback file to the partition. You could probably use a Linux LiveCD such as Knoppix, SysRescCD, or Finnix if you don't have access to a Linux machine.

I copied the debian.img file to /tmp/
mkdir /tmp/debloop
mkdir /tmp/debpart
mount -o loop /tmp/debian.img /tmp/debloop
mount /dev/mmcblk0p4 /tmp/debpart
rsync -av --progress /tmp/debloop/* /tmp/debpart/
umount /tmp/debloop
umount /tmp/debpart

I updated the installer.sh file to use the partition instead of the loop device:

# New installer.sh
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3;
echo "Filesytem remounted as read/write";
rm /system/bin/fsrw;
rm /system/bin/bootdeb;
rm /system/bin/unionfs;
rm /system/bin/installer.sh;
rm /system/bin/mountonly;
echo "Removed old Installation Files"
sleep 1;
mkdir /data/local/mnt;
echo "Made /data/local/mnt";
sleep 1;
cp /sdcard/debian/fsrw /system/bin;
cp /sdcard/debian/bootdeb /system/bin;
cp /sdcard/debian/unionfs /system/bin;
cp /sdcard/debian/installer.sh /system/bin;
cp /sdcard/debian/mountonly /system/bin;
echo "Copied new Installation Files";
echo " ";
echo "VERSION 2.2";
echo "Custom Debian Bootloader is now installed!";
echo "This process does NO damage to your Android OS!";
echo " ";
echo "Courtesy of http://www.myhangoutonline.com";
echo "Installer by WhiteMonster84";
echo " ";
echo "To enter the Debian Linux console just type 'sh bootdeb'";
echo "PS: Be sure to run 'sh /scripts/onetime.sh' as root from the shell after your FIRST 'boot'.";


Here is the updated bootdeb:

# Based on Saurik's remount.sh - modified by WhiteMonster84 of http://www.myhangoutonline.com
# Email whitemonster84@gmail.com

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3;
echo "Android Filesytem remounted as read/write"

export bin=/system/bin;
export mnt=/data/local/mnt;
echo "Exported Path set #1"

export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH;
export TERM=linux;
export HOME=/root;
echo "Exported Path set #2"


echo " "
echo " a888a "
echo " d888888b "
echo " 8P YP Y88 "
echo " 8|o||o|88 "
echo " 8. .88 "
echo " 8 ._. Y8. "
echo " d/ 8b. "
echo " .dP . Y8b. "
echo " d8: ::88b. "
echo " d8 Y88b "
echo " :8P :888 "
echo " 8a. : _a88P "
echo " ._/ Yaa_ : .| 88P| "
echo " \ YP | 8P \. "
echo " / \._____.d| .| "
echo " --..__)888888P ._.|"
echo " "
echo " THE PENGUIN IS ALIVE "

mount /dev/block/mmcblk0p4 $mnt;

mount -t devpts devpts $mnt/dev/pts;

mount -t proc proc $mnt/proc;

mount -t sysfs sysfs $mnt/sys;

echo "Custom Linux Pseudo Bootstrapper V2.2 - by WhiteMonster84"
echo "WEB: http://www.myhangoutonline.com"
echo " "
sleep 1
echo "Starting init process"
sleep 1
echo "INIT: Debian booting....."
sleep 1
echo "Running Linux Kernel"
sysctl -w net.ipv4.ip_forward=1;
sleep 1
echo "AutoMounter started"
sleep 1
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean kill of Debian!"
echo " "
sleep 1
chroot $mnt /bin/bash;



After you run /scripts/onetime.sh (Choose a good password, you don't want to get rooted when the ssh daemon is running) once logging in for the first time, you might want to change your /etc/apt/sources.list to:
deb http://ftp.us.debian.org/debian lenny main contrib non-free
deb http://security.debian.org/ lenny/updates main contrib non-free

I modified /root/.bashrc to the following:
# ~/.bashrc: executed by bash(1) for non-login shells.
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/bin"
export SHELL=/bin/bash
hostname yourhostname

export PS1='\h:\w\$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
export USER=root


You should now probably update the phone and install some apps. But you might want to do this from a ssh shell first.
So run: /etc/init.d/ssh start
Look up your ip address with: ifconfig
ssh to your phone (Windows users can use putty)
Now update your phone:
apt-get update
apt-get -u upgrade
apt-get install vim lxde tightvncserver locales tsclient pptp-linux

Locales might still be broken, so choose your locale by running:
dpkg-reconfigure locales

I set up a init file that I run after logging each time called myinit.sh that I placed in /root/bin/

#!/bin/bash
rm -fr /tmp
mkdir /tmp
chmod 777 /tmp
/usr/local/bin/vncstart
/etc/init.d/ssh start

I created a vncstart script at /usr/local/bin:
#!/bin/bash
vncserver -kill :0
sleep 2
kill -9 $(ps ax | grep vnc | grep -v grep | grep -v vncstart | awk {'print $1'})
sleep 2
rm -fr /tmp/.X0-lock /tmp/.X11-unix/X0
vncserver :0 -geometry 1024x768

Note that I made the vncserver screen larger than the display of the phone. I primarily use the Debian to run security tools and to take control of other servers. The tiny 320x480 screen isn't enough. The open source android-vnc has excellent scaling and panning.

I'm also running PPTP connection from the command line inside of Debian just fine. If there is enough interest, I'll post instructions on how to do that.

So I know have Debian running on my phone. Everything runs great and the Android system still responds perfectly fine with the large swap file. I think you could drop the swap file down to 256MB though without any issues. Iceweasel (firefox) is very slow though. I guess I'll just have to wait for the mobile version.
 

dmwOtis

Member
Apr 13, 2008
43
0
Denver
Installing Debian

I just used this method to install on CM5 test 2 and it is running fast, smooth and without issue. I wanted to thank you for the walkthrough and time spent. All other forms of installation were failing miserable for me.

I am confused about these steps:

I used my laptop running Linux to copy the files from the debian.img loopback file to the partition. You could probably use a Linux LiveCD such as Knoppix said:
Which of the above were run opn the laptop, an which were run on the G1?
 

@xDeepS

Senior Member
Sep 17, 2010
615
208
Dubai
deepsoni.me
Code:
cd /sdcard/debian
# sh ./installer.sh
sh ./installer.sh
# exit
exit
←[H←[Jmkdir failed for /data/local/mnt, File exists
←[H←[Jchmod: bootdeb: Operation not permitted
chmod: debian.img: Operation not permitted
chmod: fsrw: Operation not permitted
chmod: installer.sh: Operation not permitted
chmod: mountonly: Operation not permitted
chmod: unionfs: Operation not permitted
←[H←[J
Custom Debian Bootloader is now installed! Quick huh?
This process does NO damage to your Android underlying OS!

Courtesy of http://www.androidfanatic.com
Installer by Mark Walker (ghostwalker)

To enter the Debian Linux console just type 'bootdeb'
PS: Be sure to run /scripts/onetime.sh as root from the shell after your FIRST '
boot'.

# sh bootdeb
sh bootdeb
←[H←[JAndroid Filesytem remounted as read/write
insmod: can't read 'ext2': No such file or directory
mknod: /dev/loop2: File exists
←[H←[J
               a888a
             d888888b
             8P YP Y88
             8|o||o|88
             8.    .88
             8 ._.  Y8.
            d/       8b.
          .dP   .     Y8b.
         d8:         ::88b.
        d8             Y88b
       :8P             :888
        8a.    :      _a88P
      ._/ Yaa_ :    .| 88P|
      \    YP        | 8P  \.
      /     \._____.d|    .|
       --..__)888888P ._.|


mount: can't setup loop device: No such file or directory
mount: mounting devpts on /data/local/mnt/dev/pts failed: No such file or direct
ory
mount: mounting proc on /data/local/mnt/proc failed: No such file or directory
mount: mounting sysfs on /data/local/mnt/sys failed: No such file or directory
Custom Linux Pseudo Bootstrapper V1.0 - by Mark Walker
WEB: http://www.androidfanatic.com
EML: admin@androidfanatic.com

Starting init process
INIT: Debian booting.....
Running Linux Kernel
net.ipv4.ip_forward = 1
AutoMounter started
Type EXIT to end session
Make sure you do a proper EXIT for a clean kill of Debian!

chroot: can't execute '/bin/bash': No such file or directory
umount: can't forcibly umount /data/local/mnt/dev/pts: No such file or directory

umount: can't forcibly umount /data/local/mnt/proc: No such file or directory
umount: can't forcibly umount /data/local/mnt/sys: No such file or directory
umount: can't forcibly umount /data/local/mnt: Invalid argument
Filesystems have unmounted
losetup: /dev/block/loop2: No such device or address
Loopback device shutdown - success
Debian down
Coded by Mark Walker
http://www.androidfanatic.com
admin.androidfanatic.com
Reverted back to Android console

ANyone wanna help =S