[ABANDONED] AndroPlusKernel v43

Search This thread

AndroPlus

Senior Member
***ABANDONED***
I am sorry but I stopped supporting this kernel because I don't have much time recently.


ly0E01b.jpg


This is first custom kernel for Xperia Z4 Tablet SGP712/SGP771.

Download
Download from official website

How to root
See my blog post:
https://androplus.org/Entry/626/

I won't create kernel for device which I don't own.
If you want me to create, please give me the device.

Donate:
PayPal

XDA:DevDB Information
AndroPlusKernel for Z4 Tablet, Kernel for the Sony Xperia Z4 Tablet

Contributors
AndroPlus, Tommy-Geenexus, DHGE, dl12345, andip71, nilezon
Source Code: https://github.com/AndroPlus-org/android_kernel_sony_msm8994

Kernel Special Features:

Version Information
Status: Testing

Created 2015-08-02
Last Updated 2017-05-04
 
Last edited:

AndroPlus

Senior Member
SONY has a 28.0.A.7.31 under "Android Downloads"

Have not found a changelog yet.

A device tree is in the attachment.

Oh I meant set of files such as "android_device_sony_karin" or "android_device_sony_msm8994-common". (you can see some device tree for other devices on cyanogenmod's Github)
This is also called device tree.
 

Stevethegreat

Senior Member
Nov 28, 2010
1,200
326
@AndroPlus:
Hello, I'm seriously considering to buy this device but first I want to make sure (before buying a new tablet) that (a) it supports root (which obviously you were able to do) and (b) to support linux running on the device's framebuffer.

Since running linux on my 10 inch + tablets has become a 2nd nature to me (tablets make some of the best netbooks, being so light and battery-efficient compared to regular netbook) may I venture a suggestion?

Can you try enabling the config_VT on the kernel's option (i.e. the Virtual Terminal feature)? I know some devices to be unbootable after enabling that feature, others do boot. I mean I would be happy to try it myself, but for that I would need to buy the device first, and I much prefer to have a confirmation first.

So yeah great work there (creating the first custom kernel et al). Enabling a single feature would -at worse- cause a boot loop, so I'd guess it would be an easy experiment to do (in case of bootloop you just reflash a "proper" version of the kernel).

Thanks.
 
  • Like
Reactions: JohnnyTactic

DHGE

Senior Member
Jun 20, 2015
636
305
coastal paradise
Code:
# Character devices
#
CONFIG_TTY=y
# [COLOR="Red"]CONFIG_VT is not set[/COLOR]
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_NOZOMI is not set
# CONFIG_N_GSM is not set
# CONFIG_N_SMUX is not set
# CONFIG_TRACE_SINK is not set
CONFIG_DEVMEM=y
CONFIG_DEVKMEM=y

I do not have the time ATM to test VT.

When I have the itch to work in terminal mode I either use adb from my Debian box or the app "Terminal Emulator".

What would VT give us more?

I'd like (as a challenge, not too useful) to port Perl 5.22 to the device and some tools...
But that should be possible with my above mentioned terminals at hand.

I have disabled SONY's RIC and that prevents the bootloops when fiddling with the configuration.
No guaranty for CONFIG_VT though.

Next thing I will try (not this week I suppose): work with the latest ..31 version from SONY and try to enable SELinux again. AndroPlus used my sources and with "his" kernel SELinux is disabled - necessary for me in rooting in the first attempt but I'd like to have SELinux again (stagefright etc.)
 
Last edited:
  • Like
Reactions: JohnnyTactic

Stevethegreat

Senior Member
Nov 28, 2010
1,200
326
Virtual Terminal gives us the chance to output whatever image "we wish" directly to Android's framebuffer.

To make a longer story short, it lets us run Linux on a chroot environment almost natively.
The alternative to that would be running a whole X-server on top of Android or -worse- establish a VNC connection to the chroot environment. In both occasions running a (Desktop) linux distro would be a pain both for every-day use purposes but also kill the battery.

So -yeah- enabling the VT feature lets us -basically- turn our android tablet into a linux tablet with a press of a button (a script that starts the chroot environment and outputs to android's framebuffer) and then back to android through a second script.
I find the concept of Android/Linux netbooks/tablet very appealing as unlike Surface pro it lasts a longer (battery wise), it's half the weight and much better for tablet purposes.

Anyway testing VT would be a godsend (just see whether it boots at least). If it does boot I will buy the tablet in a heartbeat, and probably even write a guide of how to turn it into a full featured Linux machine with the press of a button ;) (without having to dual boot)
 
  • Like
Reactions: JohnnyTactic

DHGE

Senior Member
Jun 20, 2015
636
305
coastal paradise
maybe this commit works

This is straight disabling RIC.

Fine but when I went this route my device bootlooped. I suppose because RIC-calls are hardcoded into SONY's init binary and we do not have the source for that.

So my "solution" was just to patch the calls to RIC and give OK on every call.

When AOSP sources will be available we have a modifiable init and you get your device tree.
 
  • Like
Reactions: AndroPlus

Stevethegreat

Senior Member
Nov 28, 2010
1,200
326
@Stevethegreat
It booted successfully after adding CONFIG_VT and patch to arch/arm64/kernel/setup.c.
https://github.com/AndroPlus-org/an...mmit/18db9f30bc60bdb5ec0e91826e1ebba313b762a0

How do I check if it really works?

Wow those are great news. Thanks!

A quick way to check if it worked is to open Terminal emulator. Then navigate to dev/graphics and make a mental note of the different fb files that exist in that folder (for example fb0, fb1, etc)

When you do that you simply type "su" (to gain super user access) and lastly:
cat /dev/urandom > /dev/graphics/fb0

If all goes well you should get a flashing screen or even a solid screen with urandom's gibberish on top of the screen (a screen fillled with characters). You should *not* get "static" (non specific image) or an error code, really. After trying fb0 , please try the rest of FBx that you found in /dev/graphics. At least one should work as above (generally fb0 does).

Once again thanks man, much appreciated. If all goes well, I'm buying this tablet ;)
 
Last edited:

DHGE

Senior Member
Jun 20, 2015
636
305
coastal paradise
I built a new kernel from the 28.0.A.31 sources with SELinux enabled (Yeah!! :laugh:).

On a second run I set CONFIG_VT=y.

cat /dev/urandom > /dev/graphics/fb0

gives:

tmp-mksh: ... No space left on device

attempting to write on fb2 (three framebuffers 0-2) gives No such device

So no sport here ...
 

Stevethegreat

Senior Member
Nov 28, 2010
1,200
326
Hmmm pity :/.

Hope you ran the command as a super user.
Also maybee trying it w SeLinux in permissive may give different result.

Still I may buy the tablet annyway. As long as it boots with VT on I may find a way to make it work once I have it in hand...
 

Stevethegreat

Senior Member
Nov 28, 2010
1,200
326
yes I used the root account

I really like the tablet:
http://forum.xda-developers.com/showpost.php?p=62033395&postcount=17

Was fortunate to get it for 465 EUR, otherwise I'd have used my Tablet Z longer.

Since I'm very much interested, where did you find it (selling it) at 465 Euros? Everywhere I look is close to 600 Euros (shipping included) and that's kind of too much.

edit: sorry for the off-topic, I just remembered that this thread is about the OP's kernel, not our discussion (still PM me the answer if you wish, thanks).
 

AndroPlus

Senior Member
I tried to build TWRP and build succeeded, but didn't boot:(
here's last_log
kitakami device tree
https://github.com/AndroPlus-org/android_device_sony_karin

I could build and boot Cyanogen Recovery (useless...):
Download
If someone want to try useless recovery, enter into fastboot mode and type
Code:
fastboot flash recovery cmr.img
then reboot and hit power key when LED turn on.

[UPDATE]
OK, TWRP now boots!
CMh4wdgVEAA9FHX.jpg
...but no touch input:crying:
Build from official source didn't boot at all, and this multi-language fork boots.
 
Last edited:

thermonen

Member
Nov 20, 2010
12
2
Recap please

I've been following this thread intrigued for about a month, as long as I've had the tablet. I see that people have been successful in getting their tablets rooted and even gotten TWRP to work on some of them.

What I'm interested is getting simple instructions on how to get root access and of course TWRP would be a big plus since I'm using it on my phone :)
 
  • Like
