yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] FukTheRegister:
NATIVELY boot Debian on my G1.

Hi,

I can boot my Debian distribution NATIVELY on my G1 (No Android boot !).

For that : I make an openmoko kernel : http://wiki.openmoko.org/wiki/OpenMoko_on_HTC-Dream

I have flash my RECOVERY partition (not boot) for give my android :

If you boot your phone, you have Android.

If you want to give Debian, you can adb reboot recovery or boot the phone hold home buton.

I have 3 partition on my 16GB sdcard :

4Gb for /sdcard in fat for Android (the real stockage for Android)

4Gb for /system/sd in ext2 for Android apps and other tools for me like the Debian WITH Android.

8Gb for my NATIVE Debian.

I have take the Xfbdev from openmoko wiki And install Debian and replace my X with them.

I have to able to boot, Have network (troung USB), X with KDE/LXDE, ssh, and more.

The X mouse isn't calibrate. TouchScreen work, ball work, but I can't have precision of my pointer.

I can acces to mtd partitions of the phone.

but I don't arrived to turn on GSM, camera, and other.

Actualy, I continue to search on them, troung SSH of course :D

Would you like a video of booting my Debian ?
[G1 Android Development] Clyborg:
I would like to see it.

How is the speed when booting native?

Thanks,

Jason
[G1 Android Development] Burag:
Amazing! :O

I really want to see it!
[G1 Android Development] the_fish:
sounds good! Capture a little video for us ;)

EDIT: how did you get all the apps you need to work? i can't seem to be able to get installer.sh (the script that should load debian (mount everything and stuff)) to work, as its missing binaries...
[G1 Android Development] innerspace:
wow!

Now this sounds like something we can really work with. Would love to see a video of it in action and get ahold of a tutorial and the files needed to pull this off.

Thanks for all your hard work!
[G1 Android Development] FukTheRegister:
I put my Video (sory for the quality) at this URL : http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/

If you want to test the chanlange, use the GALOULA_V1.002 kernel because the IPV6 support generate less error messages than GALOULA_V1.001.

I put my kernel source temporatly and my .config if we want to recompile the kernel.

You CAN compile DIRECTLY on the phone without CROSS_COMPILE and ARCH variables ! just "apt-get install build-essential".

Tell me if we want my X binaries (extracted from OpenMoko binaries).

Warning : If we run X on the phone, make sur you can acces to the phone throung USB NET beacause I can't exit X, and I must kill X by SSH access ...
[G1 Android Development] FukTheRegister:
I make a rapid keymap layourt for my G1.

For use, donwload trout-azerty.key and type "loadkeys trout-azerty.key" on the G1.

Yesterday I lost to tell, if you want to read G1 Patition, add a line "yaffs" in /etc/modules
[G1 Android Development] the_fish:
please give us your X binary :)
[G1 Android Development] the_fish:
Anyways, i've got a question: has anyone here tried USING the display manager as explained in the guide on androidfanatic? i tried it out, e16 works... but as soon as an app runs out of mem, it just completely crashes! like, i have to "boot" debian all over again :/ does anyone know why? don't think its because of the swap, as it does NOT matter what size my swapfile is, always crashes at the same place...

EDIT: could it be that android kills the terminal (and the instance of sh running inside it) be causing the problem?
[G1 Android Development] d0ca:
can't you just open a terminal in X and then kill it via that?
[G1 Android Development] the_fish:
should be possible if you know the PID / name of the process....
[G1 Android Development] FukTheRegister:
Here : http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/Xfbdev.tar.gz

XDA don't like this format, and I don't like ZIP format in Linux :D

This binaries are extracted from OpenMoko.
[G1 Android Development] FukTheRegister:
Yes it's possible !

Just I don't auto lunch Xterm in the video !

Anyone test my recovery kernel ? (PS : You can execute the nandroid sh for your backup in Debian, just change few lines in the script and copye some binaries from nandroid sources).

It's work well ?
[G1 Android Development] FukTheRegister:
I have making an boot.img named "oneshot". You can kill all (not the init process !), and I can kill all Android Process. If you kill all without "init"," "rild" and "adbd" you have an adb shell terminal with network (if you have unlock sim card befor in android) without anything : Not Android application run.

All of them can killed without damage (in my case) :

