[GUIDE] Build Debian image to run on Tab via chroot - Galaxy Tab 10.1 Android Development

I've been experimenting and gathering information all day on how to build a Debian image to run on the Tab (and any other ARM Android devices, for that matter). I've found all the stuff on how to use the Ubuntu images posted, but I really wanted to know how to build a minimal system that I could have complete control over. (I used the latest version of Debian available, Squeeze, when building this, so anything that references "Squeeze" in the commands is because of that. You can easily substitute in a more generic name for files.)
I am going to break this down into a few sections.
Requirements:
Debian or Ubuntu machine (I used a VM with Ubuntu 11.04 installed on it)
Rooted Tab with BusyBox installed
Create the Image:
On the Linux machine you will need to install debootstrap
Code:
sudo apt-get install debootstrap
Create a blank image, format it and then mount it
Code:
dd if=/dev/zero of=squeeze.img bs=1M count=512
mkfs.ext4 -F squeeze.img
sudo mkdir /mnt/squeeze/
sudo mount -t ext4 -o loop squeeze.img /mnt/squeeze/
Note: The image file above is for 512MB, change it to "count=1024" for 1GB, I tried 512MB and it was very limited in space once X was installed.
Run debootstrap and install the system into the image
Code:
sudo debootstrap --verbose --arch armel --foreign squeeze /mnt/squeeze/ http://ftp.debian.org/debian
Unmount the image
Code:
sudo umount /mnt/squeeze/
Install the Image
Create a folder on the Tab, I used /sdcard/debian/ as my storage for my Debian files. Copy your newly created image over into the folder.
Installation will involve the following:
Creating a mount point and mounting the image
Chrooting into the Debian system
Setting some variables
Running the debootstrap installation
Either in a terminal on the device or using adb, do the following to install the system. (The code is commented to better explain how things are working.)
Code:
# Gain root access
su
# Create a mount point and mount the image file into it
# You can substitute any folder instead /data/local/debian/
mkdir /data/local/debian/
mount -o loop,noatime -t ext4 /sdcard/debian/squeeze.img /data/local/debian/
# Chroot into the Debian system
chroot /data/local/debian/ /bin/sh
# Set some required variables
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/
export USER=root
# Set the shell prompt just in case it got overwritten by something else
export PS1='[email protected]$HOSTNAME:${PWD-?} # '
# Run debootstrap
sh /debootstrap/debootstrap --second-stage
# Start a bash shell
/bin/bash
DO NOT EXIT THE SHELL BEFORE MOVING ON TO THE NEXT SECTION
First Boot
Technically the system is running, but if you start to use it you will quickly notice some things just aren't right. There are a few things that I've found that I've needed to do in order to get things running right. You should only need to do these the first time the system is run.
In the Debian shell that is still running on the Tab, do the following
Code:
# This is for working DNS
echo "nameserver 8.8.8.8" > /data/local/debian/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /data/local/debian/etc/resolv.conf
echo "127.0.0.1 localhost" > /data/local/debian/etc/hosts
# Needed to install packages from the repository
echo "deb http://ftp.debian.org/debian/ squeeze main contrib non-free" > /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian/ squeeze main contrib non-free" > /etc/apt/sources.list
# Do the initial update of the package repository
apt-get update
Once that is complete return to the Android system by running the exit command
Code:
exit
So that's a fully running system right there. But we haven't addressed starting and shutting down the system.
Here is what a simple boot script would look like to both run and stop the system:
Code:
clear
echo "Mounting Debian Squeeze..."
mount -t ext4 -o loop squeeze.img /mnt/squeeze/
echo "Setting environmental variables..."
export PATH=$bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH
export TERM=linux
export HOME=/
export USER=root
export PS1='[email protected]:${PWD-?} # '
echo "Mounting devpts/proc/sysfs..."
mount -t devpts devpts /data/local/debian/dev/pts
mount -t proc proc /data/local/debian/proc
mount -t sysfs sysfs /data/local/debian/sys
echo "Chrooting into Debian Squeeze..."
chroot /data/local/debian/ /bin/bash
echo "Unmounting devpts/proc/sysfs..."
umount /data/local/debian/dev/pts
umount /data/local/debian/proc
umount /data/local/debian/sys
echo "Unmounting Debian Squeeze..."
umount /mnt/squeeze/
You will notice that the script also mounts and unmounts additional system filesystems. Also, the script basically pauses right after the chroot command waiting for the process to end, which occurs when you type exit inside of the Debian system. In effect, the script queues up the umount commands for whenever the Debian system is exited.
I use a script similar to that (without the mount/umount because I prefer to do that myself) to start my system. I have it saved to /sdcard/debian/debian and I start the system with the following command:
Code:
su
sh /sdcard/debian/debian
Issues:
The following issues have been encountered:
If the image file is mounted then unmounted, if you try to remount the image again it will error out. (Reboot to solve)
Optional Installation:
Of course the steps above leave you with a working system, but no doubt you will want more functionality.
I've installed TightVNC using the following command:
Code:
apt-get install tightvncserver
To start it:
Code:
vncserver -geometry 1280×752
After that you can connect to it using any VNC software, either local or over the network. If you connect local, be sure to use 127.0.0.1:5901.
Note: This does not install a window manager, if you VNC into the Tab you will get a blank desktop.
I also found that the less command was missing. Turns out the easy fix was to do the following:
Code:
apt-get install less
Finally...
All of this has just been what I've encountered so far today, haven't done much more than set up the system. Please let me know if I'm missing any key parts of the system or if there are any ways that this could be more streamlined.
Hope this helps someone

Thanks man, after rooting my SGT i have been looking for something like this, i'll try it when arrive home.

does touch screen work?

hardt2788 said:
does touch screen work?
Click to expand...
Click to collapse
Dear god man read! It runs as a Virtual Machine on your tablet and you use a VNC client to control it. So yes touchscreen works but it is not a duel boot and is "piggy backing" off android.
So if someone emails you can switch to the email app then back to the vnc app.

You need pills.
Sent from my GT-P7510 using XDA Premium App

maniac3389, have you tried running lxde instead of gnome to see if it runs any faster?

hardt2788 said:
does touch screen work?
Click to expand...
Click to collapse
Sorry, been a few days since I've been on here. Well, the concept is that you run a VNC server in the Debian system and you "remote" into it via a VNC client on the Honeycomb side.

jamezelle said:
maniac3389, have you tried running lxde instead of gnome to see if it runs any faster?
Click to expand...
Click to collapse
Been a bit since I've worked with it, it installed and worked but something was quirky about it. (can't recall what it was)

Related

Ubuntu on droid incredible - SUCCESS!

