Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

900supersports guide to working MediaTek ROMs

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Pack boot

    900ssMTKKitchen:ackboot.sh

    Code:
    #!/bin/sh
    #
    #   
    #   900ssMTKKitchen::packboot.sh www.freaktab.com
    #
    #   Copyright 2014 Brian Mahoney [email protected]
    #
    #   1.0
    #
    ############################################################################
    #
    #   900ssMTKKitchen is free software: you can redistribute it and/or modify
    #   it under the terms of the GNU General Public License as published by
    #   the Free Software Foundation, either version 3 of the License, or
    #   (at your option) any later version.
    #
    #   900ssMTKKitchen is distributed in the hope that it will be useful,
    #   but WITHOUT ANY WARRANTY; without even the implied warranty of
    #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    #   GNU General Public License for more details.
    #
    #   You should have received a copy of the GNU General Public License
    #   along with FreakTabKitchen.  If not, see .
    #
    ############################################################################
    #
    #   22/09/14 Created
    # 
    ############################################################################
    #
    #   pack kernel and ramdisk into boot.img
    #
    #   when called with fewer than one parameter a USAGE prompt will be 
    #   displayed
    #
    ############################################################################
    
    
    
    
    PROGNAME=$(basename $0)
    
    
    
    
    error_exit(){
        echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
        exit 1
    }
    
    
    
    
    usage(){
        echo "\n\nUSAGE\n\t${PROGNAME} <DESTINATION>\n\n"
        error_exit "incorrect usage"
    }
    
    
    filesize(){
    stat -c %s $1
    }
    
    
    #check parameters
    if [ $# -lt 1 ] ;then
        usage
    else
        DESTINATION=$1
    fi
    
    
    repack-MT65xx.pl -boot boot.img-kernel.img boot.img-ramdisk $DESTINATION
    note I'm using repack-MT65xx.pl rather than perl repack..., if you check the first lines of the pack and unpack perl scripts you will see that adding a -W to the pack perl will mean we can run it without having to use perl
    Last edited by 900supersport; 09-28-2014, 21:00.
    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


      #17
      Pack system

      900ssMTKKitchen:acksystem.sh

      Code:
      #!/bin/sh
      #
      #   
      #   900ssMTKKitchen::packsystem.sh www.freaktab.com
      #
      #   Copyright 2014 Brian Mahoney [email protected]
      #
      #   1.0
      #
      ############################################################################
      #
      #   900ssMTKKitchen is free software: you can redistribute it and/or modify
      #   it under the terms of the GNU General Public License as published by
      #   the Free Software Foundation, either version 3 of the License, or
      #   (at your option) any later version.
      #
      #   900ssMTKKitchen is distributed in the hope that it will be useful,
      #   but WITHOUT ANY WARRANTY; without even the implied warranty of
      #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      #   GNU General Public License for more details.
      #
      #   You should have received a copy of the GNU General Public License
      #   along with FreakTabKitchen.  If not, see .
      #
      ############################################################################
      #
      #   22/09/14 Created
      # 
      ############################################################################
      #
      #   add support for root
      #
      #   when called with fewer than one parameter a USAGE prompt will be 
      #   displayed
      #
      ############################################################################
      
      
      
      
      PROGNAME=$(basename $0)
      
      
      
      
      error_exit(){
          echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
          exit 1
      }
      
      
      
      
      usage(){
          echo "\n\nUSAGE\n\t${PROGNAME} <EXT4SOURCE> <MOUNTPOINT> <DESTINATION>\n\n"
          error_exit "incorrect usage"
      }
      
      
      filesize(){
          stat -c %s $1
      }
      
      
      #check parameters
      if [ $# -lt 3 ] ;then
          usage
      else
          SOURCEEXT4=$1
          FOLDER=$2
          DESTINATION=$3
      fi
      
      
      SIZE=$( filesize $SOURCEEXT4 )
      
      
      sudo make_ext4fs -s -l "$SIZE" -a system "$DESTINATION" $FOLDER
      Again, we have seen make_ext4fs earlier, here you can see the SIZE variable being set using stat -c %s against the original ext4file, this keeps things nice and simple for us.
      Last edited by 900supersport; 09-28-2014, 21:05.
      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


        #18
        un-mount system

        900ssMTKKitchen::mtkunmount.sh

        Code:
        #!/bin/sh
        #
        #   
        #   900ssMTKKitchen::mtkunmount.sh www.freaktab.com
        #
        #   Copyright 2014 Brian Mahoney [email protected]
        #
        #   <version>1.0</version>
        #
        ############################################################################
        #
        #   900ssMTKKitchen is free software: you can redistribute it and/or modify
        #   it under the terms of the GNU General Public License as published by
        #   the Free Software Foundation, either version 3 of the License, or
        #   (at your option) any later version.
        #
        #   900ssMTKKitchen is distributed in the hope that it will be useful,
        #   but WITHOUT ANY WARRANTY; without even the implied warranty of
        #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        #   GNU General Public License for more details.
        #
        #   You should have received a copy of the GNU General Public License
        #   along with FreakTabKitchen.  If not, see <http://www.gnu.org/licenses/>.
        #
        ############################################################################
        #
        #   27/09/14 Created
        # 
        ############################################################################
        #
        #   unmount an ext4 filesystem
        #
        #   when called with too few parameters a USAGE prompt will be 
        #   displayed
        #
        ############################################################################
        
        
        PROGNAME=$(basename $0)
        
        
        error_exit(){
            echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
            exit 1
        }
        
        
        usage(){
            echo "\n\nUSAGE\n\t${PROGNAME} <MOUNTPOINT>\n\n"
            error_exit "incorrect usage"
        }
        
        
        if [ $# -lt 1 ] ;then
            usage
        else
            FOLDER=$1
        fi
        
        
        echo "############################################################################"
        echo "working,  please wait"
        
        
        if ! sudo umount $FOLDER;then
            error_exit 'Failed to unmount filesystem'
        fi
        to tidy up after ourselves we umount the system file system.
        Last edited by 900supersport; 09-28-2014, 21:07.
        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


          #19
          Bringing it all back home

          900ssMTKKitchen::900ssMTKKitchen.sh

          We now have a useful tool kit but why not automate things a bit further.

          Code:
          #!/bin/sh
          #
          #   
          #   900ssMTKKitchen::900ssMTKKitchen.sh www.freaktab.com
          #
          #   Copyright 2014 Brian Mahoney [email protected]
          #
          #   1.0
          #
          ############################################################################
          #
          #   900ssMTKKitchen is free software: you can redistribute it and/or modify
          #   it under the terms of the GNU General Public License as published by
          #   the Free Software Foundation, either version 3 of the License, or
          #   (at your option) any later version.
          #
          #   900ssMTKKitchen is distributed in the hope that it will be useful,
          #   but WITHOUT ANY WARRANTY; without even the implied warranty of
          #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
          #   GNU General Public License for more details.
          #
          #   You should have received a copy of the GNU General Public License
          #   along with FreakTabKitchen.  If not, see .
          #
          ############################################################################
          #
          #   27/09/14 Created
          # 
          ############################################################################
          #
          #   re-work boot and system images for an MTK ROM with ext4 system
          #
          #   when called with fewer than one parameter a USAGE prompt will be 
          #   displayed
          #
          ############################################################################
          
          
          
          
          PROGNAME=$(basename $0)
          
          
          
          
          error_exit(){
              echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
              exit 1
          }
          
          
          
          
          usage(){
              echo "\n\nUSAGE\n\t${PROGNAME} <SourcePath>\n\n"
              error_exit "incorrect usage"
          }
          
          
          filesize(){
          stat -c %s $1
          }
          
          
          #check parameters
          if [ $# -lt 1 ] ;then
              usage
          else
              SOURCEPATH=$1
          fi
          
          
          SPARSEIMAGE="${SOURCEPATH}system.img"
          BOOTIMAGE="${SOURCEPATH}boot.img"
          
          
          SDESTINATION="${SOURCEPATH}system_900ss.img"
          BDESTINATION="${SOURCEPATH}boot_900ss.img"
          
          
          EXT4IMAGE="system.ext4.img"
          MOUNTPOINT="mntSystem/"
          
          
          if ! unpack.sh $SPARSEIMAGE $EXT4IMAGE ;then
              error_exit 'failed to unpack'  
          fi
          
          
          if ! mtkmount.sh $EXT4IMAGE $MOUNTPOINT ;then
              error_exit "failed to mount ${EXT4IMAGE}"
          fi
          
          
          if ! debloat.sh $MOUNTPOINT ;then
              error_exit "failed to remove bloat"
          fi
          
          
          if ! editbuildprop.sh $MOUNTPOINT ;then
              error_exit "make any build prop changes"
          fi
          
          
          if ! applyroot.sh $MOUNTPOINT;then
              error_exit "Failed to apply root files to system"
          fi
          
          
          if ! addbusybox.sh $MOUNTPOINT ;then
              error_exit "failed to add busybox and symlinks"
          fi
          
          
          if ! deploy.sh $MOUNTPOINT ;then
              error_exit "failed to deploy any further files"
          fi
          
          
          if ! unpackboot.sh $BOOTIMAGE;then
              error_exit "failed to unpack boot"
          fi
          
          
          if ! applyinitrcchanges.sh ;then
              error_exit "failed to apply changes to init.rc"
          fi
          
          
          echo "\n\nReview changes to System and Boot\n\n"
          sudo nautilus .
          
          
          if ! packboot.sh $BDESTINATION;then
              error_exit "failed to pack boot"
          fi
          
          
          if ! packsystem.sh $EXT4IMAGE $MOUNTPOINT $SDESTINATION  ;then
              error_exit "failed to pack system"
          fi
          
          
          if ! mtkunmount.sh $MOUNTPOINT;then
              error_exit "failed to unmount ext4 file system"
          fi
          Here we build up a set of variables to be passed into the later calls as required and then process each script in turn. We will end up with updated boot and system images.
          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


            #20
            CWM Recovery

            Placeholder
            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


              #21
              Boot logo

              Placeholder
              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


                #22
                boot animation

                Placeholder
                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


                  #23
                  I'll complete the prior place holder posts and update posts as required.

                  Any questions?

                  Happy to accept constructive feedback
                  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


                    #24
                    Fantastic work.

                    I've been following this whilst it was a closed thread.

                    R-TV BOX S10, Beebox N3150, Chuwi Hibox, Nvidia Shield, A95X Max

                    Comment


                      #25
                      Thanks I've tidied up my scripts somewhat to get here. I still need to flash the system and boot images created.
                      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


                        #26
                        EBR files

                        I forgot EBR files so consider this another placeholder.
                        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


                          #27
                          Thank you for all the hard work on this. This is one of the most useful threads I've seen in a long time. I will help spread the word. Thanks again.
                          Last edited by Freewaymad; 10-16-2014, 20:14.

                          Comment


                            #28
                            Will try and update one or two of the place holders this weekend, been a bit busy with family lately.
                            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


                              #29
                              thank you!

                              Originally posted by 900supersport View Post
                              Will try and update one or two of the place holders this weekend, been a bit busy with family lately.
                              Um... freaking THANK YOU!

                              I have been looking for an explanation on how to root an Android 4.X rom forever now and your scripts/tutorials provided the answer I was looking for.

                              One thing I will note for anyone else that might come across this and struggle. The latest MTK tools master files contain a mkbootimg binary file that I couldn't get to work for the life of me. It just would not execute so the perl scrip to repack the boot image kept failing. I jumped on github and grabbed the prior revision of the file and that worked a treat.

                              Anyhow, I spent like half an hour scratching my head. I will work on creating a new zip file with all of the tools in one place and post a link here when I get a chance. The latest commit on github was 18 days ago for that file, that is probably why it was working for you just fine but anyone else that grabs the latest version of the file is going to run into problems I think. I am on LuBuntu 32-bit for anyone that is wondering. Also, that brings up another point - I built a new VM for kitchening MTK roms and I accidentally installed 64-bit LuBuntu to start with. Fail... the binary files are all for 32-bit only.

                              Cheers!

                              Roman

                              Comment


                                #30
                                EBR files the easy way?

                                I don't mean to co-opt supersport here, just trying to help so feel free to tell me if I am stepping on any toes.

                                For anyone wanting a quick answer on EBR and partition resizing...

                                Here is a link where you can download a windows tool to quickly modify the EBR files and change partition sizes.

                                http://mtkfirmware.com/content/mtk-p...tool-ebr-files

                                The manual method involves a hex-editor and "nothing ever good comes from using a hex editor" This tool, by contrast, is stupid simple to use.

                                The preset sizes are in .5 GB increments so it should work well for most folks. I tested on a device using the 8127 chipset and it worked perfectly.

                                The tool can be downloaded from there and there is also a link to another site in the references section with more detailed instructions on use if you need them.

                                Kind Regards,

                                Roman

                                Comment

                                Working...
                                X