Author Topic: MINI GUIDE - Compile s192 source  (Read 14480 times)

skelton (OP)

  • Posts: 6894
MINI GUIDE - Compile s192 source
« on: June 14, 2016, 04:35:18 pm »
This is just a basic start to compile the JXD firmware as it is, a very vasic guide to begin with.

You need a x64 linux version, I personally use Ubuntu 14.04. You can virtualize it too with Virtaubox.
Once ubuntu is installed, download packages according to your ubuntu version. Ignore the java installation (we'll do it later)

https://source.android.com/source/initializing.html

You can obvious the java part, because we'l install java manually.. We?ll need Oracle Java 6 to compile  android 4..4. other Java versions like 1,7 or openjdk can give you use issues.

To download Java run terminal and run the following commands:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java6-installer

With this we are ready to begin:

Download the source and untar it whenever you want.

https://mega.nz/#F!Utg3xR5B!1phxtRLppKCB4Kb18CsyMQ

Before starting we need to modify a couple of mk files that are wrong in the source.

Go to  packages/apps/Gamemap and edit the file android,mk, like this:


Code: [Select]
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := GameMap
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_PACKAGE_NAME := GameMap
LOCAL_OVERRIDES_PACKAGES := Game
LOCAL_CERTIFICATE := platform
LOCAL_PREBUILT_JNI_LIBS := $(LOCAL_MODULE)/libhello-jni.so
include $(BUILD_PREBUILT)

# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))


Now we do the same with packages/apps/keyMaster. We edit android,mk file so it keeps this way:


Code: [Select]
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := KeyMaster
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := platform
     
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_PACKAGE_NAME := KeyMaster

include $(BUILD_PREBUILT)
# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))]

Yoy are ready to start. Go to yout folder where untar the source and run setup_ardbeg.sh from terminal with ./setup_ardbeg_sh

Be patiente because compiling can take hours , depending on your machine
Once finished, take files from  out/target/product/ardbeg (ignoing the folders)

You'll need to flash with nvflash and APX drivers like the firmware JXD released here:

https://mega.nz/#F!Ewp2FQgD!_4ThgwYYR8oiwwl0mbsH6w

Download file called 00 firmware and tools,unrar ir under widnows and you can replace tour compiled files with the ones oncluded in the original firmware to flash.Inside the JXD there are drivers and instructions to flash it

In next post I will explain how to compile stand alone kernel.
Retired

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #1 on: June 14, 2016, 04:36:14 pm »
HOW TO COMPILE stand alone KERNEL binary:

first of all, tegra devices doesn't allow kernel in tree compilation, that means we need to compile whole SDK, unless we do the following.

STEP 1: copy your kernel folder from the source to another directory, because we need to make a change a compile kernel only that won't alllow us to compile whole SDK later.

STEP 2: download this file and copy it to arch/arm/boot/dts (to the folder where you copied kernel)

https://mega.nz/#!U5gw1DqK!UNONoBdfahGtmIwMxdDiv-LW1VwYGDzPlzPjGKFSr-E

STEP 3: We need to edit the following file located at  drivers/staging/ozwpan/ozeventtrace.h

The end of the fle should be that way:

#define TRACE_INCLUDE_PATH ../../drivers/staging/ozwpan/
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE ozeventtrace
#include <trace/define_trace.h>

With that we are reasy compile kernel binary. Nvidia uses arm eabi 4.7. It's located in prebuilts/gcc folders of your whole SDK source. I personally a folder called Toolchains with all the toolchains I use. So if you have your toolchain in other location, just change my example with your path to your toolchain:

Now we open terminal, we go to our new kernel directory and run followin command.

1-  make ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.7/bin/arm-eabi- clean     (this step is optional to clean previous buils if there are any)

2-  make ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.7/bin/arm-eabi- tegra12_android_defconfig

3- make ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.7/bin/arm-eabi- tegra124-tn8-e1780-1100-a03-battery.dtb

4- make ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.7/bin/arm-eabi- -j5

After it compiles we'll see out zImage binary kernel under arch(arm/boot

If we add new modules to the kernel we can run the following commands:  make ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.7/bin/arm-eabi- INSTALL_MOD_PATH=build_modules modules
and then

 make ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.7/bin/arm-eabi- INSTALL_MOD_PATH=build_modules modules_install


we will get our new modules under build_modules directory





Have in mind this is only a binary kernwl without a ramdisk, so we need to include it inside our boot.img. You can get boot.img from your already compiled source, or just take from the firmware JXD provides.

We can use a tool like Android Image Kitchen to umpack and repack a boot,img, we just need to replace our new zImage for the one included in boot,img. We can also can make changes to the ramdisk if we want to. there are many image kitchen tools to do that, like this one:
http://forum.xda-developers.com/showthread.php?t=2073775

And that's all. Happy compiling.



« Last Edit: June 19, 2016, 05:50:09 pm by skelton »
Retired

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #2 on: June 14, 2016, 04:36:24 pm »
Include superSU guide:

This is what I do when I compile AOSP to include supersu and binaries. I do it in my GPD too, so hope that works:

Extract this to packages/aliasapps


https://mega.nz/#!tgRHzTqJ!O06r2OEXcdd4dMF5_d9JMIJRhz7CgSW089GoINTHL_g

You will see user_apk.mk file and a root file. Everything is set up, nothing to chamge in there. I included busybox locally because nvidia sources comes without busybox.

Obviously we need to call our new user_apk.mk file so, we edit the file device.mk located in device/nvidia/ardbeg

You can place after this line so it keeps like this:
include packages/aliasapps/user_apk.mk

You can use that line after the following line:
include packages/aliasapps/alias_apps.mk

Now, open the file called init_no_root_device.rc located in device/nvidia/ardbeg
 Look for the service console so that it remains that way :

service console /system/bin/sh
    class core
    console
    disabled
    user root
    group log

Also look for the service flash recovery so that it keeps that way:
service flash_recovery /system/etc/install-recovery.sh
    class main
    oneshot

Basically I remove the # though I think it is removed after compiling anyway.

With that just recompile and in theory you should have root and superSU in your system (It compiles well, but I cannot test). It could also to ask you to update binaries. If it does, select normal option in SuperSU app. If this does not work , we need a different approach I am afraid



« Last Edit: June 22, 2016, 02:21:52 pm by skelton »
Retired

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #3 on: June 15, 2016, 05:57:06 am »
The two code changes fixed my compiling errors.  Didn't have much time to spend with it tonight though.  Made the changes and recompiled.  Came back 20 minutes later and everything was done.

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #4 on: June 15, 2016, 01:40:59 pm »
Glad you got it working. I uodated second post for kernel only.
Retired

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #5 on: June 16, 2016, 01:51:01 am »
Glad you got it working. I uodated second post for kernel only.

Thank you for the guide.  I'll try it tomorrow.  Had too busy a day today to do anything with the ROM.  Since I have Android built, I am going to go after the kernel next, so this is perfect timing.  Then, I am going to start building a ROM, adding in all JXD changes, and seeing if I can spoof the Shield even more.

leafar

  • Posts: 265
Re: MINI GUIDE - Compile s192 source
« Reply #6 on: June 16, 2016, 02:00:09 am »
hoping you peoples do a good job,for the benefic of this device,can be done something like the shield tablet a monster,skelton knows that in XDA are a lot a resources,i use to owned the shield tablet. there is a spanior person called Bitob he doing a tremenduos job with the shield,if the 192 get better a will buy

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #7 on: June 17, 2016, 03:42:19 pm »
Glad you got it working. I uodated second post for kernel only.

Thank you for the guide.  I'll try it tomorrow.  Had too busy a day today to do anything with the ROM.  Since I have Android built, I am going to go after the kernel next, so this is perfect timing.  Then, I am going to start building a ROM, adding in all JXD changes, and seeing if I can spoof the Shield even more.

There are the config. mk files for the shield tablet in the source. So editing board config..mk should do the trick to spoof it even more from source.
Retired

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #8 on: June 18, 2016, 01:46:59 am »
There are the config. mk files for the shield tablet in the source. So editing board config..mk should do the trick to spoof it even more from source.

I noticed all the shield stuff in there.  I want to try spoofing the android version in the file too, to see if that helps the Play Store allow the games we want.  I've asked for a weekend of nothing for Father's Day, so I should have time to get it all done. as long as it really happens.  Although, I picked up a new Tacoma Limited last weekend, so I may want to hit the road for a bit. ;-)

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #9 on: June 19, 2016, 05:35:32 am »
4- make ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.7/bin/arm-eabi- j5

