yashsingh1/xdaforums huggingface dataset:
[Transformer TF300T Android Development] Geometry:
Yes, this version does boot unpatched kernels. :)

And yes, you do need to provide the initramfs in addition to the kernel for booting. But I don't think this is a problem. For Android, the ROM you use (stock or otherwise) comes with its boot blob. You just extract the initramfs and kernel from that, no modification necessary. For Linux, you simply use the "update-initramfs" tool included in your linux distro to generate the initramfs, works for me at least with the kernels I described in previous posts.
[Transformer TF300T Android Development] Graiden05:
No, You need to copy files to exactly same places, if files placed at /data/misc/wifi/ in android then create /data/misc/wifi/ in xubuntu and put it there.
[Transformer TF300T Android Development] Geometry:
Yes, sound works for me. The rootfs does include files "/etc/init/alsa*.override" as well as a file "/etc/init/alsa-tegra.conf" that make this work.

In fact I tried that a long time ago, but it didn't work for me. However, I solved the issue in a different way, by changing kernel config, I don't remember the details, however. This is included in the kernels I have described in previous posts. Of course, this makes the kernel probably incompatible with Adroid. There is a remaining problem with suspend however: After wake up there is some graphics corruption. I found a workaround for this, which I probably describe in a later post. (This is not included in the rootfs I have posted.)

Yes, it is the updated version. (Again, I did this more than a year ago, so unfortunately I don't remember the details of how exactly I modified Tasssadar's work.)

Thanks for the suggestion! However, I am using xbmc/kodi under Android (CM 11) and it works great there. By the way, if you know how to get an external monitor working under Linux let me know!
[Transformer TF300T Android Development] Graiden05:
[MENTION=6136418]Geometry[/MENTION]

Yeah... It definitely works with unpatched kernels but it seems like f2fs is problem for kexec. So kernels should be on ext4 partition (probably system partition is good for this aim).

Edit: Have anyone know what can be safely removed from host kernel?
[Transformer TF300T Android Development] ch3mn3y:
Nice

Following Your posts I copied all the files where they should be and now WiFi is connecting with router, but I still cant access any site. Is this normal? Do You have similar problem or thats again my skills?

Its not routers security as my wifi is open with access via mac address and tablet is added as known device (im writing from it).

Sent using tf300t - PAC-man/GRIMLOCK (Linaro)
[Transformer TF300T Android Development] harryharryharry:
[MENTION=6136418]Geometry[/MENTION] Does the kexec bootloader support f2fs ?

I tried it out and kexec does support f2fs, however I need to mount /dev/mmcblk0p8 to /data manually everytime from shell before I choose "0", is there a way to permanently mount /dev/mmcblk0p8 to /data ?
[Transformer TF300T Android Development] Geometry:
I had this very same issue a long time ago when I first played with these things and was puzzled about it. I suspect that you have not replaced (in the rootfs) the file "/lib/firmware/nvram.txt" with your own device's version from "/data/misc/wifi/nvram.txt" as recommended here. The thing is, the MAC address (and some other parameters) for your wifi are determined by this file. If you use the rootfs I provided without replacing this file you will have a different MAC address under Linux than under Android. So that explains why your router will not recognize the device under Linux. Let me know if replacing the file fixed your problem!

---------- Post added at 17:57 ---------- Previous post was at 17:31 ----------

OK, so am I correct to assume that your mmcblk0p8 (/data) partition is f2fs formatted?

Assuming this, the problem is that in the boot loader script "second_stage_boot_menu" in here the mount command is called with "-t ext4" as I wasn't considering the possibility that this partition might be formatted with a different file system. So you could just edit that line to say "-t f2fs" instead or remove the "-t" option alltogether, (although I am not sure if filesystem atodetect works reliably here). Then, proceed as described in the last part of this post to generate a new flashable boot loader.
[Transformer TF300T Android Development] harryharryharry:
Yes, you were correct in assuming that ;)

Thanks, it's working now ! (I chose to change the "-t ext4" flag to "-t f2fs", but mounting from shell I left out the flag so it probably would have worked without it)
[Transformer TF300T Android Development] Graiden05:
[MENTION=6136418]Geometry[/MENTION]

For auto-detect FS I use function like this:

Mount()
{
dev=$1
mp=$2
if [ "$(fsdetect "${dev}")" == "ext4" ]; then
return $(mount -t ext4 -o defaults,noatime,nodiratime,discard,errors=remount-ro,commit=60 "${dev}" "${mp}" 1>&2 2>/dev/null)
else if [ "$(fsdetect "${dev}")" == "f2fs" ]; then
return $(mount -t f2fs "${dev}" "${mp}" 1>&2 2>/dev/null)
fi
fi
}

With "fsdetect" binary from katkernel. But in my case it was necessary to mount only ext4/f2fs and skip other FS and on data partition there is only needed possibilities.
[Transformer TF300T Android Development] androidjel:
Are there gonna be Any updates? Like ubuntu 15.04
[Transformer TF300T Android Development] harryharryharry:
[MENTION=3734775]Graiden[/MENTION] I would like to compile the driver for an awus036h wlan-adapter for ubuntu 14.04 rootfs + db_katkern18_50.

The compilation is terminated with a make error: /lib/modules/3.1.10-katkernel-018/build No such file or directory. Stop.

When I look in /lib/modules I only see a 3.1.10 directory, so I created a symlink 3.1.10-katkernel-018 that points to 3.1.10 (I don't know whether this is smart or stupid :o)

When I try to compile again, I still get the same make error that the build directory does not exist (it is in fact a symlink to the non existing /mnt/data/tf300t/devel/tf300t_kernel/out). Is this because there are no kernel-headers installed ? And if so, is it possible to compile those from: https://github.com/Graiden/tf300t-katkernel-dualboot.git ? (I looked a little back in this thread and saw [MENTION=5983213]tux-friend[/MENTION] had some problems with it...)
[Transformer TF300T Android Development] tux-friend:
@ harryharryharry: If you have to build a kernel module for your awus036h wlan-adapter you probably have to install corresponding kernel-headers for your running kernel (as you mentioned it should be the 3.1.10-katkernel-018 in your case).

How to get the kernel-headers? The correct way would be to download the kernel sources for the katkernel-018 and compile the kernel-headers by using these sources. You can look about the provious posts maybe starting from #535 on this page to get an idea howto do so.

If you succeed, the compilation process will yield a deb file with the name "linux-headers...." which can be installed by dpkg -i command. Afterwards it should be possible to compile a new kernel module for your running kernel.

Concerning missing build directory: Yes, indeed, the error message appears because no kernel-headers are currently installed and actually it's just a symlink to them. After successfully installing the headers, you could create it with following command as far as I can remember:

sudo ln -s /usr/src/linux-headers-3.1.10-katkernel-018/ /lib/modules/3.1.10-katkernel-018/build

Good luck!

---------- Post added at 10:31 PM ---------- Previous post was at 10:00 PM ----------

lol ... maybe you better need to ask canonical at first if they have the plan to release any further updates.

But to be serious again: Why do you worry about updates for 15.04 now even it's such a great thing that currently 14.04 LTS version seems to work quite well due to the great efforts from Geometry? Just keep in mind that this LTS version will be supported untill april 2019 (!) while version 15.04 will be supported only untill 2016. Furthermore, nobody will be probably able to tell you at the moment if there are any further compatibility issues concerning the xserver (especially due to XABI version) since version 15.04 hasn't been released yet.

My personal recommendation: Enjoy the 14.04 LTS version for the moment and if you really feel that some new features of a newer ubuntu version are missing for you before 2019 then try to do a distribution update. Of course, this should be possible but there is currently no guaranty that it will easily work.
[Transformer TF300T Android Development] Graiden05:
So here port of tf700 kexec kernel. As far as I know it was created by JoinTheRealms, cogano and workdowg. By default it comes with original katkernel v0.17 for android 4.4.4. But You can use AndroidRoot boottools+blobtools to unpack any other kernel and replace it in /system/boot (zImage+initrd.img).
[Transformer TF300T Android Development] androidjel:
I kinda ment like update the threat or make a new one so its nit confusing.
[Transformer TF300T Android Development] Graiden05:
But kexecboot binary sends "partition", "directory" and "image" variables throug cmdline to guest kernel or I'm wrong? I glad if it will be possible to use for example "image" variable to send to guest kernel additional parameters while boot method is "directory".
[Transformer TF300T Android Development] JoinTheRealms:
Yes sorry you're correct, the kexecboot binary modifies /proc/cmdline with partition, image and directory. Relevant code: https://github.com/moreD/kexecboot/blob/6504a27d4afd5ceab41cfc8d78f8b5ba4a439503/kexecboot.c#L236

but it shouldn't be hard to add additional parameters to cmdline via the kexecboot binary.
[Transformer TF300T Android Development] harryharryharry:
If I read the thread correctly you didn't succeed in building the headers, am I right ? I am getting a similar error as your:

make[3]: *** No rule to make target `drivers/pci/access.o', needed by `drivers/pci/built-in.o'. Stop.

namely:

make[2]: *** No rule to make target `init/initramfs.o', needed by `init/built-in.o'. Stop.

Graiden05 replies that there is no target for building "kernel_headers" in the Makefile. A couple of posts later (post 540) Graiden05 a provides a deb file saying he managed to build the headers. [MENTION=4872519]Graiden05[/MENTION] could you elaborate on how you built the headers ?
[Transformer TF300T Android Development] ch3mn3y:
Sorry that i didnt answer before, but i had hard week in school

I remember that i did it, but i did it again and still smae thing happens. It connects to wifi but any app has no access to internet...

Sent using C6833 - AICP/GreatDevs
[Transformer TF300T Android Development] harryharryharry:
sounds like you did not yet follow the instructions from post 219 :

as root:

groupadd -r -g 3003 inet
groupadd -r -g 3004 netraw
groupadd -r -g 3005 netadmin

and add your user to the inet, netraw and netadmin groups (via settings manager > users and group). Then log out and in again (or reboot)
[Transformer TF300T Android Development] ch3mn3y:
I thought i did it, but i forgot to check inet, so it didint work. Thanks

And it works really nice ;D Really thanks for Your work
[Transformer TF300T Android Development] Graiden05:
Actually easiest way to build external module is cross compile it. Even when I managed to build headers deb package it wasn't complete.
[Transformer TF300T Android Development] harryharryharry:
Hey, to err is human. Glad to hear it works. All praise go to the devs (which I am not, of course)
[Transformer TF300T Android Development] harryharryharry:
You mean I should not try to compile the headers but instead try to cross compile a single module (in my case the driver for my wlan card) ?

Meanwhile I succeeded in building a kernel-headers deb-file which is only ~5 mb's, i installed it with dpkg anyway and created a symbolic link from /lib/modules/3.1.10/build to /usr/src/linux-headers-3.1.10-katkernel-018+

now when I try to compile the driver for the wlan card it gives the following error:

gcc: error: -mfloat-abi=soft and -mfloat-abi=hard may not be used together

Did something go wrong in building the headers, or is there a gcc setting I need to configure ?
[Transformer TF300T Android Development] Graiden05:
Yep, building single module seems easier for Me. Probably (if I got it right) it possible to install headers directly from kernel source by running "make headers_install". But You should put sources in tablet storage.
[Transformer TF300T Android Development] Geometry:
Thanks for the effort Graiden05! Unfortunately, it does not seem to work. Whenever I select an item to boot, the GUI exits and the text menu appears. In fact have tried myself various times to get kexecboot to work, also combining it with variants of this initrd.img. I always get the same result: The GUI comes up fine and the contents of boot.cfg are detected correctly. But it seems to just exit when selecting a system to boot, instead of calling "kexec". Any ideas?

@JoinTheRealms Do you have some idea maybe?
[Transformer TF300T Android Development] Graiden05:
Did You use Your own setup or just installed mine through twrp? And if You use Your own setup can You describe where You store kernels and show Your config? May be long paths cause issues (for example I spent a lot of time trying to understand why run-init binary doesn't start xubuntu from /data/media/linux and bind it to /root solved a problem).
[Transformer TF300T Android Development] Geometry:
I just did some more testing and it tuns out I made a mistake with the syntax in the "boot.cfg" file. Now it works!

Thanks Graiden05!
[Transformer TF300T Android Development] Geometry:
suspend issues and workaround

If you use Linux on the tf300t it is likely that you will have some issues with suspend. These issues depend in general on the kernel you use and on tweaks in the rootfs. If you use this xubuntu 14.04 with either this or this kernel you can make suspend work as follows.

Remove the package "gnome-power-manager":

sudo apt-get remove gnome-power-manager

Switch off "Light Locker" in the settings. (Be sure to click the "Apply" button.)

It is also advisable to select "When power botton is pressed: Nothing" in "Power Manager" settings.

Now reboot.

Suspend should now be mostly working with the power button causing wakeup.

There is one remaining problem: Some graphics corruption after wakeup. This affects mostly window title bars. It also causes a strange slow-down of the system. To remove the corruption the following works for me. In the Settings go to "Window Manager" and change the Theme, then change it back to the original Theme. Of course you don't want to do this each time you wake up the device from suspend. So I have written a small script that implements this workaround automatically. It is contained in the attached file "nvpmxcfe.tar.gz". When unpacked into the rootfs it goes automatically into the right place at "/etc/pm/sleep.d/". It is really a dirty hack, but seems to work.

If anybody has a better idea what the root cause of the corruption problem is and has some idea of how to fix it, let me know!

UPDATE 2015-06-18:

I have separated the script that fixes corruption so that it can also be used stand-alone. The new version of the attachment to be unpacked into the rootfs is called "nvpmxfce-2.tar.gz". The script is extracted to "/usr/bin/xfwm_restore". It is convenient to define a key combination that causes the script to be executed. So whenever this corruption occurs (for example attaching an external monitor via HDMI) you can fix this with the key combination. The script is still automatically called upon wake up from suspend.
[Transformer TF300T Android Development] Feazzu:
Hi Geometry.

I don't understand just a little thing. I need to flash other file in addition to those that you attached in this post?

I've now installed in my tf300t the dualboot kernel v.2.2.9.

I can just follow this post, after a wipe, or i need to do other things?

big thanks in advance
[Transformer TF300T Android Development] aurel33:
I have no sound under the image of xubuntu 14.04 by Geometry with the kernel for Android 5.0 by Graiden05. Other users have this bug? How to solve it?
[Transformer TF300T Android Development] Keshukas:
On my tf300 sound and Bluetooth working well. I copy system/etc/firmware with -r * it's not only files but 2 directory
[Transformer TF300T Android Development] ch3mn3y:
Add user to audio group. Do it the same like u were adding it for wifi to work

Sent using C6833 - AICP/GreatDevs
[Transformer TF300T Android Development] aurel33:
It works! Thank you!
[Transformer TF300T Android Development] Geometry:
Hi Feazzu.

You only need to flash the file "kexec-boot-menu.blob" as described in the post. You don't need to flash anyhting else. And you don't need to wipe anything. (In fact, if you want to continue using Android as before you should not wipe anything.) However, it is important that you complete steps 1 and 2, otherwise the kexec boot loader will not be able to boot your Android system.

Also, if you have Linux installed to boot it you need either

a) Linux to live on the first partition of the microsd card. Then you can boot it with the "l" option in the boot menu.

b) or add files "zImage-1" and "initrd-1.img" in "/data/media/0/boot/" for Linux to boot it with option "1" (or replace "1" by another number)

