Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

FreakTab RK ROM Kitchen by 900supersport v2

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

    FreakTab RK ROM Kitchen by 900supersport v2

    I think the time is right to release my ROM ktchen. It's a menu driven python program that runs on linux. I use this kitchen to work all my ROMs, 3066 and 3188.

    There is no fancy UI it runs from a terminal session, here's the main menu.

    Code:
    [FONT=courier new]======================================================================
    [/FONT][FONT=courier new]| FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |[/FONT]
    [FONT=courier new]| Brian Mahoney                                                      |[/FONT]
    [FONT=courier new]| 19 Oct 2013                                                        |[/FONT]
    [FONT=courier new]======================================================================[/FONT]
    [FONT=courier new]| Current ROM U30GT2V2.06_20131017                                   |[/FONT]
    [FONT=courier new]| CWD /home/brian/Desktop/ROMS/cube/u30gt2/2.06                      |[/FONT]
    [FONT=courier new]| Kernel image size:1920:1200                                        |[/FONT]
    [FONT=courier new]======================================================================[/FONT]
    [FONT=courier new]| 1 Pick up img and create locations                                 |[/FONT]
    [FONT=courier new]| 2 Clean, brand and root system and boot images                     |[/FONT]
    [FONT=courier new]======================================================================[/FONT]
    [FONT=courier new]| b boot menu                                                        |[/FONT]
    [FONT=courier new]| r recovery menu                                                    |[/FONT]
    [FONT=courier new]| s system menu                                                      |[/FONT]
    [FONT=courier new]| k kernel menu                                                      |[/FONT]
    [FONT=courier new]| p parameter menu                                                   |[/FONT]
    [FONT=courier new]| f flash menu                                                       |[/FONT]
    [FONT=courier new]======================================================================[/FONT]
    [FONT=courier new]| w broWse                                                           |[/FONT]
    [FONT=courier new]======================================================================[/FONT]
    [FONT=courier new]| x eXit                                                             |[/FONT] 
    ======================================================================
    The kitchen leverages a number of tools to take apart and reassemble ROMs. You will need these working on your linux system to use the kitchen.

    Details of these with information as to how I complied them can be found here.

    I've set-up a github with my kitchen it can be found here. This is my first usage of git so hope I've got it right.

    What can you do with it?
    Using the kitchen you can
    • create well organised workspaces for any number of different ROMs
    • take a factory rom.img and split it into its component images and files
    • pull parameters and a set of image files off an rk device
    • flash imges acording to the currently configured parameter settings
    • work system.img
      • debloat
      • build prop changes
      • add apks both system and user
      • add files
      • busybox integration
      • xml market fixes
      • resize system
      • mount system and browse using a file manager and add, remove and edit files
      • add init.d
      • add boot animations
    • work boot
      • add init.d support
      • add a preinstall service to install apks on first boot
      • add boot screens
      • browse using a file manager and add, remove and edit files
    • kernel
      • brand kernel with own graphics
    The kitchen is highly configurable and greatly simplifies and speeds up the production of a new ROM. In general it takes longer for me to download a new image from cube than it does to produce my first test version of a ROM.

    Update 1 Dec 2013
    Changes as follows
    • parameter validation and repair
    • changes to cope with unusual layout of hudl
    • change to preinstall processes, copy from preinstall/cwm to external_sd
    • some UI changes and bug fixes where found

    Update 20 Nov 2013
    I've just updated my github. Changes as follows:
    • Creation and population of zipped ROM kits
    • clean up of workspace
    • automatic production of multiple parameter files
    • menu driven resize of system.img

    Credits
    Without the support of the other Devs here on Freaktab I doubt I would have created this kitchen or a ROM or two. In particular Finless has shared much of his knowledge on this site.
    Last edited by 900supersport; 12-01-2013, 21:08.
    900Supersport

    900supersports FreakTab rkROMkitchen

    900supersports guide to working-RK-ROMs

    Under Construction 900supersports guide to working MediaTek ROMS

    Struggling for time at the moment, but will try and drop by when I can.

    If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

    freaktab developer

    Proof that you're never to old to learn. Sometimes too old to remember though.

    #2
    Set up

    First ensure you have working versions of rkflashtool, rkcrc and rkunpack. Details of these with information as to how I complied them can be found here. You need these runnable from a command line in a terminal so it's a good idea to symlink them from /user/local/bin.

    Get the kitchen from my github and put it in a location of your choice, it can be found here. For simplicities sake again symlink from /user/local/bin

    I have my kitchen in a folder rkKitchen in my home folder. Below is the link command I used to create the symlink and listing of my /usr/local/bin

    Code:
    [email protected]:~$ cd /usr/local/bin
    [email protected]:/usr/local/bin$ ln -s /home/brian/rkKitchen/FreakTabKitchen.py FreakTabKitchen
    [email protected]:/usr/local/bin$ 
    [email protected]:/usr/local/bin$ 
    [email protected]:/usr/local/bin$ ls -l
    lrwxrwxrwx 1 root root 40 Nov  3 21:18 FreakTabKitchen -> /home/brian/rkKitchen/FreakTabKitchen.py
    lrwxrwxrwx 1 root root 40 Oct 28 21:56 rkcrc -> /home/brian/pykitchen/tools/rk3066/rkcrc
    lrwxrwxrwx 1 root root 46 Oct 29 22:03 rkflashtool -> /home/brian/pykitchen/tools/rk3066/rkflashtool
    lrwxrwxrwx 1 root root 43 Oct 26 10:54 rkunpack -> /home/brian/pykitchen/tools/rk3066/rkunpack
    [email protected]:/usr/local/bin$
    That should be your kitchen crated. Now you just need a workspace. Create a suitable folder heriachy, below is the one I have on my new laptop, a ROMKitchen folder in my home folder with a sub folder for each manufacturer. How far you go with organisation is up to you though the more ROMs you work the more you want to be organised.

    Code:
    [FONT=courier new][email protected]:~$ cd ROMKitchen/[/FONT]
    [FONT=courier new][email protected]:~/ROMKitchen$ ls[/FONT]
    [FONT=courier new]Cube[/FONT]
    [FONT=courier new][email protected]:~/ROMKitchen$ [/FONT]
    Updating the kitchen
    To update download the zip from my github and unzip to a new folder. If you have not customised any of the files in processcontrol etc then you can just copy all the files and folders over your ROM kitchen. If you have customised any of the files copy the .py files to replace the originals. Then review the sub folders and copy in any new files and folders.
    Last edited by 900supersport; 12-01-2013, 18:31. Reason: corrected ln - s to ln -s
    900Supersport

    900supersports FreakTab rkROMkitchen

    900supersports guide to working-RK-ROMs

    Under Construction 900supersports guide to working MediaTek ROMS

    Struggling for time at the moment, but will try and drop by when I can.

    If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

    freaktab developer

    Proof that you're never to old to learn. Sometimes too old to remember though.

    Comment


      #3
      Working a ROM part 1

      I've created /U30GT2/2.06 to serve as a workspace for this ROM then started the Kitchen. If the kitchen does not start you will need to set the execute permission on FreakTabKitchen.py

      Code:
      [email protected]:~/ROMKitchen/Cube/U30GT2/2.06$ ls -l
      total 604584
      -rw-r--r-- 1 brian brian 619086328 Nov  9 15:59 U30GT2V2.06_20131017.img
      [email protected]:~/ROMKitchen/Cube/U30GT2/2.06$ FreakTabKitchen 
      ======================================================================
      | FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |
      | Brian Mahoney                                                      |
      | 19 Oct 2013                                                        |
      ======================================================================
      | Current ROM un-initialised                                         |
      | CWD /home/brian/ROMKitchen/Cube/U30GT2/2.06                        |
      ======================================================================
      | 1 Pick up img and create locations                                 |
      | 2 Clean, brand and root system and boot images                     |
      ======================================================================
      | b boot menu                                                        |
      | r recovery menu                                                    |
      | s system menu                                                      |
      | k kernel menu                                                      |
      | p parameter menu                                                   |
      | f flash menu                                                       |
      ======================================================================
      | w broWse                                                           |
      ======================================================================
      | x eXit                                                             |
      ======================================================================
      Enter selection :


      Rather than type the file name I open Nautilus and drag and drop.

      Click image for larger version

