[WIP] Asus Eee Pad Transformer native install

Install Arch Linux ARM on other devices.

[WIP] Asus Eee Pad Transformer native install

Postby Gary13579 » Sun Dec 16, 2012 4:37 am

prereq's: rooted TF101 with a custom recovery (CWM). Installation to microSD card (which this guide uses) does not require an unlocked bootloader, as it does not touch the internal partition layout. It is setup to dualboot Arch and Android. You must flash a file in recovery to switch between the two operating systems. Data will be preserved through the flashing.

This should work on other TF models, but you may need different kernels. I only have a TF101 to test on.

I have had a TF101 since launch, but have always shied away from getting Arch Linux (or worse, Ubuntu) on it due to the lack of proper GPU drivers. Today, I found out nvidia has released Tegra 2 drivers for the 3.1 kernel, so I figured I may as well get this underway. Thankfully I am able to take a lot of information from the various Ubuntu development to speed up this progress, and felt I should post this to try to get further interest and help.

Current progress:
It boots!

WIP:
X server
Getting linux kernel 3.1 booting
GPU driver (requires above)
wifi
practically everything else

Steps taken:
$this->bbcode_second_pass_code('', 'wget http://archlinuxarm.org/os/ArchLinuxARM-trimslice-latest.tar.gz
dd if=/dev/zero of=arch.img seek=749999999 bs=1 count=1
mke2fs -F arch.img
sudo mknod /dev/loop1 b 7 0
sudo losetup /dev/loop1 arch.img
mkdir arch
sudo mount -t ext2 /dev/loop1 arch/
cd arch
sudo tar xzf ../ArchLinuxARM-trimslice-latest.tar.gz')

At this point, we have created a rootfs image called arch.img and extracted the trimslice rootfs to it. This is the exact same as building the image for a chroot, so if you have a trimslice chroot already on your TF101, then you can use that image instead. Now, we need to stick this onto the microSD card. Plug your microSD card into your computer, then continue. You'll need to determine the block device of your card for yourself, and replace /dev/sdb1 below with it. Failing at the next command can cause data loss to your computer. Make absolutely sure you know what device your microSD card is before continuing.

$this->bbcode_second_pass_code('', 'sudo dd if=arch.img of=/dev/sdb1 bs=8M')

The microSD card should now contain the Arch image. Now we need to flash a file in CWM on the tablet that instructs the bootloader to boot Arch over Android. This is really just a blob file that contains the kernel, initrd, etc. If you want to boot into Android, you have to have a kernel blob available for your ROM. I use RaymanFX's CM10 build with his ELITE kernel, which means if I want to go back to Android, I just have to flash his ELITE kernel from this thread, however, that may not work on your ROM. You need to find a kernel .zip for your ROM in order to return to Android.

Download this .zip to the internal memory of your tablet, http://dl.dropbox.com/u/60048492/transf ... sdcard.zip . This contains the 2.6.36.4 kernel along with a boot.cfg which instructs the device to boot mmcblk1p1, which is our microSD card containing Android. Reboot into recovery by holding the volume down button while turning the device on. Hit the volume up button as soon as some text appears (if you don't do this fast enough, it will wipe your tablet. annoying.) Flash the zip from internal memory, and when you reboot, it should boot into Arch Linux! Default password for root account is just 'root'.

There's still a long way to go on getting this usable. I'm willing to put in the work myself, but I am very new at this, it is the first time I have tried porting Linux to a device such as this, I've never even compiled linux kernel before. When things are further along, I hope to be able to contribute a rootfs to the ArchLinuxARM community to make this process much easier.

Comments/suggestions/help appreciated <3.
Gary13579
 
Posts: 30
Joined: Tue Feb 28, 2012 9:21 am

Re: [WIP] Asus Eee Pad Transformer native install

Postby Gary13579 » Sun Dec 16, 2012 10:49 pm

Progress update:
3.1.10 kernel boots
wifi working (requires proprietary firmware file ripped from Android)
X is starting

About X, there's currently no HW acceleration, and touchpad still broken. Still a long way to go, but I'm getting there :).
Gary13579
 
Posts: 30
Joined: Tue Feb 28, 2012 9:21 am