Reactions: mcraeally44

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    ***ABANDONED***
    I am sorry but I stopped supporting this kernel because I don't have much time recently.


    ly0E01b.jpg


    This is first custom kernel for Xperia Z4 Tablet SGP712/SGP771.

    Download
    Download from official website

    How to root
    See my blog post:
    https://androplus.org/Entry/626/

    I won't create kernel for device which I don't own.
    If you want me to create, please give me the device.

    Donate:
    PayPal

    XDA:DevDB Information
    AndroPlusKernel for Z4 Tablet, Kernel for the Sony Xperia Z4 Tablet

    Contributors
    AndroPlus, Tommy-Geenexus, DHGE, dl12345, andip71, nilezon
    Source Code: https://github.com/AndroPlus-org/android_kernel_sony_msm8994

    Kernel Special Features:

    Version Information
    Status: Testing

    Created 2015-08-02
    Last Updated 2017-05-04
    10
    Sony released kernel source, so I'll start porting today.
    http://developer.sonymobile.com/dow...rchives/open-source-archive-for-32-1-a-1-163/

    Hi,
    I have downgraded to @AndroPlus v10 for some strange behavior and freeze and hard reset (to see if this related or not with the V14 in LP 5.0.2)
    (but with Twrp 3.0.0-0 the touch screen doesn't function in kernel v10)
    The boot time is much faster in v10 (10 second faster to boot, and Antutu benchmark is over 780000 and battery drain is ok)
    So if @AndroPlus can update the kernel v10 to work with TWRP 3.0.0-0 :good:
    Thanks in advance.

    OK, I'll remove changes and release last lollipop update.
    10
    @DHGE and @AndroPlus

    I've been walking through the binaries of both TWRP as well as touch_fusion, I seriously am dumbfounded by what I couldn't find: the location/binary from which touch_fusion is started... it was beyond my comprehension... seriously mind gobbling :eek:

    After another attempt to find out what caused touch_fusion to start I searched and searched and finally think to have found the cause and solution :victory:

    From what I gather, there are still some config files being read from system, other then the firmware file, the path to these files is hardcoded in the binary, which means that we will need to patch the binary to allow a different path to use them. It also uses 2 libraries from the /system/lib64 folder to function according to the touch_fusion.idc.

    I have FINALLY found where touch_fusion is getting started: from the kernel driver :victory:

    # This seems to be date-time related and probably used to calibrate timing:
    /system/usr/share/zoneinfo
    /system/usr/share/zoneinfo/zoneinfo.idx
    /system/usr/share/zoneinfo/zoneinfo.dat

    # The firmware location is hardcoded in to the touch_fusion binary (this is a good thing, hurray!):
    /vendor/firmware/max11945.bin

    # The libaries it is using according to the idc file (but the binary has no reference to them):
    /system/lib64/touchfilter/tfsw.so
    /system/lib64/touchfilter/roadrunner_ukf.so

    This is in the kernel config for the MAXIM_STI touch panel driver:
    https://github.com/AndroPlus-org/an...om/msm8994-kitakami_karin_common.dtsi#L82-L85
    maxim_sti.c
    maxim_sti.h
    max11801_ts.c (probably linked to the binary firmware file used in the ROM, though I don't know for sure)

    Updating the driver to load from /vendor should not even break the stock rom functionality... That should make for an easy test during development :)

    The setting on line 84 seems to be ignored by the touch_fusion binary (luckily)...

    Anyway... to make touch_fusion work system-less:
    • We will need to incorporate the libraries in the vendor folder;
    • Patch the touch_fusion binary to use them and zoneinfo from there too;
    • Copy all related idc/config files to the vendor folder together with the config files (which are already stored in the vendor/etc folder in the ramdisk);
    • The kernel driver needs a patch, loading touch_fusion from the ramdisk vendor folder instead of from system.
    • http://forum.xda-developers.com/showpost.php?p=65212357&postcount=201

    The down side of these discoveries is that we will probably need to create a kernel module which overloads the built-in functionality for locked bootloader devices to make this all work trouble free if locked bootloader root is ever found... but let's start with fixing the UB TWRP :)

    A big thanks go to @jelbo, for helping me test using Google Hangouts, that lead to the discovery of the touch_fusion daemon getting started with a touch of the screen and the reason why I started digging in the kernel sources... :highfive:
    7
    Features and changelog

    I won't answer questions or requests for older version (e.g. "Please update kernel for old firmware!")

    Moved to here
    7
    I updated to v4.
    Kernel source is updated to .251 and SELinux is enforcing.

    The problem is... I still can't working TWRP build:crying:
    I tried modifying config for Z3+ (working) to Z4T one, but stuck at Sony logo.
    Maybe my build environment is bad, though I can build TWRP for Z3...

    Ok, let's see if I can give you a few pointers for getting TWRP to work. There are two possible configurations you can use

    1. AOSP kernel
    2. Sony copyleft kernel

    1. AOSP Kernel
    This one is fairly easy to get working. You just need to look at my commits on the TWRP branch. Import the device and vendor trees directly from the Sony AOSP source and use their prebuilt AOSP kernel. When building using the CM build environment, the key items are RECOVERY_VARIANT=twrp and BOARD_KERNEL_CMDLINE in the BoardConfig.mk and installation of the TWRP sources in bootable/recovery-twrp.

    The disadvantage of this variant is that you're forever doomed to use it in fastboot mode. It's not flashable.

    2. Sony 28.0.A.8.251 Kernel
    This one is much harder to get working. Look at my commits under the branch TWRP-28.0.A.8.251.

    The advantage to this variant is that you can create a flashable TWRP. The way in which this is done is to create a ramdisk that contains a cpio image of the normal boot ramdisk and then you flash the recovery image to the FOTAKernel partition. At boot time, a pseudo init script checks for a keypress. If it finds one, it uses extract_elf_ramdisk to extract the recovery image ramdisk from the FOTAKernel partition, un-cpio's it and then execs the real init. If no keypress occurs, the same thing is done to the cpio image of the normal boot ramdisk.

    Obviously, when you look at the steps required to get a flashable recovery, it's clear that the main boot and the recovery need to use the same kernel. Ergo, for a flashable recovery you need to use the Sony copyleft kernel. Here's where some of the problems start to occur. In no specific order,

    • Sony kernel sources are incomplete. Several kernel modules, not included in the source downloads, are critical. I pulled the binaries off my device (since they're compiled for the same kernel) and put them into the ramdisk, loading them with an insmod at boot time in the init.qcom.rc script. In particular, one of these completes the initialization of the SoC, without which many /sys/class nodes critical to proper functioning of TWRP don't exist and adb doesn't work. Look at the recovery/root folder on the device_sony_ivy repository to identify these kernel modules
    • AOSP and Sony copyleft use a different hardware identifier: AOSP uses kitakami and Sony uses qcom. So you need to rename the various init files to be init.qcom.rc, for example
    • Sony copyleft uses dtb version 3.0. Most of the dtbtools are version two. I had endless trouble with this so I added a custom dtbtool to the build. See my vendor_sony_system_dtbtool repository
    • Ditto issues with mkbootimage. I created a custom one, vendor_sony_system_mkivybootimg
    • The kernel uses a separate dt.img. You need to specify this in the BoardConfig.mk. You then need to make a customkbootimg.mk file that calls dtbtool. You can find this in device_sony_kitakami. Mine is still missing the final steps to create a combined boot image (necessary for dual boot as described above) - I created the dual boot image manually so far. Note carefully that the pagesize on the dt command is NOT the same as the pagesize in the BoardConfig.mk. The latter is 4096 and the dt is 2048. When I tried to use the same pagesize it wouldn't boot. I got the 2048 directly from the Sony instructions on how to build a kernel using copyleft sources in the README_Xperia file.
    • You need to add the diffconfig contents to the main kernel config otherwise it won't boot as it's missing key config defines
    • You need to modify the kernel commandline otherwise TWRP won't boot. See the commandline in BoardConfig.mk in the device_sony_kitakami repository
    • Add the extract_elf_ramdisk if you want to make a flashable recovery. You need to modify the source to support kitakami devices as the default buffer size is too small to contain the extracted ramdisk. I doubled it.

    When you build, make sure to do a "make clobber" first. Hope this helps somewhat....