system 30 0.0 0.2 808 264 ? S 15:16 0:00 /system/bin/servicemanager
root 31 0.0 0.4 848 396 ? S 15:16 0:00 /system/bin/vold
root 32 0.0 0.2 668 264 ? S 15:16 0:00 /system/bin/debuggerd
root 34 5.8 20.8 70552 20656 ? S 15:16 0:13 zygote /bin/app_process -Xzygote /system/bin --zygote --start-system-server
system 64 9.5 26.2 141936 25944 ? Sl 15:16 0:20 \_ system_server
app_7 106 2.6 20.8 104508 20648 ? Sl 15:16 0:05 \_ android.process.acore
radio 108 1.3 15.4 105108 15268 ? Sl 15:16 0:02 \_ com.android.phone
app_5 135 0.9 16.2 120328 16076 ? Sl 15:17 0:01 \_ com.android.mms
app_7 147 0.1 12.6 97124 12512 ? Sl 15:17 0:00 \_ com.android.inputmethod.latin
app_13 149 0.9 15.0 99968 14880 ? Sl 15:17 0:01 \_ com.google.process.gapps
app_14 165 0.7 13.4 93460 13272 ? Sl 15:17 0:01 \_ android.process.media
app_0 179 0.1 12.7 93244 12640 ? Sl 15:17 0:00 \_ com.android.email
app_1 202 0.4 14.4 94652 14308 ? Sl 15:17 0:00 \_ com.android.calendar
app_10 215 0.2 13.8 95328 13740 ? Sl 15:17 0:00 \_ com.google.android.apps.maps
app_18 229 0.1 12.6 93340 12532 ? Sl 15:17 0:00 \_ com.android.alarmclock
media 35 0.9 4.2 24296 4248 ? Sl 15:16 0:02 /system/bin/mediaserver
bluetooth 36 0.0 0.7 1172 728 ? S 15:16 0:00 /system/bin/dbus-daemon --system --nofork
root 37 0.0 0.3 800 304 ? S 15:16 0:00 /system/bin/installd
compass 39 0.3 0.6 3372 692 ? Sl 15:16 0:00 /system/bin/akmd

And you can chroot in your Debian and test your E16 (but you don't have FrameBuffer) trought VNC with SSH port forwarding (I never test the adb port forwarding yet).
[G1 Android Development] the_fish:
that application killer thing sounds good, but would be quite useless as the network connection would die together with android, right? we need something that keeps the connection that has been established in android alive ;)
[G1 Android Development] the_fish:
I just realized that ubuntu for mobile internet devices (ubuntu MID) has a armel version finally!

We should try to get this working, as the UI looks amazing! Should be definetely possible, only problem i see there is how to launch the installer? Fuk has the x binaries so that shouldnt be a problem :) and maybe the installer just is a shellscript?
[G1 Android Development] FukTheRegister:
Why Ubuntu ? Ubuntu IS Debian !

You just take ARMEL Binaries of Debian and add your config file for X configuration, and Window Manager.

For making an installer of your project you can a lot of choices :

And FULL native distribution (an boot.img and system.img images) with your OS, and user use the data partition for is PIM, but it's disable Android.

You can, as me, make a multi-boot similar : juste flash an recovery.img, and boot the phone with home button (or you can, flash boot.img in recovery and vice-versa for have Android with the home button) and use, SD card for the system.

In this case two choices :

- A ful partition for the OS : I like this because you have and "real machine".

- An image with OS : This solution can also lock the system, and put data in another image : more secure for actidentaly shutdown (power lost).

The real problem is USER : He must have a rooted phone.

- If he want the full native image, no problems : just flash all partition (he lost ALL data)

- If he want a full partition, or and image of OS in the sdcard data

he must have modified Android OS (IE busybox !) with an modified KERNEL to support loop, ext2/ext3 support for the script. I think you script must execute in the Android.

Else if, you can create an false boot.img to boot with fastboot to install to OS : This boot.img hold kernel, and micro GUI to install the OS into the phone.

you can use flash_image to flash partition in "live" mode without tell user to make this.

Your OS, is for DUAL OS (Android WITH you OS), MultiBoot Os (Android OR your OS on boot), or FULL (Only your OS in the phoen and he can boot without SDcard).

All solutions are possibles !
[G1 Android Development] :
Wait, are you saying that got a full linux distro running on your g1 natively and people have not gone ape**** over this, I am confuddle, I would to be able to check this out and see if it would run correctly with some real performance and full advantage of the hardware, how bout you post some files and directions on how to do, to see if this will really work
[G1 Android Development] :
If this is true you might want to change the title to include natively so people don't confuse it with the other thread with a similiar title or completely disregard it
[G1 Android Development] :
Whoops disregard last post, didn't realise this was the old thread and not a new one, got all confused by following a link, think it might be nap time soon
[G1 Android Development] the_fish:
i know it is, but Ubuntu MID has more enhancements for mobile machines, that's why...