Re: [WIP] Asus Eee Pad Transformer native install

Postby Gary13579 » Mon Dec 17, 2012 6:35 am

Posting this from Chrome inside Arch running natively on my TF101 :).

Checking about:gpu, NOTHING is being accelerated. I can't tell if this is because I still haven't gotten the GPU driver working properly, or if it's because Chrome doesn't support GLES (I doubt this, Samsung Chromebook uses GLES).

Currently, I am booting the 3.1.10 kernel made by Jhinto at xda. But that only works with the r15 driver. I want to get the r16.2 driver working. This apparently means I'm going to need to merge Jhinta's tweaked kernel into nvidia's r16.2 kernel, as the driver is tied very closely to specific kernels.

To get wifi working, you need to get the firmware file brcm4329-fullmac-4.bin off of your Android install on your tablet. I put it in /lib/firmware/brcm/. Then load the module like this:

modprobe bcm4329 firmware_path=/lib/firmware/brcm/bcm4329-fullmac-4.bin

Then, either write your own wpa_supplicant.conf, or even easier, copy the one from your Android install.

# mkdir android
# mount /dev/mmcblk0p7 android
# cp android/misc/wifi/wpa_supplicant.conf /etc/

Then to start it up:

# wpa_supplicant -B -i eth0 -c /etc/wpa_supplicant.conf
# dhcpcd eth0

You still need to build a new kernel if you want to really start messing with GPU stuff. X will probably work with software framebuffer on the kernel I posted in OP. I don't want to post my kernel until I clean the modules up/get initramfs working, and more importantly, merge nvidia's r16.2 kernel into Jhinto's so that we get latest GPU drivers with all of the TF101 kernel tweaks. I will hopefully work on this tomorrow, but I'm pretty burnt out today.

edit: forgot to mention, touchpad is working fine. just grab xf86-input-mtrack-git from the AUR and build it. Then edit /etc/X11/xorg.conf.d/10-mtrack.conf to contain

$this->bbcode_second_pass_code('', 'Section "InputClass"
Identifier "elantech_touchscreen"
MatchProduct "elantech_touchscreen"
MatchDevicePath "/dev/input/event*"
Driver "mtrack"
EndSection')

Buttons work as does trackpad. Two finger tap acts as right click, but it currently does not support gestures (such as two fingers to scroll). AFAIK no one has gotten gestures working yet... I'll have to try, because that'd be nice.
Gary13579
 
Posts: 30
Joined: Tue Feb 28, 2012 9:21 am

Re: [WIP] Asus Eee Pad Transformer native install

Postby Gary13579 » Sat Dec 22, 2012 1:58 am

Gonna try to write up a full guide on what all I have done so far, starting from scratch. If you want to boot Arch, follow these instructions:

Downloads:
1) TrimSlice ALARM build: http://archlinuxarm.org/os/ArchLinuxARM ... est.tar.gz
2) Kernel modules/firmware: http://novaspirit.com/tubuntu/kernel_sup_3-7-12.tar.gz
3) Packed kernel and initramfs in an Android recovery flashable zip: https://docs.google.com/open?id=0B0_TDZ ... GY4WS1zbnM (this is named Ubuntu-sdcard.zip and says flashing Ubuntu when you flash it... ignore that, too lazy to change it yet)
4) wifi module firmware in http://dl.dropbox.com/u/60048492/files.tar.gz

Stick the microSD card into your computer and format it, then mount it to /mnt/microsd. I will skip these steps because you may want to use a different FS format than I. I chose ext2.

$ sudo su
# cd /mnt/microsd
# tar xvf ~/path/to/ArchLinuxARM-trimslice-latest.tar.gz
# tar xvf ~/path/to/files.tar.gz
# tar xvf ~/path/to/kernel_sup_3-7-12.tar.gz

Make sure that kernel_sup_3-7-12.tar.gz overwrites any files that already exist.

# vim etc/pacman.conf

You can use nano as well. Just make sure you add the following to the repos, before everything else

