yashsingh1/xdaforums huggingface dataset:
[Transformer TF300T Android Development] Graiden05:
It's Me... again...

DualBoot kernel based on timduru's katkernel v0.18

Features:

-can boot KatKiss ROM (android 4.4.4)

-can boot *ubuntu from internal memory directly (You should unpack rootfs in /data/media/linux). Both ext4 and f2fs is supported.

-can boot *ubuntu from *.img file (/data/media/linux/rootfs.img)

-can boot *ubuntu from any external memory device (usb, SD, microSD) {currently untested}

-can mount data, system and any partition on external memory device throught usb cable (Your PC OS should support FS of mounted partition). This option available in boot menu by pressing "f" on keyboard. Here is what this option does to mount something:

echo 0 > /sys/class/android_usb/android0/enable
echo 0B05 > /sys/class/android_usb/android0/idVendor
echo 4D04 > /sys/class/android_usb/android0/idProduct
echo mass_storage > /sys/class/android_usb/android0/functions
echo "[B]$dev[/B]" > /sys/class/android_usb/f_mass_storage/lun/file
echo 1 > /sys/class/android_usb/android0/enable

Replace $dev with actual device. For example /dev/block/mmcblk1p1 (android) or /dev/mmcblk1p1 (*ubuntu) for microSD card. Also this build is partially compatible with Geometry's xubuntu 14.04. You need to copy firmwares from android to make wi-fi work.

For brave ones here is a completely untested android 5.0 (KatKiss) version.

--------------------------------------

P.S.: Linux boot order: 1) External memory (usb, SD, microSD); 2) internal (directly); 3) rootfs.img.
[Transformer TF300T Android Development] ch3mn3y:
So let me clear it.

I can use Gemotery's linux on /sdcard/ubuntu. However what i should do with his tar.gz file? Unpack it to this folder or just copy there?

How it looksfor what to boot? It seems that ubuntu has higher priority than android.

Lets assume that i have android on internal memory and linux on sdcard. If sdcard is in slot it will boot ubuntu, but if its not, the android will boot? Or everytime I will need to edit this file?

And additional small question (probably should ask Geometry): why xubuntus build's file is named public.php_service=files&t=f3eacede636eafdec2fdd4308284e37d&download?

Thanks i advance
[Transformer TF300T Android Development] Graiden05:
First of all /sdcard/ is internal storage. External is /storage/sdcard1/. This kernel looks for ext4 or f2fs partition on external memory and for /sbin/init on this partition. If both condition is passed it will try to boot from there. So You should reformat Your microSD and create that partition (better to make it latest) and then unpack tar.gz there. And You actually have choice what to boot and kernel will show You hint. To boot android just press "vol -" button during boot menu. And also if kernel doesn't find any linux it will boot to android.

___________________________

Probably is dev-host bug. Just rename it.
[Transformer TF300T Android Development] ch3mn3y:
Thanks. Will try if I understood everything.

One last question: Geometry added to his post u refered to nvidia-tegra3_16.4_armhf.deb.gz file. Is it important (i think it is), and what to do with it?
[Transformer TF300T Android Development] Graiden05:
It already included in rootfs, so You can just ignore it.
[Transformer TF300T Android Development] ch3mn3y:
Thanks. U answered all my question. But which is better for desktop linux - ext4 or f2fs? I would prefer f2fs coz it really give something my tab.

And how to get f2fs partition on sdcard?

When i try gparted it format it but after refresh FS is unknown. If anyone can answer it I will change FS, for now will try ext4
[Transformer TF300T Android Development] Graiden05:
I don't have direct answer on this question. It depends only on how good F2FS was implemented in our kernel. But F2FS has all needed properties so it shouldn't be an issue.

To make sure You can use "fsdetect" utility provided by katkernel (maybe by any f2fs compatible kernel). Just run in android terminal:

su
echo $(fsdetect /dev/block/mmcblk1p[B]N[/B])

where N is a partition number on microSD card. It can detect only f2fs and ext4. Also You can format it with mkfs.f2fs:

su
mkfs.f2fs /dev/block/mmcblk1p[B]N[/B]
[Transformer TF300T Android Development] ch3mn3y:
For now i will stay with ext4.

I dont know if its only me, but Your zip with DB kernel doesnt work. I got successful, but after that no blue bar and in setting still exist grimlock

EDIT: If someone has similar problem Im attaching DualBoot kernel, but in Grimlocks kernel zip, which let me flash it. It still says grimlock in recovery log, but its katkernel

