[Dev] Native linux on Iconia

Search This thread

sp3dev

Senior Member
Jul 11, 2006
554
675
Kaluga/Moscow
So, let's get linux installed natively on our Iconia.

As some of you I have been working on porting Iconia to chromeos 2.6.38 kernel (to get rid of Acer crappy moron-written drivers (well.. nothing personal, but most code written for commercial embedded devices is a pile of crap and you have to rewrite everything to update kernel or integrate upstream))

For now, I have hardcoded the kernel command line in the boot config to boot off /dev/mmcblk1p2 (that is, you must create ext4 (this is also hardcoded.. uhh)) second primary partition on your sd card with the root fs). For now, until all hardware is working fine and userland is ready, let's boot off micro sd. We don't have nvflash yet so let's leave repartitioning internal storage aside.

Flash the kernel image instead of boot.img to LNX or instead of recovery to SOS. And make sure to write your UID in a secure place before messing with the device - this is the only way to flash your device if you have checksum errors (you should contact sc2k in that case). Okay, even if you eff up here, there is still a way to get UID from a brick so take it easy. But if you do screw it, be prepared to work hard and use some command-line tools.

You should be able to use any armel rootfs. For X11, use fbdev driver and evdev for touchscreen.

For the proprietary NVIDIA accellerated drivers for X11, OpenGL ES and OpenMAX, download the nvidia-tegra package from AC100 PPA https://launchpad.net/~ac100/+archive/ppa (probably you have to manually download using this link http://ppa.launchpad.net/ac100/ppa/...dia-tegra_12-0ubuntu1~alpha1monson6_armel.deb as the package didn't show in aptitude for me after adding to sources.list.. or i was doing sth wrong) or the tarball from nvidia. A newer package of tegra drivers is available at https://launchpad.net/ubuntu/+source/nvidia-graphics-drivers-tegra. You may just add an alternative to mesa EGL/GLES library path via update-alternatives to always use nvidia libs.

precompiled kernel image [15 August 2012]
http://www.mediafire.com/?p32l949n2s7la43

xorg.conf
http://pastebin.com/0a6T6c18

Here is some video
http://www.youtube.com/watch?v=NlGHZ5VTAr8

And now - we need developers, developers, developers.
The git is https://github.com/astarasikov/iconia-gnu-kernel

The main branch is chromeos-2.6.38 that is more stable. The 3.0 branch is unstable (network traffic causes virtual memory trashing).

For now, the following stuff works
-Panel/framebuffer/backlight
-Touchscreen
-Internal eMMC
-microSD slot
-usb gadget
-usb host
-gpio keys/buttons [rotation switch acts as wifi/bluetooth power blocker. iirc, left position disables wireless, right - enables]
-charger
-battery
-shutdown
-LEDs
-bcm4329 wifi (don't forget to copy bcm4329-fullmac-4.bin to /lib/firmware/brcm and nvram.txt from android's /system/etc to the same dir as bcm4329-fullmac-4.txt) [causes lockups with 3.0 kernel]
-nct1008 temperature sensor for cpu throttling
-sound. external speakers and headphones.
-bcm4329 bluetooth. accessible at 115200 on /dev/ttyHS2. Look at http://htc-linux.org/wiki/index.php?title=Ubuntu/Leo/Bluetooth to get it running at higher speeds with proprietary firmware patches (hcd files from android)
-suspend. Although will probably drain a bit more power than android because mmc power is not disabled (due to a race condition in kernel. and because we have rootfs on micro sd). Two glitches are: sometimes, the device freezes for several seconds after suspend (will test later if playing with wifi clock fixes it) and fonts get corrupted after suspend if using proprietary nvidia X11 driver. [suspend works in 2.6.38 only]
-kxtf9 accelerometer
-mpu3050 gyroscope
-ak8975 magnetometer

The following stuff is broken or not implemented at all
-hdmi video. May be working but no one has tested. hdmi audio is not implemented.
-light sensor
-video cameras, focus, torch.
-gps. To turn on the chip, it should be enough to enable gpio 203 via sysfs. Unfortunately it uses the proprietary MEIF protocol which can probably be obtained from Nokia under NDA. And I don't feel like disassembling the whole megabyte of the gps daemon
-3G. I don't have the modem in my iconia. So I don't care. But should be easy to add.

