Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

[KERNEL] Compiling a working kernel (android) - WIP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [KERNEL] Compiling a working kernel (android) - WIP

    Hi all,

    This thread is to share my findings and have a place to ask when I'll get stuck.
    As the title mention, I'm trying to compile an android kernel for this device, to get DVB-C support, and perhaps one day release a "tweaked" version

    My preliminary 'research' :








    After Android 4.4 SDK for AllWinner A31 last week, another AllWinner software development kit has been seen in the wild, this time for the new AllWinner


    Trusted side of the TEE. Contribute to OP-TEE/optee_os development by creating an account on GitHub.



    Learnings, steps taken & status update
    Here's where I'm at this point (updated 19.01.2015):

    * got SKD & android SKD from Tronsmart: http://www.tronsmart.com/support/dow...0/137-sdk-aw80
    * using virtualbox
    * installed lubuntu 12.04 (64bit)+ updates


    PREREQUISITES
    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl \
    zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs   x11proto-core-dev libx11-dev \
    lib32z1-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
    libxml2-utils libglapi-mesa:i386
    JAVA JDK
    Code:
    add-apt-repository ppa:webupd8team/java
    apt-get update
    apt-get install oracle-java6-installer
    * copied android.tar.gz
    * copied "Tronsmart Draco AW80_lichee_20141102.tar" inside virtual machine
    * extracted android tar to home dir
    * extracted lichee archive inside (see page 7 of https://www.pollin.de/shop/downloads/D702359D.PDF)
    resulting in
    /home/dov/android/lichee/


    MKIMAGE
    compiled and "installed" mkimage with sun9iw1p1_config
    Code:
    cd /home/dov/android/lichee/brandy/u-boot-2011.09
    make sun9iw1p1_config
    make
    sudo cp /home/dov/android/lichee/brandy/u-boot-2011.09/tools/mkimage /usr/local/bin/mkimage
    sudo chmod 777 /usr/local/bin/mkimage
    GCC / G++
    installed and changed default compiler to gcc 4.4 & g++ 4.4
    By deleting thegcc-4.6 soft connection file/usr/bin/gcc (just delete the soft connection),
    then build a soft connection, pointing to the gcc-4.4.
    Code:
    sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib
    
    sudo rm/usr/bin/gcc
    sudo ln -s /usr/bin/gcc-4.4 / usr/bin/gcc
    sudo rm/usr/bin/g++
    sudo ln -s /usr/bin/g++-4.4 / usr/bin/g++
    BUILDING KERNEL
    Code:
    cd android/lichee
    ./build.sh config
    Options selected:
    1. 0
    2. android
    3. jaws

    Click image for larger version

Name:	2015-01-18 09_54_30-LUBUNTU [En fonction] - Oracle VM VirtualBox.png
Views:	2
Size:	18.0 KB
ID:	439959

    which ran for quite some time and resulted in a successful build (or reported as such...)
    Click image for larger version

Name:	2015-01-18 09_57_06-LUBUNTU [En fonction] - Oracle VM VirtualBox.png
Views:	2
Size:	12.5 KB
ID:	439958


    BUILDING ANDROID
    Code:
    cd /home/dov/android
    source build/envsetup.sh
    lunch
    extract-bsp
    make -j 8
    Last edited by GJayJayG; 20 January 2015, 00:32. Reason: "clean setup"

    #2
    1st tests -w00t

    Click image for larger version

Name:	2015-01-18 09_54_30-LUBUNTU [En fonction] - Oracle VM VirtualBox.png
Views:	2
Size:	18.0 KB
ID:	436010Click image for larger version

Name:	2015-01-18 09_57_06-LUBUNTU [En fonction] - Oracle VM VirtualBox.png
Views:	2
Size:	12.5 KB
ID:	436011

    Comment


      #3
      any ideas?

      Inserting resulting kernel and modules into my system resulted in a non-working machine,

      freezing at boot logo

      Any one with possible solution or ideas to try?

      Comment


        #4
        Are you sure you changed all modules ? And have them all ? In boot.img also ?

        Without a serial console might be troublesome to see where the kernel hangs.
        Try to see if last_ksmg exists, restore to working state without wiping and check cache also, but I doubt that any useful info exists in there.

        Tapatalked
        if [ $up.post.type = $type.two.lazy.to_use_google ] || [ $up.post.type = $type.silly_question ];
        then mv $user.contact.up.post /.trash; set response($response.type = ignore);
        $user.up.post.ignore_in_future = true; fi;

        Comment


          #5
          Originally posted by abdul_pt View Post
          Are you sure you changed all modules ? And have them all ? In boot.img also ?

          Without a serial console might be troublesome to see where the kernel hangs.
          Try to see if last_ksmg exists, restore to working state without wiping and check cache also, but I doubt that any useful info exists in there.

          Tapatalked
          Thank you for your time and answer.

          Yes, I was under the impression that I had included all modules.

          I will double check and try again, kernel source & config should be fine, as I first attempt to compile without any modifications.

          I'll try to also rework the boot.img.

          Indeed, I'm progressing blindly.

          Comment


            #6
            Tronsmart SDK is bloated with 3 android images

            For those who have already downloaded the tronsmart SDK, have a look here:

            \Tronsmart Draco AW80_lichee_20141102.tar\lichee\tools\pack
            • sun9iw1p1_android_jaws-p1.img
            • sun9iw1p1_android_jaws-p2.img
            • sun9iw1p1_android_jaws-p2_browserOK.img

            Comment


              #7
              Are you packing boot.img the right way ?
              Try just opening and closing it without changes to check.
              It passes a base value on mkbootimg, don't recall what and I'm mobile.

              Tapatalked
              if [ $up.post.type = $type.two.lazy.to_use_google ] || [ $up.post.type = $type.silly_question ];
              then mv $user.contact.up.post /.trash; set response($response.type = ignore);
              $user.up.post.ignore_in_future = true; fi;

              Comment


                #8
                Originally posted by abdul_pt View Post
                Are you packing boot.img the right way ?
                Try just opening and closing it without changes to check.
                It passes a base value on mkbootimg, don't recall what and I'm mobile.

                Tapatalked
                Thank you for the suggestion, will check this as well.

                Click image for larger version

Name:	boot.img.png
Views:	1
Size:	34.0 KB
ID:	436023
                EDIT: ok, the above seem to require a full android build...

                EDIT: gcc version could be an issue, while the cross-compiler tool used are 4.6, it does mention gcc-4.4 ==> post #1 edited to reflect new setup

                "The cross-compiler tools we used is arm-linux-gnueabi-gcc-4.6.3"

                similarly here http://linux-sunxi.org/Android"Unfortunately ICS don't compile with gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 already installed on (*)ubuntu"



                Also, I do not have a male-male usb cable, so I have to use phoenixcard at the moment for sdcard preparation & flashing
                Last edited by GJayJayG; 20 January 2015, 00:21.

                Comment


                  #9
                  Only an idea:
                  Why cross compiling? Use the Linux Boot SD and compile it at the Draco... ok, it takes "a little bit" longer, but...
                  RK3288 Devices
                  - Overview BOX (LINK !)
                  - Overview STICK (Dongle) (LINK !)

                  MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
                  UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
                  Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
                  Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

                  RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
                  Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

                  Comment


                    #10
                    Originally posted by GJayJayG View Post
                    Thank you for the suggestion, will check this as well.

                    [ATTACH=CONFIG]9877[/ATTACH]
                    EDIT: ok, the above seem to require a full android build...

                    EDIT: gcc version could be an issue, while the cross-compiler tool used are 4.6, it does mention gcc-4.4 ==> post #1 edited to reflect new setup

                    "The cross-compiler tools we used is arm-linux-gnueabi-gcc-4.6.3"

                    similarly here http://linux-sunxi.org/Android"Unfortunately ICS don't compile with gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 already installed on (*)ubuntu"

                    Also, I do not have a male-male usb cable, so I have to use phoenixcard at the moment for sdcard preparation & flashing
                    new kernel built with the updated environment (possible that setting gcc-4.4 helped)
                    inserted into ROM
                    burned with phoenix card
                    All in order, working good,
                    Click image for larger version

Name:	Screenshot_2015-01-20-05-11-11.png
Views:	1
Size:	164.6 KB
ID:	436043
                    Click image for larger version

Name:	Screenshot_2015-01-20-05-13-39.png
Views:	1
Size:	45.0 KB
ID:	436044

                    apparently the issue was not with mkimage or with boot.img, but with either the kernel itself or the modules. Could not even try boot.img yet since android is taking ages to compile.
                    Meanwhile, inserted the kernel using good old & buggy dragonface, still have the "startup mode" crash bug, could not find a fix to that yet.

                    Now onto kernel experimenting. I wish I could port that for Android :
                    Allwinner A80 is a powerful octa-core processor found in development boards and TV boxes such as Cubieboard4 or Tronsmart Draco AW80. Some early Ubuntu


                    but I have no f*cking clue how to get there

                    Comment


                      #11
                      Originally posted by GJayJayG View Post
                      new kernel built with the updated environment (possible that setting gcc-4.4 helped)
                      inserted into ROM
                      burned with phoenix card
                      All in order, working good,
                      [ATTACH=CONFIG]9903[/ATTACH]
                      [ATTACH=CONFIG]9904[/ATTACH]

                      apparently the issue was not with mkimage or with boot.img, but with either the kernel itself or the modules. Could not even try boot.img yet since android is taking ages to compile.
                      Meanwhile, inserted the kernel using good old & buggy dragonface, still have the "startup mode" crash bug, could not find a fix to that yet.

                      Now onto kernel experimenting. I wish I could port that for Android :
                      Allwinner A80 is a powerful octa-core processor found in development boards and TV boxes such as Cubieboard4 or Tronsmart Draco AW80. Some early Ubuntu


                      but I have no f*cking clue how to get there
                      Dragonface while easier to use does not work for some things.
                      I use ImgRepacker. Give you full capability with no problems as all it is doing it packing all the files in the ROM. Any changes like replacing the kernel you do in Linux with the FEX tools.

                      Let me know if you want any tips on this process.

                      Bob
                      "Pzebacz im, bo nie wiedzą, co czynią"
                      "Прости им, они не ведают, что творят"
                      "Perdona loro perché non sanno quello che fanno"
                      "Vergib ihnen, denn sie wissen nicht, was sie tun"
                      "Vergeef hen want ze weten niet wat ze doen"
                      "Pardonne-leur car ils ne savent pas ce qu'ils font"
                      "Perdónalos porque no saben que lo que hacen"
                      "Oprosti im, jer ne znaju što čine"
                      "Forgive them as they know not what they do"





                      Comment


                        #12
                        [KERNEL] Compiling a working kernel (android) - WIP

                        Good.

                        Tapatalked
                        if [ $up.post.type = $type.two.lazy.to_use_google ] || [ $up.post.type = $type.silly_question ];
                        then mv $user.contact.up.post /.trash; set response($response.type = ignore);
                        $user.up.post.ignore_in_future = true; fi;

                        Comment


                          #13
                          Originally posted by GJayJayG View Post
                          :
                          Now onto kernel experimenting. I wish I could port that for Android :
                          Allwinner A80 is a powerful octa-core processor found in development boards and TV boxes such as Cubieboard4 or Tronsmart Draco AW80. Some early Ubuntu

                          :
                          Why do you want to port something from linux to android which, if I'm not wrong, is only a linux problem because already implemented at android...
                          (it's the same with linux at e.g. mali400 at rk3188... because the drivers are NP they had to do a lot of reverse-engineering to get the 3D working at GPU but no way for VPU support...)
                          RK3288 Devices
                          - Overview BOX (LINK !)
                          - Overview STICK (Dongle) (LINK !)

                          MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
                          UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
                          Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
                          Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

                          RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
                          Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

                          Comment


                            #14
                            Originally posted by no_spam_for_me View Post
                            Why do you want to port something from linux to android which, if I'm not wrong, is only a linux problem because already implemented at android...
                            (it's the same with linux at e.g. mali400 at rk3188... because the drivers are NP they had to do a lot of reverse-engineering to get the 3D working at GPU but no way for VPU support...)
                            Ok I see, thank you.

                            Source a shit nevertheless, cannot do much until they (allwinner & tronsmart) release proper or better SKD / NDK, everytime I change something via makemenu config, resulting kernel wont boot...

                            Comment


                              #15
                              Originally posted by Finless View Post
                              Dragonface while easier to use does not work for some things.
                              I use ImgRepacker. Give you full capability with no problems as all it is doing it packing all the files in the ROM. Any changes like replacing the kernel you do in Linux with the FEX tools.

                              Let me know if you want any tips on this process.

                              Bob
                              Dear Bob,

                              Thank you for your advices.

                              EDIT, REASON: found solution;
                              Would it be possible to also package TWRP inside ROMs, using ImgRepacker or other method. Do you have a few pointers on that?
                              Last edited by GJayJayG; 27 January 2015, 13:43.

                              Comment

                              Working...
                              X