Mine is compiling now.  I think you may have a typo though.  Do you mean -j5 at the end?

Also, doesn't the Shield Tablet use tegra_ardbeg_mods_defconfig?  Would using that one make any difference?
« Last Edit: June 19, 2016, 05:48:07 am by LordDavon »

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #10 on: June 19, 2016, 10:23:25 am »
-j5 is the number of jobs. No idea what is the config used in the shield, but shield will have different drivers so it doesn't make sense  to use that config. If you want to add modules or something to your config you can just run menuconfig after loading config.
Retired

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #11 on: June 19, 2016, 05:30:34 pm »
-j5 is the number of jobs.
I know that. :-)  You don't have the dash in front of it in your instructions.

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #12 on: June 19, 2016, 05:50:30 pm »
-j5 is the number of jobs.
I know that. :-)  You don't have the dash in front of it in your instructions.

Oops, you are right. I edited,
Retired

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #13 on: June 20, 2016, 02:02:56 am »
FYI - Everything is compiled and built.  I am going to put together an update and see if it will install. 

Re: MINI GUIDE - Compile s192 source
« Reply #14 on: June 20, 2016, 03:37:29 am »
Skelton and LordDavon awesome work brothers!😂 Thank you both for your hard work improving the quality and performance of the Jxd S192.
Alienware 18 Sli Gtx 880m 8tb external 1tb enternal 80gb SSD 256gb SSD
Nvidia Shield Portable Tegra 4 64gb Micro SD
Jxd S192 Tegra K1 200gb Mirco SD
PlayStation 3 320gb

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #15 on: June 20, 2016, 05:08:09 am »
Skelton and LordDavon awesome work brothers!😂 Thank you both for your hard work improving the quality and performance of the Jxd S192.