Anyways... so in theory it would be possible to write a bootloader (boot.img?) that has options to flash/mount/whatever an image like in the 1.41 JF recovery image? that would be great!
[G1 Android Development] FukTheRegister:
My solution is work fine, but I can't call, SMS, and have not Internet over 3G.

I just can boot my Native Debian, I have a full /dev like android. But I don't know how to use /dev for camera,phone,modem,gps and other.

My solution is just have a Partitionned SDCARD, and have A recovery.img to boot on this.

Just power on the phone with HOME button can boot a native Debian without Android kernel/binaries.

This is a base for making an real distribution for G1 like OpenMoko.

This solution have the real advantage to have Android AND Debian on the same device for test.
[G1 Android Development] FukTheRegister:
I create an image to Install Ubuntu (The Debian version is making !) via netinstall.

Just download the image : http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Ubuntu/Ubuntu-Install.img , fastboot the image (Don't flash it !!!), and configure USB-Networking.

The installer work on my French G1, with a French keymap of G1 (with some difference for special keys in the installer).

My readme file : http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Ubuntu/Readme.txt

I think it's easier to install with this image.

Please report your suggestions.
[G1 Android Development] the_fish:
great! could you explain fastboot please? i never used it...

edit: ohh trying it out now :)
[G1 Android Development] FukTheRegister:
FastBoot Binaries :

http://www.htc.com/www/support/android/adp.html#s2

FastBoot How-To : http://android-dls.com/wiki/index.php?title=Fastboot

I tested only on Linux And Mac OS.

I only test the USB-Net of my Ubuntu image on Linux (Debian).
[G1 Android Development] the_fish:
Hmmm so far i wasn't able to get it working... tried on 9.04 ubuntu, no luck
[G1 Android Development] FukTheRegister:
If you have Ubuntu : download fastboot.zip from HTC.

unzip and copy fastboot from the fastboot.zip in /usr/bin/fastboot

make it executable :

chmod +x /usr/bin/fastboot

And now type fastboot.

It's work now ?

PS : I'm in downloading Ubuntu MID.

And test if it's capable to autodetect my G1 !
[G1 Android Development] the_fish:
i was talking about the usb net ;P anyways, nice to hear you are going to try usbnet out :)
[G1 Android Development] FukTheRegister:
I try this on an BackTrack just for the fun :

sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up

sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24

sudo sysctl -w net.ipv4.ip_forward=1

This work fine, my network is on 10.33.24.0/24

Can you ping your device ?

Can you see usb0 with ifconfig -a ?

PS : Ubuntu MID are finish to download, my G1 is install IT :p
[G1 Android Development] the_fish:
i can ping it and i can ping the web from the ubuntu machine...
[G1 Android Development] FukTheRegister:
Are you sur did you have enter the good gateway on G1 and the good DNS ?

Don't mind the sysctl and iptables for routing the usb request from G1 to the web ...

You can also check with tcpdump.

PS : Ubuntu mid is installed, but, the X crash. I tried to check with OpenMoko binaries, I have the hildon desktop. But is late I m go to sleep !
[G1 Android Development] FukTheRegister:
For my Debian Installer, I need the trout-us.kmap(.gz)

Anyone have this ?

I have making my own trout-fr.kmap, and the Debian Installer hold it fine.

I think it is better with an official trout keymap for release an good Debian-Installer image.
[G1 Android Development] the_fish:
hmmm nope don't have that file, where did you find it?
[G1 Android Development] FukTheRegister:
I making mine ...

I use showkey and write my file.

It's not 100% fiable, but it can write all characters on my HTC G1 keyboard.
[G1 Android Development] pxshock:
installing apache on debian in g1 running with android os

I am trying to do the same thing (as the quote below), but with svn and Apache, they install, i manually start them, no errors, but when i do an nmap on localhost all i see is the ssh bound to port 22

is it that some sort of firewall if blocking the svnserve and the apache applications to bind ports? Or is it that, debian is not allowed to bind ports of the android OS (as far as i know they are running separately, so this shouldn't be the case.). this has got me puzzles as ssh works fine.

Any help will be appreciated
[G1 Android Development] binary.koala:
was having same suspicion while getting openssh-server to run in chrooted jaunty setup, but as i figured out why wireless was simply dropping out. for some reason cyanogen 4.0.4 and 4.1.7 do this to my g1...
[G1 Android Development] binary.koala:
hey FukTheRegister,

could you give us some insights on how do you make your own images? i would like to bake one with 2.6.31 Karmic kernel, since it has wl12xx driver... ;)

there is also a ARM kernel here http://ports.ubuntu.com/ubuntu-ports/dists/karmic/main/installer-armel/current/images/imx51/netboot

