Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

900supersport's guide to working RK ROMs

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

    900supersport's guide to working RK ROMs

    A while back I wrote a tutorial for some new devs. I thought it's time to make this public. Much of the info here can be found in Fineless's thread.

    I'll be using the Yuandao N70-S-4.1-20121203 firmware for this tutorial

    I'll group the posts by topic and plan the following

    post topic
    1 Introduction and table of contents
    2 pre-requisites
    3 Unpacking
    4 A little background - The Extracted Files
    5 Test Now - Test Often
    6 Some prep work on system.img
    7 Root
    8 Change default language and region
    9 Debloat
    10 Deploy some files
    11 Play/Market Permissions Fixes
    12 Busybox
    13 Parameter
    14 boot.img
    15 init.rc
    16 kernel
    17 Convert a png graphic to rle
    18 Testing init.d


    Brian
    Last edited by 900supersport; 10-11-2013, 21:16.
    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
    Pre-requisites

    We are going to need Linux for this,I'm using Ubuntu but much of this should be the same on otherversions of Linux.


    You can either download and compile the tools yourself or when I get the chance I'll upload the files I have in my kitchen.


    For an overview of some tools see.
    http://www.freaktab.com/showthread.p...or-RK-ROM-Devs


    I currently have the following in my kitchen in ~/pykitchen/tools/rk3066. '~' is interpreted by Linux as the users home folder.




    aapt
    apktool.jar
    mkbootimg
    rkcrc
    rkunpack
    afptool
    img_maker
    mkkrnlimg
    rkflash
    unpack_all.sh
    apktool
    img_unpack
    pack_all.sh
    rkflashtool
    unpackbootimg


    It's a pain to always have to refer to these using the full path. One option would be to move these into/usr/local/bin as executables in this folder are available without specifying the path. Even better is to create symlinks in this folder to our targets.


    The syntax is
    Code:
    ln -s target linkname
    this creates a symbolic link linkname that links to target. As we are creating the symlinks within /usr/local/bin we need to use sudo


    so to get us sorted
    Code:
    cd /usr/local/bin
    sudo ln -s ~/pykitchen/tools/rk3066/aapt aapt
    sudo ln -s ~/pykitchen/tools/rk3066/apktool.jar  apktool.jar 
    sudo ln -s ~/pykitchen/tools/rk3066/mkbootimg  mkbootimg
    sudo ln -s ~/pykitchen/tools/rk3066/rkcrc rkcrc       
    sudo ln -s ~/pykitchen/tools/rk3066/rkunpack rkunpack
    sudo ln -s ~/pykitchen/tools/rk3066/afptoo lafptool 
    sudo ln -s ~/pykitchen/tools/rk3066/img_maker img_maker    
    sudo ln -s ~/pykitchen/tools/rk3066/mkkrnlimg mkkrnlimg   
    sudo ln -s ~/pykitchen/tools/rk3066/rkflash rkflash     
    sudo ln -s ~/pykitchen/tools/rk3066/unpack_all.sh unpack_all.sh
    sudo ln -s ~/pykitchen/tools/rk3066/apktool apktool 
    sudo ln -s ~/pykitchen/tools/rk3066/img_unpack img_unpack  
    sudo ln -s ~/pykitchen/tools/rk3066/pack_all.sh pack_all.sh 
    sudo ln -s ~/pykitchen/tools/rk3066/rkflashtool rkflashtool 
    ln -s~ /pykitchen/tools/rk3066/unpackbootimg  unpackbootimg

    Finally it's handy to know when your ROMs are. In my home folder I have a ROMKitchen folder containing sub-folders for each manufacture, model, ROM version
    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
      Unpacking

      I've made the following folder hierarchy and placed the unzipped download ( N70-S-4.1-20121203.img) into this folder

      ~/ROMKitchen/Yuandao/N70S/4.1-20121203/sources

      To unpack we use the unpack_all.sh we created a symlink to earlier (I have these files set as executable).

      unpack_all.sh target destination

      Again to stay organised I like to always unpack into a folder called unpacked so we will use

      unpack_all.sh N70-S-4.1-20121203.img unpacked

      Here's the results I see copied directly from the terminal session.

      Code:
      unpack_all.sh N70-S-4.1-20121203.img unpacked
      rom version: 4.0.4
      build time: 2012-12-03 15:48:59
      chip: 60
      checking md5sum....OK
      Check file...OK
      ------- UNPACK -------
      package-file    0x00000800    0x00000233
      RK30xxLoader(L)_V1.20.bin    0x00001000    0x0002F3EE
      parameter    0x00030800    0x00000267
      Image/misc.img    0x00031000    0x0000C000
      Image/kernel.img    0x0003D000    0x006C2030
      Image/boot.img    0x006FF800    0x000EA0D1
      Image/recovery.img    0x007EA000    0x00960000
      Image/system.img    0x0114A000    0x17E9A400
      RESERVED    0x00000000    0x00000000
      update-script    0x18FE4800    0x000003A5
      recover-script    0x18FE5000    0x0000010A
      UnPack OK!
      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 little background - The Extracted Files

        Within the image sub-folder we have

        kernel.img A stand alone kernel, used if boot or recovery do not have an embedded kernel. To work as a stand alone kernel it must be signed, to check open in a hex editor the first 4 bytes should be KRNL.

        NB on some of the ROMs I've extracted the kernel has not been signed and cannot be booted
        recovery.img Hopefully provides recovery functionality. Clockwork recovery provides much greater functionality and is a good upgrade. Sometimes with clockwork the role played by recovery on first boot will fail, hopefully this can be overcome once the tab is booted.
        boot.img Manages the boot process. Edit this if we need to change file systems, add init.d support
        system.img The main part of the ROM. Edit this to root, debloat, change default languages, add busybox and a whole host of other changes
        misc.img This works a little like a scratch pad allowing communication between boots of the tab. This inspected early on in the boot progress to determine if the boot is to recovery, bootloader or booting normally. It's possible misc has other functions I am not aware of.
        A few more files
        parameter Details the ROM configuration. We will edit this to adjust the size and locations of the various file systems.
        RK30xxLoader(L)_V1.20.bin I'll just give some warnings on this as I need to get around to researching this more thoroughly.

        Flashing an incorrect loader can cause serious issues with bricking. They can normally be resolved but screwdrivers may be required.

        I include the loader in my roms but do not advise flashing it
        recover-script
        update-script
        If you use the stock flashtool. Then one of these scripts is used to deal with the flash process, they are text files and are worth a look if you are curious.
        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
          Test Now - Test Often

          It's time we checked the image we have taken apart is a good image so let's build a ROM kit and flash.

          While you are learning, force yourself to flash the ROM on a regular basis, this will make it much easier to trouble shoot issues as and when they occur.

          Either take an existing ROM kit and remove the image and parameters file or download and extract this ROMKit that I've already removed the files from.

          http://www.freak-tab.de/900superspor...itTemplate.zip

          Now copy the five .img files and the parameter file into the ROM folder (if you are using my template then it's the 900supersportROM folder).

          At this point I
          • copy the complete ROMkit to a location accessible from windows
          • reboot to windows
          • flash the tab
          • configure the tab and check it works


          If it all works then boot back to Linux for the next session. If not then identify resolve the issue. Help is available here on freaktab.
          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
            Some prep work on system.img

            Lets start off by making a folder fo rus to work in. From the terminal session within the 4.1-20121203 folder enter

            Code:
            mkdir working
            now copy system.img from sources/unpacked/Image to working. Also copy parameter from sources/unpacked to working

            Later on we will be wanting to add files to our system.img. It's quite likely that we will run into problems with space limitations. To deal with this we will create a new, larger ext4 formatted system.img and copy all the files from the original.

            So to do this within the terminal from our working folder we need to enter then following

            Code:
            mkdir mntsystem
            mkdir mntsystem_ext4
            dd if=/dev/zero of=system_ext4.img bs=4096 count=131084
            sudo mkfs.ext4 -q -b 4096 system_ext4.img
            sudo mount -t ext4 -o loop system_ext4.img mntsystem_ext4/
            sudo mount -t ext4 -o loop system.img mntsystem/
            sudo cp -r -v --no-dereference --preserve=all mntsystem/* mntsystem_ext4
            sudo umount mntsystem
            sudo umount mntsystem_ext4
            mv system.img system.img.orig
            mv system_ext4.img system.img
            the mkdir instructions create new folders into which we can mount our system.img files

            we then use dd to create a new .img file all zeros with block size 4096 (this is a best size to use for 3066 system files) and length 131084 blocks. More on these when we get to look at parameter in detail in a later post.

            next as root (sudo) make system_ext4.img an ext4 file system with block size 4096

            now mount the two ext4 file systems into the two folders we have created

            copy all the files from the original to the new image

            unmount the two systems and rename them

            To go along with the new system size lets adjust the parameter file

            Original

            Code:
            FIRMWARE_VER:4.0.4
            MACHINE_MODEL:rk30sdk
            MACHINE_ID:007
            MANUFACTURER:RK30SDK
            MAGIC: 0x5041524B
            ATAG: 0x60000800
            MACHINE: 3066
            CHECK_MASK: 0x80
            KERNEL_IMG: 0x60408000
            #RECOVER_KEY: 1,1,0,20,0
            CMDLINE: console=ttyFIQ0androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000mtdparts=rk29xxnand:[email protected](misc),[email protected](kernel),[email protected](boot),[email protected](recovery),[email protected](backup),[email protected](cache),[email protected](userdata),[email protected](kpanic),[email protected](system),[email protected](user)
            New
            Code:
            FIRMWARE_VER:4.0.4
            MACHINE_MODEL:rk30sdk
            MACHINE_ID:007
            MANUFACTURER:RK30SDK
            MAGIC: 0x5041524B
            ATAG: 0x60000800
            MACHINE: 3066
            CHECK_MASK: 0x80
            KERNEL_IMG: 0x60408000
            #RECOVER_KEY: 1,1,0,20,0
            CMDLINE: console=ttyFIQ0androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000mtdparts=rk29xxnand:[email protected](misc),[email protected](kernel),[email protected](boot),[email protected](recovery),[email protected](backup),[email protected](cache),[email protected](userdata),[email protected](kpanic),[email protected](system),[email protected](user)
            I make these changes using a text editor and save the parameter file.

            The changes are
            [email protected](userdata) to give 2 gig app space
            [email protected](kpanic) adjusted for the new size of userdata
            [email protected](system) adjusted for new size of userdata and increased size of system
            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
              Root

              Now lets get root.To gain root we need to add and correctly set Superuser.apk and the su binary.

              Assuming you have these in my kitchen in ~/pykitchen/deployfiles/ enter the following. If you don't have these files either exract them from an existing ROM or I'll see about uploading copies later. If you have the files in a different location then you will need to adjust the copy commands following. See note below re KitKat.

              Code:
              sudo mount -t ext4-o loop system.img mntsystem
              sudo cp~/pykitchen/deployfiles/Superuser.apk mntsystem/app
              sudo cp~/pykitchen/deployfiles/su mntsystem/xbin
              sudo chmod 644 mntsystem/app/Superuser.apk
              sudo chmod 6755 mntsystem/xbin/su 
              sudo umountmnt system
              sudo e2fsck -y -v system.img
              Note we run all these as root.

              Mount system.img
              Copy Superuser.apk and su into the correct locations
              Set the permissions on Superuser.apk and su
              Unmount system.img
              Check and repair the file system in system.img. This is always worth doing before you flash system.img

              permissions
              octal permissions are as follows
              special permissions(often not set at all) 6 says to run as owner
              owners permissions
              group permissions
              public permissions

              for the Owner, Group and Public permissions simply add as follows
              execute 1
              write 2
              read 4

              so if the digit is
              7 then it's 4+2+1 so its read write execute
              5 then it's 4+1 so it's read execute

              as we have copied these files in as root then the owner and group is root.

              Superuser.apk has permissions 644 read write, read, read (owner, group, public)
              su has permissions 6755 run as owner (root), read write execute, read execute, read execute(special, owner, group, public)

              Finally copy this into the ROM kit on windows, boot to windows and flash the full ROM.Are you rooted?

              Note KitKat changes things somewhat, see http://www.freaktab.com/showthread.p...Rooting-KitKat for a guide as to how to root.
              Last edited by 900supersport; 04-26-2014, 13:20.
              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
                Change default language and region

                I for one am already fed up with having to deal with the language each time I flash this ROM so lets deal with that.

                As usual we need to be in a terminal session with your working folder selected. Enter the following to mount system.img and start a text editor editing build.prop

                Code:
                sudo mount -t ext4-o loop system.img mntsystem
                sudo gedit mntsystem/build.prop
                The following should now open in the text editor

                Code:
                # begin build properties
                # autogenerated bybuildinfo.sh
                ro.build.id=JRO03H
                ro.build.display.id=rk30sdk-eng4.1.1 JRO03H eng.sw3.20121203.151800 test-keys
                ro.build.version.incremental=eng.sw3.20121203.151800
                ro.build.version.sdk=16
                ro.build.version.codename=REL
                ro.build.version.release=4.1.1
                ro.build.date=2012年11月24日星期六 15:18:37 CST
                ro.build.date.utc=1353741517
                ro.build.type=eng
                ro.build.user=sw3
                ro.build.host=SW-desktop
                ro.build.tags=test-keys
                ro.product.model=N70-S
                ro.product.brand=rk30sdk
                ro.product.name=rk30sdk
                ro.product.device=rk30sdk
                ro.product.board=rk30sdk
                ro.product.cpu.abi=armeabi-v7a
                ro.product.cpu.abi2=armeabi
                ro.product.manufacturer=rockchip
                ro.product.locale.language=zh
                ro.product.locale.region=CN
                ro.wifi.channels=
                ro.board.platform=rk30xx
                # ro.build.productis obsolete; use ro.product.device
                ro.build.product=rk30sdk
                # Do not try toparse ro.build.description or .fingerprint
                ro.build.description=rk30sdk-eng4.1.1 JRO03H eng.sw3.20121127.151800 test-keys
                ro.build.fingerprint=rk30sdk/rk30sdk/rk30sdk:4.1.1/JRO03H/eng.sw3.20121127.151800:eng/test-keys
                ro.build.characteristics=tablet
                # end buildproperties
                #
                # system.prop
                #
                #rild.libpath=/system/lib/libreference-ril.so
                #rild.libargs=-d/dev/ttyUSB2
                #
                #ADDITIONAL_BUILD_PROPERTIES
                #
                ro.com.android.dateformat=MM-dd-yyyy
                ro.config.ringtone=Ring_Synth_04.ogg
                ro.config.notification_sound=pixiedust.ogg
                ro.carrier=unknown
                ro.config.alarm_alert=Alarm_Classic.ogg
                dalvik.vm.heapstartsize=8m
                dalvik.vm.heapgrowthlimit=64m
                dalvik.vm.heapsize=384m
                ro.config.facelock=enable_facelock
                persist.facelock.detect_cutoff=5000
                persist.facelock.recog_cutoff=5000
                persist.sys.usb.config=mass_storage
                persist.sys.strictmode.visual=false
                dalvik.vm.jniopts=warnonly
                ro.rksdk.version=RK30_ANDROID4.1.1-SDK-v1.00.00
                sys.hwc.compose_policy=6
                ro.sf.fakerotation=true
                ro.sf.hwrotation=270
                ro.rk.MassStorage=false
                wifi.interface=wlan0
                ro.sf.lcd_density=160
                ro.rk.screenoff_time=60000
                ro.rk.def_brightness=200
                ro.rk.homepage_base=http://www.google.com/webhp?client={CID}&source=android-home
                ro.rk.install_non_market_apps=false
                ro.default.size=100
                persist.sys.timezone=Asia/Shanghai
                ro.product.usbfactory=N70-S
                wifi.supplicant_scan_interval=15
                ro.opengles.version=131072
                testing.mediascanner.skiplist=/mnt/sdcard/Android/
                rild.libargs=-d_/dev/ttyUSB1
                ril.pppchannel=/dev/ttyUSB2
                rild.libpath=/system/lib/libril-rk29-dataonly.so
                ril.function.dataonly=1
                ro.product.version=1.0.0
                ro.product.ota.host=www.rockchip.com:2300
                ro.kernel.android.checkjni=1
                dalvik.vm.dexopt-flags=m=y
                net.bt.name=Android
                dalvik.vm.stack-trace-file=/data/anr/traces.txt
                changes
                #build.prop edits to make English

                So lets deal with a few things
                • First set the default language to english
                  • ro.product.locale.language=zh to ro.product.locale.language=en
                • Now set the locale to Great Britain
                  • ro.product.locale.region=CN to ro.product.locale.region=GB
                • And set the required date format
                  • ro.com.android.dateformat=MM-dd-yyyy to ro.com.android.dateformat=dd-MM-yyyy
                • Set the timezone
                  • persist.sys.timezone=Asia/Shanghai to persist.sys.timezone=Europe/London
                • and finally check, the following, I'm leaving this one
                  • ro.rk.homepage_base=http://www.google.com/webhp?client={CID}&source=android-home
                Obviously you may want different settings for these.

                Region Preferred Settings
                GB ro.product.locale.language=en
                ro.product.locale.region=GB
                ro.com.android.dateformat=dd-MM-yyyy
                persist.sys.timezone=Europe/London

                Time to save the changes and flash, don't forget to unmount and check the file system after saving

                Code:
                sudo umount mntsystem
                sudo e2fsck -y -v system.img
                Now would be a good time to flash and test.
                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
                  Debloat

                  Now to remove some junk. As usual we need to be in a terminal session with your working folder selected. Enter the following to mount system.img and get a listing of the files in system/app


                  Code:
                  sudo mount -t ext4 -o loop system.img mntsystem 
                  ls mntsystem/app/ >app.txt
                  Open the fileapp.txt we have just created to see a list of what is in system/app

                  Code:
                  ApplicationsProvider.apk
                  BackupRestoreConfirmation.apk
                  Browser.apk
                  Calculator.apk
                  Calendar.apk
                  CalendarProvider.apk
                  CalendarProviderGoogle.apk
                  CertInstaller.apk
                  Chrome.apk
                  ChromeBookmarksSyncAdapter.apk
                  com.google.android.marvin.talkback.apk
                  Contacts.apk
                  ContactsProvider.apk
                  DefaultContainerService.apk
                  DeskClock.apk
                  DownloadProvider.apk
                  DownloadProviderUi.apk
                  DrmProvider.apk
                  ECalendar_v3_136_CS_YDSM_20120918.apk
                  Email.apk
                  Exchange2.apk
                  FaceLock
                  FaceLock.apk
                  flashplayer
                  Galaxy4.apk
                  Gallery2.apk
                  Gmail.apk
                  GmsCore.apk
                  GoogleBackupTransport.apk
                  GoogleCalendarSyncAdapter.apk
                  GoogleContactsSyncAdapter.apk
                  GoogleEars.apk
                  GoogleFeedback.apk
                  GoogleLoginService.apk
                  GooglePartnerSetup.apk
                  GooglePlayNew.apk
                  GoogleServicesFramework.apk
                  GoogleTTS.apk
                  HoloSpiralWallpaper.apk
                  HTMLViewer.apk
                  InputDevices.apk
                  Ireader_yuandao.apk
                  KeyChain.apk
                  LatinIME.apk
                  Launcher2.apk
                  LiveWallpapers.apk
                  LiveWallpapersPicker.apk
                  MagicSmokeWallpapers.apk
                  Maps.apk
                  mCubeAcc_V1.0.82.apk
                  MediaFloat.apk
                  MediaProvider.apk
                  MediaUploader.apk
                  MusicFX.apk
                  NetworkLocation.apk
                  NoiseField.apk
                  OneTimeInitializer.apk
                  PackageInstaller.apk
                  PhaseBeam.apk
                  Phone.apk
                  Phonesky.apk
                  PicoTts.apk
                  PinyinIME.apk
                  Provision.apk
                  QianxunKankan.apk
                  QuickSearchBox.apk
                  RkApkinstaller.apk
                  RkExplorer.apk
                  RKUpdateService.apk
                  RkVideoPlayer.apk
                  Settings.apk
                  SettingsProvider.apk
                  SharedStorageBackup.apk
                  SoundRecorder.apk
                  Street.apk
                  Superuser.apk
                  SystemUI.apk
                  TelephonyProvider.apk
                  UserDictionaryProvider.apk
                  Velvet.apk
                  VisualizationWallpapers.apk
                  VoiceSearchStub.apk
                  VpnDialogs.apk
                  WAPPushManager.apk
                  yuandaoPAD.v3011.apk
                  yuandaoxiaomishu.apk
                  I think it's a safe bet we want to remove Ireader_yuandao.apk, we can do so with

                  Code:
                  sudo rm mntsystem/app/Ireader_yuandao.apk
                  Using the tab see if you can identify bloat, I tend to look for apks with obviously Chinese icons. I like to leave rkexplorer.apk as it's handy to know we have some sort of file manager available. With the amount of memory available on the typical rk3066 tab and the other changes we are going to make de bloat is probable not as important as it once was. Be careful not to remove anything important.

                  Its a good idea to edit the txt file we have to separate out all the apks we want to remove. Now using the tab delete these files. Does it still work? If so delete them from our system image similarly to how we deleted Ireader_yuandao.apk.

                  All that remains is to unmount system, check it and test flash.

                  NB a better way to debloat would be to move the file into a 'removed' subfolder of your working folder
                  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
                    Deploy some files

                    Back in post seven we deployed Superuser.apk and su to the correct folders and set permissions.

                    [CODE
                    ]sudo cp~/pykitchen/deployfiles/Superuser.apk mntsystem/app
                    sudo cp~/pykitchen/deployfiles/su mntsystem/xbin
                    sudo chmod 644 mntsystem/app/Superuser.apk
                    sudo chmod 6755 mntsystem/xbin/su
                    [/CODE]

                    If you haven't already got them download Petrus's AppInjector, FileSystemManager and Reboot apks. I locate these in ~/pykitchen/deployfiles/. If you have it available we can deploy the bootanimation.zip as well, I place these in a localdeploy folder in the 4.1-20121203 folder.

                    The apks need to be copied into system/app and permissions set to 644, bootanimation.zip to system/media with permissions 755.

                    Deploy any other files you are wanting to add.

                    Finally as usual unmount, check and flash.
                    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
                      Play/Market Permissions Fixes

                      If you take a look in system/etc/permissions you will see a set of xmlfiles. One of the roles these play is in describing the capabilities of the device to Google Play. My fix involves four of these files.

                      android.hardware.location.gps.xml
                      android.hardware.location.xml
                      com.android.location.provider.xml
                      tablet_core_hardware.xml

                      If you have my kitchen you will find copies in ~/pykitchen/deployfiles/

                      xmlPermissions.zip

                      here's the content of tablet_core_hardware.xml

                      Code:
                      <?xmlversion="1.0" encoding="utf-8"?>
                      <!--Copyright (C) 2010 The Android Open Source Project
                      Licensed under the Apache License, Version 2.0 (the "License");
                      you may not use this file except in compliance with the License.
                      You may obtain a copy of the License at
                      http://www.apache.org/licenses/LICENSE-2.0
                      
                      Unless required by applicable law or agreed to in writing, software
                      distributed under the License is distributed on an "AS IS" BASIS,
                      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
                      
                      See the License for the specific language governing permissions and
                      limitations under the License.
                      
                      900supersport
                      
                      -->
                      <!--These are the hardware components that all handheld devices
                      must include. Devices with optional hardware must also include extra hardwarefiles, per the comments below.
                      
                      Handhelddevices include phones, mobile Internet devices (MIDs),
                      PersonalMedia Players (PMPs), small tablets (7" or less), and similar
                      devices.
                      -->
                      <permissions>
                      <featurename="android.hardware.wifi" />
                      <featurename="android.hardware.camera.front" />
                      <featurename="android.hardware.camera.autofocus" />
                      <featurename="android.hardware.location.gps" />
                      <featurename="android.hardware.camera" />
                      <featurename="android.hardware.location" />
                      <featurename="android.hardware.location.network" />
                      <featurename="android.hardware.location.provider" />
                      <featurename="android.hardware.sensor.compass" />
                      <featurename="android.hardware.sensor.accelerometer" />
                      <featurename="android.hardware.touchscreen" />
                      <featurename="android.hardware.touchscreen.multitouch" />
                      <featurename="android.hardware.touchscreen.multitouch.distinct" />
                      <featurename="android.hardware.microphone" />
                      <featurename="android.hardware.screen.portrait" />
                      <featurename="android.hardware.screen.landscape" />
                      <!--devices with GPS must include android.hardware.location.gps.xml -->
                      <!--devices with a rear-facing camera must include one of these as appropriate:
                      android.hardware.camera.xmlor 
                      android.hardware.camera.autofocus.xmlor 
                      android.hardware.camera.autofocus-flash.xml
                      -->
                      <!--devices with a front facing camera must include
                      android.hardware.camera.front.xml-->
                      <!--devices with WiFi must also include android.hardware.wifi.xml -->
                      <!--devices with an ambient light sensor must also include
                      android.hardware.sensor.light.xml-->
                      <!--devices with a proximity sensor must also include
                      android.hardware.sensor.proximity.xml-->
                      <!--devices with a barometer must also include
                      android.hardware.sensor.barometer.xml-->
                      <!--devices with a gyroscope must also include
                      android.hardware.sensor.gyroscope.xml-->
                      <!--GSM phones must also include android.hardware.telephony.gsm.xml -->
                      <!--CDMA phones must also include android.hardware.telephony.cdma.xml-->
                      </permissions>
                      I add my handle to the header so I know I have edited the file. The rest is just a list of the features that we claim the tab has.

                      In each case if the file does not exist put my file in place, if it does compare with mine and add any features missing.

                      I got worn down by the comparison as I cannot remember a time when the stock had permissions that where not in my template. I now remove the original files and replace with mine. I'm sure this will come back to bite me one day but when it does I'll at least have the originals handy for comparison.
                      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
                        Busybox

                        Busybox basically wraps a lot of standard Linux calls (cp, mv, chmod, etc) into a small binary allowing us access to them in a terminal session within android.

                        First we have a fairly straight forwards deploy of the busybox binary from~/pykitchen/deployfiles to system/bin. Permissions should be set to 755

                        That's put the functionality in place now lets make it usable. Back in post2 Pre-requisites we set-up symlinks to make a number of tools more accessible in Linux, we will now do the same to expose busybox functionality

                        from post 2 we had

                        Code:
                        sudo ln -s ~/pykitchen/tools/rk3066/rkcrcrkcrc
                        this created a symbolic link rkcrc in the current folder to~/pykitchen/tools/rk3066/rkcrc. Our busybox symlinks are similar, here's one of the busybox symlinks we are going to make from our working folder

                        Code:
                        ln -s  /system/bin/busybox mntsystem/bin/run-parts
                        edit I suspect this will need to be run as sudo.

                        this creates a symlink run-parts in system/bin that links to/system/bin/busybox

                        when this is called (you will see an example when we are working boot.img), busybox is invoked with any parameters passed in including the name of the symlink used to call it. In this way busybox automatically executes run-parts when executed as run-parts.

                        At this point it's time to make the symlinks, mount system and from a terminal in your working folder enter the following in turn.

                        Code:
                        ln -s  /system/bin/busybox mntsystem/bin/[ 
                        ln -s  /system/bin/busybox mntsystem/bin/[[ 
                        ln -s  /system/bin/busybox mntsystem/bin/ash 
                        ln -s  /system/bin/busybox mntsystem/bin/awk 
                        ln -s  /system/bin/busybox mntsystem/bin/base64 
                        ln -s  /system/bin/busybox mntsystem/bin/basename 
                        ln -s  /system/bin/busybox mntsystem/bin/blkid 
                        ln -s  /system/bin/busybox mntsystem/bin/bunzip2 
                        ln -s  /system/bin/busybox mntsystem/bin/bzip2 
                        ln -s  /system/bin/busybox mntsystem/bin/cal 
                        ln -s  /system/bin/busybox mntsystem/bin/chattr 
                        ln -s  /system/bin/busybox mntsystem/bin/chgrp 
                        ln -s  /system/bin/busybox mntsystem/bin/chroot 
                        ln -s  /system/bin/busybox mntsystem/bin/chrt 
                        ln -s  /system/bin/busybox mntsystem/bin/cksum 
                        ln -s  /system/bin/busybox mntsystem/bin/clear 
                        ln -s  /system/bin/busybox mntsystem/bin/comm 
                        ln -s  /system/bin/busybox mntsystem/bin/cp 
                        ln -s  /system/bin/busybox mntsystem/bin/crond 
                        ln -s  /system/bin/busybox mntsystem/bin/crontab 
                        ln -s  /system/bin/busybox mntsystem/bin/cut 
                        ln -s  /system/bin/busybox mntsystem/bin/depmod 
                        ln -s  /system/bin/busybox mntsystem/bin/devmem 
                        ln -s  /system/bin/busybox mntsystem/bin/diff 
                        ln -s  /system/bin/busybox mntsystem/bin/dirname 
                        ln -s  /system/bin/busybox mntsystem/bin/dnsd 
                        ln -s  /system/bin/busybox mntsystem/bin/dnsdomainname 
                        ln -s  /system/bin/busybox mntsystem/bin/dos2unix 
                        ln -s  /system/bin/busybox mntsystem/bin/du 
                        ln -s  /system/bin/busybox mntsystem/bin/echo 
                        ln -s  /system/bin/busybox mntsystem/bin/egrep 
                        ln -s  /system/bin/busybox mntsystem/bin/env 
                        ln -s  /system/bin/busybox mntsystem/bin/ether-wake 
                        ln -s  /system/bin/busybox mntsystem/bin/expand 
                        ln -s  /system/bin/busybox mntsystem/bin/expr 
                        ln -s  /system/bin/busybox mntsystem/bin/fakeidentd 
                        ln -s  /system/bin/busybox mntsystem/bin/fdflush 
                        ln -s  /system/bin/busybox mntsystem/bin/fdformat 
                        ln -s  /system/bin/busybox mntsystem/bin/fdisk 
                        ln -s  /system/bin/busybox mntsystem/bin/fgrep 
                        ln -s  /system/bin/busybox mntsystem/bin/find 
                        ln -s  /system/bin/busybox mntsystem/bin/fold 
                        ln -s  /system/bin/busybox mntsystem/bin/free 
                        ln -s  /system/bin/busybox mntsystem/bin/freeramdisk 
                        ln -s  /system/bin/busybox mntsystem/bin/fsck 
                        ln -s  /system/bin/busybox mntsystem/bin/fsync 
                        ln -s  /system/bin/busybox mntsystem/bin/ftpd 
                        ln -s  /system/bin/busybox mntsystem/bin/ftpget 
                        ln -s  /system/bin/busybox mntsystem/bin/ftpput 
                        ln -s  /system/bin/busybox mntsystem/bin/getopt 
                        ln -s  /system/bin/busybox mntsystem/bin/grep 
                        ln -s  /system/bin/busybox mntsystem/bin/groups 
                        ln -s  /system/bin/busybox mntsystem/bin/gunzip 
                        ln -s  /system/bin/busybox mntsystem/bin/head 
                        ln -s  /system/bin/busybox mntsystem/bin/hexdump 
                        ln -s  /system/bin/busybox mntsystem/bin/hostid 
                        ln -s  /system/bin/busybox mntsystem/bin/hostname 
                        ln -s  /system/bin/busybox mntsystem/bin/httpd 
                        ln -s  /system/bin/busybox mntsystem/bin/hwclock 
                        ln -s  /system/bin/busybox mntsystem/bin/ifenslave 
                        ln -s  /system/bin/busybox mntsystem/bin/inetd 
                        ln -s  /system/bin/busybox mntsystem/bin/inotifyd 
                        ln -s  /system/bin/busybox mntsystem/bin/install 
                        ln -s  /system/bin/busybox mntsystem/bin/iostat 
                        ln -s  /system/bin/busybox mntsystem/bin/ipaddr 
                        ln -s  /system/bin/busybox mntsystem/bin/ipcalc 
                        ln -s  /system/bin/busybox mntsystem/bin/iplink 
                        ln -s  /system/bin/busybox mntsystem/bin/iproute 
                        ln -s  /system/bin/busybox mntsystem/bin/iprule 
                        ln -s  /system/bin/busybox mntsystem/bin/iptunnel 
                        ln -s  /system/bin/busybox mntsystem/bin/killall 
                        ln -s  /system/bin/busybox mntsystem/bin/killall5 
                        ln -s  /system/bin/busybox mntsystem/bin/less 
                        ln -s  /system/bin/busybox mntsystem/bin/logname 
                        ln -s  /system/bin/busybox mntsystem/bin/losetup 
                        ln -s  /system/bin/busybox mntsystem/bin/lsattr 
                        ln -s  /system/bin/busybox mntsystem/bin/lsusb 
                        ln -s  /system/bin/busybox mntsystem/bin/lzop 
                        ln -s  /system/bin/busybox mntsystem/bin/lzopcat 
                        ln -s  /system/bin/busybox mntsystem/bin/md5sum 
                        ln -s  /system/bin/busybox mntsystem/bin/microcom 
                        ln -s  /system/bin/busybox mntsystem/bin/mkfifo 
                        ln -s  /system/bin/busybox mntsystem/bin/mkfs.ext2 
                        ln -s  /system/bin/busybox mntsystem/bin/mkfs.vfat 
                        ln -s  /system/bin/busybox mntsystem/bin/mknod 
                        ln -s  /system/bin/busybox mntsystem/bin/mkswap 
                        ln -s  /system/bin/busybox mntsystem/bin/modinfo 
                        ln -s  /system/bin/busybox mntsystem/bin/modprobe 
                        ln -s  /system/bin/busybox mntsystem/bin/more 
                        ln -s  /system/bin/busybox mntsystem/bin/mt 
                        ln -s  /system/bin/busybox mntsystem/bin/nameif 
                        ln -s  /system/bin/busybox mntsystem/bin/nanddump 
                        ln -s  /system/bin/busybox mntsystem/bin/nandwrite 
                        ln -s  /system/bin/busybox mntsystem/bin/nice 
                        ln -s  /system/bin/busybox mntsystem/bin/nmeter 
                        ln -s  /system/bin/busybox mntsystem/bin/nslookup 
                        ln -s  /system/bin/busybox mntsystem/bin/ntpd 
                        ln -s  /system/bin/busybox mntsystem/bin/od 
                        ln -s  /system/bin/busybox mntsystem/bin/patch 
                        ln -s  /system/bin/busybox mntsystem/bin/pgrep 
                        ln -s  /system/bin/busybox mntsystem/bin/pidof 
                        ln -s  /system/bin/busybox mntsystem/bin/pkill 
                        ln -s  /system/bin/busybox mntsystem/bin/pmap 
                        ln -s  /system/bin/busybox mntsystem/bin/powertop 
                        ln -s  /system/bin/busybox mntsystem/bin/printf 
                        ln -s  /system/bin/busybox mntsystem/bin/pscan 
                        ln -s  /system/bin/busybox mntsystem/bin/pwd 
                        ln -s  /system/bin/busybox mntsystem/bin/rdate 
                        ln -s  /system/bin/busybox mntsystem/bin/rdev 
                        ln -s  /system/bin/busybox mntsystem/bin/readlink 
                        ln -s  /system/bin/busybox mntsystem/bin/realpath 
                        ln -s  /system/bin/busybox mntsystem/bin/reset 
                        ln -s  /system/bin/busybox mntsystem/bin/rev 
                        ln -s  /system/bin/busybox mntsystem/bin/rfkill 
                        ln -s  /system/bin/busybox mntsystem/bin/run-parts 
                        ln -s  /system/bin/busybox mntsystem/bin/script 
                        ln -s  /system/bin/busybox mntsystem/bin/scriptreplay 
                        ln -s  /system/bin/busybox mntsystem/bin/sed 
                        ln -s  /system/bin/busybox mntsystem/bin/seq 
                        ln -s  /system/bin/busybox mntsystem/bin/setkeycodes 
                        ln -s  /system/bin/busybox mntsystem/bin/setlogcons 
                        ln -s  /system/bin/busybox mntsystem/bin/setsid 
                        ln -s  /system/bin/busybox mntsystem/bin/sha1sum 
                        ln -s  /system/bin/busybox mntsystem/bin/sha256sum 
                        ln -s  /system/bin/busybox mntsystem/bin/sha512sum 
                        ln -s  /system/bin/busybox mntsystem/bin/showkey 
                        ln -s  /system/bin/busybox mntsystem/bin/smemcap 
                        ln -s  /system/bin/busybox mntsystem/bin/sort 
                        ln -s  /system/bin/busybox mntsystem/bin/split 
                        ln -s  /system/bin/busybox mntsystem/bin/stat 
                        ln -s  /system/bin/busybox mntsystem/bin/strings 
                        ln -s  /system/bin/busybox mntsystem/bin/stty 
                        ln -s  /system/bin/busybox mntsystem/bin/sum 
                        ln -s  /system/bin/busybox mntsystem/bin/swapoff 
                        ln -s  /system/bin/busybox mntsystem/bin/swapon 
                        ln -s  /system/bin/busybox mntsystem/bin/sysctl 
                        ln -s  /system/bin/busybox mntsystem/bin/tac 
                        ln -s  /system/bin/busybox mntsystem/bin/tail 
                        ln -s  /system/bin/busybox mntsystem/bin/tar 
                        ln -s  /system/bin/busybox mntsystem/bin/tee 
                        ln -s  /system/bin/busybox mntsystem/bin/telnet 
                        ln -s  /system/bin/busybox mntsystem/bin/telnetd 
                        ln -s  /system/bin/busybox mntsystem/bin/test 
                        ln -s  /system/bin/busybox mntsystem/bin/tftp 
                        ln -s  /system/bin/busybox mntsystem/bin/tftpd 
                        ln -s  /system/bin/busybox mntsystem/bin/time 
                        ln -s  /system/bin/busybox mntsystem/bin/timeout 
                        ln -s  /system/bin/busybox mntsystem/bin/tr 
                        ln -s  /system/bin/busybox mntsystem/bin/traceroute 
                        ln -s  /system/bin/busybox mntsystem/bin/traceroute6 
                        ln -s  /system/bin/busybox mntsystem/bin/tty 
                        ln -s  /system/bin/busybox mntsystem/bin/ttysize 
                        ln -s  /system/bin/busybox mntsystem/bin/tunctl 
                        ln -s  /system/bin/busybox mntsystem/bin/uname 
                        ln -s  /system/bin/busybox mntsystem/bin/uncompress 
                        ln -s  /system/bin/busybox mntsystem/bin/unexpand 
                        ln -s  /system/bin/busybox mntsystem/bin/uniq 
                        ln -s  /system/bin/busybox mntsystem/bin/unix2dos 
                        ln -s  /system/bin/busybox mntsystem/bin/unlzop 
                        ln -s  /system/bin/busybox mntsystem/bin/unzip 
                        ln -s  /system/bin/busybox mntsystem/bin/usleep 
                        ln -s  /system/bin/busybox mntsystem/bin/uudecode 
                        ln -s  /system/bin/busybox mntsystem/bin/uuencode 
                        ln -s  /system/bin/busybox mntsystem/bin/vconfig 
                        ln -s  /system/bin/busybox mntsystem/bin/vi 
                        ln -s  /system/bin/busybox mntsystem/bin/watch 
                        ln -s  /system/bin/busybox mntsystem/bin/wc 
                        ln -s  /system/bin/busybox mntsystem/bin/wget 
                        ln -s  /system/bin/busybox mntsystem/bin/which 
                        ln -s  /system/bin/busybox mntsystem/bin/who 
                        ln -s  /system/bin/busybox mntsystem/bin/whoami 
                        ln -s  /system/bin/busybox mntsystem/bin/whois 
                        ln -s  /system/bin/busybox mntsystem/bin/xargs 
                        ln -s  /system/bin/busybox mntsystem/bin/zcat
                        I've never done this, I thought bugger that, so I scripted these. To do this
                        • use the text editor of your choice
                          • enter #!/bin/bash as the first line
                          • copy and paste in all the ln lines from the code above
                          • Save this as makelinks.sh into ~/pykitchen/tools/scripts
                        • set the permissions on the file to include execute (remember chmod, or take the easy route and use nautilus)
                        • set-up a symlink from /user/local/bin to makelinks.sh
                        now from our terminal session within our working folder enter sudo makelinks.sh

                        unmount, check repair system.img and test flash.

                        How did I know that?

                        I found most of this using my tab as follows.
                        • From play I installed one of the busybox installers
                        • I then tracked down the location of busybox and the links
                        • from a terminal session on the tab I chose the directory then used ls -l >links.txt
                        • I copied busybox and links.txt to my laptop and edited links.txt to give the abov
                        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
                          Parameter

                          Lets take a quick look at a stock Parameter file

                          Code:
                          FIRMWARE_VER:4.0.4
                          MACHINE_MODEL:rk30sdk
                          MACHINE_ID:007
                          MANUFACTURER:RK30SDK
                          MAGIC: 0x5041524B
                          ATAG: 0x60000800
                          MACHINE: 3066
                          CHECK_MASK: 0x80
                          KERNEL_IMG: 0x60408000
                          #RECOVER_KEY: 1,1,0,20,0
                          CMDLINE: console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:[email protected](misc),[email protected](kernel),[email protected](boot),[email protected](recovery),[email protected](backup),[email protected](cache),[email protected](userdata),[email protected](kpanic),[email protected](system),[email protected](user)
                          A quick warning I don't think it's a good idea to mess with the line '#RECOVER_KEY: 1,1,0,20,0' I leave this well alone.

                          The interesting information is in the mtdparts line, this basically defines the blocks of the filing system.

                          [email protected](misc)
                          [email protected](kernel)
                          [email protected](boot)
                          [email protected](recovery)
                          [email protected](backup)
                          [email protected](cache)
                          [email protected](userdata)
                          [email protected](kpanic)
                          [email protected](system)
                          [email protected](user)

                          each line defines a block device with length offset pairs, the vales are in hex (0x), the units are in block of 0x200 (512) bytes.

                          So for example recovery is at offset 0x10000 (33,554,432) length (16,777,216)

                          Now onto some good stuff, userdata is length 0x200000 this is 1Gb. There is a good calculator in Linux that does hex. If we want 2Gb we need to change this to 0x400000. We then need to correct the offsets to kpanic, system and user by adding to the offsets. BTW the ~ in (user) means the rest of the space.

                          This gives us the following at the end of the parameter file.

                          [email protected](userdata)
                          [email protected](kpanic)
                          [email protected](system)
                          [email protected](user)

                          This gives us

                          Code:
                          FIRMWARE_VER:4.0.4
                          MACHINE_MODEL:rk30sdk
                          MACHINE_ID:007
                          MANUFACTURER:RK30SDK
                          MAGIC: 0x5041524B
                          ATAG: 0x60000800
                          MACHINE: 3066
                          CHECK_MASK: 0x80
                          KERNEL_IMG: 0x60408000
                          #RECOVER_KEY: 1,1,0,20,0
                          CMDLINE: console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:[email protected](misc),[email protected](kernel),[email protected](boot),[email protected](recovery),[email protected](backup),[email protected](cache),[email protected](userdata),[email protected](kpanic),[email protected](system),[email protected](user)
                          Flashing a ROM with this parameter file will give 2 Gig app space :-)

                          While we are hear let's just take a look at system, on this ROM its length 0xE0000 or 469,762,048 bytes. The stock system.img is 401,187,840 bytes so we are wasting about 68,000,000 bytes of space. I'd rather use this for system.img. Remember when we did this we used a block size of 4096. a quick sum on the calculator gives a total of 114688 4096 blocks in 469,762,048. So if I want to work to this parameter file in post 6 I would use

                          dd if=/dev/zero of=system_ext4.img bs=4096 count=114687

                          I've used one less than the full size, I need to do some testing but so far have just played safe.

                          The value in post 6 is one I often use as it save the need of a calculator, I can just use that value and some standard parameters setting.

                          Homework
                          1. Work out the parameters for this or a different ROM with 2Gb user space and 4 Gb user space.
                          2. What is the biggest system.img that will fit into this parameter file?
                          3. If we go with the system.img file from post 6 what changes are required to the parameters?



                          The attached spreadsheet may help some.
                          Attached Files
                          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

                            Copy boot.img, from the folder you unpacked the ROM into, into your working folder. You might notice this is quite a small file, in fact it's smaller than kernel.img. Based on this I suspect it's an rkcrc signed image. This can be confirmed by opening boot.img in a hex editor, I use GHex in Linux, the first 4 bytes will be KRNL.

                            So onto unpacking

                            Code:
                            dd if=boot.img of=boot.img-ramdisk.gz skip=8 bs=1 count=20000000
                            This uses the dd command to copy 20000000 blocks of size 1 byte from boot.img to boot.img-ramdis.gz skipping the first 8 blocks of size 1 byte. 20000000 is bigger than any boot.img so the copy will continue until an end of file is found in boot.img.

                            We now have a new file boot.img-ramdisk.gz which as the name suggests is a gzipped ram disk.

                            Unpack with

                            Code:
                            mkdir boot
                            sudo cd boot
                            sudo gunzip < ../boot.img-ramdisk.gz | sudo cpio -i --make-directories
                            we first make a boot folder to unpack into
                            then choose this this folder as superuser, this will request the password if required, if the cd was not run with sudo then password would be requested twice on the following line and the second time would be collected in plain text (not good).
                            Then this runs gunzip using the file ../boot.img-ramdisk.gz from the boot's parent folder as input and pipes (|) the output to cpio to unarchive making directories as appropriate.

                            in some cases gunzip may not be able to extract the file, it's worth trying zcat in this case

                            Code:
                            sudo zcat ../boot.img-ramdisk.gz|sudo cpio -idm
                            We now have boot unpacked.

                            Next session we will look at init.rc and some, options for mounting system rw and adding init.d support.

                            Before that we need to know how to re-pack and test flash, so still in boot

                            Code:
                            sudo find . -exec touch -d "1970-01-01 01:00" {} \;
                            sudo find . ! -name "." | sort | sudo cpio -oa -H newc | sudo gzip -n >../customboot.gz
                            cd ..
                            rkcrc -k customboot.gz customboot.img
                            Firstly all the files must be dated 1/1/1970 or boot will not work, so we find every file and touch them to that date.

                            Then we find each file pipe to sort then cpio to archive then gzip to the file customboot.gz in the parent folder.

                            Finally we cd to the parent folder and sign customboot.gz with rkcrc (-k gives KRNL header) saving the signed file as customboot.img

                            I normally rename the original boot.img boot.img.orig and then rename customboot.img as boot.img.

                            Finish off with a test flash.

                            There's a few of the lines here that show one of the core Unix philosophies. That is have a number of small tools that do one thing well and combine these to get sophisticated functionality. Eg gunzip a file and pipe the result to cpio.

                            If you want to know more about the individual commands we are using either search the internet or in a terminal enter man command eg

                            Code:
                            man cpio
                            In many ROM you will find that boot.img includes an embedded kernel. The image will be bigger and will not start KRNL. In this case we need to use a perl script split_bootimg.pl. This is in my kitchen in
                            ~/pykitchen/tools/scripts/split_bootimg.pl. to make this more accessible set up a symlink from /user/local/bin. You may also need to set the execute permission on it.

                            to unpack such an image from working enter

                            Code:
                            sudo split_bootimg.pl boot.img
                            if you inspect the files created you will see a familiar boot.img-ramdisk.gz. Continue as earlier.
                            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
                              init.rc

                              Within boot you will find init.rc. Use sudo gedit filename to open it.

                              Code:
                              # Copyright (C) 2012 The Android Open Source Project
                              #
                              # IMPORTANT: Do not create world writable files or directories.
                              # This is a common source of Android security bugs.
                              #
                              
                              import /init.${ro.hardware}.rc
                              import /init.trace.rc
                              
                              on early-init
                                  # Set init and its forked children's oom_adj.
                                  write /proc/1/oom_adj -16
                              
                                  start ueventd
                              
                              # create mountpoints
                                  mkdir /mnt 0775 root system
                              
                              on init
                              
                              sysclktz 0
                              
                              loglevel 3
                              
                              # setup the global environment
                                  export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
                                  export LD_LIBRARY_PATH /vendor/lib:/system/lib
                                  export ANDROID_BOOTLOGO 1
                                  export ANDROID_ROOT /system
                                  export ANDROID_ASSETS /system/app
                                  export ANDROID_DATA /data
                                  export ASEC_MOUNTPOINT /mnt/asec
                                  export LOOP_MOUNTPOINT /mnt/obb
                                  export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar
                              
                              # Backward compatibility
                                  symlink /system/etc /etc
                                  symlink /sys/kernel/debug /d
                              
                              # Right now vendor lives on the same filesystem as system,
                              # but someday that may change.
                                  symlink /system/vendor /vendor
                              
                              # create mountpoints
                                  mkdir /mnt/sdcard 0000 system system
                              
                              # Create cgroup mount point for cpu accounting
                                  mkdir /acct
                                  mount cgroup none /acct cpuacct
                                  mkdir /acct/uid
                              
                                  mkdir /system
                                  mkdir /data 0771 system system
                                  mkdir /cache 0770 system cache
                                  mkdir /config 0500 root root
                              
                                  # Directory for putting things only root should see.
                                  mkdir /mnt/secure 0700 root root
                              
                                  # Directory for staging bindmounts
                                  mkdir /mnt/secure/staging 0700 root root
                              
                                  # Directory-target for where the secure container
                                  # imagefile directory will be bind-mounted
                                  mkdir /mnt/secure/asec  0700 root root
                              
                                  # Secure container public mount points.
                                  mkdir /mnt/asec  0700 root system
                                  mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
                              
                                  # Filesystem image public mount points.
                                  mkdir /mnt/obb 0700 root system
                                  mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
                              
                                  write /proc/sys/kernel/panic_on_oops 1
                                  write /proc/sys/kernel/hung_task_timeout_secs 0
                                  write /proc/cpu/alignment 4
                                  write /proc/sys/kernel/sched_latency_ns 10000000
                                  write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
                                  write /proc/sys/kernel/sched_compat_yield 1
                                  write /proc/sys/kernel/sched_child_runs_first 0
                                  write /proc/sys/kernel/randomize_va_space 2
                                  write /proc/sys/kernel/kptr_restrict 2
                                  write /proc/sys/kernel/dmesg_restrict 1
                                  write /proc/sys/vm/mmap_min_addr 32768
                                  write /proc/sys/kernel/sched_rt_runtime_us 950000
                                  write /proc/sys/kernel/sched_rt_period_us 1000000
                              
                              # Create cgroup mount points for process groups
                                  mkdir /dev/cpuctl
                                  mount cgroup none /dev/cpuctl cpu
                                  chown system system /dev/cpuctl
                                  chown system system /dev/cpuctl/tasks
                                  chmod 0660 /dev/cpuctl/tasks
                                  write /dev/cpuctl/cpu.shares 1024
                                  write /dev/cpuctl/cpu.rt_runtime_us 950000
                                  write /dev/cpuctl/cpu.rt_period_us 1000000
                              
                                  mkdir /dev/cpuctl/apps
                                  chown system system /dev/cpuctl/apps/tasks
                                  chmod 0666 /dev/cpuctl/apps/tasks
                                  write /dev/cpuctl/apps/cpu.shares 1024
                                  write /dev/cpuctl/apps/cpu.rt_runtime_us 800000
                                  write /dev/cpuctl/apps/cpu.rt_period_us 1000000
                              
                                  mkdir /dev/cpuctl/apps/bg_non_interactive
                                  chown system system /dev/cpuctl/apps/bg_non_interactive/tasks
                                  chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks
                                  # 5.0 %
                                  write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52
                                  write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000
                                  write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000
                              
                              # Allow everybody to read the xt_qtaguid resource tracking misc dev.
                              # This is needed by any process that uses socket tagging.
                                  chmod 0644 /dev/xt_qtaguid
                              
                              on fs
                                  insmod /rk30xxnand_ko.ko
                              # mount mtd partitions
                                  mount ext4 [email protected] /system wait ro noatime nodiratime noauto_da_alloc
                                  start readahead
                                  mount ext4 [email protected] /data wait noatime nodiratime nosuid nodev noauto_da_alloc
                                  mount ext4 [email protected] /cache wait noatime nodiratime nosuid nodev noauto_da_alloc
                              
                                  insmod /system/lib/modules/ump.ko
                                  insmod /system/lib/modules/mali.ko mali_dvfs=50,100,133,160,200,266,400 mali_init_clock=50
                                  insmod /system/lib/modules/rk29-ipp.ko
                              
                              on post-fs
                                  # once everything is setup, no need to modify /
                                  mount rootfs rootfs / ro remount
                              
                                  # We chown/chmod /cache again so because mount is run as root + defaults
                                  chown system cache /cache
                                  chmod 0770 /cache
                              
                                  # This may have been created by the recovery system with odd permissions
                                  chown system cache /cache/recovery
                                  chmod 0770 /cache/recovery
                              
                                  #change permissions on vmallocinfo so we can grab it from bugreports
                                  chown root log /proc/vmallocinfo
                                  chmod 0440 /proc/vmallocinfo
                              
                                  #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
                                  chown root system /proc/kmsg
                                  chmod 0440 /proc/kmsg
                                  chown root system /proc/sysrq-trigger
                                  chmod 0220 /proc/sysrq-trigger
                              
                                  # create the lost+found directories, so as to enforce our permissions
                                  mkdir /cache/lost+found 0770 root root
                              
                              on post-fs-data
                                  # We chown/chmod /data again so because mount is run as root + defaults
                                  chown system system /data
                                  chmod 0771 /data
                              
                                  # Create dump dir and collect dumps.
                                  # Do this before we mount cache so eventually we can use cache for
                                  # storing dumps on platforms which do not have a dedicated dump partition.
                                  mkdir /data/dontpanic 0750 root log
                              
                                  # Collect apanic data, free resources and re-arm trigger
                                  copy /proc/apanic_console /data/dontpanic/apanic_console
                                  chown root log /data/dontpanic/apanic_console
                                  chmod 0640 /data/dontpanic/apanic_console
                              
                                  copy /proc/apanic_threads /data/dontpanic/apanic_threads
                                  chown root log /data/dontpanic/apanic_threads
                                  chmod 0640 /data/dontpanic/apanic_threads
                              
                                  write /proc/apanic_console 1
                              
                                  # create basic filesystem structure
                                  mkdir /data/misc 01771 system misc
                                  mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
                                  mkdir /data/misc/bluetooth 0770 system system
                                  mkdir /data/misc/keystore 0700 keystore keystore
                                  mkdir /data/misc/keychain 0771 system system
                                  mkdir /data/misc/vpn 0770 system vpn
                                  mkdir /data/misc/systemkeys 0700 system system
                                  # give system access to wpa_supplicant.conf for backup and restore
                                  mkdir /data/misc/wifi 0770 wifi wifi
                                  chmod 0660 /data/misc/wifi/wpa_supplicant.conf
                                  mkdir /data/local 0751 root root
                              
                                  # For security reasons, /data/local/tmp should always be empty.
                                  # Do not place files or directories in /data/local/tmp
                                  mkdir /data/local/tmp 0771 shell shell
                                  mkdir /data/data 0771 system system
                                  mkdir /data/app-private 0771 system system
                                  mkdir /data/app-asec 0700 root root
                                  mkdir /data/app 0771 system system
                                  mkdir /data/property 0700 root root
                                  mkdir /data/ssh 0750 root shell
                                  mkdir /data/ssh/empty 0700 root root
                              
                                  # create dalvik-cache, so as to enforce our permissions
                                  mkdir /data/dalvik-cache 0771 system system
                              
                                  # create resource-cache and double-check the perms
                                  mkdir /data/resource-cache 0771 system system
                                  chown system system /data/resource-cache
                                  chmod 0771 /data/resource-cache
                              
                                  # create the lost+found directories, so as to enforce our permissions
                                  mkdir /data/lost+found 0770 root root
                              
                                  # create directory for DRM plug-ins - give drm the read/write access to
                                  # the following directory.
                                  mkdir /data/drm 0770 drm drm
                              
                                  # If there is no fs-post-data action in the init.<device>.rc file, you
                                  # must uncomment this line, otherwise encrypted filesystems
                                  # won't work.
                                  # Set indication (checked by vold) that we have finished this action
                                  #setprop vold.post_fs_data_done 1
                              
                                  chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
                                  chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
                                  chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
                                  chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
                              
                              on boot
                              # basic network init
                                  ifup lo
                                  hostname localhost
                                  domainname localdomain
                                  setprop UserVolumeLabel "N70DC-T"
                              
                              # set RLIMIT_NICE to allow priorities from 19 to -20
                                  setrlimit 13 40 40
                              
                              # Memory management.  Basic kernel parameters, and allow the high
                              # level system server to be able to adjust the kernel OOM driver
                              # parameters to match how it is managing things.
                                  write /proc/sys/vm/overcommit_memory 1
                                  write /proc/sys/vm/min_free_order_shift 4
                                  chown root system /sys/module/lowmemorykiller/parameters/adj
                                  chmod 0664 /sys/module/lowmemorykiller/parameters/adj
                                  chown root system /sys/module/lowmemorykiller/parameters/minfree
                                  chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
                              
                                  # Tweak background writeout
                                  write /proc/sys/vm/dirty_expire_centisecs 200
                                  write /proc/sys/vm/dirty_background_ratio  5
                              
                                  # Permissions for System Server and daemons.
                                  chown radio system /sys/android_power/state
                                  chown radio system /sys/android_power/request_state
                                  chown radio system /sys/android_power/acquire_full_wake_lock
                                  chown radio system /sys/android_power/acquire_partial_wake_lock
                                  chown radio system /sys/android_power/release_wake_lock
                                  chown system system /sys/power/state
                                  chown system system /sys/power/wakeup_count
                                  chown radio system /sys/power/wake_lock
                                  chown radio system /sys/power/wake_unlock
                                  chmod 0660 /sys/power/state
                                  chmod 0660 /sys/power/wake_lock
                                  chmod 0660 /sys/power/wake_unlock
                              
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
                                  chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
                                  chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
                                  chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                                  chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
                                  chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
                                  chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
                                  chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
                                  chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
                              
                                  # Assume SMP uses shared cpufreq policy for all CPUs
                                  chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
                                  chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
                              
                                  chown system system /sys/class/timed_output/vibrator/enable
                                  chown system system /sys/class/leds/keyboard-backlight/brightness
                                  chown system system /sys/class/leds/lcd-backlight/brightness
                                  chown system system /sys/class/leds/button-backlight/brightness
                                  chown system system /sys/class/leds/jogball-backlight/brightness
                                  chown system system /sys/class/leds/red/brightness
                                  chown system system /sys/class/leds/green/brightness
                                  chown system system /sys/class/leds/blue/brightness
                                  chown system system /sys/class/leds/red/device/grpfreq
                                  chown system system /sys/class/leds/red/device/grppwm
                                  chown system system /sys/class/leds/red/device/blink
                                  chown system system /sys/class/leds/red/brightness
                                  chown system system /sys/class/leds/green/brightness
                                  chown system system /sys/class/leds/blue/brightness
                                  chown system system /sys/class/leds/red/device/grpfreq
                                  chown system system /sys/class/leds/red/device/grppwm
                                  chown system system /sys/class/leds/red/device/blink
                                  chown system system /sys/class/timed_output/vibrator/enable
                                  chown system system /sys/module/sco/parameters/disable_esco
                                  chown system system /sys/kernel/ipv4/tcp_wmem_min
                                  chown system system /sys/kernel/ipv4/tcp_wmem_def
                                  chown system system /sys/kernel/ipv4/tcp_wmem_max
                                  chown system system /sys/kernel/ipv4/tcp_rmem_min
                                  chown system system /sys/kernel/ipv4/tcp_rmem_def
                                  chown system system /sys/kernel/ipv4/tcp_rmem_max
                                  chown root radio /proc/cmdline
                              # for hdmi
                                     chown root system /sys/class/display/HDMI/enable
                                     chown root system /sys/class/display/HDMI/mode
                                     chown root system /sys/class/display/HDMI/scale
                              # Define TCP buffer sizes for various networks
                              #   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
                                  setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
                                  setprop net.tcp.buffersize.wifi    524288,1048576,2097152,262144,524288,1048576
                                  setprop net.tcp.buffersize.lte     524288,1048576,2097152,262144,524288,1048576
                                  setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
                                  setprop net.tcp.buffersize.hspa    4094,87380,262144,4096,16384,262144
                                  setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
                                  setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
                              
                              # Set this property so surfaceflinger is not started by system_init
                                  setprop system_init.startsurfaceflinger 0
                              
                                  class_start core
                                  class_start main
                              
                              on nonencrypted
                                  class_start late_start
                              
                              on charger
                                  class_start charger
                              
                              on property:vold.decrypt=trigger_reset_main
                                  class_reset main
                              
                              
                              on property:vold.decrypt=trigger_load_persist_props
                                  load_persist_props
                              
                              on property:vold.decrypt=trigger_post_fs_data
                                  trigger post-fs-data
                              
                              on property:vold.decrypt=trigger_restart_min_framework
                                  class_start main
                              
                              on property:vold.decrypt=trigger_restart_framework
                                  class_start main
                                  class_start late_start
                              
                              on property:vold.decrypt=trigger_shutdown_framework
                                  class_reset late_start
                                  class_reset main
                              
                              # Used to disable USB when switching states
                              on property:sys.usb.config=none
                                  stop adbd
                                  write /sys/class/android_usb/android0/enable 0
                                  write /sys/class/android_usb/android0/bDeviceClass 0
                                  setprop sys.usb.state ${sys.usb.config}
                              
                              # adb only USB configuration
                              # This should only be used during device bringup
                              # and as a fallback if the USB manager fails to set a standard configuration
                              on property:sys.usb.config=adb
                                  write /sys/class/android_usb/android0/enable 0
                                  write /sys/class/android_usb/android0/idVendor 0bb4
                                  write /sys/class/android_usb/android0/idProduct 0c01
                                  write /sys/class/android_usb/android0/functions ${sys.usb.config}
                                  write /sys/class/android_usb/android0/enable 1
                                  start adbd
                                  setprop sys.usb.state ${sys.usb.config}
                              
                              # USB accessory configuration
                              on property:sys.usb.config=accessory
                                  write /sys/class/android_usb/android0/enable 0
                                  write /sys/class/android_usb/android0/idVendor 18d1
                                  write /sys/class/android_usb/android0/idProduct 2d00
                                  write /sys/class/android_usb/android0/functions ${sys.usb.config}
                                  write /sys/class/android_usb/android0/enable 1
                                  setprop sys.usb.state ${sys.usb.config}
                              
                              # USB accessory configuration, with adb
                              on property:sys.usb.config=accessory,adb
                                  write /sys/class/android_usb/android0/enable 0
                                  write /sys/class/android_usb/android0/idVendor 18d1
                                  write /sys/class/android_usb/android0/idProduct 2d01
                                  write /sys/class/android_usb/android0/functions ${sys.usb.config}
                                  write /sys/class/android_usb/android0/enable 1
                                  start adbd
                                  setprop sys.usb.state ${sys.usb.config}
                              
                              # Used to set USB configuration at boot and to switch the configuration
                              # when changing the default configuration
                              on property:persist.sys.usb.config=*
                                  setprop sys.usb.config ${persist.sys.usb.config}
                              
                              ## Daemon processes to be run by init.
                              ##
                              service ueventd /sbin/ueventd
                                  class core
                                  critical
                              
                              service console /system/bin/sh
                                  class core
                                  console
                                  disabled
                                  user shell
                                  group log
                              
                              on property:ro.debuggable=1
                                  start console
                              
                              # adbd is controlled via property triggers in init.<platform>.usb.rc
                              service adbd /sbin/adbd
                                  class core
                                  disabled
                              
                              # adbd on at boot in emulator
                              on property:ro.kernel.qemu=1
                                  start adbd
                              
                              # This property trigger has added to imitiate the previous behavior of "adb root".
                              # The adb gadget driver used to reset the USB bus when the adbd daemon exited,
                              # and the host side adb relied on this behavior to force it to reconnect with the
                              # new adbd instance after init relaunches it. So now we force the USB bus to reset
                              # here when adbd sets the service.adb.root property to 1.  We also restart adbd here
                              # rather than waiting for init to notice its death and restarting it so the timing
                              # of USB resetting and adb restarting more closely matches the previous behavior.
                              on property:service.adb.root=1
                                  write /sys/class/android_usb/android0/enable 0
                                  restart adbd
                                  write /sys/class/android_usb/android0/enable 1
                              
                              service servicemanager /system/bin/servicemanager
                                  class core
                                  user system
                                  group system
                                  critical
                                  onrestart restart zygote
                                  onrestart restart media
                                  onrestart restart surfaceflinger
                                  onrestart restart drm
                              
                              service vold /system/bin/vold
                                  class core
                                  socket vold stream 0660 root mount
                                  ioprio be 2
                              
                              service netd /system/bin/netd
                                  class main
                                  socket netd stream 0660 root system
                                  socket dnsproxyd stream 0660 root inet
                                  socket mdns stream 0660 root system
                              
                              service debuggerd /system/bin/debuggerd
                                  class main
                              
                              service ril-daemon /system/bin/rild
                                  class main
                                  socket rild stream 660 root radio
                                  socket rild-debug stream 660 radio system
                                  user root
                                  group radio cache inet misc audio sdcard_r sdcard_rw log
                              
                              service surfaceflinger /system/bin/surfaceflinger
                                  class main
                                  user system
                                  group graphics
                                  onrestart restart zygote
                              
                              service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
                                  class main
                                  socket zygote stream 660 root system
                                  onrestart write /sys/android_power/request_state wake
                                  onrestart write /sys/power/state on
                                  onrestart restart media
                                  onrestart restart netd
                              
                              service drm /system/bin/drmserver
                                  class main
                                  user drm
                                  group drm system inet drmrpc sdcard_r
                              
                              service media /system/bin/mediaserver
                                  class main
                                  user media
                                  group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
                                  ioprio rt 4
                              
                              service bootanim /system/bin/bootanimation
                                  class main
                                  user graphics
                                  group graphics
                                  disabled
                                  oneshot
                              
                              service dbus /system/bin/dbus-daemon --system --nofork
                                  class main
                                  socket dbus stream 660 bluetooth bluetooth
                                  user bluetooth
                                  group bluetooth net_bt_admin
                              
                              service bluetoothd /system/bin/bluetoothd -n
                                  class main
                                  socket bluetooth stream 660 bluetooth bluetooth
                                  socket dbus_bluetooth stream 660 bluetooth bluetooth
                                  # init.rc does not yet support applying capabilities, so run as root and
                                  # let bluetoothd drop uid to bluetooth with the right linux capabilities
                                  group bluetooth net_bt_admin misc
                                  disabled
                              
                              service installd /system/bin/installd
                                  class main
                                  socket installd stream 600 system system
                              
                              service flash_recovery /system/etc/install-recovery.sh
                                  class main
                                  oneshot
                              
                              service racoon /system/bin/racoon
                                  class main
                                  socket racoon stream 600 system system
                                  # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.
                                  group vpn net_admin inet
                                  disabled
                                  oneshot
                              
                              service mtpd /system/bin/mtpd
                                  class main
                                  socket mtpd stream 600 system system
                                  user vpn
                                  group vpn net_admin inet net_raw
                                  disabled
                                  oneshot
                              
                              service keystore /system/bin/keystore /data/misc/keystore
                                  class main
                                  user keystore
                                  group keystore drmrpc
                                  socket keystore stream 666
                              
                              service dumpstate /system/bin/dumpstate -s
                                  class main
                                  socket dumpstate stream 0660 shell log
                                  disabled
                                  oneshot
                              
                              service readahead /sbin/readahead -f
                                  disabled
                              
                              service sshd /system/bin/start-ssh
                                  class main
                                  disabled
                              
                              service mdnsd /system/bin/mdnsd
                                  class main
                                  user mdnsr
                                  group inet net_raw
                                  socket mdnsd stream 0660 mdnsr inet
                                  disabled
                                  oneshot
                              
                              service whtest /system/bin/whtest.sh
                                  disabled
                                  oneshot

                              Note the warning at the top.

                              Anyway lets look at a few lines

                              mkdir /data 0771 system system
                              chmod 0771 /data
                              mount ext4 [email protected] /system wait ro noatime nodiratime noauto_da_alloc
                              start readahead
                              mount rootfs rootfs / ro remount


                              Here we see the /data folder will be created on boot with permissions 771, owner system, group system.

                              Later permissions on /data will be forced to 771

                              system is mounted read only (ro) as an ext4 file system

                              the root fliesystem / is mounted ro

                              If ever you need to change so that system is mounted rw or if you are changing from one file system to another these lines are worth understanding.

                              Now lets add init.d support. At the end of the file add a blank line then the following

                              Code:
                              #900supersport  add init.d support to boot/init.rc
                              service runparts /system/bin/run-parts /system/etc/init.d
                                  class core
                                  user root
                                  group root
                                  oneshot
                              these lines are 'I was here' :-)
                              execute runparts '/system/bin/run-parts' to execute the scripts in /system/etc/init.d. We created the symlink run-parts (to busybox) earlier within system. These execute as user root, group root. Finaly oneshot says run this just once on boot.

                              If you have an initlogo.rle prepared add it now to boot so your branding is displayed. Note some ROMs do not provide this.

                              Finally re-pack, flash and test.
                              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