It was much easier with skelton's help.  He really gets most of the credit for getting me this far, this quickly.  Luckily, compiling all this is not much different than compiling andLinux, or any of my other projects, and his instructions have been very straight-forward.  I am going to duplicate the build environment on MacOS, so I can take it with me when I am sitting at the doctor's office, or at the in-laws.  Right now I am using VirtualBox, and RDPing into it directly with the Mac anyway.

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #16 on: June 20, 2016, 06:29:53 pm »
@skelton My system.img is 555MB, and the one in their firmware is 600MB.  Shouldn't we be compiling the same sized?

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #17 on: June 20, 2016, 06:31:54 pm »
When i compiled it was also about 550. I suppose they included some additional apps or something in their first firmware.
Retired

LordDavon

  • Posts: 807
Re: MINI GUIDE - Compile s192 source
« Reply #18 on: June 20, 2016, 10:13:03 pm »
When i compiled it was also about 550. I suppose they included some additional apps or something in their first firmware.

Is there something better I should name the controller?  In gpio_keys.c, it defines it as jxd_key.  I'd like to change it to something a little more common.

skelton (OP)

  • Posts: 6894
Re: MINI GUIDE - Compile s192 source
« Reply #19 on: June 20, 2016, 10:15:51 pm »
You can try something like playstation 3, like un gpd firmware, or try to what shield controller is called (i don't know thw exact name for shield controller). But probable it implies to rename the file jxd_key.kl in system/usr/keylayout
« Last Edit: June 20, 2016, 10:18:06 pm by skelton »
Retired

 

Post a new topic