do you think it is usable with the jaunty install you performed?

chrz,
[G1 Android Development] FukTheRegister:
I use this tutorial to unpack and repack boot images : http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

Simply download "http://ports.ubuntu.com/ubuntu-ports/dists/karmic/main/installer-armel/current/images/imx51/netboot/initrd.gz" in your exmple, and repack the boot image with the netboot initrd !

You may add the initrd support to the kernel.
[G1 Android Development] binary.koala:
great, thanks for the hint. i will post my images when i succeed ;)
[G1 Android Development] binary.koala:
i'm following the tutorial, but can not get my boot.img to actually boot. i can repack your 'boot-recovery.img' successfully, but i can not make a new bootable image using vmlinuz-2.6.31-100-imx51 + initrd.gz from http://ports.ubuntu.com/ubuntu-ports/dists/karmic/main/installer-armel/current/images/imx51/netboot/

where is the trick?

do i need to use msm kernels? i noticed that your 'native-ubuntu' and 'native-debian' kernels are the same, did you use openmoko kernel there? if yes, how would it be possible to use current ubuntu-arm kernels?

chrz!

d
[G1 Android Development] FukTheRegister:
Simply the vmlinuz-2.6.31-100-imx51 is not for G1 phone !

You can repack the boot.img with my kernel from my recovery.img and with the initrd.gz of netboot.

And yes, I use msm-kernel sources from openmoko in my boot images, but I did not test kernel from Ubuntu arm. I don't know if he can boot, and if he has drivers for the phone.

The OpenMoko kernel is a fork of Android kernel, if I understood well.
[G1 Android Development] theoneonly:
Have any of you tried http://www.androidfanatic.com/cms/community-forums.html?func=view&catid=9&id=2248

and http://www.androidfanatic.com/cms/community-forums.html?func=view&catid=9&id=1620#1620

Does it work on CM mod?
[G1 Android Development] safet14:
HEY FukTheRegister can u plzzzzzzzzzzzz help me

email me at

safetomerbasic@gmail.com

when ever u can help me
[G1 Android Development] springah:
Theres a 1-click solution for this now, right?
[G1 Android Development] FukTheRegister:
Yes, for what ?

(I think, if ib this forum, it's can help another one !)
[G1 Android Development] mrandroid:
Here, instructions for debian, resizing the image(from your phone!) and installing a GUI.... Enjoy! http://www.myhangoutonline.com
[G1 Android Development] redfvc:
Debian on the G1 cupcake CRC1

Hi all. I've tried installing Debian with the saurik's guide: http://www.saurik.com/id/10 and I have some problems. This is what I did:

1. On my standard (not ADP) G1 cupcake CRC1 I've used InstantRoot application to acquire root ( http://neilandtheresa.co.uk/Android/ ).

2. I've connected to my phone via adb shell, entered su and started executing the steps from the saurik's guide.

3. I've encountered problems while doing the insmod (I was given the same output as on the emulator - that this version of android hasn't been compiled to run insmod). But I didin't worry, saurik has stated that some newer android versions have support for ext2 so the insmod part isn't necessary.

4. mknod /dev/loop0 b 7 0 gives me permission errors. This doesn't happen on emulator and nowhere (google, irc) did I find any help.

Somebody at IRC adviced me to run the 'id' command. Even when I'm in su it doesn't return the "uid=0(root) gid=0(root)" (as it does in the emulator), but the same output as when run from outside the su (some lengthy list but _without_ root).

I. Does this mean that using the InstantRoot application didn't give me root privileges?

II. Is it possible to have debian on G1 CRC1 standard cupcake rom?

Thanks in advance for any help!
[G1 Android Development] ransu:
Fuktheregister, does your install of debian replace the android os? If not how do you choose to boot into debian instead of android?
[G1 Android Development] tep065:
I came across a thread somewhere last night (at work now) that said it does not replace the Rom, it is just a shell. I would assume u would load it like an app on top of your current Rom. I in the process of researching this to apply it soon. Not too familiar with it, and been ages since i've messed with Linux in general. But I did read about the shell thing last night. I'm guessing that it will use the drivers that the rom has to run debian instead of coding new drivers specifically for debian...i'm prolly wrong but that makes sense to me if its just a shell and not a rom replacement
[G1 Android Development] FukTheRegister:
My Debian Instal DOESN'T replace android.

In my test configuration Debian is on the 3thrd partition of my SD card.

To choose the OS on boot, I have make an custum recovery image.

If you boot your phone "normaly" you have Android, if you boot your phone on recovery mode (HOME + POWER) you boot on Debian.

I have make a new initrd, to have a "mega" recovery :

- It'as can boot Os on any partitions.