And one notice for those who want to join in. I don't care if hardware works properly. I want 'beautiful' code. That is, please, when you make patches to add functionality, do not follow the path of corporate coders and do not invent custom interfaces and sysfs hacks. Use rfkill for bt/3g power control, for example. And don't be selfish - please share your patches and userland stuff.

TODO:
-fix framebuffer issues (no console till X boots, X fonts and window decorations get corrupted after suspend with proprietary drivers) it kinda works.
-video camera
-port meego or build the list of good software in ubuntu for handling sensors, virtual keyboard etc

I'm not currently working on the project and don't have the device anymore. Feel free to PM me if you need help with some tegra hackery
 
Last edited:

tholmewood

Member
Mar 11, 2008
36
4
FANTASTIC WORK!!!!

Guys... I'm not so clued up on the bootloader here, but is dual boot possible with this setup?


"so I guess I need to switch distro to try out this cool stuff"

What distro are you considering switching to?
 

sp3dev

Senior Member
Jul 11, 2006
554
675
Kaluga/Moscow
FANTASTIC WORK!!!!

Guys... I'm not so clued up on the bootloader here, but is dual boot possible with this setup?


"so I guess I need to switch distro to try out this cool stuff"

What distro are you considering switching to?

Yes, dual boot is possible - the android is in internal memory, our stuff is on micro sd card. It should be possible to even dual boot from internal memory, but not right now

I am switching to ubuntu because it has a lot of packages prebuilt
 

tholmewood

Member
Mar 11, 2008
36
4
Yes, dual boot is possible - the android is in internal memory, our stuff is on micro sd card. It should be possible to even dual boot from internal memory, but not right now

I am switching to ubuntu because it has a lot of packages prebuilt

Man I cant wait to get Netbook Remix dual booting on this badboy... Living the dream I tell ya...

Thanks again :)
 

M..N

Senior Member
Jul 14, 2009
1,212
99
Would booting a distro from say the usb work?

Sent from my HTC HD2 using XDA Premium App
 
  • Like
Reactions: sirzen

sp3dev

Senior Member
Jul 11, 2006
554
675
Kaluga/Moscow
Would booting a distro from say the usb work?

Sent from my HTC HD2 using XDA Premium App

I see no reason why not. But you'd have to hardcode the uuid of the boot partition in kernel command line or build a ram disk. Anyway having to use a heavy and power consuming external storage sounds like an extremely stupid and useless idea
 
  • Like
Reactions: HannoSLM

M..N

Senior Member
Jul 14, 2009
1,212
99
I see no reason why not. But you'd have to hardcode the uuid of the boot partition in kernel command line or build a ram disk. Anyway having to use a heavy and power consuming external storage sounds like an extremely stupid and useless idea

Not even from a USB flash drive? Wouldn't it be the same as say booting it from a microsd card?

Sent from my A500 using XDA Premium App
 

yodor

Member
Jun 20, 2011
21
3
Haskovo
can you share the steps after compiling the kernel ?
I would like to try with different kernels but I'm still not confident on how to do this.
If I use dd if=zImage of=/dev/mmcblk00p1
will this effectively boot this kernel after pressing power and vol- keys ?
 

sp3dev

Senior Member
Jul 11, 2006
554
675
Kaluga/Moscow
can you share the steps after compiling the kernel ?
I would like to try with different kernels but I'm still not confident on how to do this.
If I use dd if=zImage of=/dev/mmcblk00p1
will this effectively boot this kernel after pressing power and vol- keys ?

No.. You need to build boot image with android's mkbootimg and flash instead of recovery. And then, mkfs.ext4 on your sd card on partition mmcblk1p2 and untar rootfs there
 
  • Like
Reactions: montolla and yodor

yodor

Member
Jun 20, 2011
21
3
Haskovo
Thanks man, this is really getting clear to me now.
I'm going to try and post results here. I will love to try and see how arch, fedora and ubuntu will run on A500.
 
P