Hope that helps!
[Transformer TF300T Android Development] Geometry:
xubuntu rootfs cleanup

It tuns out there are some ingredients, especially from gnome, that don't quite work in this xubuntu 14.04 rootfs. There are multiple versions of some indicators, various indicators do not work or work only partially etc. To improve this I recommend removing a number of packages. These are mostly gnome duplicates of xfce functionality.

sudo apt-get remove gnome-power-manager unity-control-center unity-settings-daemon gnome-session-bin gnome-user-share gnome-bluetooth indicator-session indicator-datetime indicator-bluetooth indicator-keyboard indicator-power

After this remove superfluous dependencies as follows:

sudo apt-get autoremove

Now install a package to control bluetooth:

sudo apt-get install blueman

You might want to reboot now. (Maybe just logging out and logging in again is sufficient, but I'm not sure.)

Now things should work much better. To get battery indicators in the panel just activate them in the power manager settings.
[Transformer TF300T Android Development] Geometry:
improved dock keyboard mapping

In xubuntu 14.04 the dock keyboard mapping is far from optimal (you can use for example the keyboard setting "Asus Laptop"). In the work for linux on the TF700T, an improved keyboard mapping was implemented by xda developer rabits. I have slightly adapted this for the TF300T and 14.04. Just extract the attached file to the 14.04 rootfs (and possibly reboot). Then select "Asus TF300T Dock" in the keyboard settings.
[Transformer TF300T Android Development] Graiden05:
Here genmon (xfce4-genmon-plugin) version which adds a button that allows You to run this script manualy (just in case). Add path to "theme.sh" in "Command" field of genmon-plugin settings on panel.
[Transformer TF300T Android Development] Graiden05:
For devs only:

Here is port of bash selection menu (is better to enable adblock before click the link). It's still have at least two issues: "bad number" message and if You rapidly press vol- button twice it will bring some symbols to current line. Also bootit.ko not included, You can get it here and place it in /lib/multi/. And "Mount as storage" works only with patched kernel.

Screenshots: 1, 2.

______________________________________________________________

Update: Better method to recognise pressed keys, now support dock keyboard arrows (up/down - move, right - select). Cleanup and bigger font size.

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

Probably final version. Added ability to boot default system by timeout. Default system and timeout can be set by "set default boot" menu entry.

**************************************************************************************

End user version of dualboot kernel with pseudo graphical menu is here (katkiss 4.4.4).
[Transformer TF300T Android Development] JoinTheRealms:
So I took sometime to properly test out Geometry's Xubuntu 14.04 rootfs mostly interested in seeing how well native suspend works, something that i've spent many hours aimlessly trying to fix.

Its very good. Everything works as it should, having native suspend working is a major plus, [MENTION=6136418]Geometry[/MENTION] i assume this was partially solved by disabling kernel wakelocks? I had attempted this, while suspend worked, the screen wouldnt wake-up correctly(stayed black with backlight on) was this something you had to overcome?

Id like to get this rootfs/ kernel combination working with Kexecboot, should only require recompiling the host kernel with the latest kexec-hardboot patch due to not being able to load non-patched guest kernels. Also not sure how well this will play with generated initrds.

A couple of notes for people using this rootfs,

-You will want to use chromium-browser, this can use gles hardware acceleration which speeds things up as well as taking load off the cpu, to enable this add

export CHROMIUM_USER_FLAGS="--allow-outdated-plugins --use-gl=egl --ignore-gpu-blacklist
"

to ~/.profile and reboot, if you open chromium and goto chrome://gpu you should see all "Graphical Features" hardware accelerated (other than, Canvas).

-To enable hardware accelerated video, you need to downgrade "parole", this version http://tuomas.kulve.fi/tmp/ouya-ubuntu/parole_0.5.0-0ubuntu1-tk1_armhf.deb uses nvxvimagesink pipeline that we require for video hwa.

-To get XBMC (kodi) working:

-- Tuomas Kulve

I've tested it and it works great, Video plays great and general navigation is smooth, versions of kodi from now on should support Tegra3 devices.
[Transformer TF300T Android Development] JoinTheRealms:
So external displays are working, although its somewhat flaky. HDMI needs to be connected during boot as far as i can tell, but i'm typing this on my 720p TV, dpi was detected correctly (will test some more monitors and report back) both duplicate and extend modes work, and xubuntu does a great job of dealing with them

More interesting is HDMI Audio works, with the caveat that once hdmi is working, you must suspend, on wake hdmi audio should be detected and work from there on. The amount of time i've spent trying to get this working in the past is ridiculous, seems to be exposed with working suspend. Will look deeper, see if we can get this working on first boot

Note, with the touchscreen driver will break with external displays, it centers based on the combine resolution of both displays, the drivers a hack from the beginning, hopefully we can replace it with something more suitable.

Edit:

Im pretty amazed to see not only does it output correctly to a 1080p monitor while detecting and maintaining correct dpi, it can even extend the monitor, so its easy to say hdmi 99% works (apart from needing to be plugged in during boot)
[Transformer TF300T Android Development] Geometry:
It is some time ago that I worked on this so unfortunately I don't remember all the details. I am not sure I had this screen wake up issue. But disabling wake locks was definitely the key step.

In my experience this kexec-hardboot kernel patch mentioned here works perfectly, not requiring any guest kernel patch. I have also verified that the kexecboot (and kexec) executable as provided by [MENTION=4872519]Graiden05[/MENTION] here in a boot image works. I have not tested if that boot image itself already reliably boots any unpatched kernel/initrd.img, but if it does not it would just have to be modified with the version of the kernel patch I mentioned or directly by using e.g. the whole kernel I provided here.

Thanks for these useful recommendations!