$this->bbcode_second_pass_code('', '[fly-ac100]
Server = http://flie.no-ip.org:7080/archlinux/armv7h/')

Please note this is an untrusted repo. I have not talked to fly, and cannot confirm that he is trustworthy. He has the ability to trojan his packages. If you are paranoid, do not use his repo, and instead build the packages yourself. I, however, am lazy.

We need to grab a couple of packages related to wifi and store them on the microSD card to install them later.

# cd /mnt/microsd/root
# wget http://us.mirror.archlinuxarm.org/armv7 ... pkg.tar.xz
# wget http://us.mirror.archlinuxarm.org/armv7 ... pkg.tar.xz
# wget http://us.mirror.archlinuxarm.org/armv7 ... pkg.tar.xz
# wget http://us.mirror.archlinuxarm.org/armv7 ... pkg.tar.xz
You should unmount the microSD card and insert it into your tablet.

# cd ..
# umount microsd

Once it is back in your tablet, reboot into recovery and flash Ubuntu-sdcard.zip from within CWM. This flashes a blob file which contains the kernel, a bootimg.cfg, and initramfs. After it has flashed, reboot your tablet. You'll get an ASUS bootloader screen with a progress bar. After that is done, it'll reboot again. This time after the bootloader screen, you should see Linux starting! Wait for that to finish and you should be at a login prompt. Username root, password root.

Now, let's get wifi working. Enter the following on your tablet.

# mkdir android
# mount /dev/mmcblk0p7 android
# cp android/misc/wifi/wpa_supplicant.conf /etc/
# pacman -U *.pkg.tar.xz

Now, every time you want to start wifi, you need to do the following. I currently have them saved in a bash script named "wifi". I plan to automate module loading eventually but it doesn't work right now.

# modprobe bcm4329 firmware_path=/lib/firmware/brcm/bcm4329-fullmac-4.bin
# wpa_supplicant -B -i eth0 -c /etc/wpa_supplicant.conf
# dhcpcd eth0

Wifi should now work! Test it by pinging both local and remote networks. Time to do a

# pacman -Syy

Now to install some useful packages:

# pacman -S fly-ac100/xorg-server nvidia-tegra libegl libgles libva mesa-demos-git

We need to specify fly-ac100 for xorg-server because the xorg-server in main repos is incompatible with the current driver. The rest of the packages are also from the ac100 repository.

Now, edit /etc/pacman.conf to add "xorg-server" to IgnorePkg line. This prevents pacman from updating xorg, so that it doesn't update it later and break it. Run a full system update:

# pacman -Syu

Install sudo

# pacman -S sudo

Run visudo (or EDITOR=nano visudo) to configure the sudoers file and give access to the group wheel.

At this point you should create your own non-root user.

# useradd -m -g users <YOURUSERNAME>
# usermod -aG bin,daemon,adm,tty,disk,kmem,wheel,ftp,rfkill,http,network,video,audio,storage,scanner,power,dbus <YOURUSERNAME>
# passwd <YOURUSERNAME>

At this point, you should log out and login to your new user. We should get the touchpad working now:

$ mkdir builds
$ cd builds
$ sudo pacman -S base-devel
$ wget https://aur.archlinux.org/packages/xf/x ... git.tar.gz
$ tar xvvf xf86-input-mtrack-git.tar.gz
$ cd xf86-input-mtrack-git
$ makepkg -s
$ sudo pacman -U *.pkg.tar.gz

Now we need to edit the 10-mtrack.conf file to detect our touchpad. Edit /etc/X11/xorg.conf.d/10-mtrack.conf to contain the following:

$this->bbcode_second_pass_code('', '
Section "InputClass"
Identifier "elantech_touchscreen"
MatchProduct "elantech_touchscreen"
MatchDevicePath "/dev/input/event*"
Driver "mtrack"
EndSection')

At this point, you should be able to install whatever you want. I use openbox with tint2 as my window manager. I won't cover installing/configuring those, but they should work as expected. Just toss exec openbox-session into ~/.xinitrc, then run startx. X is hardware accelerated. Chrome is fully hardware accelerated, as well, and runs very smooth.

Much much thanks to fly for packaging up tegra driver and to novaspirit/x3maniac from XDA for updating the TF kernel to support compositing. Also HUGE thanks to lilstevie/jhinta at XDA for all of their work on Linux for the TF101.

If you have any problems, PLEASE post them. I typed most of this from memory and may have forgotten steps.
Gary13579
 
Posts: 30
Joined: Tue Feb 28, 2012 9:21 am

Re: [WIP] Asus Eee Pad Transformer native install

Postby sim590 » Mon Dec 24, 2012 9:50 pm

Hello, I'm interested in installing this but I have some questions. I think this is the right place to post them.

- I have Asus TF101 but I would be using the sdcard that plants itself in the keyboard (not the microSD). Would it boot anyway? Presently, I have flashed the ubuntu.zip file from CWM recovery, but it rebooted in Android :| .

- My tablet doesn't seem to be able to mount the sdcard that's in my keyboard. When I'm on Android, I go Settings>Storage>SD card>Mount device and it seems to be triggering something and canceling just after (I don't have access to it through file manager). Any thoughts on how to fix this? Would it be the cause of the first problem I mentionned?
sim590
 
Posts: 13
Joined: Mon Dec 24, 2012 9:17 pm

Re: [WIP] Asus Eee Pad Transformer native install

Postby Gary13579 » Tue Dec 25, 2012 7:33 am

$this->bbcode_second_pass_quote('sim590', 'H')ello, I'm interested in installing this but I have some questions. I think this is the right place to post them.


Yup. I don't check IRC that often so sorry for ignoring your PMs, I just saw them. I'd prefer to answer questions here.

$this->bbcode_second_pass_quote('sim590', '-') I have Asus TF101 but I would be using the sdcard that plants itself in the keyboard (not the microSD). Would it boot anyway? Presently, I have flashed the ubuntu.zip file from CWM recovery, but it rebooted in Android :| .


That wouldn't work, at least not with the current Ubuntu-sdcard.zip. Inside of the zip is a "kernelblob" file which gets flashed over the Android kernel. This includes the kernel zImage, a bootimg.cfg, and an initramfs. You need to modify the bootimg.cfg to point to the SD card rather than the microSD card. But I'm not sure where the SD card is mounted (microSD is /dev/block/mmcblk1p1), if it is at all. You need "abootimg" and "blobpack" tools to mess around with these, I suggest looking at this thread: http://forum.xda-developers.com/showthr ... ?t=1537566

$this->bbcode_second_pass_quote('sim590', '-') My tablet doesn't seem to be able to mount the sdcard that's in my keyboard. When I'm on Android, I go Settings>Storage>SD card>Mount device and it seems to be triggering something and canceling just after (I don't have access to it through file manager). Any thoughts on how to fix this? Would it be the cause of the first problem I mentionned?