Name:	FKtutorial1.png
Views:	1
Size:	67.3 KB
ID:	431178

      While doing so you will see that the kitchen has created a number of folders and a log file. Errors etc are recorded in the log file.

      Code:
      ======================================================================
      | FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |
      | Brian Mahoney                                                      |
      | 19 Oct 2013                                                        |
      ======================================================================
      | Current ROM un-initialised                                         |
      | CWD /home/brian/ROMKitchen/Cube/U30GT2/2.06                        |
      ======================================================================
      | 1 Pick up img and create locations                                 |
      | 2 Clean, brand and root system and boot images                     |
      ======================================================================
      | b boot menu                                                        |
      | r recovery menu                                                    |
      | s system menu                                                      |
      | k kernel menu                                                      |
      | p parameter menu                                                   |
      | f flash menu                                                       |
      ======================================================================
      | w broWse                                                           |
      ======================================================================
      | x eXit                                                             |
      ======================================================================
      Enter selection :1
      
      
      
      
      ======================================================================
      | FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |
      | Brian Mahoney                                                      |
      | 19 Oct 2013                                                        |
      ======================================================================
      | Current ROM un-initialised                                         |
      | CWD /home/brian/ROMKitchen/Cube/U30GT2/2.06                        |
      ======================================================================
      Please enter file name:'/home/brian/ROMKitchen/Cube/U30GT2/2.06/U30GT2V2.06_20131017.img'
      Press enter and watch as the image is unpacked and placed into the kitchen.

      Code:
      
      
      Code:
      [FONT=courier new]======================================================================[/FONT]
      [FONT=courier new]| FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |[/FONT]
      [FONT=courier new]| Brian Mahoney                                                      |[/FONT]
      [FONT=courier new]| 19 Oct 2013                                                        |[/FONT]
      [FONT=courier new]======================================================================[/FONT]
      [FONT=courier new]| Current ROM U30GT2V2.06_20131017                                   |[/FONT]
      [FONT=courier new]| CWD /home/brian/ROMKitchen/Cube/U30GT2/2.06                        |[/FONT]
      [FONT=courier new]| Kernel image size:1920:1200                                        |[/FONT]
      [FONT=courier new]======================================================================[/FONT]
      [FONT=courier new]| 1 Pick up img and create locations                                 |[/FONT]
      [FONT=courier new]| 2 Clean, brand and root system and boot images                     |[/FONT]
      [FONT=courier new]======================================================================[/FONT]
      [FONT=courier new]| b boot menu                                                        |[/FONT]
      [FONT=courier new]| r recovery menu                                                    |[/FONT]
      [FONT=courier new]| s system menu                                                      |[/FONT]
      [FONT=courier new]| k kernel menu                                                      |[/FONT]
      [FONT=courier new]| p parameter menu                                                   |[/FONT]
      [FONT=courier new]| f flash menu                                                       |[/FONT]
      [FONT=courier new]======================================================================[/FONT]
      [FONT=courier new]| w broWse                                                           |[/FONT]
      [FONT=courier new]======================================================================[/FONT]
      [FONT=courier new]| x eXit                                                             |[/FONT]
      [FONT=courier new]======================================================================[/FONT]
      [FONT=courier new]Enter selection :[/FONT]
      [FONT=courier new]
      [/FONT]
      [FONT=courier new][/FONT]


      The kitchen has picked up a few bits and pieces about the ROM. The name is extracted from the filename of the original image. The kernel has been inspected and the size of the embedded boot image has been determined.

      Did you notice the prompt about local deploy, this is a useful reminder that we may want to prepare a number of boot images and add them to the local deploy folder.

      Press W then enter and browse the workspace, you should get some idea as to what has been done so far.
      Last edited by 900supersport; 11-09-2013, 16:41.
      900Supersport

      900supersports FreakTab rkROMkitchen

      900supersports guide to working-RK-ROMs

      Under Construction 900supersports guide to working MediaTek ROMS

      Struggling for time at the moment, but will try and drop by when I can.

      If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

      freaktab developer

      Proof that you're never to old to learn. Sometimes too old to remember though.

      Comment


        #4
        a moments reflection

        So exiting the kitchen and listing the folder structure (-R is recursive)

        Code:
        [email protected]:~/ROMKitchen/Cube/U30GT2/2.06$ ls -l -R
        -rw-r--r-- 1 brian brian 2083 Nov  9 16:59 kitchen.log
        drwxr-xr-x 2 brian brian 4096 Nov  9 16:29 KitchenPrivate
        drwxr-xr-x 2 brian brian 4096 Nov  9 16:06 localdeploy
        drwxr-xr-x 2 brian brian 4096 Nov  9 16:06 read
        drwxr-xr-x 3 brian brian 4096 Nov  9 16:29 sources
        drwxr-xr-x 7 brian brian 4096 Nov  9 16:29 working
        
        
        ./KitchenPrivate:
        -rw-r--r-- 1 brian brian 2100 Nov  9 16:59 ROMInfo.rtb
        
        
        ./localdeploy:
        
        
        ./read:
        
        
        ./sources:
        drwxr-xr-x 3 brian brian 4096 Nov  9 16:29 U30GT2V2.06_20131017
        
        
        ./sources/U30GT2V2.06_20131017:
        -rw-r--r-- 1 brian brian 619086328 Nov  9 15:59 U30GT2V2.06_20131017.img
        -rw-r--r-- 1 brian brian    194926 Nov  9 16:29 U30GT2V2.06_20131017.img-BOOT
        -rw-r--r-- 1 brian brian       102 Nov  9 16:29 U30GT2V2.06_20131017.img-HEAD
        -rw-r--r-- 1 brian brian        32 Nov  9 16:29 U30GT2V2.06_20131017.img-MD5
        drwxr-xr-x 4 brian brian      4096 Nov  9 16:29 unpacked
        
        
        ./sources/U30GT2V2.06_20131017/unpacked:
        drwxr-xr-x 2 brian brian      4096 Nov  9 16:29 backupimage
        drwxr-xr-x 2 brian brian      4096 Nov  9 16:29 Image
        -rw-r--r-- 1 brian brian       577 Nov  9 16:29 package-file
        -rw-r--r-- 1 brian brian       602 Nov  9 16:29 parameter
        -rw-r--r-- 1 brian brian       266 Nov  9 16:29 recover-script
        -rw-r--r-- 1 brian brian    194926 Nov  9 16:29 RK3188Loader(L)_V1.24.bin
        -rw-r--r-- 1 brian brian 618891268 Nov  9 16:29 update.img
        -rw-r--r-- 1 brian brian       933 Nov  9 16:29 update-script
        
        
        ./sources/U30GT2V2.06_20131017/unpacked/backupimage:
        -rw-r--r-- 1 brian brian 35069956 Nov  9 16:29 backup.img
        
        
        ./sources/U30GT2V2.06_20131017/unpacked/Image:
        -rw-r--r-- 1 brian brian   1018849 Nov  9 16:29 boot.img
        -rw-r--r-- 1 brian brian   1018837 Nov  9 16:29 boot.img-raw
        -rw-r--r-- 1 brian brian   9793584 Nov  9 16:29 kernel.img
        -rw-r--r-- 1 brian brian   9793572 Nov  9 16:29 kernel.img-raw
        -rw-r--r-- 1 brian brian     49152 Nov  9 16:29 misc.img
        -rw-r--r-- 1 brian brian  24002560 Nov  9 16:29 recovery.img
        -rw-r--r-- 1 brian brian 548744192 Nov  9 16:29 system.img
        
        
        ./working:
        drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 boot
        -rw-r--r-- 1 brian brian   1018849 Nov  9 16:29 boot.img
        drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 brand
        -rw-r--r-- 1 brian brian   9793584 Nov  9 16:29 kernel.img
        -rw-r--r-- 1 brian brian     49152 Nov  9 16:29 misc.img
        drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 mntsystem
        drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 mntsystem_ext4
        -rw-r--r-- 1 brian brian       602 Nov  9 16:29 parameter
        -rw-r--r-- 1 brian brian  24002560 Nov  9 16:29 recovery.img
        drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 removed
        -rw-r--r-- 1 brian brian 548744192 Nov  9 16:29 system.img
        
        
        ./working/boot:
        
        
        ./working/brand:
        
        
        ./working/mntsystem:
        
        
        ./working/mntsystem_ext4:
        
        
        ./working/removed:
        The kitchen has moved the original img file to /sources/U30GT2V2.06_20131017 creating folders as required. rkunpack has then been used to unpack the folder. The kitchen has copied a number of images and the parameters file into working and inspected the kernel and parameters files.

        As already mentioned kitchen.log is a log of errors and information. By default the kitchen logs information and errors, and appends to any existing log. Two optional parameters, debug and overwrite can be used when starting the kitchen to get more information or force overwrite.

        Finally /KitchenPrivate/ROMInfo.rtb is used to persist information about the ROM in this workspace. It can be opened in an editor if you want to view it's contents but this is not necessary.
        900Supersport

        900supersports FreakTab rkROMkitchen

        900supersports guide to working-RK-ROMs

        Under Construction 900supersports guide to working MediaTek ROMS

        Struggling for time at the moment, but will try and drop by when I can.

        If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

        freaktab developer

        Proof that you're never to old to learn. Sometimes too old to remember though.

        Comment


          #5
          Local Deploy

          I use local deploy to store ROM specific files. I've added some files to this folder

          Code:
          [email protected]:~/ROMKitchen/Cube/U30GT2/2.06$ ls -l localdeploy/
          -rw-r--r-- 1 brian brian  4842287 Jul 11 21:15 bootanimation.zip
          -rw-r--r-- 1 brian brian   955500 Jul 11 21:15 cube-boot.png
          -rw-r--r-- 1 brian brian  1829020 Jul 11 21:15 initlogo.rle
          -rw-r--r-- 1 brian brian      655 Aug 25 18:14 logo_clut
          -rw-r--r-- 1 brian brian  2304004 Aug 25 18:14 logo_data
          -rw-r--r-- 1 brian brian 11812864 Nov  8 22:11 recovery.img
          bootanimation.zip is the boot animation that plays as system loads
          initlogo.rle is the boot image that displays when boot is loading
          logo_clut and logo_data are the graphic elements required to brand the kenel
          recovery.img is a CWM recovery made by Fun of http://androtab.info/ specifically for the Cube U30GT2

          While I'm here the artwork in my ROMs is from tattman65 here on freaktab. I'll cover details of the graphics anther time.

          The kitchen will work fine without these files but the ROM created will be less 'yours'
          900Supersport

          900supersports FreakTab rkROMkitchen

          900supersports guide to working-RK-ROMs

          Under Construction 900supersports guide to working MediaTek ROMS

          Struggling for time at the moment, but will try and drop by when I can.

          If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

          freaktab developer

          Proof that you're never to old to learn. Sometimes too old to remember though.

          Comment


            #6
            Just cook will you
            • So starting the kitchen (I've used the additional switches here but this is not required)

            Code:
            [email protected]:~/ROMKitchen/Cube/U30GT2/2.06$ FreakTabKitchen debug overwrite
            
            
            ======================================================================
            | FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |
            | Brian Mahoney                                                      |
            | 19 Oct 2013                                                        |
            ======================================================================
            | Current ROM U30GT2V2.06_20131017                                   |
            | CWD /home/brian/ROMKitchen/Cube/U30GT2/2.06                        |
            | Kernel image size:1920:1200                                        |
            ======================================================================
            | 1 Pick up img and create locations                                 |
            | 2 Clean, brand and root system and boot images                     |
            ======================================================================
            | b boot menu                                                        |
            | r recovery menu                                                    |
            | s system menu                                                      |
            | k kernel menu                                                      |
            | p parameter menu                                                   |
            | f flash menu                                                       |
            ======================================================================
            | w broWse                                                           |
            ======================================================================
            | x eXit                                                             |
            ======================================================================
            Enter selection :2
            So press 2 and enter. Some of the operations require root access so you will be prompted for your password then sit back and watch it happen.

            If you follow the prompts it goes something like this.
            • Debloat system
            • resize system
            • deploy some files to system
            • move a few files around
            • create symlinks
            • edit build.prop, you did want to chanage from chineese
            • open Nautilus to allow the changes to be reviewed. inspect build.prop media and preinsall. When you close nautilus the kitchen will continue
            • unmount and fscheck system.img
            • unpack boot
            • remove and deploy some files
            • inspect init.rc and extend to include init.d and preinstall
            • open init.rc in gedit, this allows you to review init.rc and edit if required. Again when you exit the kitchen will continue.
            • Nautilus will open pointing at boot to allow inspection etc, note initlogo.rle, if you put this in local deployclose nautilus to continue.
            At this point the kitchen should really Ding as the ROM is cooked :-).

            Now it's just a case of assembling a ROM kit and flashing, test and refine.

            A quick inspection of working seems in order

            Code:
            Thankyou for using 900supersports FreakTab RK Kitchen
            [email protected]:~/ROMKitchen/Cube/U30GT2/2.06$ ls -l working/
            drwxr-xr-x 9 brian brian      4096 Jan  1  1970 boot
            -rw-r--r-- 1 brian brian   1508896 Nov  9 17:45 boot.img
            -rw-r--r-- 1 brian brian   1018849 Nov  9 16:29 boot.img.old
            -rw-r--r-- 1 brian brian   1018841 Nov  9 17:40 boot.img-ramdisk.gz
            drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 brand
            -rw-r--r-- 1 brian brian   1508884 Nov  9 17:45 customboot.img.gz
            -rw-r--r-- 1 brian brian   9793584 Nov  9 16:29 kernel.img
            -rw-r--r-- 1 brian brian     49152 Nov  9 16:29 misc.img
            drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 mntsystem
            drwxr-xr-x 2 brian brian      4096 Nov  9 16:06 mntsystem_ext4
            -rw-r--r-- 1 brian brian       602 Nov  9 16:29 parameter
            -rw-r--r-- 1 brian brian  24002560 Nov  9 16:29 recovery.img
            drwxr-xr-x 5 brian brian      4096 Nov  9 17:35 removed
            -rw-r--r-- 1 brian brian 576716800 Nov  9 17:40 system.img
            -rw-r--r-- 1 brian brian 548744192 Nov  9 17:35 system.img.orig
            For your ROM kit you want
            • kernel.img
            • recovery.img
            • boot.img
            • system.img
            • parameter
            • misc.img

            As of yet no branding has been applied to the kernel.
            900Supersport

            900supersports FreakTab rkROMkitchen

            900supersports guide to working-RK-ROMs

            Under Construction 900supersports guide to working MediaTek ROMS

            Struggling for time at the moment, but will try and drop by when I can.

            If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

            freaktab developer

            Proof that you're never to old to learn. Sometimes too old to remember though.

            Comment


              #7
              Branded

              If you have suitable graphics for the kernel then

              Start the kitchen, from the menu select K for kernel, this is difficult stuff pay attention at the back there. From the kernel menu press ? i've forgotten

              Code:
              ======================================================================
              | FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |
              | Brian Mahoney                                                      |
              | 19 Oct 2013                                                        |
              ======================================================================
              | Current ROM U30GT2V2.06_20131017                                   |
              | CWD /home/brian/ROMKitchen/Cube/U30GT2/2.06                        |
              | Kernel image size:1920:1200                                        |
              ======================================================================
              | a Get Kernel image info                                            |
              | b Brand Kernel                                                     |
              ======================================================================
              | m main menu                                                        |
              ======================================================================
              Enter selection :
              That would be b then :-)

              This takes a while so the kitchen tells you what it is doing

              Code:
              ======================================================================
              | ... Branding Kernel                                                |
              | ... opening  working/kerneltmp.img for read                        |
              | ... Checking for signature                                         |
              | ... signature found                                                |
              | ... opening  working/kerneltmp.img for write                       |
              | ... read write the kernel up to clut                               |
              | ... adjust for the signature as required                           |
              | ... open the clut for read and write to kerneltmp                  |
              | ... read write through to the logo_data                            |
              | ... open the image data for read and write to kerneltmp            |
              | ... Write remainder of kernel                                      |
              | ... sign the kernel and move branded kernels to working/brand      |
              Flash just the kernel from working/brand. There are two kernels in working/brand one is signed as is suitable for use as stand alone kernel the other is unsigned, suitable for embedding in boot* or recovery.

              * I recommend not embedding a kernel in boot as it will prevent you from swapping kernels without having to rebuild boot.img

              Preparing the image file.
              Once you know the image size you require, create an appropriate png and then in the words of Finless Bob

              First this is a handy tool to have. It converts a PNG to CLUT data.
              This will work in windows as it uses CGI-Win dll's. But the scripts inhere should also work in Linux.

              https://docs.google.com/file/d/0B9BF...RNb3BDaGM/edit

              What you do is drag and drop your PNG onto the .bat file and it will convert the PNG to many files.
              Of these files we only need:
              logo_clut
              logo_data
              copy these two files into localdepoly

              Just a quick note of thanks to Finless who gave me the information required to script this.
              Last edited by 900supersport; 12-12-2013, 12:45.
              900Supersport

              900supersports FreakTab rkROMkitchen

              900supersports guide to working-RK-ROMs

              Under Construction 900supersports guide to working MediaTek ROMS

              Struggling for time at the moment, but will try and drop by when I can.

              If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

              freaktab developer

              Proof that you're never to old to learn. Sometimes too old to remember though.

              Comment


                #8
                A little more details. Remove some files

                Here we want to debloat the system by removing apks that are not required, typically a lot of the Chinese stuff.


                Rather than hard code the files I want to remove I instead have created a file that defines what is to be removed. The code I have implemented tries to do the re-move and handles the non existence of files quite happily. This means I can use a single file against any number of ROMs and expect the apks to me removed if present. If you look in the folder containing the kitchen you will find a sub-folder processcontrol. Within this folder is a file deboatl this is a plain text file, open it in the editor of your choice.

                Code:
                #this file controls debloat process
                #
                #lines staring # and empty will be treated as comments
                #
                #each line is of the form 
                #   bloatpathname, removaldestination
                #
                #bloatpathname is rooted to system
                app/buyu.apk, removed/app
                app/cube.0.3.0_v2963.apk, removed/app
                many of the files controlling the process are similar to this. Lines starting # or blank will be ignored. This file configures the kitchen that it should attempt to move the specified files to a particular folder. By moving them into a removed hierarchy we have the option of putting them back. As I work more ROMs I add to this file and so the debloat gets better and better.
                900Supersport

                900supersports FreakTab rkROMkitchen

                900supersports guide to working-RK-ROMs

                Under Construction 900supersports guide to working MediaTek ROMS

                Struggling for time at the moment, but will try and drop by when I can.

                If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                freaktab developer

                Proof that you're never to old to learn. Sometimes too old to remember though.

                Comment


                  #9
                  Resize system.img

                  When the ROM was originally unpacked the parameters file was parsed and persisted in the rominfo file. The kitchen now compares system.img with the space allocated to it from the parameter file. I resize system.img to the maximum size that will fit. This involves creating a new system.img file mounting both system images and copying all the files from the original (already debloated :-)) image. Finally some unmounting fschecks and rename and we are done.
                  900Supersport

                  900supersports FreakTab rkROMkitchen

                  900supersports guide to working-RK-ROMs

                  Under Construction 900supersports guide to working MediaTek ROMS

                  Struggling for time at the moment, but will try and drop by when I can.

                  If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                  freaktab developer

                  Proof that you're never to old to learn. Sometimes too old to remember though.

                  Comment


                    #10
                    Move some files

                    Typically some of the apps I want to keep would be better as standard apps rather than system apps so here's how I deal with them.

                    To achieve this requires several steps.
                    1. move apks as required from system/data to another location, we will use system/preinstall
                    2. install these files automatically on first boot but not again. It's easy enough to do this from a shell script if we can get it to run.
                    3. to run the shell script set-up a service to run at start-up. This requires busybox


                    In this post we will look at 1 but come back to 2 and 3 later.

                    Within processcontrol is a file movepreinstall this is a plain text file, open it in the editor of your choice.

                    Code:
                    #this file controls move to preinstall process
                    #
                    #lines staring # and empty will be treated as comments
                    #
                    #each line is of the form 
                    #   movefilepathnam, movedestination
                    #
                    
                    
                    app/Email.apk, preinstall/                         
                    app/Exchange2.apk, preinstall/     
                    app/Gmail.apk, preinstall/   
                    app/RkExplorer.apk, preinstall/ 
                    app/DeskClock.apk, preinstall/            
                    app/LatinIME.apk, preinstall/                  
                    app/RkVideoPlayer.apk, preinstall/
                    again you can safely add further files to be moved. The 1st line in the file instructs the kitchen to move Email.apk from system/app/ to system/preinstall/ these apks will be installed on first boot.
                    900Supersport

                    900supersports FreakTab rkROMkitchen

                    900supersports guide to working-RK-ROMs

                    Under Construction 900supersports guide to working MediaTek ROMS

                    Struggling for time at the moment, but will try and drop by when I can.

                    If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                    freaktab developer

                    Proof that you're never to old to learn. Sometimes too old to remember though.

                    Comment


                      #11
                      Adding some files

                      again look in processcontrol and you will find a file deploy, lets take a quick look.

                      Code:
                      #this file controls system deploy process
                      #
                      #lines staring # and empty will be treated as comments
                      #
                      #each line is of the form 
                      #   type,deploypathname, deploydestination, filepermissions
                      #
                      #   type is one of G,L
                      #       G Global, universal for all ROMs
                      #       L Local, ROM specific deployment
                      
                      
                      #G, Superuser.apk, app/, 0o644
                      G, com.koushikdutta.superuser-1.apk, app/, 0o644
                      G, su, xbin/, 0o6755
                      #G, su, bin/, 0o6755
                      G, busybox, bin/, 0o755
                      G, tablet_core_hardware.xml, etc/permissions/, 0o644
                      G, com.android.location.provider.xml, etc/permissions/, 0o644
                      G, android.hardware.location.xml, etc/permissions/, 0o644
                      G, android.hardware.location.gps.xml, etc/permissions/, 0o644
                      
                      G, AppInjector_v1.3.0.apk, preinstall/, 0o644
                      G, FileSystemManager_v0.3.0.apk, preinstall/, 0o644
                      G, Reboot_v0.9.3.apk, preinstall/, 0o644
                      
                      G, flash_image, bin/, 0o755
                      G, preinstall.sh, bin/, 0o755
                      
                      L, bootanimation.zip, media/, 0o755
                      L, recovery.img, preinstall/,0o555
                      This file is a little more complex, lines starting # or blank are ignored as usual. Each line consists of 4 data items, as follows.

                      Item 1, tells the kitchen whereto look for then file
                      G - Global, in the deploy folder of the kitchen
                      L - Local, in the localdeploy folder of the workspace
                      Item 2, the file to be deployed
                      Item 3, the target location for the file
                      Item 4, the Octal permissions for the file

                      a few lines and there function

                      G, com.koushikdutta.superuser-1.apk, app/, 0o644
                      Koush's superuser apk used to manage superuser access and part of the root implementation.
                      G, su, xbin/, 0o6755
                      the su binary require by the superuser apk. More on this later but note the special permissions and destination
                      G, preinstall.sh, bin/, 0o755
                      a shell script that implements the preinstall behaviour
                      L, bootanimation.zip, media/, 0o755
                      the bootanimation, this is ROM specific so is installed from localdeploy
                      L, recovery.img, preinstall/,0o555
                      if I have a clockwork recovery this will be it. Again they are ROM specific and are from localdeploy
                      900Supersport

                      900supersports FreakTab rkROMkitchen

                      900supersports guide to working-RK-ROMs

                      Under Construction 900supersports guide to working MediaTek ROMS

                      Struggling for time at the moment, but will try and drop by when I can.

                      If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                      freaktab developer

                      Proof that you're never to old to learn. Sometimes too old to remember though.

                      Comment


                        #12
                        Linking it all together, complete the busybox set-up

                        You may have noticed in the deploy file that busybox was deployed. To complete the integration we need to set-up some symlinks. We also need a few others. As usual it's controlled by a file, makelinks, in processcontrol.

                        Code:
                        #this file controls busybox symbolic link creation process
                        #
                        #lines staring # and empty will be treated as comments
                        #
                        #each line is of the defines a simlink
                        
                        
                        ln -s  /system/bin/busybox working/mntsystem/bin/[ 
                        ln -s  /system/bin/busybox working/mntsystem/bin/[[
                        ...
                        
                        
                        ln -s  /system/bin/flash_image working/mntsystem/bin/dump_image 
                        
                        
                        #now add additional symlinks for root and boot animation
                        ln -s  /system/xbin/su working/mntsystem/bin/su
                        ln -s  /system/media/bootanimation.zip working/mntsystem/media/bootanimation_0.zip
                        ln -s  /system/media/bootanimation.zip working/mntsystem/media/bootanimation_1.zip
                        If you browse system with nautilus these will show as broken links. They do work correctly in the ROM.

                        There are lots of links created for busybox, I also set some other symlinks. One for dump_image to flash_image, one linking bin/su to xbin/su (root completed). Finally two further symlinks are created essentially aliasing bootanimation.zip as both bootanimation_0.zip and bootanimation_1.zip. This deals with ROMS where the name used for bootanimation is any of these cases.
                        900Supersport

                        900supersports FreakTab rkROMkitchen

                        900supersports guide to working-RK-ROMs

                        Under Construction 900supersports guide to working MediaTek ROMS

                        Struggling for time at the moment, but will try and drop by when I can.

                        If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                        freaktab developer

                        Proof that you're never to old to learn. Sometimes too old to remember though.

                        Comment


                          #13
                          build.prop changes

                          Again this process is controlled by a file this time buildprop_makeenglish. This defines a number of sed substitutions to be applied against build.prop

                          Code:
                          #build.prop edits to make english
                          
                          
                          #these will be made into called like
                          #sudo sed -i "s/\(data 077\)[0123456]\( system system\)/\17\2/g" boot/init.rc
                          
                          
                          "s/\(ro.product.locale.language=\).*/\1en/g" 
                          "s/\(ro.product.locale.region=\).*/\1GB/g" 
                          "s/\(ro.com.android.dateformat=\).*/\1dd-MM-yyyy/g" 
                          "s/\(persist.sys.timezone=\).*/\1Europe\/London/g" 
                          "s/\(ro.rk.homepage_base=\).*/\1http:\/\/www.google.co.uk/g"
                          Edit these as required for your chosen region and language. Following this the build prop is then extended with additional keys, see queryaddbuild.prop.
                          900Supersport

                          900supersports FreakTab rkROMkitchen

                          900supersports guide to working-RK-ROMs

                          Under Construction 900supersports guide to working MediaTek ROMS

                          Struggling for time at the moment, but will try and drop by when I can.

                          If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                          freaktab developer

                          Proof that you're never to old to learn. Sometimes too old to remember though.

                          Comment


                            #14
                            boot.img changes

                            The changes to boot.img are configured similarly. See the files
                            addinitdsupport, addpreinstall, bootdeploy, init.rc_systemrw and queryaddinitrc

                            the two add... files will be grafted onto init.rc if specific words are not found in the init.rc file.
                            900Supersport

                            900supersports FreakTab rkROMkitchen

                            900supersports guide to working-RK-ROMs

                            Under Construction 900supersports guide to working MediaTek ROMS

                            Struggling for time at the moment, but will try and drop by when I can.

                            If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                            freaktab developer

                            Proof that you're never to old to learn. Sometimes too old to remember though.

                            Comment


                              #15
                              ROM Kitchen update 20 Nov 2013

                              I've just updated my github. Changes as follows:
                              • Creation and population of zipped ROM kits
                              • clean up of workspace
                              • automatic production of multiple parameter files
                              • menu driven resize of system.img
                              Code:
                              ======================================================================
                              | FreakTab RK ROM Kitchen by 900supersport v2.0.0                    |
                              | Brian Mahoney                                                      |
                              | 19 Oct 2013                                                        |
                              | www.freaktab.com                                                   |
                              ======================================================================
                              | Current ROM U39GT_V1.04_20130723_WIN8_UI                           |
                              | CWD /home/brian/Desktop/ROMS/cube/u39gt                            |
                              | Kernel image size:1920:1280                                        |
                              ======================================================================
                              | 1 Pick up img and create locations                                 |
                              | 2 Clean, brand and root system and boot images                     |
                              | 3 Make ROM kits                                                    |
                              | 4 Clean workspace (removes working files)                          |
                              ======================================================================
                              | b boot menu                                                        |
                              | r recovery menu                                                    |
                              | s system menu                                                      |
                              | k kernel menu                                                      |
                              | p parameter menu                                                   |
                              | f flash menu                                                       |
                              ======================================================================
                              | w broWse                                                           |
                              ======================================================================
                              | x eXit                                                             |
                              ======================================================================
                              Enter selection :
                              Last edited by 900supersport; 11-20-2013, 21:54.
                              900Supersport

                              900supersports FreakTab rkROMkitchen

                              900supersports guide to working-RK-ROMs

                              Under Construction 900supersports guide to working MediaTek ROMS

                              Struggling for time at the moment, but will try and drop by when I can.

                              If you would like to support my ROM development then please visit my Google site donate page where you can make a paypal donation

                              freaktab developer

                              Proof that you're never to old to learn. Sometimes too old to remember though.

                              Comment

                              Working...
                              X