Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

SD Card booting without flashing your device

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

    SD Card booting without flashing your device

    So with the Rada SD Bootloader it is possible to boot directly from the SD card.
    That means that when the SD is inserted, there is no need to flash a special rom to boot an alternative kernel/Linux/Android flavour.

    See http://androtab.info/radxa_rock/sdboot/

    Now that said... I have not gotten it to work properly.

    What I found so far is that on my T428 I can boot with the files in the http://files.androtab.info/radxa/sdb...8_miniroot.zip package, but then replacing the kernel with a kernel for my stick. Using the Radxa kernel will just show a black screen.

    Using the picbuntu kernel file, I do see the boot messages, and I end with an error that it can't find the root device and it is dropping me to the command line. From there I can connect to the network with the minimalistic commands that are available. However with the picbuntu kernel I still get lots of errors in the booting process. Specifically it seem to have difficulty reading the remainder of the sdcard.

    The key now is to make a proper working package that is easy to use. Hope that anyone has good suggestions on how to move forward.


    what i also found;
    When the parameter file is edited directly it will not boot anymore from the SD card, it will hang somewhere prior to the kernel loading. You can modify the parametere file, but it requires it to be signed again.
    You can sign it by using the rkrc command from the rk-tools https://github.com/rk3066/rk-tools. Then it will be usable for flashing.

    To create the SD I used this little batchfile to avoid typing the commands each time
    Code:
    #!/bin/sh
    
    DEV="/dev/sdb"
    LOADER="sdboot_rk3188.img"
    PARA="parameter.img"
    KERNEL="kernel-pic.img"
    BOOT="boot.img"
    
    echo "SD disk preparation"
    echo "device $DEV"
    echo "loader:    $LOADER"
    echo "parameter: $PARA"
    echo "kernel:    $KERNEL"
    echo "boot:      $BOOT"
    
    echo "Copying loader:    $LOADER"
    sudo dd if=$LOADER of=$DEV conv=fsync
    
    echo "Copying parameter: $PARA"
    sudo dd if=$PARA of=$DEV conv=fsync seek=$((0x2000))
    
    echo "Copying kernel:    $KERNEL"
    sudo dd if=$KERNEL of=$DEV conv=fsync seek=$((0x2000+0x4000))
    
    echo "Copying boot:      $BOOT"
    sudo dd if=$BOOT of=$DEV conv=fsync seek=$((0x2000+0xC000))

    #2
    Originally posted by marcelv View Post
    So with the Rada SD Bootloader it is possible to boot directly from the SD card.
    That means that when the SD is inserted, there is no need to flash a special rom to boot an alternative kernel/Linux/Android flavour.

    See http://androtab.info/radxa_rock/sdboot/

    Now that said... I have not gotten it to work properly.

    What I found so far is that on my T428 I can boot with the files in the http://files.androtab.info/radxa/sdb...8_miniroot.zip package, but then replacing the kernel with a kernel for my stick. Using the Radxa kernel will just show a black screen.

    Using the picbuntu kernel file, I do see the boot messages, and I end with an error that it can't find the root device and it is dropping me to the command line. From there I can connect to the network with the minimalistic commands that are available. However with the picbuntu kernel I still get lots of errors in the booting process. Specifically it seem to have difficulty reading the remainder of the sdcard.

    The key now is to make a proper working package that is easy to use. Hope that anyone has good suggestions on how to move forward.


    what i also found;
    When the parameter file is edited directly it will not boot anymore from the SD card, it will hang somewhere prior to the kernel loading. You can modify the parametere file, but it requires it to be signed again.
    You can sign it by using the rkrc command from the rk-tools https://github.com/rk3066/rk-tools. Then it will be usable for flashing.

    To create the SD I used this little batchfile to avoid typing the commands each time
    Code:
    #!/bin/sh
    
    DEV="/dev/sdb"
    LOADER="sdboot_rk3188.img"
    PARA="parameter.img"
    KERNEL="kernel-pic.img"
    BOOT="boot.img"
    
    echo "SD disk preparation"
    echo "device $DEV"
    echo "loader:    $LOADER"
    echo "parameter: $PARA"
    echo "kernel:    $KERNEL"
    echo "boot:      $BOOT"
    
    echo "Copying loader:    $LOADER"
    sudo dd if=$LOADER of=$DEV conv=fsync
    
    echo "Copying parameter: $PARA"
    sudo dd if=$PARA of=$DEV conv=fsync seek=$((0x2000))
    
    echo "Copying kernel:    $KERNEL"
    sudo dd if=$KERNEL of=$DEV conv=fsync seek=$((0x2000+0x4000))
    
    echo "Copying boot:      $BOOT"
    sudo dd if=$BOOT of=$DEV conv=fsync seek=$((0x2000+0xC000))
    What I have noticed after recompiling radxa_sd and radxa_nand system images is that radxa_sd has 3 extra files in /system/bin/ (exfat, exfatfsck, mxexfatfs).. also I have noticed that kernel is 40 Kb bigger at radxa_sd firmware. While ramdisk is the same I think.
    I tried porting finless rom to SD booting, and I took boot720.img, kernel_stock.img, parameter2g (and signed it again), system (as it is), recovery (as it is). And it starts booting as in shows kernel image and after that shows like system is about to start booting, and it freezes on that.
    Now, I noticed in sdboot_rk3188_miniroot.zip package that boot.img has some files that do not exist in finless boot image. maybe thats why it wont boot all the way. Will try some more stuff and will get back to you.

    Regards.

    Edit: maybe it wont boot coz of bootloader, parameter at sdboot_rk3188_miniroot.zip shows Android 4.4.2 and Finless rom for my device is 4.2.2, Usually for booting android 4.4.2 they use Bootloader v2.xx and in finless rom I am trying to use the bootloader version V1.20.. so that might be the reason too.. donno.. :/
    Last edited by Boocy; 05-29-2014, 17:43.

    Comment


      #3
      Originally posted by Boocy View Post
      Edit: maybe it wont boot coz of bootloader, parameter at sdboot_rk3188_miniroot.zip shows Android 4.4.2 and Finless rom for my device is 4.2.2, Usually for booting android 4.4.2 they use Bootloader v2.xx and in finless rom I am trying to use the bootloader version V1.20.. so that might be the reason too.. donno.. :/
      Maybe it is possible to up/downgrade by combining pieces as it seems the SDpart of the bootloader can be separated from the other parts. See here
      Note:  This blog post outlines upcoming changes to Google Currents for Workspace users. For information on the previous deprecation of Googl...

      Comment


        #4
        Originally posted by marcelv View Post
        Maybe it is possible to up/downgrade by combining pieces as it seems the SDpart of the bootloader can be separated from the other parts. See here
        https://plus.google.com/105214450751...ts/PChNVCEEWHZ
        Just tried Finless Android 4.4.2 with sdboot, and it hangs at 4 penguins.
        So I am not sure if it is all about bootloader, maybe its even boot image (ramdisk/kernel).. I will look into this link you sent me, but also I will try after that extracting boot image to search all text readable files for keyword "nand", and I will compare that part to radxa's boot image.. maybe on some place there is something in ramdisk that should be changed from nand to mmcblock..... Still just guessing.. :S
        Then again, when comparing radxa's classic image and SD boot image after unpacking kernel size is different, and that is concerning me a bit. :/
        Link: http://dl.radxa.com/rock/images/android/

        Comment


          #5
          Originally posted by marcelv View Post
          Maybe it is possible to up/downgrade by combining pieces as it seems the SDpart of the bootloader can be separated from the other parts. See here
          https://plus.google.com/105214450751...ts/PChNVCEEWHZ
          Okay, I get the entire part with perl script for decompiling bootloaders, which seems really sweet
          But, how do we use the .c script? I compiled it with c++ but I don't know how to set sdboot_rk3188.img as input parameter so the damn thing would decompile it?

          did you try it out?

          Comment


            #6
            BTW:
            1 simple question:
            How do you manage to boot from the SD? Do the device it automatically if the SD exist?
            RK3288 Devices
            - Overview BOX (LINK !)
            - Overview STICK (Dongle) (LINK !)

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

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

            Comment


              #7
              Originally posted by no_spam_for_me View Post
              BTW:
              1 simple question:
              How do you manage to boot from the SD? Do the device it automatically if the SD exist?
              Yes. If bootable SD is inserted. We are trying to make for other RK3188 devices what radxa made for their device here: http://wiki.radxa.com/Rock/SD_booting

              Comment


                #8
                No, did not get any further.

                I was trying to build my own kernel, so I can avoid the logo from displaying.
                That way it is possible to see where it stops during the loading process and it is easier to pinpoint the issue.

                Unfortunately the kernels that I was building don't boot... so making babysteps here.
                Guess I first need to be able to successfully build kernels before I can attempt to get it properly working via SDCard loading

                Comment


                  #9
                  Originally posted by marcelv View Post
                  No, did not get any further.

                  I was trying to build my own kernel, so I can avoid the logo from displaying.
                  That way it is possible to see where it stops during the loading process and it is easier to pinpoint the issue.

                  Unfortunately the kernels that I was building don't boot... so making babysteps here.
                  Guess I first need to be able to successfully build kernels before I can attempt to get it properly working via SDCard loading
                  I would say that is a wrong direction because it is stated in the article that any kernel can be used, only thing we need is to figure out how to decompile sdboot_rk3188.img. I think that we both know how to get FlashData and FlashBoot from bootloaders, so in theory decompiling sdboot_rk3188.img should solve everything.

                  Now, how do we use this script: http://pastebin.com/gB174sUH

                  Comment


                    #10
                    Originally posted by Boocy View Post
                    I would say that is a wrong direction because it is stated in the article that any kernel can be used, only thing we need is to figure out how to decompile sdboot_rk3188.img. I think that we both know how to get FlashData and FlashBoot from bootloaders, so in theory decompiling sdboot_rk3188.img should solve everything.

                    Now, how do we use this script: http://pastebin.com/gB174sUH

                    According to the page http://androtab.info/radxa_rock/sdboot/ the bootloader is version from RK3188Loader(L)_V2.10.bin so it should be possible to load a Kitkat 4.4.2 kernels with it.

                    Therefore as far as I know it is most likely a matter of having the right nand/sdhc modules in the kernel and setting the right path in the rom to get it properly booting. That's why I'm trying to build my own kernel, esp without bootlogo to see what's going on.

                    Is there a special reason why you want to boot a 4.2.2 kernel instead of a Kitkat 4.4.2?

                    Comment


                      #11
                      Originally posted by marcelv View Post
                      According to the page http://androtab.info/radxa_rock/sdboot/ the bootloader is version from RK3188Loader(L)_V2.10.bin so it should be possible to load a Kitkat 4.4.2 kernels with it.

                      Therefore as far as I know it is most likely a matter of having the right nand/sdhc modules in the kernel and setting the right path in the rom to get it properly booting. That's why I'm trying to build my own kernel, esp without bootlogo to see what's going on.

                      Is there a special reason why you want to boot a 4.2.2 kernel instead of a Kitkat 4.4.2?
                      Well yes, KitKat is unstable as it is, it crashes as soon as you start playing a video, many of KitKat rom's do not come with google play store pre-installed, they have ugly interface, and all of them come with very small cursor, etc... (talking about firmwares them self of course ~ don't know if kernels are only problem)

                      About all that inserting right modules in kernel and paths in rom you may be right, I can't say for sure.

                      I did discover some AP6210 rom's last night that work on 2.07 and 2.13 bootloaders with 4.2.2 firmwares and they are compatible with many devices including my own (when installed directly on nand). Now I will check out if they will boot, any of them, on SD..
                      Link: http://www.rikomagic.com/en/download/download_22_1.html


                      Now, about this:

                      dd if=sdboot_rk3188.img of=8000.enc bs=$((0x200)) skip=$((0x40)) count=1
                      dd if=sdboot_rk3188.img of=8800.enc bs=$((0x200)) skip=$((0x44)) count=$((0x15))
                      dd if=sdboot_rk3188.img of=b800.enc bs=$((0x200)) skip=$((0x5C)) count=$((0xE3))
                      //dd commands are self explanatory

                      ./decode_rk 8000.enc 8000.dec
                      ./decode_rk 8800.enc 8800.dec
                      ./decode_rk b800.enc b800.dec
                      //but these ./decode_rk, I don't know where he got that decode_rk script from and/or how to encode it once again after replacing parts with ones from RK3188Loader(L)_V2.07.bin or RK3188Loader(L)_V2.13.bin

                      Any ideas?

                      Comment


                        #12
                        Could someone please tell me what steps need to be done to boot kernel from sdcard?
                        Does some tuned bootloader need to be flash into appropriate partition of my device? As far as I understand it's not enough just make bootable sdcard as described at http://androtab.info/radxa_rock/sdboot/ since standard bootloader will boot kernel from kernel partition but not from sdcard.

                        Comment


                          #13
                          Originally posted by knawnd View Post
                          Could someone please tell me what steps need to be done to boot kernel from sdcard?
                          Does some tuned bootloader need to be flash into appropriate partition of my device? As far as I understand it's not enough just make bootable sdcard as described at http://androtab.info/radxa_rock/sdboot/ since standard bootloader will boot kernel from kernel partition but not from sdcard.
                          sdboot_rk3188.img file allready has bootloader 2.10 in it, and I tried decompiling radxa's SD image and installing their SD firmware with sndrotab's method.. and it works perfectlly fine, just like if I had installed it with SD_Firmware_tool it works even when I take all the parts from radxa_sd firmware and system.img from radxa_nand .. so we come to conclusion that boot.img and recovery.img need to be reconfigured, hopefully only a ramdisk is the problem, but if the kernel is too, then I can't be of any help.. I never compiled a single kernel in my life.. :S

                          EDIT:
                          Then again, it is said on androtab's site that any kernel can be used.. hopefully thats true..

                          Regards.

                          Comment


                            #14
                            Boocy, thanks for a prompt reply!
                            Do I have to flash anything to my device's ROM? As far as I understand from http://androtab.info/radxa_rock/sdboot/ to following commands

                            dd if=sdboot_rk3188.img of=/dev/XXX conv=sync,fsync
                            dd if=parameter.img of=/dev/XXX conv=sync,fsync seek=$((0x2000))
                            dd if=kernel.img of=/dev/XXX conv=sync,fsync seek=$((0x2000+0x4000))
                            dd if=boot.img of=/dev/XXX conv=sync,fsync seek=$((0x2000+0xc000))

                            replace /dev/XXX with correct path for SD card on your machine.
                            need to be done against sdcard but not device's ROM.
                            But if I do these steps on sdcard the device's bootloader remains the same and it boots kernel from device's kernel partition but not from sdcard.

                            Comment


                              #15
                              Originally posted by knawnd View Post
                              Boocy, thanks for a prompt reply!Do I have to flash anything to my device's ROM? As far as I understand from http://androtab.info/radxa_rock/sdboot/ to following commandsneed to be done against sdcard but not device's ROM.But if I do these steps on sdcard the device's bootloader remains the same and it boots kernel from device's kernel partition but not from sdcard.
                              You don't need to flash your normal device. If the sdcard is inserted with this special bootloader it is used instead of the normal bootloader on the nand.As picbuntu kernel image is booting and giving a command prompt we think it is matter of having the right ramdisk image and references

                              Comment

                              Working...
                              X