That's probably normal, I don't think Android will mount an ext2/3/4 partition. Just open a terminal and mount it manually.
Gary13579
 
Posts: 30
Joined: Tue Feb 28, 2012 9:21 am
Top

Re: [WIP] Asus Eee Pad Transformer native install

Postby sim590 » Tue Dec 25, 2012 8:27 pm

Hey,

I've managed to modify boot.cfg to point to the right media (path was /dev/sda1), but I'm having a problem. When linux boots, it says:
$this->bbcode_second_pass_code('', 'FATAL: Could not load /lib/modules/2.6.36.4/modules.dep: No such file or directory') It also reboots for ever so I need to force it to go to the cwm.

I used the files given on the post you told me to look on since I thought there was no way to modify your blob file (is that so?) so I made the blob myself with the procedure written on XDA forums. I think the problem comes from there. I would rather need to edit the boot.cfg of your kernelblob.LNX. Is it possible? How?

If it isn't possible, I guess that I would need to make a blob that would use kernel 3.1.10 properly i.e to do everything you've done but change the root=/dev/mmcblock1p1 to root=/dev/sda1

I hope you got a clue..

Thanks.
sim590
 
Posts: 13
Joined: Mon Dec 24, 2012 9:17 pm

Re: [WIP] Asus Eee Pad Transformer native install

Postby Gary13579 » Wed Dec 26, 2012 8:37 am

You're using an out of date kernel. You should modify the kernelblob I have posted. Just unzip the blob file from the Ubuntu-sdcard.zip, then extract the bootimg.cfg from it. Run "abootimg" without any arguments and it should give you some information on how to extract it the config. After you've edited the .cfg, just update the blob with the new cfg (again, check the output of "abootimg" to see how to update the blob with new .cfg).