Hi guys,
As I'm sure most of you already know, some super-smart devs have already gotten ubuntu running on evo and nexus 1. I haven't heard any news of anyone doing this on the incredible.
I would love this functionality, but I'm no dev and have no experience building kernels. Anyone with the appropriate know how interested in having a look at the evo forum, and see if they can compile a kernel that will allow us to run ubuntu on or incredibles?
Just fyi: feedback from evo users suggest that all ubuntu functionality is working, including full flash support and even hulu.com!
Are you as excited as I am? Lets get to work on this- let me know and I'll help anyway I can.
Sent from my ADR6300 using XDA App
Ok, hadn't done this before, but it turned out to be pretty easy. I have compiled the kernel, and packaged it into an update.zip file signed with test keys. You can flash this straight from CW recovery.
If anyone is interested, this "kupdate-signed.zip" will update the kernel to the one I have compiled.
This kernel is completely identical to the stock htc kernel, except that it has the
CONFIG_BLK_DEV_LOOP=y
set so that we can run Ubuntu.
FInd it here: www<dot>4shared<dot>com/file/-kxtUfIw/kupdate-signed<dot>html
--samwathegreat
Ok, so the kernel seems to work perfectly for me, however I am unable to get ubuntu running.
I'm not sure where the problem lies, but I think it has to do with our restricted access to /system and /data.
Hopefully someone here can figure out what it is that I'm missing......I've tried following the instructions while booted into recovery and mounting /system and /data > everything works fine when I run the ubuntu.sh file, but I can't run the bootubuntu file under recovery........so after rebooting phone and trying to run bootubuntu, I get all kinds of errors and ultimately it fails.
After viewing the contents of bootubuntu file, I noticed that once again, it's trying to mount the /system partition......
If this is indeed because of the nand lock, then why does the procedure work on the evo 4g? I was under the impression that it incorporated the same nand lock as the incredible?
Any ideas?
Thanks
Edit:
The nand lock is indeed the culprit...just found out that evo users have full nand unlock available. I wasn't aware of that -hopefully we have the same soon on the incredible.
Patiently waiting...
Sent from my ADR6300 using XDA App
I was looking through the
bootubuntu a few days ago and if I remember correctly it was just moving some if the scripts into the system partition. We could probably boot into recovery and move the files in manually then edit the scripts to remove the system access.
Think its possible? I haven't looked at the scripts in a few days...
Sent from my ADR6300 using XDA App
If you need someone to test let me know.
Sent from my HTC Incredible using Tapatalk
I posted a thread about chroot earlier with no reply. No true nand unlock means no chroot which means no dual booting into ubuntu/debian/meego etc. Also no response from unrevoked if they plan on releasing a true nand unlock.
Other big problem is input.
http://forum.xda-developers.com/showthread.php?t=631389
That's about putting debian on the nexus as well using adb which might be possible but ending the session might have to be a battery pull. The big problem are sound drivers, GSM radio/modem drivers and on screen input.
Dvdivx:
Thanks, we're on the right track, however fastboot won't work on our devices either...again because of nand (that's why I had to make my kernel into an update.zip and sign with test keys - the evo boys just use fastboot to update their kernels). MAYBE we could get one of the distros installed in recovery with update.zip, but I don't see how we could boot android too if we go this method.
Shame I went to all the trouble of building that kernel....oh well. Maybe we will have nand unlock soon and get to use it yet.
Keep me posted if you find something out that hasn't been mentioned here. Thanks.
Sent from my ADR6300 using XDA App
I've been trying this for the last few days and stumbled uppon this thread when trying to get around the problem of mount -o loop.
I'm using http[://]nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-nexus-oneandroid/ as my guide and running through the two scripts manually adjusting as needed.
Thanks to your kernel i was able to get the ubuntu.img mounted. Here is what I've done so far...
#running jager chocolate rom with
#reboot recovery
mkdir /tmp/system
mount -o rw -t yaffs2 /dev/block/mtdblock3 /tmp/system
cd /tmp/system
cp /sdcard/ubuntu/fsrw .
cp /sdcard/ubuntu/bootubuntu .
cp /sdcard/ubuntu/unionfs .
cp /sdcard/ubuntu/mountonly .
chmod 4777 fsrw
chmod 4777 bootubuntu
chmod 4777 unionfs
chmod 4777 mountonly
#reboot and connect with adb shell
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
mkdir /data/local/ubuntu
mount -o rw,loop -t ext2 $kit/ubuntu.img $mnt
busybox mount --bind /dev/pts $mnt/dev/pts
busybox mount --bind /proc $mnt/proc
busybox mount --bind /sys $mnt/sys
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
chroot $mnt /bin/bash
So.... now I've got "[email protected]:/#"
And...
# uname -a
Linux localhost 2.6.29 #1 PREEMPT Sun Jul 11 03:35:47 EDT 2010 armv7l GNU/Linux
# chroot $mnt /bin/bash
[email protected]:/# cat /etc/issue
Ubuntu 9.10 \n \l
I think I'd call that a success.... Someone care to confirm?
Done with the following:
apt-get update
apt-get install tightvncserver
apt-get install lxde
export USER=root
vncserver
Over to androidVNC... The connection is taking forever to go through
When i go back to the terminal and cat /root/.vnc/localhost:1.log I see the following:
xrdb: No such file or directory
xrdb: can't open file /root/.Xresources
Segmentation fault
Edit: Nevermind... it works. When I entered the address in androidvnc, localhost was autocorrected as locals and I didn't notice.
The following script I saved as ubuntu.sh to handle creating the environment variables and such that is required each time you launch ubuntu. i call it with sh ubuntu.sh since I cant make it executable on the sdcard and don't feel like booting into recovery to put it in /system/bin until I work out the little issues. The only problem with below is that it is not un mounting the ubuntu image... Any ideas?
#####BEGIN ubuntu.sh#####
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
mount -o rw,loop -t ext2 $kit/ubuntu.img $mnt
busybox mount --bind /dev/pts $mnt/dev/pts
busybox mount --bind /proc $mnt/proc
busybox mount --bind /sys $mnt/sys
sysctl -w net.ipv4.ip_forward=1
echo Running ubuntu!
chroot $mnt /bin/bash
#After exit, cleanup
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
#####END ubuntu.sh#####
Also, I was able to launch a few applications inside my VNC session including firefox. It was really really slow (i guess as expected). i would be interested in a performance comparison from someone who has both an incredible and one of other devices people have made run ubuntu in this fashion.
Ok so I've wiped my phone and started from scratch to come up with an easy procedure...
All that you need is the kernel samwathegreat posted, ubuntu.img (in /sdcard/ubuntu) and the following script. You only need to boot into recovery to do a nandroid backup and to install the kernel.
###### BEGIN ubuntu.sh ######
export PATH=/system/bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
mkdir /data/local/ubuntu
mount -o rw,loop -t ext2 /sdcard/ubuntu/ubuntu.img /data/local/ubuntu
busybox mount --bind /dev/pts /data/local/ubuntu/dev/pts
busybox mount --bind /proc /data/local/ubuntu/proc
busybox mount --bind /sys /data/local/ubuntu/sys
sysctl -w net.ipv4.ip_forward=1
echo waiting for things to settle...
sleep 5
echo Running ubuntu!
chroot /data/local/ubuntu /bin/bash
#After exit, cleanup
umount /data/local/ubuntu/dev/pts
umount /data/local/ubuntu/proc
umount /data/local/ubuntu/sys
umount /data/local/ubuntu
###### END ubuntu.sh ######
Here is everything in one zip file: www megaupload com/?d=WO094E5Q
FANTASTIC!
pez:
Thanks so much!
I'm thrilled that my kernel did indeed go to some good use. You obviously have greater linux knowledge than I, as i would not have been able to do the scripting myself.
In the true spirit of teamwork, we've accomplished this WITHOUT having nand access. To me, this is quite an accomplishment.
Thanks to everyone that worked on this! Also - Although I did build the kernel myself, I feel that credit must also go to "Koush", who provided the means and instructions to package the kernel into an update.zip file, and sign with test keys.
Good Luck everybody, and have fun playing with ubuntu on your Incredible!!!
-samwathegreat
Here is a really crappy video I recorded. I open the browser at the start to show I disabled all network access and am indeed connecting to localhost.
http://www.youtube.com/watch?v=HMYvQ5r_OyA
If someone else could replicate my success and post a better video I'd appreciate it.
Edit: Just saw your reply samwathegreat. Did you get a chance to try it yourself? I wrote a little howto on androidforums.com (http://androidforums.com/all-things...-run-ubuntu-droid-incredible.html#post1127643) hoping that others would be able to confirm they were successful too.
Also, the key mapping is messed up when connecting with VNC, but I haven't had time to find out why.
This is pretty awesome. I'll have to try this later just for the hell of it.
Too cool. My ROM has a kernel capable of this. I'm gonna try!
ihtfp69 said:
Too cool. My ROM has a kernel capable of this. I'm gonna try!
Click to expand...
Click to collapse
Hell, you should package this in with your rom.
Gimpeh said:
Hell, you should package this in with your rom.
Click to expand...
Click to collapse
Seconded!
Vote called motion carried, the I's have it.
Gimpeh said:
Hell, you should package this in with your rom.
Click to expand...
Click to collapse
Wouldn't having something like this in your sky raider rom bloat it and cause more battery use having it run in the background?
kentoe said:
Wouldn't having something like this in your sky raider rom bloat it and cause more battery use having it run in the background?
Click to expand...
Click to collapse
If it's running all the time. As long as you have a kill command it should be fine.

[Q] Full linux on G1?

Hey everyone!!
Since if got new phone (Moto Milestone), i was wondering is it possible to install linux (gentoo, debian) on my old G1?
So, not in chroot, but as only OS on device! i dont need GUI, just shell. I was thinking that /, boot, etc, bin and maybe some more would be in device rom, and rest on sdcard!!
3g modem is not important to work, but wifi and gps are must!!
can this be done? i want to find some use of my old, but faithfull, G1!!
P.S. mods, if I posted this in wrong topic, I appologize!
thx for any hints. i have 6+ years on linux experience, mostly with gentoo, so recompiling and configuring isn't big problem!!
Sent from my Milestone
amossam said:
Hey everyone!!
thx for any hints. i have 6+ years on linux experience, mostly with gentoo, so recompiling and configuring isn't big problem!!
Click to expand...
Click to collapse
so do it then
not sure why you think its difficult
Firerat said:
so do it then
not sure why you think its difficult
Click to expand...
Click to collapse
well, i think it wouldn't be easy, and I'm asking is it possible!
with all due respect, i don't think that yours tone is in place.
so just for your info, i appreciate your work werry much!
i don't know too much about booting process of G1, but i know that SPL transfers boot process to kernel, so i assume that there is no boot flag! and i cannot find any detailed explanation of booting process that is detailed and easy to understand...
so, instead of using that tone, i would be gratefull if you have any link to share!!
Sent from my Milestone
amossam said:
well, i think it wouldn't be easy, and I'm asking is it possible!
with all due respect, i don't think that yours tone is in place.
so just for your info, i appreciate your work werry much!
i don't know too much about booting process of G1, but i know that SPL transfers boot process to kernel, so i assume that there is no boot flag! and i cannot find any detailed explanation of booting process that is detailed and easy to understand...
so, instead of using that tone, i would be gratefull if you have any link to share!!
Sent from my Milestone
Click to expand...
Click to collapse
i have 6+ years on linux experience, mostly with gentoo, so recompiling and configuring isn't big problem!!
Click to expand...
Click to collapse
here is a very usefull link
http://www.google.com
it is great for doing internet searches
don't clam to be some linux guru if you are not
http://www.unixweblog.com/2010/03/htc-dreamg1-dual-boot-native-debian/
and here is how I found it
I googled
native linux on g1
you will see links to xda
its been done, and done and done
there is absolutely nothing wrong with the firerat's tone. I actually thanked him for that post... it was classic firerat!
I think if you learned how to use the search function.. you will see it haz been done. google is your best friend!! hey, bing works as well. ask jeeves may not... but such is the element of being a man of linus -- most linux people dont go into a police station and ask for the number to dial 911 and where they can dial this number to get some police help.
jesus.......i just did a search... it goes all the way back to the days of jesus h freke. 1998.
just frigging search. how can you operate a phone and not be able to operate a basic google search..
hold one second... my 4 year old dog who has half his chromosomes just did it...wow.... here it is.. http://forum.xda-developers.com/showthread.php?t=444419&page=40
plz dont thank me either. if you must thank someone, thank firerat... but i dont know if he wants your thanx.
have fun chrootin! and its good to see people care enough about their dream to not toss it in the recycle bin at tmobile. those things are powerful.
Firerat said:
here is a very usefull link
http://www.google.com
it is great for doing internet searches
don't clam to be some linux guru if you are not
http://www.unixweblog.com/2010/03/htc-dreamg1-dual-boot-native-debian/
and here is how I found it
I googled
native linux on g1
you will see links to xda
its been done, and done and done
Click to expand...
Click to collapse
its like watching fire be invented all over again!
i humbly applogise that i asked one question. i did some research but i couldn't get the right keywords...
btw, i didn't said that i'm linux guru, only that i have experience...
nwm, i'll move on on my own...
can please mod lock this or delete, obviously this is another stupid duplicate post...
Sent from my Milestone
amossam said:
i humbly applogise that i asked one question. i did some research but i couldn't get the right keywords...
btw, i didn't said that i'm linux guru, only that i have experience...
nwm, i'll move on on my own...
can please mod lock this or delete, obviously this is another stupid duplicate post...
Sent from my Milestone
Click to expand...
Click to collapse
install linux on g1
http://www.htc-dream-g1.net/en/Linux/Debian/Native
currently the 4th hit
Firerat said:
install linux on g1
http://www.htc-dream-g1.net/en/Linux/Debian/Native
currently the 4th hit
Click to expand...
Click to collapse
how simple can you get? lol
{Mod edit}
Here's how to do this:
HTC Dream Native Debian Linux - bibanon/android-development-codex Wiki​This guide was mostly organized by Novaspirit, refined on the Debian Wiki, and based on notes from XDA-Developers.
Here, we've fixed some glaring errors and updated it for Debian squeeze.
This guide will create a dual-boot Linux and Android system. The phone will boot normally into Android; just hold home+power when turning on to enter Debian Linux.
Working / Not Working​Working
Phone can boot!
SDCard reader/writer
Keyboard
LEDs
Touchscreen
Vibrator
USB Ethernet
Xorg with OpenMoko Kernel
Phone Call : I am able to answer an incomming call from console!
Unlock SIM Card and register on Network
Working with bugs
Trackball - No event on click with ball - must click and move ball slightly
TouchScreen (MonoTouch) - I can use it in console FBDEV, but with Xorg, the calibration doesn’t work - calibration is very difficult but doable
ALSA - Sound is low, when phone works, sound is very low, and alsamixer, for select OutPut has device bugs.
Xorg with my Kernel - The phone crashes (freeze) when you leave Xorg found this only happens sometimes not all
Not working
WiFi card is detected, but crashes when doing “ifconfig wlan0 up”.
Not tested
GPS
Accelerometers/Compas
Other USB Gadgets, like Storage
Bluetooth
Internet throug GSM/3G APN
Power management
Accelerated GL
Camera
TouchScreen (MultiTouch)
HOWTO​You will need:
A laptop with Debian-based Linux (Ubuntu, Debian, Linux Mint, etc.)
Just run it off a live CD
An HTC Dream/G1 or MyTouch 3G
8GB or larger SDCard
4GB for Linux, 4GB for Android
An Android 1.6 or higher Custom ROM that supports EXT2/3
only a few older Android versions lack it.
USB Debugging Enabled
HardSPL and Engineering SPL
gives you fastboot support
ADB and Fastboot
The easiest way to install them is to use Minimal ADB.
Partitioning the SDCard​
It's possible to use Android itself to partition it, but that's another guide...
Click to expand...
Click to collapse
obtain gparted using:
sudo apt-get install gparted
select your sdcard and select it on the top right menu
You will need three partitions:
fat32 (android)
ext3 (android apps and stuff if you got app2sd)
ext3 (debian)
For example, an 8GB SDCard would be partitioned like this:
2 GB FAT32 for Android
2 GB EXT3 for app2sd
4 GB EXT3 for my real Debian
After creating the partitions, make sure to record the names, found in gparted's top-right corner (ex. /dev/sdb1, /dev/sdc6).
The G1 will see those partitions with names: /dev/mmcblk0p3 or whatnot. Just add the last number of the /dev/sdb1 name, replacing that 3.
Keep your SDCard plugged in.
Generate the Debian Root Filesystem with debootstrap​We will use debootstrap to install all the necessary system packages to an image, which you will flash onto the G1.
mkdir debdroid
sudo /usr/sbin/debootstrap --foreign --arch armel squeeze debdroid/ http://http.debian.net/debian
Copy debootstrap to the SDCard​We now need to copy the system image to the G1. Change /dev/sdb3 to the EXT3 partition for Debian on your SDCard (The names were previously obtained from GParted).
mount /dev/sdb3 /mnt/memory # change correct device
sudo cp -pfr debdroid/* /mnt/memory/
umount /mnt/memory
debootstrap Second Stage​Now reboot into your G1, and connect it to the computer to begin the second phase of installation. Make sure USB Debugging is enabled, and your phone is recognized by ADB.
Mount the debian EXT3 partition:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Now your debian partition should be mounted to file system at /data/mnt
Next, we will chroot into the debian partition to start the second stage of installation. This will take about 25 minutes, so be patient and keep your phone charged.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /debootstrap/debootstrap --second-stage
umount /data/mnt
rmdir /data/mnt
Set the SSH service to start on boot​We will need an SSH service running on the G1 for internet tethering from the PC. We have to install Galoula's SSH modules, and edit configuration files to start SSH on boot.
Insert the sdcard back into your Linux PC and run these commands:
(replace /dev/sdb2 with the name of your debian EXT3 partition)
(the package links will have to be updated for squeeze)
mount /dev/sdb2 /mnt
cd /mnt/tmp
wget http://www.galoula.net/fr/Tutoriels...ALOULA-001/Modules-2.6.32_GALOULA-001.tar.bz2
tar -jxvf Modules-2.6.32_GALOULA-001.tar.bz2 -C ..
echo g_ether >> ../etc/modules
echo "auto lo" >> ../etc/network/interfaces
echo "iface lo inet loopback" >> ../etc/network/interfaces
echo "auto usb0" >> ../etc/network/interfaces
echo "iface usb0 inet static" >> ../etc/network/interfaces
echo " address 192.168.0.202" >> ../etc/network/interfaces
echo " netmask 255.255.255.192" >> ../etc/network/interfaces
echo " network 192.168.100.0" >> ../etc/network/interfaces
echo " gateway 192.168.0.200" >> ../etc/network/interfaces
echo "none /sys sysfs rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "none /proc proc rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "udev /dev tmpfs rw,size=10240k,mode=755 0 0" >> ../etc/fstab
echo "devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0" >> ../etc/fstab
echo "HTC-Dream" > ../etc/hostname
echo "127.0.0.1 localhost HTC-Dream" > ../etc/hosts
cat /etc/resolv.conf > ../etc/resolv.conf
mkdir ../dev/pts
sync
cd
umount /mnt
Later on, we will also install the SSH packages on the phone itself.
Now insert the sdcard back into the G1, and plug the G1 into the computer.
Chroot Setup​
Note: Don't worry; we are still installing Native Debian Linux. We are only temporarily using a chroot for greater convenience when pumping in commands.
Click to expand...
Click to collapse
Make sure your Android G1 has a WiFi internet connection and USB Debugging enabled.
Set your phone to Stay Awake, so the phone will not suddenly cut off your wifi connection. Settings->Application->Development->Stay Awake
Disable WiFi sleep, which will cause download issues. Settings->Wifi->Menu Button->Advanced->Wifi Sleep Policy->Never sleep when plugged in
Enter the chroot​First, mount the Debian partition on the G1 from your PC, using these commands:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Then, enter the chroot:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /bin/bash
Set up Squeeze Package Repositories​This will install the necessary Debian repositories and some basic packages to the G1.
Type the commands below to add squeeze package repositories:
echo "deb http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install bzip2 build-essential
Install SSH​Finally, we can install the openssh packages. An SSH server allows you to access a USB connected phone from your computer, so you can pump in terminal commands using copy and paste.
Type this command in the same chroot at your computer:
apt-get install openssh-server openssh-client libkrb53 openssh-blacklist libedit2 udev libvolume-id0 libkeyutils1
/etc/init.d/ssh stop
Note: During installation, the G1 might restart unexpectedly. Simply enter the chroot again (see previous section).
Click to expand...
Click to collapse
Create a Root user password and exit the Chroot​We will want to create a root user password.
passwd
Type in the password you want to use (make sure that you only use numbers and letters! special characters cannot be easily entered).
As a security measure, text will not appear onscreen, so just keep typing and press enter when you've put it in.
Exit the Chroot​We're all done, so you can exit the chroot.
sync
exit # exits the chroot
umount /mnt
rmdir /data/mnt
exit # exits `adb shell`
Boot Linux​Put the sdcard back into your G1, Plug in your G1 to the PC, and type this command to enter fastboot mode:
adb reboot bootloader
Type this command on your Linux PC to download and boot the kernel.
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
fastboot -c "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" boot ./zImage
Your phone will now boot into Debian.
Type in the Username and Password​As a security feature, nothing will be displayed while you type your password.
username: root
password: <the password that you created>
Tether your G1's internet connection to the PC​We have to forward your PC's internet connection to your G1. Type these commands in the computer:
ifconfig usb0 192.168.0.200/26
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
(not tested) Alternatively, use these commands: (recommended by Jorge Peñalba)
ifconfig usb0 192.168.0.200/26\
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 1 \> /proc/sys/net/ipv4/ip\_forward\
ssh 192.168.0.202 -l root\
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 0 \> /proc/sys/net/ipv4/ip\_forward
SSH into the G1​Use this command to SSH into the G1's command line, so you can send commands to it from your computer. Log into your phone with the same username and password you set before.
ssh 192.168.0.202
Enable Dual Boot (optional)​We will create a custom kernel for the phone to dual-boot between Android and Linux. This way, you will be able to hold power+home to boot Linux.
Use your computer to SSH into the G1 and run these commands:
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/mkboot.tar.bz2
tar -jxvf mkboot.tar.bz2
cd mkboot
make && make install
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/android-imagetools.tar.bz2
tar -jxvf android-imagetools.tar.bz2
cd android-imagetools
make && make install
cd /tmp
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" \
--kernel zImage --ramdisk ./Newramdisk.cpio.gz -o Recovery-boot.img
cat /dev/zero > /dev/mtd1
mkdir /dev/mtd
cd /dev/ && for i in `ls -w1 mtd?`;do ln -s /dev/$i /dev/mtd/$i; done && cd - || cd -
flash_image recovery Recovery-boot.img
Normal boot will get you into Android
Holding home and power will boot into debian
Galoula's Netinstall​How to Install Ubuntu with Ubuntu-Install.img ?
Download Ubuntu-Install.img on your Linux-PC.
Turn off your HTC G1.
Turn On HTC G1 in FastBosst mode : Power on with hold the camera button, if it's OK, you can see 3 Android on Skateboards.
In this screen press Back.
Connect USB cable betweek PC and G1.
On your Linux PC type this command : "fastboot boot Ubuntu-Install.img" without quotes.
If the G1 don't start, press the back button on G1.
The G1 start the Ubuntu Installer.
Warning ! My image is set for a French G1 keymap.
The special keys are :
Up : End
Down : Back
Left : Home
Right : Call
Escape : menu (on keyboard)
Tab : Right alt with Q.
Control : Search Button
For get networking works : This kernel use USB-NET.
To configure IT :​On the Linux PC :
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
sysctl -w net.ipv4.ip_forward=1
On the G1 :​When the installer tell you for Networking Configuration, chose usb0
You can cancel the DHCP discover.
Type this settings :
IP Address : 192.168.0.202
NetMask : 255.255.255.0
GateWay : 192.168.0.200
DNS : Your DNS
The setup tell you because it can't download "kernel modules", chose continue, my kernel can read the SDCARD for the installation, but it can't read internal partition for more secure.
The setup can tell you a warning because the kernel can't be installed, please continue (and ignore it) because, Ubuntu-Rescue.img contain the appropriate kernel.
Actualy, the file is : boot-recovery.img
Now, you can setup your Ubuntu !
Galoula's Netinstall images
Page Index for this GitHub Wiki
Source: Github
ppp- said:
Here's how to do this:
HTC Dream Native Debian Linux - bibanon/android-development-codex Wiki​This guide was mostly organized by Novaspirit, refined on the Debian Wiki, and based on notes from XDA-Developers.
Here, we've fixed some glaring errors and updated it for Debian squeeze.
This guide will create a dual-boot Linux and Android system. The phone will boot normally into Android; just hold home+power when turning on to enter Debian Linux.
Working / Not Working​Working
Phone can boot!
SDCard reader/writer
Keyboard
LEDs
Touchscreen
Vibrator
USB Ethernet
Xorg with OpenMoko Kernel
Phone Call : I am able to answer an incomming call from console!
Unlock SIM Card and register on Network
Working with bugs
Trackball - No event on click with ball - must click and move ball slightly
TouchScreen (MonoTouch) - I can use it in console FBDEV, but with Xorg, the calibration doesn’t work - calibration is very difficult but doable
ALSA - Sound is low, when phone works, sound is very low, and alsamixer, for select OutPut has device bugs.
Xorg with my Kernel - The phone crashes (freeze) when you leave Xorg found this only happens sometimes not all
Not working
WiFi card is detected, but crashes when doing “ifconfig wlan0 up”.
Not tested
GPS
Accelerometers/Compas
Other USB Gadgets, like Storage
Bluetooth
Internet throug GSM/3G APN
Power management
Accelerated GL
Camera
TouchScreen (MultiTouch)
HOWTO​You will need:
A laptop with Debian-based Linux (Ubuntu, Debian, Linux Mint, etc.)
Just run it off a live CD
An HTC Dream/G1 or MyTouch 3G
8GB or larger SDCard
4GB for Linux, 4GB for Android
An Android 1.6 or higher Custom ROM that supports EXT2/3
only a few older Android versions lack it.
USB Debugging Enabled
HardSPL and Engineering SPL
gives you fastboot support
ADB and Fastboot
The easiest way to install them is to use Minimal ADB.
Partitioning the SDCard​
obtain gparted using:
sudo apt-get install gparted
select your sdcard and select it on the top right menu
You will need three partitions:
fat32 (android)
ext3 (android apps and stuff if you got app2sd)
ext3 (debian)
For example, an 8GB SDCard would be partitioned like this:
2 GB FAT32 for Android
2 GB EXT3 for app2sd
4 GB EXT3 for my real Debian
After creating the partitions, make sure to record the names, found in gparted's top-right corner (ex. /dev/sdb1, /dev/sdc6).
The G1 will see those partitions with names: /dev/mmcblk0p3 or whatnot. Just add the last number of the /dev/sdb1 name, replacing that 3.
Keep your SDCard plugged in.
Generate the Debian Root Filesystem with debootstrap​We will use debootstrap to install all the necessary system packages to an image, which you will flash onto the G1.
mkdir debdroid
sudo /usr/sbin/debootstrap --foreign --arch armel squeeze debdroid/ http://http.debian.net/debian
Copy debootstrap to the SDCard​We now need to copy the system image to the G1. Change /dev/sdb3 to the EXT3 partition for Debian on your SDCard (The names were previously obtained from GParted).
mount /dev/sdb3 /mnt/memory # change correct device
sudo cp -pfr debdroid/* /mnt/memory/
umount /mnt/memory
debootstrap Second Stage​Now reboot into your G1, and connect it to the computer to begin the second phase of installation. Make sure USB Debugging is enabled, and your phone is recognized by ADB.
Mount the debian EXT3 partition:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Now your debian partition should be mounted to file system at /data/mnt
Next, we will chroot into the debian partition to start the second stage of installation. This will take about 25 minutes, so be patient and keep your phone charged.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /debootstrap/debootstrap --second-stage
umount /data/mnt
rmdir /data/mnt
Set the SSH service to start on boot​We will need an SSH service running on the G1 for internet tethering from the PC. We have to install Galoula's SSH modules, and edit configuration files to start SSH on boot.
Insert the sdcard back into your Linux PC and run these commands:
(replace /dev/sdb2 with the name of your debian EXT3 partition)
(the package links will have to be updated for squeeze)
mount /dev/sdb2 /mnt
cd /mnt/tmp
wget http://www.galoula.net/fr/Tutoriels...ALOULA-001/Modules-2.6.32_GALOULA-001.tar.bz2
tar -jxvf Modules-2.6.32_GALOULA-001.tar.bz2 -C ..
echo g_ether >> ../etc/modules
echo "auto lo" >> ../etc/network/interfaces
echo "iface lo inet loopback" >> ../etc/network/interfaces
echo "auto usb0" >> ../etc/network/interfaces
echo "iface usb0 inet static" >> ../etc/network/interfaces
echo " address 192.168.0.202" >> ../etc/network/interfaces
echo " netmask 255.255.255.192" >> ../etc/network/interfaces
echo " network 192.168.100.0" >> ../etc/network/interfaces
echo " gateway 192.168.0.200" >> ../etc/network/interfaces
echo "none /sys sysfs rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "none /proc proc rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "udev /dev tmpfs rw,size=10240k,mode=755 0 0" >> ../etc/fstab
echo "devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0" >> ../etc/fstab
echo "HTC-Dream" > ../etc/hostname
echo "127.0.0.1 localhost HTC-Dream" > ../etc/hosts
cat /etc/resolv.conf > ../etc/resolv.conf
mkdir ../dev/pts
sync
cd
umount /mnt
Later on, we will also install the SSH packages on the phone itself.
Now insert the sdcard back into the G1, and plug the G1 into the computer.
Chroot Setup​
Make sure your Android G1 has a WiFi internet connection and USB Debugging enabled.
Set your phone to Stay Awake, so the phone will not suddenly cut off your wifi connection. Settings->Application->Development->Stay Awake
Disable WiFi sleep, which will cause download issues. Settings->Wifi->Menu Button->Advanced->Wifi Sleep Policy->Never sleep when plugged in
Enter the chroot​First, mount the Debian partition on the G1 from your PC, using these commands:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Then, enter the chroot:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /bin/bash
Set up Squeeze Package Repositories​This will install the necessary Debian repositories and some basic packages to the G1.
Type the commands below to add squeeze package repositories:
echo "deb http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install bzip2 build-essential
Install SSH​Finally, we can install the openssh packages. An SSH server allows you to access a USB connected phone from your computer, so you can pump in terminal commands using copy and paste.
Type this command in the same chroot at your computer:
apt-get install openssh-server openssh-client libkrb53 openssh-blacklist libedit2 udev libvolume-id0 libkeyutils1
/etc/init.d/ssh stop
Create a Root user password and exit the Chroot​We will want to create a root user password.
passwd
Type in the password you want to use (make sure that you only use numbers and letters! special characters cannot be easily entered).
As a security measure, text will not appear onscreen, so just keep typing and press enter when you've put it in.
Exit the Chroot​We're all done, so you can exit the chroot.
sync
exit # exits the chroot
umount /mnt
rmdir /data/mnt
exit # exits `adb shell`
Boot Linux​Put the sdcard back into your G1, Plug in your G1 to the PC, and type this command to enter fastboot mode:
adb reboot bootloader
Type this command on your Linux PC to download and boot the kernel.
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
fastboot -c "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" boot ./zImage
Your phone will now boot into Debian.
Type in the Username and Password​As a security feature, nothing will be displayed while you type your password.
username: root
password: <the password that you created>
Tether your G1's internet connection to the PC​We have to forward your PC's internet connection to your G1. Type these commands in the computer:
ifconfig usb0 192.168.0.200/26
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
(not tested) Alternatively, use these commands: (recommended by Jorge Peñalba)
ifconfig usb0 192.168.0.200/26\
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 1 \> /proc/sys/net/ipv4/ip\_forward\
ssh 192.168.0.202 -l root\
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 0 \> /proc/sys/net/ipv4/ip\_forward
SSH into the G1​Use this command to SSH into the G1's command line, so you can send commands to it from your computer. Log into your phone with the same username and password you set before.
ssh 192.168.0.202
Enable Dual Boot (optional)​We will create a custom kernel for the phone to dual-boot between Android and Linux. This way, you will be able to hold power+home to boot Linux.
Use your computer to SSH into the G1 and run these commands:
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/mkboot.tar.bz2
tar -jxvf mkboot.tar.bz2
cd mkboot
make && make install
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/android-imagetools.tar.bz2
tar -jxvf android-imagetools.tar.bz2
cd android-imagetools
make && make install
cd /tmp
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" \
--kernel zImage --ramdisk ./Newramdisk.cpio.gz -o Recovery-boot.img
cat /dev/zero > /dev/mtd1
mkdir /dev/mtd
cd /dev/ && for i in `ls -w1 mtd?`;do ln -s /dev/$i /dev/mtd/$i; done && cd - || cd -
flash_image recovery Recovery-boot.img
Normal boot will get you into Android
Holding home and power will boot into debian
Galoula's Netinstall​How to Install Ubuntu with Ubuntu-Install.img ?
Download Ubuntu-Install.img on your Linux-PC.
Turn off your HTC G1.
Turn On HTC G1 in FastBosst mode : Power on with hold the camera button, if it's OK, you can see 3 Android on Skateboards.
In this screen press Back.
Connect USB cable betweek PC and G1.
On your Linux PC type this command : "fastboot boot Ubuntu-Install.img" without quotes.
If the G1 don't start, press the back button on G1.
The G1 start the Ubuntu Installer.
Warning ! My image is set for a French G1 keymap.
The special keys are :
Up : End
Down : Back
Left : Home
Right : Call
Escape : menu (on keyboard)
Tab : Right alt with Q.
Control : Search Button
For get networking works : This kernel use USB-NET.
To configure IT :​On the Linux PC :
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
sysctl -w net.ipv4.ip_forward=1
On the G1 :​When the installer tell you for Networking Configuration, chose usb0
You can cancel the DHCP discover.
Type this settings :
IP Address : 192.168.0.202
NetMask : 255.255.255.0
GateWay : 192.168.0.200
DNS : Your DNS
The setup tell you because it can't download "kernel modules", chose continue, my kernel can read the SDCARD for the installation, but it can't read internal partition for more secure.
The setup can tell you a warning because the kernel can't be installed, please continue (and ignore it) because, Ubuntu-Rescue.img contain the appropriate kernel.
Actualy, the file is : boot-recovery.img
Now, you can setup your Ubuntu !
Galoula's Netinstall images
Page Index for this GitHub Wiki
Source: Github
Click to expand...
Click to collapse
Wow. That's a ton of info! I'll try.
ppp- said:
{Mod edit}
Here's how to do this:
Click to expand...
Click to collapse
@ppp- I've edited your post above and removed the part that was simply intended to offend another user. Be aware that XDA is not like the common social media, and we're enforcing the XDA Forum Rules that have been established, and to which you agreed to adhere when you registered on this private platform a few days ago. Please review the forum rules with special emphasis on rule no. 2 regarding member conduct. Thanks for your cooperation.
Regards
Oswald Boelcke
Senior Moderator
ppp- said:
{Mod edit}
Here's how to do this:
HTC Dream Native Debian Linux - bibanon/android-development-codex Wiki​This guide was mostly organized by Novaspirit, refined on the Debian Wiki, and based on notes from XDA-Developers.
Here, we've fixed some glaring errors and updated it for Debian squeeze.
This guide will create a dual-boot Linux and Android system. The phone will boot normally into Android; just hold home+power when turning on to enter Debian Linux.
Working / Not Working​Working
Phone can boot!
SDCard reader/writer
Keyboard
LEDs
Touchscreen
Vibrator
USB Ethernet
Xorg with OpenMoko Kernel
Phone Call : I am able to answer an incomming call from console!
Unlock SIM Card and register on Network
Working with bugs
Trackball - No event on click with ball - must click and move ball slightly
TouchScreen (MonoTouch) - I can use it in console FBDEV, but with Xorg, the calibration doesn’t work - calibration is very difficult but doable
ALSA - Sound is low, when phone works, sound is very low, and alsamixer, for select OutPut has device bugs.
Xorg with my Kernel - The phone crashes (freeze) when you leave Xorg found this only happens sometimes not all
Not working
WiFi card is detected, but crashes when doing “ifconfig wlan0 up”.
Not tested
GPS
Accelerometers/Compas
Other USB Gadgets, like Storage
Bluetooth
Internet throug GSM/3G APN
Power management
Accelerated GL
Camera
TouchScreen (MultiTouch)
HOWTO​You will need:
A laptop with Debian-based Linux (Ubuntu, Debian, Linux Mint, etc.)
Just run it off a live CD
An HTC Dream/G1 or MyTouch 3G
8GB or larger SDCard
4GB for Linux, 4GB for Android
An Android 1.6 or higher Custom ROM that supports EXT2/3
only a few older Android versions lack it.
USB Debugging Enabled
HardSPL and Engineering SPL
gives you fastboot support
ADB and Fastboot
The easiest way to install them is to use Minimal ADB.
Partitioning the SDCard​
obtain gparted using:
sudo apt-get install gparted
select your sdcard and select it on the top right menu
You will need three partitions:
fat32 (android)
ext3 (android apps and stuff if you got app2sd)
ext3 (debian)
For example, an 8GB SDCard would be partitioned like this:
2 GB FAT32 for Android
2 GB EXT3 for app2sd
4 GB EXT3 for my real Debian
After creating the partitions, make sure to record the names, found in gparted's top-right corner (ex. /dev/sdb1, /dev/sdc6).
The G1 will see those partitions with names: /dev/mmcblk0p3 or whatnot. Just add the last number of the /dev/sdb1 name, replacing that 3.
Keep your SDCard plugged in.
Generate the Debian Root Filesystem with debootstrap​We will use debootstrap to install all the necessary system packages to an image, which you will flash onto the G1.
mkdir debdroid
sudo /usr/sbin/debootstrap --foreign --arch armel squeeze debdroid/ http://http.debian.net/debian
Copy debootstrap to the SDCard​We now need to copy the system image to the G1. Change /dev/sdb3 to the EXT3 partition for Debian on your SDCard (The names were previously obtained from GParted).
mount /dev/sdb3 /mnt/memory # change correct device
sudo cp -pfr debdroid/* /mnt/memory/
umount /mnt/memory
debootstrap Second Stage​Now reboot into your G1, and connect it to the computer to begin the second phase of installation. Make sure USB Debugging is enabled, and your phone is recognized by ADB.
Mount the debian EXT3 partition:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Now your debian partition should be mounted to file system at /data/mnt
Next, we will chroot into the debian partition to start the second stage of installation. This will take about 25 minutes, so be patient and keep your phone charged.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /debootstrap/debootstrap --second-stage
umount /data/mnt
rmdir /data/mnt
Set the SSH service to start on boot​We will need an SSH service running on the G1 for internet tethering from the PC. We have to install Galoula's SSH modules, and edit configuration files to start SSH on boot.
Insert the sdcard back into your Linux PC and run these commands:
(replace /dev/sdb2 with the name of your debian EXT3 partition)
(the package links will have to be updated for squeeze)
mount /dev/sdb2 /mnt
cd /mnt/tmp
wget http://www.galoula.net/fr/Tutoriels...ALOULA-001/Modules-2.6.32_GALOULA-001.tar.bz2
tar -jxvf Modules-2.6.32_GALOULA-001.tar.bz2 -C ..
echo g_ether >> ../etc/modules
echo "auto lo" >> ../etc/network/interfaces
echo "iface lo inet loopback" >> ../etc/network/interfaces
echo "auto usb0" >> ../etc/network/interfaces
echo "iface usb0 inet static" >> ../etc/network/interfaces
echo " address 192.168.0.202" >> ../etc/network/interfaces
echo " netmask 255.255.255.192" >> ../etc/network/interfaces
echo " network 192.168.100.0" >> ../etc/network/interfaces
echo " gateway 192.168.0.200" >> ../etc/network/interfaces
echo "none /sys sysfs rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "none /proc proc rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "udev /dev tmpfs rw,size=10240k,mode=755 0 0" >> ../etc/fstab
echo "devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0" >> ../etc/fstab
echo "HTC-Dream" > ../etc/hostname
echo "127.0.0.1 localhost HTC-Dream" > ../etc/hosts
cat /etc/resolv.conf > ../etc/resolv.conf
mkdir ../dev/pts
sync
cd
umount /mnt
Later on, we will also install the SSH packages on the phone itself.
Now insert the sdcard back into the G1, and plug the G1 into the computer.
Chroot Setup​
Make sure your Android G1 has a WiFi internet connection and USB Debugging enabled.
Set your phone to Stay Awake, so the phone will not suddenly cut off your wifi connection. Settings->Application->Development->Stay Awake
Disable WiFi sleep, which will cause download issues. Settings->Wifi->Menu Button->Advanced->Wifi Sleep Policy->Never sleep when plugged in
Enter the chroot​First, mount the Debian partition on the G1 from your PC, using these commands:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Then, enter the chroot:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /bin/bash
Set up Squeeze Package Repositories​This will install the necessary Debian repositories and some basic packages to the G1.
Type the commands below to add squeeze package repositories:
echo "deb http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install bzip2 build-essential
Install SSH​Finally, we can install the openssh packages. An SSH server allows you to access a USB connected phone from your computer, so you can pump in terminal commands using copy and paste.
Type this command in the same chroot at your computer:
apt-get install openssh-server openssh-client libkrb53 openssh-blacklist libedit2 udev libvolume-id0 libkeyutils1
/etc/init.d/ssh stop
Create a Root user password and exit the Chroot​We will want to create a root user password.
passwd
Type in the password you want to use (make sure that you only use numbers and letters! special characters cannot be easily entered).
As a security measure, text will not appear onscreen, so just keep typing and press enter when you've put it in.
Exit the Chroot​We're all done, so you can exit the chroot.
sync
exit # exits the chroot
umount /mnt
rmdir /data/mnt
exit # exits `adb shell`
Boot Linux​Put the sdcard back into your G1, Plug in your G1 to the PC, and type this command to enter fastboot mode:
adb reboot bootloader
Type this command on your Linux PC to download and boot the kernel.
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
fastboot -c "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" boot ./zImage
Your phone will now boot into Debian.
Type in the Username and Password​As a security feature, nothing will be displayed while you type your password.
username: root
password: <the password that you created>
Tether your G1's internet connection to the PC​We have to forward your PC's internet connection to your G1. Type these commands in the computer:
ifconfig usb0 192.168.0.200/26
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
(not tested) Alternatively, use these commands: (recommended by Jorge Peñalba)
ifconfig usb0 192.168.0.200/26\
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 1 \> /proc/sys/net/ipv4/ip\_forward\
ssh 192.168.0.202 -l root\
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 0 \> /proc/sys/net/ipv4/ip\_forward
SSH into the G1​Use this command to SSH into the G1's command line, so you can send commands to it from your computer. Log into your phone with the same username and password you set before.
ssh 192.168.0.202
Enable Dual Boot (optional)​We will create a custom kernel for the phone to dual-boot between Android and Linux. This way, you will be able to hold power+home to boot Linux.
Use your computer to SSH into the G1 and run these commands:
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/mkboot.tar.bz2
tar -jxvf mkboot.tar.bz2
cd mkboot
make && make install
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/android-imagetools.tar.bz2
tar -jxvf android-imagetools.tar.bz2
cd android-imagetools
make && make install
cd /tmp
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" \
--kernel zImage --ramdisk ./Newramdisk.cpio.gz -o Recovery-boot.img
cat /dev/zero > /dev/mtd1
mkdir /dev/mtd
cd /dev/ && for i in `ls -w1 mtd?`;do ln -s /dev/$i /dev/mtd/$i; done && cd - || cd -
flash_image recovery Recovery-boot.img
Normal boot will get you into Android
Holding home and power will boot into debian
Galoula's Netinstall​How to Install Ubuntu with Ubuntu-Install.img ?
Download Ubuntu-Install.img on your Linux-PC.
Turn off your HTC G1.
Turn On HTC G1 in FastBosst mode : Power on with hold the camera button, if it's OK, you can see 3 Android on Skateboards.
In this screen press Back.
Connect USB cable betweek PC and G1.
On your Linux PC type this command : "fastboot boot Ubuntu-Install.img" without quotes.
If the G1 don't start, press the back button on G1.
The G1 start the Ubuntu Installer.
Warning ! My image is set for a French G1 keymap.
The special keys are :
Up : End
Down : Back
Left : Home
Right : Call
Escape : menu (on keyboard)
Tab : Right alt with Q.
Control : Search Button
For get networking works : This kernel use USB-NET.
To configure IT :​On the Linux PC :
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
sysctl -w net.ipv4.ip_forward=1
On the G1 :​When the installer tell you for Networking Configuration, chose usb0
You can cancel the DHCP discover.
Type this settings :
IP Address : 192.168.0.202
NetMask : 255.255.255.0
GateWay : 192.168.0.200
DNS : Your DNS
The setup tell you because it can't download "kernel modules", chose continue, my kernel can read the SDCARD for the installation, but it can't read internal partition for more secure.
The setup can tell you a warning because the kernel can't be installed, please continue (and ignore it) because, Ubuntu-Rescue.img contain the appropriate kernel.
Actualy, the file is : boot-recovery.img
Now, you can setup your Ubuntu !
Galoula's Netinstall images
Page Index for this GitHub Wiki
Source: Github
Click to expand...
Click to collapse
Could you provide the ROM, HardSPL, and EngeneeringSPL?

[MOD] Full Linux (Debian) inside WebTop! v0.2.7 [2012/01/18] [11.30 GMT+2:00]

[size=+4]Take back WebTop![/size]​
Use anythings you can imagine! LibreOffice, Java, Firefox 4, ecc...
[size=+2]WHAT THIS MOD DOES:[/size]
Installing WebTopMOD your awm dock will be populated with 3 new icons: leafpad, lxterminal and a penguin.
Leafpad and lxterminal works inside WebTop but clicking on the penguin you get a Debian menu chrooted http://en.wikipedia.org/wiki/Chroot in a Debian enviroment. In xterm you can use synaptic and apt-get to install anything in this new enviroment.
For example I need gimp:
Code:
# apt-get update //refresh packages list from internet
# apt-get install gimp
# gimp //
Clicking another time on the penguin open another xterm IN THE SAME ENVIROMENT so I can start another program
Code:
# oo-writer //openoffice writer
NOTE: Debian disk contain a Debian stable (squeeze) release, some software could be "outdated", if you would live on the edge change stable to unstable in /etc/apt/sources.list IN CHROOT ENVIRONMENT. DO NOT TRY TO CHANGE REPOSITORY IN ORIGINAL WEBTOP ROOT
Look here (http://www.debian.org/releases/) to understand what differ between Debian branches
For example LibreOffice is not yet in stable branch, so you can install OpenOffice or switch repo to testing or unstable
Firefox is renamed Iceweasel and the latest version in unstable is 3.5 and from experimental 4.0.
REMEMBER THAT 0.x VERSION MEAN THAT THIS SOFTWARE CAN BE BUGGED AND I CONSIDER IT IN ALPHA TESTING
[size=+2]PREREQUISITES:[/size]
- A rooted Atrix
- At least 2GB free in internal memory (could be more or less with the customized installation)
- A little bit terminal knowledge and willpower
- Brain
- Liquorice mojito
[size=+2]INSTALLATION:[/size]
[size=+1][1st way - EASY METHOD][/size]
Prerequisite for this method is:
On your phone: CWM installed
0) Download Debian disk - http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z
1) Unpack in your internal or external storage (path should be /sdcard(-ext)/WebTopMOD/linuxdisk)
Please don't use "adb push" it corrupt big files
2) Download easy-signed.zip - http://www.multiupload.com/C5GEIHDEM0, MIRROR
3) Install using CWM, reboot and enter in WebTop!
Uninstaller for version >=0.2.7 http://www.multiupload.com/18H5OHND90, MIRROR
Uninstaller for version <= 0.2.2 http://www.multiupload.com/W37DT6HJ7X
Uninstaller for version 0.2.1 http://www.multiupload.com/TO6W9X7CBU
Uninstaller for version >= 0.2 http://www.multiupload.com/GLKUZA2KP9
[size=+1][2nd way - CUSTOM METHOD][/size]
Temporary deprecated
Code:
Prerequisite for this method is:
On your computer: have a Debian installation or a Debian live cd or download this file ([url]http://www.multiupload.com/403F0OQEDA[/url] -> 2GB disk in 66MB), unpack it and skip to step 8
On your phone: install a "complete" busybox thought any free market apps and be connected to internet with a wireless network.
[b][On your phone][/b]
0) Start WebTop and leave it opened
[b][On your computer][/b]
1) Create a file with the dimensions that fit your needs using dd (I used this command to create the 2GB file: dd bs=1024 count=1 seek=$((1024*1024*2-1)) if=/dev/zero of=debian)
2) Format the new "disk" using ext3 (mkfs.ext3 debian)
3) Create a folder to mount the disk (mkdir temp)
4) Mount the disk (sudo mount -t ext3 -o loop debian temp)
5) Debootstrap! (sudo debootstrap --foreign --arch armel stable temp [url]http://ftp.debian.org/debian[/url])
6) Wait...
7) Unmount disk (sudo umount temp) and remove temp directory (rmdir temp)
8) Copy debian in your internal storage inside a folder called "DEBIAN" (uppercase without quotes)
[b][On your computer if you are using adb (recommended) or on your phone using terminal emulator, connectbot, ecc)][/b]
9) Open a terminal and type:
Get superuser permissions
[code]
# su
edit sudoers
Code:
# vi /etc/sudoers
You should add "%admin ALL=NOPASSWD: ALL" after the line containing "%admin ALL=(ALL) ALL". You can try typing this:
Please note that if you are using a terminal emulator on your phone escape is bad interpreted by Android using a physical keyboard, you have to send the escape key in another way.
Code:
GkyyPjwwwld3wi
NOPASSWD: [with a space]
[Escape]
:wq!
Now we enter in a more complete and privileged bash
Code:
# /usr/bin/sudo -H -u adas bash
Enable AWM to launch anything
Search→Go To… line 1317
Take this line:
use_profile 3
and turn it into:
use_profile 2
Code:
sudo leafpad /etc/tomoyo/domain_policy.conf
Now you can add any launcher to your AWM, look in easy-signed.zip (/usr/share/applications and /home/michele/easy/home/adas/.gconf/apps/avant-window-navigator)
Mount debian disk:
Code:
# cd /sdcard/DEBIAN
# mkdir root
# sudo mount -t ext3 -o loop=/dev/block/loop7 debian root
Debootstrap! (second stage)
Code:
# sudo chroot root /debootstrap/debootstrap --second-stage
Disable X ACL (in WebTop)
Code:
# export DISPLAY=:0
# xhost +
Enter in the new system
Code:
# sudo cp /etc/hosts /sdcard/DEBIAN/root/etc/hosts
# sudo cp /etc/fstab /sdcard/DEBIAN/root/etc/fstab
# sudo cp /etc/resolv.conf /sdcard/DEBIAN/root/etc/resolv.conf
# sudo mount -o bind /proc /sdcard/DEBIAN/root/proc
# sudo mount -o bind /dev /sdcard/DEBIAN/root/dev
# sudo mount -o bind /dev/pts /sdcard/DEBIAN/root/dev/pts
# sudo mount -o bind /dev/shm /sdcard/DEBIAN/root/dev/shm
# sudo mount -o bind /sys /sdcard/DEBIAN/root/sys
# sudo mount -o bind /var/run/dbus/ /sdcard/DEBIAN/root/var/run/dbus/
# sudo chroot /sdcard/DEBIAN/root /bin/bash
Export X display (in chroot)
Code:
# export DISPLAY=:0
Add Debian main repository
Code:
# echo "deb http://ftp.debian.org/debian/ stable main non-free contrib" > /etc/apt/sources.list
Finish debian installation
Code:
# apt-get update ; apt-get install dbus dialog locales
Configure your locale
Code:
# dpkg-reconfigure locales
Install xterm
Code:
# apt-get install xterm
Run xterm!
Code:
# xterm
Now you can install anything simply using "apt-get install PROGRAM_NAME" or installing synaptic
Before unplug HDMI cable you should exit form chroot environment and unmount the chroot:
Code:
# exit
# sudo umount /sdcard/DEBIAN/root/proc
# sudo umount /sdcard/DEBIAN/root/dev
# sudo umount /sdcard/DEBIAN/root/dev/pts
# sudo umount /sdcard/DEBIAN/root/dev/shm
# sudo umount /sdcard/DEBIAN/root/sys
# sudo umount /sdcard/DEBIAN/root/var/run/dbus
# sudo umount /sdcard/DEBIAN/root
[size=+2]USE:[/size] (ONLY FOR CUSTOM METHOD)
[On your computer if you are using adb or on your phone using terminal emulator, connectbot, ecc)]
9) Open a terminal and type:
Get superuser permissions
Code:
# su
Now we enter in a more complete and privileged bash
Code:
# /usr/bin/sudo -H -u adas bash
Mount debian disk:
Code:
# cd /sdcard/DEBIAN
# sudo mount -t ext3 -o loop=/dev/block/loop7 debian root
Disable X ACL (in WebTop)
Code:
# export DISPLAY=:0
# xhost +
Enter in the new system
Code:
# sudo cp /etc/hosts /sdcard/DEBIAN/root/etc/hosts
# sudo cp /etc/fstab /sdcard/DEBIAN/root/etc/fstab
# sudo cp /etc/resolv.conf /sdcard/DEBIAN/root/etc/resolv.conf
# sudo mount -o bind /proc /sdcard/DEBIAN/root/proc
# sudo mount -o bind /dev /sdcard/DEBIAN/root/dev
# sudo mount -o bind /dev/pts /sdcard/DEBIAN/root/dev/pts
# sudo mount -o bind /dev/shm /sdcard/DEBIAN/root/dev/shm
# sudo mount -o bind /sys /sdcard/DEBIAN/root/sys
# sudo chroot /sdcard/DEBIAN/root /bin/bash
Export X display (in chroot)
Code:
# export DISPLAY=:0
Run xterm!
Code:
# xterm
Before unplug HDMI cable you should exit form chroot environment and unmount the chroot:
Code:
# exit
# sudo umount /sdcard/DEBIAN/root/proc
# sudo umount /sdcard/DEBIAN/root/dev
# sudo umount /sdcard/DEBIAN/root/dev/pts
# sudo umount /sdcard/DEBIAN/root/dev/shm
# sudo umount /sdcard/DEBIAN/root/sys
# sudo umount /sdcard/DEBIAN/root
[/code]
[size=+2]THANKS TO:[/size]
Sogarth - for http://forum.xda-developers.com/showthread.php?t=983208
kennethpenn - for motoblur remove tool! many many thanks!
Chainfire - for Gingerbreak
makr8100 - for http://droid.makrit.net/ mirror
and many other users that works actively to hack this phone!
[size=+2]NOTE:[/size]
- exporting library you can start a lot of programs without starting chroot (obviously mounting the loop device), for example you can use xterm inside WebTop launching
Code:
# LD_LIBRARY_PATH=.:/sdcard/DEBIAN/root/usr/lib /sdcard/DEBIAN/root/usr/bin/xterm
- you can use sd-card replacing /sdcard/DEBIAN to /sdcard-ext/DEBIAN
If you would like to support my work click the this droid
[size=+2]MANY THANKS FOR CONTRIBUTOR:[/size]
Francisco Bravo
Robert Johnson
[size=+2]CHANGELOG:[/size]
v0.2.7 [2012/01/18] [11.30 GMT+2:00]
easy-signed: http://www.multiupload.com/C5GEIHDEM0
uninstaller: http://www.multiupload.com/18H5OHND90
EASY:
- Disabled Tomoyo (no more firefox issues between different webtop versions)
- New uninstaller
v0.2.6 [2011/07/07] [14.15 GMT+2:00]
Debian disk: http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z
easy-signed: http://droid.makrit.net/software/atrix/easy_v0.2.6.zip-signed.zip
EASY:
- binded in chroot tmp folders
- correct typo in missing disk message
- changed umount function (should works fine now!)
- added linuxdisk check (0 size, is a file)
- 2.3.4 compatibility
- cleaned mount function
LINUXDISK:
- added pdmenu and menu
- added device etc mountpoint in /mnt/DEVICE/etc
- dynamic change of resolv.conf (thanks to krkeegan)
- linuxdisk now is ~4gb (4095MB)
- added device etc mountpoint in /mnt/DEVICE/usr
- added plugins folder symlink to use flash player or other plugins between browser (inside and outside chroot) (FLASH DOESN'T WORK YET)
v0.2.5.1b [2011/07/07] [10.15 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/ZAPZW2XX45
EASY:
- removed firmware check
- using a newer version of update-binary
v0.2.5 [2011/05/27] [9.30 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/F68D73KF26
EASY:
- fixed unmount function
- removed motorola links
- fixed leafpad icon
v0.2.4 [2011/05/26] [20.30 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/VI4JEFWLI6
EASY:
- corrected calls to loopdevice function (thanks Cryofix)
- check awm folders existence and fully reset permissions
- set different permissions to linux script, xmessage, lxterminal and WebTopMOD folder
v0.2.3 [2011/05/26] [15.45 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/2JAO6F42Z4
EASY:
- corrected typo (remember..) in installation
- make new loop device (avoid conflict)
- renfoced unmount function
- fix permission for linux.desktop (awm launcher)
v0.2.2 [2011/05/25] [22.00 GMT+2:00]
Debian disk: http://www.multiupload.com/DVF6BJGJR3
easy-signed: http://www.multiupload.com/NKSFL81ODW
EASY:
- removed /mnt/androidroot (doesn't work)
- added /mnt/sdcard and /mnt/sdcard-ext
- code clean
- corrected lxterm policy
- replaced backup script
- corrected sudoers replace
- replaced debian with a more generic linux notation
- added check disk existence
- disk can be in sdcard or sdcard-ext
CUSTOM:
- Temporary deprecated (I've no time to update it today)
v0.2.1 [2011/05/25] [10.30]
DebianEnabler: http://www.multiupload.com/F8TMHY8VQA
Images: 2gb: http://www.multiupload.com/A1B6LG9YYF
easy-signed.zip: http://www.multiupload.com/HPA820KCKR
EASY:
- replaced xterm with native lxterminal
- introduced backup original files
- added uninstaller for version >= 0.2 http://www.multiupload.com/GLKUZA2KP9
- added uninstaller for version <= 0.2.1 http://www.multiupload.com/TO6W9X7CBU
v0.2 [2011/05/24] [17.30]
EASY:
DebianEnabler: http://www.multiupload.com/F8TMHY8VQA
Images: 2gb: http://www.multiupload.com/A1B6LG9YYF
easy-signed.zip: http://www.multiupload.com/NHJGJD7E3E
- easy method!
- symbolic link in /mnt/androidroot to real root
- added image already configured with dbus, locales and dialog
- added launcher for debian chroot and xterm in awm
CUSTOM:
- added instruction to make custom launcher in awm
- added instruction to configure locales, dbus and dialog
- corrected chroot adding /var/run/dbus
v0.1 [2011/05/24]
- initial release
Pro. This looks like the real deal (no compromises). I will be waiting for the noob version though
Sent from my MB860 using XDA Premium App
What versions does this work with? 1.8.3, 1.5.7, 1.2.6 ?
XxKILLx3RxX said:
What versions does this work with? 1.8.3, 1.5.7, 1.2.6 ?
Click to expand...
Click to collapse
I used an ATT Atrix with 1.8.3 firmware.
However this guide should be applicable to any atrix (att, bell, ecc) with any firmware...
Can i use ubuntu as the debian system on the pc to do the image, secondly how do i make a 4 or even 6 gb image, thirdly is this similar to the chroot modes?
crnkoj said:
Can i use ubuntu as the debian system on the pc to do the image, secondly how do i make a 4 or even 6 gb image, thirdly is this similar to the chroot modes?
Click to expand...
Click to collapse
6gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*6-1)) if=/dev/zero of=debian
5gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*5-1)) if=/dev/zero of=debian
4gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*4-1)) if=/dev/zero of=debian
3gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*3-1)) if=/dev/zero of=debian
1gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*1-1)) if=/dev/zero of=debian
debootstrap from ubuntu
Code:
sudo apt-get install debootstrap
sudo debootstrap --foreign --arch armel squeeze temp http://ftp.debian.org/debian
Thanks man, ill go and try it out within the next few hours. Btw i already have lxterminal working in the webtop, can i use that instead of adb/ terminal emulator to enter those commands?
crnkoj said:
Thanks man, ill go and try it out within the next few hours. Btw i already have lxterminal working in the webtop, can i use that instead of adb/ terminal emulator to enter those commands?
Click to expand...
Click to collapse
Sure! I assumed that on 1.8.3 terminal is not available...
SystemR89 said:
Sure! I assumed that on 1.8.3 terminal is not available...
Click to expand...
Click to collapse
ye thats true, i copied it over from an old /osh dump and it seems to work fine, if you want/need it i can send it to you (only the lxterminal or the whole /osh dump) just started the procedures to get it on.
SystemR89 said:
6gb:
Code:
dd if=/dev/zero of=/data/6GB.swap bs=1024 count=6144000
4gb:
Code:
dd if=/dev/zero of=/data/6GB.swap bs=1024 count=4096000
debootstrap from ubuntu
Code:
sudo apt-get install debootstrap
sudo debootstrap --foreign --arch armel squeeze temp http://ftp.debian.org/debian
Click to expand...
Click to collapse
those commands returned the error:
dd: opening '/data/6GB/swap': No such file or directory
hmm in your first post the one for dding a 2gb file is different as these two.
AWESOME!!
You beat me to it!! I just ordered a Atrix and it's enroute to me over here in Japan... I was thinking I would try to build Gentoo on the webtop somehow.
I have experience there doing the whole bootstrapping thing, but then it hit me-- "How will I compile the programs?" since everything gets made from source and not from RPMs or DEBs in that distro.
Now I am totally chomping at the bit for my Atrix to get here; I am going to experiment using it as my ONLY computer at work, and out and about. I tend to use cloud-based apps even when creating content (I'm a teacher/photographer/web developer) and I feel uneasy about taking my loaded-to-the-gills Macbook on crowded Tokyo trains with me everyday.
Now with your find, I can still manage to do some light graphics work at times in GIMP too maybe?
crnkoj said:
those commands returned the error:
dd: opening '/data/6GB/swap': No such file or directory
hmm in your first post the one for dding a 2gb file is different as these two.
Click to expand...
Click to collapse
ops.. you are right.. corrected!
starrwulfe said:
Now with your find, I can still manage to do some light graphics work at times in GIMP too maybe?
Click to expand...
Click to collapse
I've not tried gimp, but it should works, we have 1gB of ram!
I was thinking how great gentoo would be too. kholk said once he manages to get kexec and a custom kernel to work he will start work for on gentoo to replace the webtop, that ought to be awesome than
Cannot wait to give this a shot! I just need to order a blue tooth mouse and keyboard.
SystemR89 said:
ops.. you are right.. corrected!
Click to expand...
Click to collapse
ya thought so to just change to debian, btw why do you say if in ubuntu you use the squeeze tag and if just debian you use the stable tag when doing the debootstrap?
crnkoj said:
ya thought so to just change to debian, btw why do you say if in ubuntu you use the squeeze tag and if just debian you use the stable tag when doing the debootstrap?
Click to expand...
Click to collapse
I'm not sure that stable tag works with ubuntu..
Wow amazing I will try when I can, will be funny or nice if we can connect the display to a chinese tablet xD so we can get a portable display xD
.......................................................
Sent from my loved atrix ;D
update.zip, multiple size disk and terminal-less installation and usage will be ready in the next hours!
Stay tuned!

Ubuntu on Ideos X6

There are threads on this site and elsewhere showing the steps to boot ubuntu on android phones. Our Ideos X6 comes with a powerful hardware so i believe we can run ubuntu on it. But it seems that the kernel must support loop devices. Can anyone make a custom kernel supporting loop devices.
Or has anyone successful in running Ubuntu on Ideos X6.
Our kernel have support for loop device. Take this little instruction how install ubuntu oneiric, also the same process for debian just write distribution name and correct url in debootstrap.
1. this stage you must complete on your linux pc.
Code:
#debootstrap part on PC
sudo apt-get install debootstrap
sudo dd if=/dev/zero of=ubuntu.img seek=838860800 bs=1 count=1
sudo mke2fs -F ubuntu.img
sudo mkdir ubuntu
sudo mount -o loop ubuntu.img ubuntu/
sudo debootstrap --arch armel --foreign oneiric ubuntu http:/ports.ubuntu.com/ubuntu-ports/
sudo umount ubuntu
sudo rm -r ubuntu
2. push this ubuntu.img to sdcard on your phone.
Code:
adb push ubuntu.img /sdcard/ubuntu.img
3. create this script as ubuntu.sh on your sdcard too
Code:
echo "Setting some stuff up.."
export bin=/system/bin
export img=/mnt/sdcard/ubuntu.img
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
mkdir $mnt
echo "Mounting the Linux Image"
busybox losetup /dev/block/loop7 $img
mount -t ext2 -o noatime,nodiratime /dev/block/loop7 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
echo "Setting Up Networking"
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 in /mnt"
mkdir $mnt/mnt/sdcard
busybox mount --bind /mnt/sdcard/ $mnt/mnt/sdcard
echo "Entering CHROOT "
echo " "
busybox chroot $mnt /bin/bash
echo " "
echo "Shutting down CHROOT"
umount $mnt/mnt/emmc
umount $mnt/mnt/sdcard
busybox sysctl -w net.ipv4.ip_forward=0
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
busybox losetup -d /dev/block/loop7
4. So now we connect to device, run superuser permission, and chroot to ubuntu
Code:
sudo adb shell
su
sh /sdcard/ubuntu.sh
5.run continue deboostrap
Code:
/debootstrap/debootsrap --second-stage
6. setup apt
Code:
echo 'deb http:/ports.ubuntu.com/ubuntu-ports/ oneiric main' >/etc/apt/sources.list
apt-get clean
apt-get update
7. add root password
Code:
passwd root
8. exit from ubuntu shell with 'exit' and run it again sh /sdcard/ubuntu.sh from terminal emulator on your device or via adb shell.
So, now ubuntu install successfully on your phone and you may install openssh and vnc server.
P.S. http:/ correct it with two //, I can't push correct link to forum. its denied post urls.
Error
I followed your steps exactly as given and changed / to // in http i am getting the following output when i ran ubuntu.sh. kindly help
# sh ubuntu.sh
Setting some stuff up..
mkdir failed for /data/local/ubuntu, File exists
Mounting the Linux Image
losetup: /dev/block/loop7
mount: Device or resource busy
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
Setting Up Networking
net.ipv4.ip_forward = 1
ubuntu.sh: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
ubuntu.sh: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
ubuntu.sh: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
Mounting sdcard in /mnt
mkdir failed for /data/local/ubuntu/mnt/sdcard, No such file or directory
mount: mounting /mnt/sdcard/ on /data/local/ubuntu/mnt/sdcard failed: No such file or directory
Entering CHROOT
chroot: can't execute '/bin/bash': No such file or directory
Shutting down CHROOT
failed.
failed.
net.ipv4.ip_forward = 0
failed.
failed.
failed.
failed.
losetup: /dev/block/loop7: Device or resource busy
Possbile what loop7 device already busy on your phone.
ry this command to see it
Code:
busybox losetup
And try manual steps which in script to see which step is failed.
When I type
Code:
#busybox losetup
nothing happens
when i type
Code:
#busybox losetup /dev/block/loop7 /mnt/sdcard/ubuntu.img
losetup: /dev/block/loop7
Code:
#mount -t ext2 -o noatime,nodiratime /dev/block/loop7 /data/local/ubuntu
mount: Device or resource busy
the second line is the outputfrom the command.
Do you phone have block devices in /dev/block/ ?
just checked using root explorer. there are many loop# files in /dev/block folder
You may try with UC kernel, or try with ext3 file system. I suppose what your kernel without support ext2.
i tried with UC v5. It supports ext2,ext3 and ext4. Still getting same error.
Should i convert my android filesystem to ext2,3,0r 4. If yes how to do it?
No, you don't need do converting. Problem with loop device or mount, try to see busybox losetup after mount image to block device, it's must show what image mounted to block device. If it's ok, try different option for mount.
I don't have anymore ideas why it doesn't work.
This scenario successful work on my phone.
Can you tell me what ROM you are using
Sent from my CSL-MI410 using XDA App
Last rom from wellcom (2.3-V318E)
now it works. Installed ubuntu. But i am now unable to install any package. when i try to install tightvncserver i get error message
E: Unable to locate package tightvncserver
actally i am not able to install any package
i have checked the /etc/apt/sourcels.list and it contains the required entry and i also did
apt-get clean
apt-get update
and it updates without any error
You need add another repositories to /etc/sources.list such as universe, multiverse, restricted with the same path.

Chroot. Running Debian 7.8 on Chromecast

How to install chrooted Debian 7.8 on a Chromecast (Debcast?)
English are not my native language but I will try answer any questions
Step 1 – 5 was made on a Debian 7.8 computer (raspbian)
Step 6 – 12 was made in Chromecast shell
1. Install debootstrap
Code:
su
apt-get install debootstrap
2. Download mini-installation for armhf with debootstrap, this will take a while.
Code:
debootstrap --arch=armhf --variant=minbase --foreign wheezy debian http://http.debian.net/debian
3. Tar the downloaded
Code:
tar -cvf debian.tar debian/
4. Send debian.tar to CC,data dir is writable
Code:
cat debian.tar | ssh [email protected][chromecast-ip] 'cat > /data/debian.tar'
5. ssh to chromecast
Code:
ssh [email protected](chromecast-ip)
6. Untar
Code:
cd /data
tar -xvf debian.tar
7. Create a start file for Chroot
Code:
vi /data/chroot.sh
#!/bin/sh
# Fix all PATH for Debian
export ROOT=/data/debian
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export HOME=/root
# remount /data. Got an error first time I loged into chroot. remount is a fix for this
# not sure if we need to do this every reboot
echo "Remounting /data"
mount -o remount,defaults /data
# Mount dev for Debian if needed
mountpoint $ROOT/dev –q
if [ ! $? -eq 0 ] ; then
echo "Mounting dev"
mount -o bind /dev $ROOT/dev
fi
# Mount pts for Debian if needed
# It's a fix for direct ssh login to chroot
mountpoint $ROOT/dev/pts –q
if [ ! $? -eq 0 ]; then
echo "Mounting ptst"
chroot $ROOT /bin/mount -t devpts -o OPTIONS devpts /dev/pts
fi
# Mount proc for Debian if needed
mountpoint $ROOT/proc –q
if [ ! $? -eq 0 ]; then
echo "Mounting proc"
mount -o bind /proc $ROOT/proc
fi
# Mount proc for Debian if needed
mountpoint $ROOT/sys –q
if [ ! $? -eq 0 ]; then
echo "Mounting sys"
mount -o bind /sys $ROOT/sys
fi
# start chroot
chroot $ROOT /bin/bash -l
8. run chroot.sh and continue with the installation, this will take a while
Code:
chmod +x chroot.sh
./chroot.sh
debootstrap/debootstrap --second-stage
9. We now got a working minimal chroot jail, almost no programs are installed, before we can install anything we need to update sources.list and add some repositories. Use http://debgen.simplylinux.ch/ to create a sources.list. I use debian mirrors for Sweden.
Code:
echo ”deb http://ftp.se.debian.org/debian stable main” > /etc/apt/sources.list
echo ”deb http://security.debian.org/ wheezy/updates main” >> /etc/apt/sources.list
apt-get update
10. Install vim and ssh
Code:
apt-get install vim ssh
11. change port from 22 to 2222 and restart ssh
Code:
vi /etc/ssh/sshd_config
/etc/init.d/ssh restart
12. Set a password
Code:
passwd
OPTIONAL
1. Install desctop and vnc server, this will take a while and our installation will rise with 400-450M (mine using about 800M total), we only got 1.1G total to play with so be carefull which program you install. A fix to this would be to create a Yaffs2 image for loop mount and then store it on a USB drive.
Code:
apt-get install xfce4 tightvncserver
2. Create a loginpassword to vnc, and choose if you need a guest login
Code:
tightvncserver
3. Start vnc server, 800x600 res.
Code:
vncserver :0 -geometry 800x600 -depth 24
4. Log into chromecast, I used a standalone RealVNC in windows and [chromecast-ip]:0 to login
5. More info at http://elinux.org/RPi_VNC_Server
INFO
- To exit root jail, just type exit
- If you started sshd in root jail you can connect to it with ssh on port 2222.
- No need to start chroot to load a program in chroot, you can start it from outside
Code:
chroot with chroot /data/debian /etc/init.d/ssh start
- you can also kill program from outside, run ps to find out ID and use kill [id]
- Chromecast does support loop mount, but not very many filesystems
o To mount a supported filesystem use
Code:
mount myImage.img /mnt/myImage –o loop=/dev/block/loop0
o does not support ext, ext2, ext3 or ext4
o Does support yaffs2, vfat…
o supported filetypes can be found in cat /proc/filesystems
o yaffs2utils can be compiled in debian (on CC), this program can make same filesystem type as /data, and this file can be loop mounted
o Install git, gcc and make. Then git clone https://github.com/justsoso8/yaffs2utils
Errors:
- stdin is not a tty. Run inside chroot jail:
Code:
/bin/mount -t devpts -o OPTIONS devpts /dev/pts
or outside chroot run
Code:
chroot /data/debian /bin/mount -t devpts -o OPTIONS devpts /dev/pts
. Then try to connect to port 2222 again.
- do this: mount -t proc proc /proc.
Run (outside chroot)
Code:
mount -t proc /proc /data/debian/proc
- Chroot and vi can be found in busybox (busybox chroot, busybox vi) you can create a symlink to it.
Code:
mkdir /data/bin & cd /data/bin
ln /bin/busybox –s vi
ln /bin/busybox –s chroot
export PATH=/data/bin:$PATH
o If you need Busybox it can be downloaded from: http://www.busybox.net/downloads/binaries/latest/busybox-armv7l
TODO:
- Autostart chroot on boot
- Does anyone know how to view shell via HDMI?
- Can keyboards and mouse be connected via a USB hub so we can use CC as a minimal computer?
LINKS:
http://www.hjackson.org/blog/archives/2008/10/18/ssh-stdin-is-not-a-tty
https://wiki.debian.org/ChrootOnAndroid
http://www.cyberciti.biz/faq/how-do-i-compress-a-whole-linux-or-unix-directory/
http://elinux.org/RPi_VNC_Server
http://debgen.simplylinux.ch/
https://bitbucket.org/inkubux/cubox-i/wiki/Plex Wheezy
https://help.ubuntu.com/community/BasicChroot
https://github.com/justsoso8/yaffs2utils
http://www.busybox.net/downloads/binaries/latest/busybox-armv7l
Screenshot:
g
Click for large
How are you using a mouse and keyboard, powered otg
Sent from my iPad using Tapatalk
it's a minimum installation of Debian, but I guess you can install xfce and use X-forwarding with sshd. They got it working on a transcend wifi sd-card so it can be made, not sure how fast it will run.
http://dmitry.gr/index.php?r=05.Projects&proj=15. Transcend WiFiSD
Cool
Ok, I tried X-forwarding, it's not a GUI, it's more like you run a program from a host, and "stream" it to some other computer using a client program and ssh.
Also installed xcfe-desctop and tightvncserver. No problem connecting to chromecast and run programs in vnc.
Is it possible to post a little 'how to' and some screenshots?
sure, give me a few days =)
Pietplezier said:
Is it possible to post a little 'how to' and some screenshots?
Click to expand...
Click to collapse
First post is updated with new information
Mape0661 said:
sure, give me a few days =)
Click to expand...
Click to collapse
Screenshots looks wicked!
Pietplezier said:
Screenshots looks wicked!
Click to expand...
Click to collapse
Thanks! It worked better then I thought it would, it's working like a small computer.
I have tryed to view shell over HDMI, would be fun, but I haven't got it to work yet, only crashed the chromecast.

Categories

Resources