- It's can boot OS in a DIRECTORY (ex Debian, Ubuntu MID ...)

- It's can make a nadroid backup (not stable at this time)

- It's can leave on shell with Us or FR Keyboard.

Acutaly, I have a 2nd G1 phone, I test to install Debian in the NAND Flash, with Android on SD for the fun.
[G1 Android Development] ransu:
Oh i get it now. Why does everybody talk about the old debian method? This is waaaay better. You should start a new thread just for your debian install with a really complete tutorial that goes over every details for dummies like myself.

I still am wondering how big the 3rd partition needs to be. Also, Im assuming all the commands in the tutorial are done in the linux terminal? Do I need adb installed?
[G1 Android Development] mrandroid:
Guys I posted simple instructions on my site and in the forum here on how to install Debian... It's easy to boot... once installed, you just open up terminal and type

$ su

# bootdeb

and it boots up.

It's around 700-800MB... if you install a GUI you'll need to resize the debian Image to 1.5GB (minimum) and install the GUI.

I have each tutorial up... install debian, resize image and install a GUI. (My instructions included are to do it from a computer or straight from the phone if ytou don't have a linux computer)

The debian file I have on my site has been modded to work on Cupcake, Donut and Hero Builds. All you need on your phone is to have ROOT.

*** All of it runs from a DEBIAN folder on your SDCard so a Class 6 card is recommended ***
[G1 Android Development] ransu:
I appreciate it, but I've done that type of install before. Using vnc viewer to log into a debian gui running ontop of android is very slow. Fuktheregister has created a dual boot method. You don't even start Android. I can only assume its much faster, but Im trying to figure out all the details first.
[G1 Android Development] blackknightavalon:
Does anyone else get a reboot error when 1) running this for the first time and 2) typing in "# sh bootdeb"?

Running CM4.2.5 and trying to get it working. Followed initial instructions from here.
[G1 Android Development] ccunningham83:
Debian problems

I am trying to perform the install as outlined from here:

http://www.myhangoutonline.com/2009/11/22/install-linux-on-your-g1/

When I get to step 10 and type:

sh /scripts/onetime.sh

I get:

sh: Can'topen /scripts/onetime.sh

Everything else seems to install fine. I didn't notice a change when it rebooted after typing:

sh bootdeb

in step 9. It just reboots then I go back to terminal recovery to proceed with step 10. I never get to set the root password. I would like to have it installed with the GUI as outlined in this tutorial

http://www.myhangoutonline.com/2009/11/25/resize-your-linux-image-from-phone-or-computer/

I first have to get Debian up and running first.
[G1 Android Development] vaskas:
Wow, it was great to discover that we can make Debian/Ubuntu run natively on G1. I've been playing around with dual Android-Ubuntu setup for some days, I'm somewhat impressed with it but it feels slow and inefficient due to Android processes taking up too much memory and CPU from Ubuntu (needless to say, the VNC-instead-of-xfbdev hack ain't nice as well).

The G1 looks and feels like a little computer and it definitely lacks a fully-featured native Linux distribution. I hope that FukTheRegister and other guys hacking on it come up with full instructions in the nearest future :)

FukTheRegister, how is everything working there in native Debian? As far as I can see you have KDE installed. Does it run well? I saw people using KDE daily on their Nokia tablets. Since the G1 has a more powerful CPU, it should run nicely on it too I guess. E17 should be a great option too.

I can also see that you tried both Ubuntu and Debian. Are you more focused on Debian now?

Ha-ha, as you understand I am waiting for updates of galoula.net/fr/Tutoriels/HTC-DREAM-G1/ anxiously :)
[G1 Android Development] olvap377:
has there been anu progress with this ?
[G1 Android Development] kR105!:
That will be f*****g awesome!!
[G1 Android Development] Macrophage001:
Im stuck at insmod =/:

insmod $kit/ext2.ko

insmod: can't open '/sdcard/kit/ext2.ko

Do I have to do this on the G1 or on the ADB shell?
[G1 Android Development] Macrophage001:
put the folder with the debian.img, ext2.ko, and the other .ko in the root of the sdcard and rename it kit.

the only problem with this is that a new error appears which is pissing me off -.-
[G1 Android Development] iWannaBeAdored:
what is good about this? what is debian?
[G1 Android Development] Ace42:
http://www.debian.org/

Its another one of those open sourced OS based on Linux.It will be slow since Android might still be using some of the phone's Ram and CPU.
[G1 Android Development] Macrophage001:
Damnit can someone talk about the problems of installing this on the g1 please?!?

Im starting to lose my mind here with the insmod $kit/ext2.ko:mad: lol