After that, you just need to run blobpack on the file (the command mentioned on the forum post I linked), then add it to the zip file. You should then be able to flash it.

Also, audio over the speakers works fine! Just tested it last night. Just install alsa-utils from repos, then run "alsamixer". You need to unmute some channels near the very end (specifically left and right DACL, I *think*), and it works great. Haven't messed around with the headphone jack yet.
Gary13579
 
Posts: 30
Joined: Tue Feb 28, 2012 9:21 am

Re: [WIP] Asus Eee Pad Transformer native install

Postby sim590 » Wed Dec 26, 2012 1:59 pm

I hope I'm not messing this thread too much by posting my questions (hope it helps if someone runs into something similar).

Ok here's what I did:
$this->bbcode_second_pass_code('', '# unzip Ubuntu-update.zip
# ./blobunpack kernelblob
# ./aboot-i686 -x kernelblob.LNX
# rm zImage initrd.img /* Getting rid of files I don't need since I'm directly updating the kernelblob.LNX file. At first, I did by rebuilding the image with "zImage" and "initrd.img" and blobpacking all back and it was the same.. */
# vim bootimg.cfg // Editing the cfg file in order to replace root=/dev/mmcblk1p1 by root=/dev/sda1
# ./aboot-i686 -u kernelblob.LNX -f bootimg.cfg
# rm kernelblob // Removing the old kernelblob
# ./blobpack kernelblob LNX kernelblob.LNX
# zip -r archSD-update.zip kernelblob META-INF
# adb push archSD-update.zip /sdcard/')
From there, I flash it from CWM and nothing has changed. It still is looking for 2.6.36 modules and rebooting over and over.

My guess is that using your files (your kernel "zImage" and "initrd.img") made no changes after flashing. I verified that by flashing back the stock ASUS firmware and then reflash archSD-update.zip and then I noticed it booted in Android. So, flashing your files doesn't change anything but flashing the files from the XDA forum post makes a change (It wants to boot kernel 2.6.36).

So, you may have uploaded the wrong files on docs.google.com or else I don't know what's going on..
sim590
 
Posts: 13
Joined: Mon Dec 24, 2012 9:17 pm

Re: [WIP] Asus Eee Pad Transformer native install

Postby Gary13579 » Wed Dec 26, 2012 2:28 pm

Here are the exact steps I took to build the Ubuntu-sdcard.zip file. I used a kernel compiled by someone else (x3maniac from xda). This is right from my ~/.bash_history, so it should produce proper results if done properly.

$this->bbcode_second_pass_code('', '
wget http://novaspirit.com/tubuntu/kernel.tar.gz
tar xvvf kernel.tar.gz
vim bootimg.cfg # build your own bootimg here
abootimg -u linux3.1.10+.img -f bootimg.cfg
blobpack kernelblob LNX linux3.1.10+.img
zip -u Ubuntu-sdcard.zip kernelblob
')

If you still get the error that it can't load modules.dep, then I'm not sure what the issue is. Based on the path it's using to look for modules.dep, the tablet is booting a 2.6.36.4 kernel (likely the Android kernel), which would make me think that the 3.1.10 kernel isn't getting flashed for some reason. If it's managing to boot into Android after flashing Ubuntu-sdcard.zip, then it's definitely not using the proper kernel, as Android should not be able to boot with the 3.1.10 kernel I've posted.

Try the above steps and let me know what happens.

Edit: Just for clarity, I decided to download the zip and compare it against the one stored locally. They are the same.

[gary@alarm ~]$ md5sum Downloads/Ubuntu-sdcard.zip ~/android/media/Ubuntu-sdcard.zip
f94372df7f7a77c034e7302b8665c148 Downloads/Ubuntu-sdcard.zip
f94372df7f7a77c034e7302b8665c148 /home/gary/android/media/Ubuntu-sdcard.zip
Gary13579
 
Posts: 30
Joined: Tue Feb 28, 2012 9:21 am

Next

Return to [Please read announcement] Community-Supported Devices

Who is online

Users browsing this forum: No registered users and 17 guests