EDIT2: Anuone knows why I get no root error when trying to get to android root using solid explorer when db katkernel is flashed? I flashed it over grimlock. Should i try "cleaner" flash (means over pac man's kernel)?
[Transformer TF300T Android Development] ch3mn3y:
So using Your guide i made 8gb ext4 partition on my sdcard so it is:

~21gb ntfs

~8gb ext4

Than using ububtu i unpacked Geometry's xubuntu 14.04 and copied it to ext4 partition.

Than i flashed db kernel, but when wait or choose 1 it still boots android...

Any idea?

Sent using C6833 - AICP/GreatDevs
[Transformer TF300T Android Development] Graiden05:
Thanks for feedback. That is My mistake, I misnamed kernel file so it does nothing with "success" status. :p Updated zip files available through old links.
[Transformer TF300T Android Development] ch3mn3y:
No problem. It works, but have u idea, why it always boot android? Unpacking was fine (i used 7zip), copying too, but it doesnt boot.

I looked into (f) flash, but there is nothin

i got:

Mmcblk0p1, 0p81p1, 1w2 and sda1, but it only mounts them and let me only unmount it

When i press 1 or wait i got text "trying root" and than "sbin/init" or something is not found

Sent using C6833 - AICP/GreatDevs
[Transformer TF300T Android Development] Graiden05:
May be it caused by old android init. I updated 4.4.4 version again.

Probably 7zip is not a best idea. I always use linux tar command (also presented in android) for it.

cd /path_where_to_extract
tar -xvpf /path_to_tar.gz

But again booting from external volume still not tested by Me. May be there something else to fix.

____________________

P.S.: Forgot to mention that I use tar with root privileges.
[Transformer TF300T Android Development] Geometry:
Sorry about that. I have corrected the name now.
[Transformer TF300T Android Development] harryharryharry:
Hi [MENTION=4872519]Graiden05[/MENTION] , thanks for the kernels ! Right now I am trying xubuntu 14.04 from Geometry in combination with your experimental android 5.0 kernel. As you said wifi isn't working out of the box, could you specify which firmware-files I need to copy from android, and to which location they need to be copied ?
[Transformer TF300T Android Development] Graiden05:
If xubuntu is unpacked to internal memory in directory /data/media/linux run from android terminal:

su
mkdir -p [B]/data/media/linux[/B]/system/etc/firmware
mkdir -p [B]/data/media/linux[/B]/system/vendor/firmware
mkdir -p [B]/data/media/linux[/B]/data/misc/wifi
cp /system/etc/firmware/BCM* [B]/data/media/linux[/B]/system/etc/firmware/
cp -r /system/vendor/firmware/* [B]/data/media/linux[/B]/system/vendor/firmware/
cp -r /data/misc/wifi/* [B]/data/media/linux[/B]/data/misc/wifi/

Also to make internet accessible for non root user use this post.
[Transformer TF300T Android Development] harryharryharry:
Thanks, that worked like a charm! Is there any way to change the boot priority (so that android boots by default) and boot timeout in your kernel ?
[Transformer TF300T Android Development] Graiden05:
Yes, with AndroidRoot boottools and blobtools. ;) Alternatively You can wait when I'll put these values to separated config file.
[Transformer TF300T Android Development] harryharryharry:
Haha, i've already tried that, but i'll give it another try :)

edit: result! Linux' version of blobpack wasn't packing the modified ramdisk+kernel properly. Once I packed the ramdisk+kernel in windows I could flash the boot.blob succesfully. If someone out there is also booting android 5.0 and wants it to boot by default, they can download this blob:

https://mega.co.nz/#!KYJUgYLJ!qGFSSNWSIPj3pS6L33QWncmk_OY93neKvsnxBQPPgs4 (boots Android 5.0 by default within 3 seconds, press 2 or VolDown for Linux)
[Transformer TF300T Android Development] ch3mn3y:
@up

Could u try (if there is possibility) booting xubuntu from second sdcard partition? Will try today tommorow to unpack rootfs using linux, but that doesnt worked for me and i dont know if its me or kernel doesnt boot it.

[MENTION=4872519]Graiden05[/MENTION]

One more question. U wrote that ext4/f2fs partition should be latest partition. Its not any mistake and it should be after ntfs one (if i have 2 partitions)? I just want to be sure.

And need it to be ie mmcblk1p2 or can be other. Mine is p8 (even if first is p1).

Is there any chance that doc sd card could interfere? Coz i was booting it before docked with sdcard mounted

Sent using C6833 - AICP/GreatDevs
[Transformer TF300T Android Development] Graiden05:
Kernel scans all partitions of external memory devices and should be able to boot from any of 4 partitions (standard partition table of flash drives mainly support only 4). But if external device have more than 4 partitions it shouldn't be a problem. Making ext4 or f2f2 partition latest is better for android which tend to mount first partition and usually don't like non FAT16/32 FS. And mmcblk0p8 (data partition AKA internal sdcard) is hardcoded and it boots only from directory /data/media/linux or file /data/media/linux/rootfs.img. And no, dock-station shouldn't cause any problem. Also I going to test it now.
[Transformer TF300T Android Development] Graiden05:
Xubuntu successfuly booted from second f2fs formatted partition of my microSD card.

How it was done.

First of all reformat Your microSD (all data will be lost). Go in settings and unmount microSD. Then in android terminal:

su
fdisk /dev/block/mmcblk1

Then input "o" and hit enter. Same procedure with following symbols: "n"; "p"; "1"

Here just press enter. Now You should decide how much You will keep for usual storage and how much for xubuntu (min 3GB). I decided make 10GB partition for usual storage: 10*1024=10240. So input following line with Your number and hit enter:

+10240M

Again symbols: "n"; "p"; "2"; just hit enter; hit enter again; "w".

By doing this we got 2 partition: 10GB and all remaining space (in my case about 6GB). Now format 10GB as exfat and 6GB as f2fs:

mkfs.exfat /dev/block/mmcblk1p1
mkfs.f2fs /dev/block/mmcblk1p2

Place tf300t-xubuntu-rootfs.tar.gz archive at root of internal sdcard and run in android terminal:

mkdir /sdcard/1p2
mount -t f2fs /dev/block/mmcblk1p2 /sdcard/1p2
cd /sdcard/1p2
tar -xvpf /data/media/0/tf300t-xubuntu-rootfs.tar.gz

Now wait (on tablet it will take looong time, so better use linux on PC or VirtuaBox) until terminal will show new input line with header like "root@tf300t:/sdcard/1p2 #".
[Transformer TF300T Android Development] ch3mn3y:
Trying now. Just need to set linux build on my pc :D

I would like to use ubuntu, but I cant make it to see f2fs partition. Even if I add f2fs-tools I only could format partition as it. After that its unknown and unmouted

And as "long" u mean hour, two or more? For working xubuntu even 6 hours is worth it.

Final Q: If I will make it work, can I use updates or shoudnt I? Wont it break the build?

EDIT: SO i tried, but terminall stopped me.

I wrote su, fdisk, letters, but than i have only 3844 cilinders... (32gb card = ~29,44) and cant make 21500M exfat partition and ~8000M f2fs...

Have I wrong terminal or dont have something in rom (PAC man)???

EDIT2: Even if u do all steps u wrote, without looking at cylinders in the end i dont have make.exfat and make.f2fs

And if u use "fdisk -l /dev/block/mmcblk1" there is 1 partition only

EDIT3: So i used gparted to partition and even when it said "unknown" i unmounted sdcard from pc and inserted it to tab.

Than mounted it as 1p2 and started to unpack tar. Its unpackig, will se where (if still) I will need your help. Thanks

EDIT4: Everything is fine except wifi. First I forgot to copy nvram.txt, but than i did it using android terminal, when it still doesnt work i used linux terminal and even copied it using file explorer with root, but it still is "disconnected" with no available wifi...

By that i mean that Networking is enabled, Wi-Fi is enabled, but there is greyed "Wi-Fi Networks | device not ready"

EDIT5: I recommend to not suspend the device as after weking up display starts to blink (on off) and only reset works
[Transformer TF300T Android Development] Graiden05:
Probably f2fs in gparted is broken. My desktop xubuntu 14.10 mounts f2fs without any problems. Cylinders isn't equal to 1MB, for my 16GB microSD is about 8MB. So You shouldn't even look on cylinders count. That is possible that PAC have alternative for mkfs.exfat and may not have one for mkfs.f2fs (but something like mkfs.ext4 should be there). For me it takes about 2 hours. To make wi-fi work You should copy content of /system/etc/firmware, /system/vendor/firmware and /data/misc/wifi to same places in root of xubuntu fs.
[Transformer TF300T Android Development] ch3mn3y:
Ok. will try it later as i broke xubuntu :( Good that now i know how to "install" it

Where I should I exactly copy them?

there is no /system in xubuntu, should i made one?

For me unpacking take ~10 minutes
[Transformer TF300T Android Development] Graiden05:
Yes, You should make all needed dirs to reproduce places where android stores those files. And yeah, I have pretty slow microSD card...
[Transformer TF300T Android Development] ColMustard:
I used Minitool Partition Wizard for windows.
[Transformer TF300T Android Development] schrdlu:
I have uploaded an interim versions (0.1.1) which adresses usability, since it will be some time before I can cleanup all I want. Until then the current version adresses :

- 3G should work on android ;

- /system and /data are mounted from the initrd so that you don't have to copy /system/vendor, /system/etc and /data/misc to have wifi ;

- touchpad and touchscreen are enabled ;

Changes to the rootfs :

- remove mounting /system and /data from /etc/fstab ;

- apt-get install xserver-xorg-input-multitouch ;

- copy mtev.so from rabit's ubuntu (into /usr/lib/xorg/modules/input) ;

- create /etc/X11/xorg.conf.d and add configuration files for touchscreen and touchpad there.

install kernel as usual (fastboot or dd to /dev/mmcblk0p4).

unpack the rootfs and rename into linux/rootfs.img on the internal storage (/data/media/linux/rootfs.img).

rootfs : http://d-h.st/Kts

kernel : http://d-h.st/fgo

c605ed37e2f0a2d8956ff25c864d88b7 xubuntu_tf300tg_kernel-0.1.1.blob

9121c217a6233a7306ca59e0540c7a99 xubuntu_tf300tg_rootfs-0.1.1.img.lzma
[Transformer TF300T Android Development] ColMustard:
Wow that was quick, I'll have to check it out later when I get home. Just out of curiosity do you have sound on your TG version? It appears to have the same problem I encountered with Arch Linux where I was never able to configure the sound card, however the ones with the TG version worked fine.
[Transformer TF300T Android Development] **Menos**:
ColMustard

How's called your memory card? What class and amount of memory?
[Transformer TF300T Android Development] ColMustard:
The Label of the partition really doesn't matter, if that's what your asking. I'm using a Class 4 32 gig MicroSD. I would suggest you go with the root image approach at first seeing as that has been proven to work. Just unpack the rootfs to your /data/media/linux folder and flash the kernel. Provided that your on a 4.1 bootloader running CROMI 3.
[Transformer TF300T Android Development] **Menos**:
Where now installed ubuntu? To a memory card or memory tablet?
[Transformer TF300T Android Development] ColMustard:
Tablet internal storage.

---------- Post added at 01:49 PM ---------- Previous post was at 01:20 PM ----------

Just this morning I realized a made a stupid mistake with the original install of rootfs. Instead of deleting and re-creating the partition on the external SD, I just formatted it as ext4. Once I deleted and re-created the partition, the kernel recognized the partition. I'm back to thinking that the rootfs is a better approach than the virtual image, this way if I flash another ROM (for testing purposes) the rootfs will not be affected. Now if we can just get Ubuntu-Touch added to the kernel, that would minimized the flashing altogether.
[Transformer TF300T Android Development] **Menos**:
In my console is not one team does not respond, issue the following error:

menos is not in the sudoers file. This incident will be reported.

Who knows how to cure it?
[Transformer TF300T Android Development] ColMustard:
When you added the User "menos" did you add him to the "sudo" group?
[Transformer TF300T Android Development] **Menos**:
My problem is solved.
[Transformer TF300T Android Development] schrdlu:
No. I don't have sound either. It does not seem to be at the kernel level since the device is exposed in proc. Need to check alsa and pulseaudio. I will look into it someday..
[Transformer TF300T Android Development] matonka007:
Thank you, touchpad and touchscreen is working very fine, wifi is working too. Wainting for sound and it can be my daily system :))

-------

Have TF300T

Using HUAWEI external modem for 3G and it working very nice in xubuntu :) in android too
[Transformer TF300T Android Development] nowell29:
Re: [DEV][WIP] xubuntu on tf300tg 0.1.0

How do these mobile processors handle things? I use xubuntu as a daily driver to admin, just curious how this can handle the load. Also, how about sleep (when screen is off), how does X handle that?

I am so stoked! I wish I could buy you guys a donut for the hard work!
[Transformer TF300T Android Development] ColMustard:
If your expecting this to perform like big brother AMD64 or x86 variants your going to be disappointed. That being said though, this arm variant is at a very stable point and performs simple linux tasks very well. I'm Still testing the sleep feature and have found the screen does shut off and will turn on with any movement of mouse but not key press. The suspend feature has issues with wake, sending it into a suspend wake loop.
[Transformer TF300T Android Development] Keshukas:
Re: [DEV][WIP] xubuntu on tf300tg 0.1.0

I think is Bluetooth heave take control tray to turn off Bluetooth
[Transformer TF300T Android Development] Charle692:
Re: [DEV][WIP] xubuntu on tf300tg 0.1.0

cb22 had some luck with the suspend loop with his arch linux. He said that he had to disable wakelocks within the kernel to make it work, but it broke his dual boot. So if you need help with that I think he could have some info about it.
[Transformer TF300T Android Development] ColMustard:
No Sound

After a little checking around and using the alsa utilities, this does seem to be a kernel problem. pavcontrol show no audio device configured, which lead me to look at alsa.

amixer scontrols shows 'IEC958', 0 and 'HDA Decode Capability', 0.

When displaying a list of playback hardware with aplay -l, after card 0:Tegra [HDA NVIDIA Tegra] device 3: HDMI 0 displays the command hangs, indicating the kernel oopsed. Is there anyway for you to debug this to get the oops message?
[Transformer TF300T Android Development] Keshukas:
Nice job !!! Starts without problems. Heave menage to start without dock-station. Virtual keyboard works perfect after some fix on settings to popup automatically :highfive:
[Transformer TF300T Android Development] nowell29:
Re: [DEV][WIP] xubuntu on tf300tg 0.1.0

Thank you! I didnt expect it to perform like my desktop :) but i wondered how it made use of these tegra chips. I know they are supposed to be spiffy in their own right, but knew that this kind of usage would put them to the test.

It is running lightweight that got me into xfce in the first place, now I just love how it screams with real horse power behind it.

I will give this a shot! I am excited to try it. Just to have real bash will be a hit on this device!
[Transformer TF300T Android Development] Keshukas:
Re: [DEV][WIP] xubuntu on tf300tg 0.1.0

Yes some happens to me to. I move to next room and no problem to connect. Good that I heave reed yours post
[Transformer TF300T Android Development] Geometry:
kexec-hardboot patch and linux kernel

While dual-boot kernels are a great way to have both Android and Linux work on your tablet there is an even more flexible way to do that. This is via the kexec kernel call. Basically this executes an arbitrary kernel together with matching initramfs. The original kexec does not work on the TF300T, but a modified "hardboot" version does. This modified version effects a full reboot with the specified kernel and initramfs. This is explained in more detail here for the Nexus 7. It was also made to work on the TF700T. I have attached a version of this patch that works for the TF300T. The file is called "hardboot.patch", see attachment. This is simply a minor adaption of the patch by Tasssadar for the Nexus 7. Note that this version of the patch does not require any patch of the kernel to be booted (sometimes called "guest kernel").

I have also prepared a linux kernel including the patch that works with this xubuntu 14.04 rootfs. It is prepared exactly as described here, except for the additional inclusion of the hardboot patch. The result is the attached file "kernel_hb_files.tar.gz" that is to be unpacked into the rootfs. It contains the kernel itself as "/boot/vmlinuz-3.1.10". The kernel config file is "/boot/config-3.1.10".

In a later post I will describe an implementation of a second stage boot loader based on this kernel and with a simple menu that allows you to boot essentially anything (device compatible) on your TF300T.
[Transformer TF300T Android Development] Graiden05:
Actually I know about kexec but when I tried it long ago it wasn't be able to boot non kexec kernels. Does it really can boot unpatched kernel now? Also there is another problem for android: You anyway need to adapt initramfs to booting from data or system partition.
[Transformer TF300T Android Development] JoinTheRealms:
Yeah I prefer the kexecboot implementation also, in fact the TF700 files worked fine for the host kernel, basically just needed a kernel with tf300 wifi modules, _that's tf700 kernel has tf300 kernels included. But ill be sure to try out your kernel and implementation. Actually a few notes on your rootfs which i decided to fire up on my idle tf300. Did you manage to get sound working? im only seeing a dummy device, i did remebrer seeing some commands for rc.local floating around in here, not sure if they nessacery for working sound. Also might be worth adding this: http://xdaforums.com/showpost.php?p=44764722&postcount=6 to get suspend working. While a somewhat hacky workaround it does work as expected.

Im not sure if the ported kexec-hardboot patch was updated to Tasssadar's later code which allowed for unpatched guest kernels, but the potential is there for that to be updated to allow that. Also thanks for your f2fs dualboot kernel, was locked out of using linux on the tf300 uptil now, working great!

For those interested in testing, seems we might be able to get a working/ stable version of xbmc (kodi) apparently some patches to xbmc relateding to the nvidia k1 help the tegra3 also,

from http://tuomas.kulve.fi/blog/2014/03/24/ubuntu-on-ouya/

will try this out later today
[Transformer TF300T Android Development] ch3mn3y:
I looked into xubuntus folder and im not sure where to copy files.

I understood that files from Android's /system/etc/ should gp to xubuntu's /etc/

/data/misc/wifi/ should go to /lib/firmware/?

But there are /system/vendor/ too and cant find where it should go...

Sent using R800i - AuroraPLAY/LuPuS_GB (RAM)