profclean2000

Guest
There are two apps in the Android market that will install either Ubuntu or Backtrack for you- they are not native installs though I can confirm they perform well even if it is chroot and I can also confirm they work on the iconia great! Search ubuntu installer or backtrsck5 linux install in the mmarket....
 

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    So, let's get linux installed natively on our Iconia.

    As some of you I have been working on porting Iconia to chromeos 2.6.38 kernel (to get rid of Acer crappy moron-written drivers (well.. nothing personal, but most code written for commercial embedded devices is a pile of crap and you have to rewrite everything to update kernel or integrate upstream))

    For now, I have hardcoded the kernel command line in the boot config to boot off /dev/mmcblk1p2 (that is, you must create ext4 (this is also hardcoded.. uhh)) second primary partition on your sd card with the root fs). For now, until all hardware is working fine and userland is ready, let's boot off micro sd. We don't have nvflash yet so let's leave repartitioning internal storage aside.

    Flash the kernel image instead of boot.img to LNX or instead of recovery to SOS. And make sure to write your UID in a secure place before messing with the device - this is the only way to flash your device if you have checksum errors (you should contact sc2k in that case). Okay, even if you eff up here, there is still a way to get UID from a brick so take it easy. But if you do screw it, be prepared to work hard and use some command-line tools.

    You should be able to use any armel rootfs. For X11, use fbdev driver and evdev for touchscreen.

    For the proprietary NVIDIA accellerated drivers for X11, OpenGL ES and OpenMAX, download the nvidia-tegra package from AC100 PPA https://launchpad.net/~ac100/+archive/ppa (probably you have to manually download using this link http://ppa.launchpad.net/ac100/ppa/...dia-tegra_12-0ubuntu1~alpha1monson6_armel.deb as the package didn't show in aptitude for me after adding to sources.list.. or i was doing sth wrong) or the tarball from nvidia. A newer package of tegra drivers is available at https://launchpad.net/ubuntu/+source/nvidia-graphics-drivers-tegra. You may just add an alternative to mesa EGL/GLES library path via update-alternatives to always use nvidia libs.

    precompiled kernel image [15 August 2012]
    http://www.mediafire.com/?p32l949n2s7la43

    xorg.conf
    http://pastebin.com/0a6T6c18

    Here is some video
    http://www.youtube.com/watch?v=NlGHZ5VTAr8

    And now - we need developers, developers, developers.
    The git is https://github.com/astarasikov/iconia-gnu-kernel

    The main branch is chromeos-2.6.38 that is more stable. The 3.0 branch is unstable (network traffic causes virtual memory trashing).

    For now, the following stuff works
    -Panel/framebuffer/backlight
    -Touchscreen
    -Internal eMMC
    -microSD slot
    -usb gadget
    -usb host
    -gpio keys/buttons [rotation switch acts as wifi/bluetooth power blocker. iirc, left position disables wireless, right - enables]
    -charger
    -battery
    -shutdown
    -LEDs
    -bcm4329 wifi (don't forget to copy bcm4329-fullmac-4.bin to /lib/firmware/brcm and nvram.txt from android's /system/etc to the same dir as bcm4329-fullmac-4.txt) [causes lockups with 3.0 kernel]
    -nct1008 temperature sensor for cpu throttling
    -sound. external speakers and headphones.
    -bcm4329 bluetooth. accessible at 115200 on /dev/ttyHS2. Look at http://htc-linux.org/wiki/index.php?title=Ubuntu/Leo/Bluetooth to get it running at higher speeds with proprietary firmware patches (hcd files from android)
    -suspend. Although will probably drain a bit more power than android because mmc power is not disabled (due to a race condition in kernel. and because we have rootfs on micro sd). Two glitches are: sometimes, the device freezes for several seconds after suspend (will test later if playing with wifi clock fixes it) and fonts get corrupted after suspend if using proprietary nvidia X11 driver. [suspend works in 2.6.38 only]
    -kxtf9 accelerometer
    -mpu3050 gyroscope
    -ak8975 magnetometer

    The following stuff is broken or not implemented at all
    -hdmi video. May be working but no one has tested. hdmi audio is not implemented.
    -light sensor
    -video cameras, focus, torch.
    -gps. To turn on the chip, it should be enough to enable gpio 203 via sysfs. Unfortunately it uses the proprietary MEIF protocol which can probably be obtained from Nokia under NDA. And I don't feel like disassembling the whole megabyte of the gps daemon
    -3G. I don't have the modem in my iconia. So I don't care. But should be easy to add.

    And one notice for those who want to join in. I don't care if hardware works properly. I want 'beautiful' code. That is, please, when you make patches to add functionality, do not follow the path of corporate coders and do not invent custom interfaces and sysfs hacks. Use rfkill for bt/3g power control, for example. And don't be selfish - please share your patches and userland stuff.

    TODO:
    -fix framebuffer issues (no console till X boots, X fonts and window decorations get corrupted after suspend with proprietary drivers) it kinda works.
    -video camera
    -port meego or build the list of good software in ubuntu for handling sensors, virtual keyboard etc

    I'm not currently working on the project and don't have the device anymore. Feel free to PM me if you need help with some tegra hackery
    7
    It appears to be booting into the p2 kernel as dmesg shows:

    Linux version 2.6.36.4-DFRX-ge7dee2a-dirty (alexander@wintermute)

    A normal boot shows:

    Linux version 2.6.36.3 (simba@lion) (gcc version 4.4.3 (GCC) ) #1 SMP PREEMPT

    Dang. Looks like I've uploaded the wrong image.. Which pretty much explains why the kernel hangs.

    Here is the correct link (the original post is updated as well) - http://www.mediafire.com/?a5ii7l1q11595ht

    As for compiling kernel. Download a toolchain (I'm using Sourcery G++ Lite for arm). Use something like this

    Code:
    #use your toolchain path
    export PATH=/home/alexander/handhelds/armv6/codesourcery/bin:$PATH
    export ARCH=arm
    #and here
    export CROSS_COMPILE=/home/alexander/handhelds/armv6/codesourcery/bin/arm-none-eabi-
    #path where your git clone or archive lies
    cd /home/alexander/handhelds/tegra/kernel/chromium
    make iconiaa500_defconfig
    #use -j2 if you have one CPU. or Ncpu * 2 if you have more cores to speed up
    make -j4 ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE zImage modules
    #this kernel doesn't really build useful modules
    rm -r /home/alexander/handhelds/tegra/modules
    make modules_install INSTALL_MOD_PATH=/home/alexander/handhelds/tegra/modules/
    
    #now, make a flashable image. use mkbootimg from android tree or use Google to find a binary
    export TEGRA=/home/alexander/handhelds/tegra
    mkbootimg --ramdisk /dev/zero --kernel ${TEGRA}/kernel/chromium/arch/arm/boot/zImage -o ${TEGRA}/rc/newrec.img

    Sorry guys for uploading the wrong image.. Hope it works this time for everyone
    5
    You can follow OP post or netham's instruction (http://xdaforums.com/showpost.php?p=20013519&postcount=200) or you can follow this :)

    OPTION 1:
    Netham's recovery image and rootfs (everything can be done within Windows):
    original post: http://xdaforums.com/showpost.php?p=20157497&postcount=242
    Firstly download these files:
    Here are the links to the rootfs :

    http://www.mediafire.com/?f8kbtmdm4gt2fhb
    http://www.mediafire.com/?btrp3tnbbszdzq2
    http://www.mediafire.com/?9iby2p7d83yld7w

    Recovery image: http://www.mediafire.com/?k6j2ck6et8kbgyg

    Now, extract the recovery image to ur SDCard (external) and use Acer Recovery Installer to flash it.

    Then extract the rootfs file above to your harddrive and copy it straight to the home directory of your internal sdcard (the internal 16GB/32GB memory).

    Reboot your tablet into recovery mode and you are ready to go.

    Fix audio (thx to sp3dev and netham)
    Code:
    usermod -a -G audio <your username here>
    ---------------
    OPTION 2
    Sp3dev's recovery image and rootfs
    original post: http://xdaforums.com/showpost.php?p=20013519&postcount=225

    First, you need to have an external SDCard. Use a live ubuntu disk to partition your sdcard into 3 partition (use GParted, youtube how to use gparted in ubuntu for sdcard)
    ||||1st partition is Fat32 ||||2nd partion is EXT4||||3rd is swap (optional)

    Then download this rootfs from http://www.2shared.com/qs/1/ubuntu.tar.part
    After that, extract those files in the tar file into your EXT4 partition using this command:

    For example:
    I partitioned my SDcard into
    ||||Fat32-label: SDStorage||||EXT4-label: Iubuntu:||||SWAP-nolabel

    Then I copy the tar file onto my SDStorage partition
    In Ubuntu, I mount SDStorage and Iubuntu, open terminal and do:
    Code:
    cd /media/Iubuntu/
    sudo tar -zxf /media/SDStorage/tarballfilenameuextracted

    Let the computer do the job.

    Once everything is done, download this recovery image from http://www.mediafire.com/?d73g9bnc8s3b18c and extract it to ur SDStorage again. then put ur sdcard into ur tablet. Get into Android, run Acer Recovery Installer and flash the recovery image from the sdcard.

    Then reboot into recovery mode (volumn up power on) and you are ready to go.

    ________

    Both rootfs are working fine :) You need to do updates to get the latest version of ubuntu on ur tablet.

    GRAPHIC (HW Acceleration --- I WISH :(
    You need to install the tegra graphic driver manual. I recommend the alpha version not the beta one as flash crashed.
    Download it at: http://dl.dropbox.com/u/27802094/arm tegra driver/nvidia-tegra_12~beta1-0ubuntu1_armel.deb and rename to nvidia.deb

    After that, copy it to ur SDStorage and in terminal, type:
    Code:
    cd /media/SDStorage
    sudo dpkg -i nvidia.deb
    Also install the following lib:
    Code:
    sudo apt-get install mesa-utils
    Code:
    sudo apt-get install libgl1-mesa-swrast

    Restart the tablet and go to SYSTEM Settings - System info and see if you get MESA X11 as ur graphic device.
    You can check by running
    Code:
    glxgears
    in terminal or
    Code:
    xvinfo

    CPU
    For cpu, run it at 1Ghz all the time will provide you better smoothness. You can do it by installing indicator-cpufreq from terminal:

    Code:
    sudo add-apt-repository ppa:artfwo/ppa
    sudo apt-get update
    sudo apt-get install indicator-cpufreq

    Everytime ur restart your tablet you can choose which power management profile to use: powersave---ondemand---performance(go for this XD)

    ZRAM
    in terminal:
    Code:
    sudo wget -O /etc/init/zramswap.conf 'https://wiki.ubuntu.com/ARM/TEGRA/AC100?action=AttachFile&do=get&target=zramswap.conf'

    Flashplayer

    Code:
    sudo wget -O /usr/lib/mozilla/plugins/libflashplayer.so http://kotelett.no/ac100/phh/Android2.2/libflashplayer.so

    Code:
    sudo wget -O /usr/lib/chromium-browser/plugins/libflashplayer.so http://kotelett.no/ac100/phh/Android2.2/libflashplayer.so
    Swap
    I took advantage of the spare swap partition on my SDCard....though it doesn't help improving the performance much. Only work well when u use things like office or gaming.

    --------------------------------
    That's pretty much I have gone through so far. If u know how to enable HW Acceleration, please let me know :)
    4
    FANTASTIC WORK!!!!

    Guys... I'm not so clued up on the bootloader here, but is dual boot possible with this setup?


    "so I guess I need to switch distro to try out this cool stuff"

    What distro are you considering switching to?

    Yes, dual boot is possible - the android is in internal memory, our stuff is on micro sd card. It should be possible to even dual boot from internal memory, but not right now

    I am switching to ubuntu because it has a lot of packages prebuilt
    4
    I'm typing most of this from memory, but here goes.


    I have two different methods in here, one using my kernel, and one using sp3devs. My kernel boots from a loopback image on your tablet, his boots from a partition on the SD Card.

    The main differences are:

    Mine uses internal storage which is faster than the SD card
    Mine uses internal storage which takes internal memory
    Mine is a bit easier to set up
    My kernel has a handful of extra drivers, such as USB audio, installed

    sp3dev's uses an SD card which is slightly slower
    sp3dev's uses and SD card which leaves all the internal memory for Android
    sp3dev's is a bit more complicated to partition and set up
    sp3dev's provides the minimum to use your tablet

    -Here are the steps for creating a rootstock image-
    1) Install ubuntu on your PC or inside a VM. There are millions of tutorials for this out there, so I'm not going to bother.

    2) Once that's done, install rootstock.
    Code:
    sudo apt-get install rootstock

    3) Once that's installed, you need to generate an image.
    Code:
        sudo rootstock \
            --fqdn ubuntu \
            --login ubuntu \
            --password ubuntu \
            --imagesize 3G \
            --seed ubuntu-desktop \
            --notarball
    The components to this particular command are:
    --fqdn : This will be your images hostname
    --login :This will be the account you log in with
    --password : This will be the password y ou log in with
    --imagesize : This is the image size. 3G is 3 gigs.
    --seed : This is the initial package that is installed. I personally use kubuntu-desktop(KDE), though I would suggest you use ubuntu-desktop(Gnome) or xubuntu-desktop(XFCE), as KDE isn't the most stable on our tablets.
    --notarball : This creates a root image we can mount as a loopback image. If you're using sp3devs kernel, omit this line.

    -Here are the instructions for using my kernel-
    4) There will be a file in the folder you're in named <filename>.img. Rename that to rootfs.img and upload it to your tablets internal memory (/sdcard on android)

    5) Download my kernel, extract it, and name it 'Recovery.img'. Upload this to your tablets internal memory too.

    6) Download and install the Acer Recovery Installer onto your tablet. Open it up and select 'Flash custom or stock recovery.img from sdcard', hit flash.

    7) Hit reboot into recovery. If I didn't miss a step in my writeup, you're done.



    -Here are the instructions for using sp3dev's kernel (These steps assume you're on Linux, I know of no way to do this from within Windows)-
    4) Get a MicroSD card. I suggest a -minimum- of 4GB. Format it using gparted so that it has two partitions, a small FAT partition at the beginning for usage with Android, and the rest an ext4 partition.

    5) Mount the SD card and change to the root of it. Then extract the tarball you created with rootstock to it.
    Code:
    sudo mkdir /mnt/sd
    sudo mount /dev/sdX2 /mnt/sd # Where X is the device for your SD card
    sudo cd /mnt/sd
    sudo tar -zxf /path/to/the/rootstock/tarball/here

    6) Unmount it, then go download sp3devs kernel. I don't have a link handy, but it's in this thread somewhere. Place his kernel on your tablets internal memory (/sdcard on android) as 'recovery.img'.

    7) Download and install the Acer Recovery Installer onto your tablet. Open it up and select 'Flash custom or stock recovery.img from sdcard', hit flash.

    8) Hit reboot into recovery. If I didn't miss a step in my writeup, you're done.


    Note: I'm omitting the part to get wifi to run here. I can't recall it off the top of my head, but all it is is copying two files into a folder on the image you just made. I believe that there is another tutorial somewhere for this.

    From here, you'll want to start configuring the system. The first thing I did was remove pulseaudio. I was getting audio stuttering with it. This can be achieved by renaming the pulseaudio file in /usr/bin. sudo mv /usr/bin/pulseaudio /usr/bin/pulseaudio.old. This causes it to fail back to ALSA which has the nifty property of not being a CPU whore.

    The next thing I did was set an automatic login. This can be achieved in KDE through the settings panel, I imagine that it'd be located similarly in Gnome and XFCE.

    Then I got a virtual keyboard. Once again, I used KDEs built-in one (kvkbd), though I imagine at least Gnome has one available. There are dozens within ubuntu's repos, too.

    Those were the only things I felt were really necessarry for a tablet. For a browser, I use Chromium, and I use pithos (when it's not broken) for Pandora Radio.

    Feel free to ask for help on this, though I ask that you ask in this thread, and not PM me. I won't respond if you do PM me.