Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

linux-amlogic-toolkit - unpack and repack AMLogic images using Linux (works with Android 7 !)

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

    #46
    Originally posted by natinusala View Post
    We were not talking about the same image I'm afraid, I was talking about the one on Beelkink GT1. You can absolutely use the Customization Tool to edit it and use dd to install it directly on your device !
    But this is Android 7.1, are you sure?
    Also is there a way to do a TWRP backup as a zip and somehow create an .img file out of that which can then be flashed with stock recovery?

    Comment


      #47
      It is Android 7.1, you can lookup for yourself if you want it's the GT1 TVStock ROM.

      You can create an IMG file out of a ZIP backup but that will require special work for each partition, and you will certainly have permissions problems for the system partition. I would not recommend doing that, not worth the hassle. You can use dd to directly extract the PARTITION files from the device, which you can then put in my toolkit.

      Comment


        #48
        Originally posted by natinusala View Post
        It is Android 7.1, you can lookup for yourself if you want it's the GT1 TVStock ROM.

        You can create an IMG file out of a ZIP backup but that will require special work for each partition, and you will certainly have permissions problems for the system partition. I would not recommend doing that, not worth the hassle. You can use dd to directly extract the PARTITION files from the device, which you can then put in my toolkit.
        Dude you are a life saver. I used customization tool then your unpack tool and got boot logo back to the device it works! Now if you could just briefly explain how to extract the PARTITION files from the device and put in your toolkit I would be very grateful Perhaps if you have time skype chat would be easier? whichever you prefer.

        Thanks

        Comment


          #49
          I don't know if I'm allowed to use XDA links here but I'll do it anyway : https://forum.xda-developers.com/sho....php?t=2450045

          This post explains everything needed

          Comment


            #50
            Originally posted by natinusala View Post
            I don't know if I'm allowed to use XDA links here but I'll do it anyway : https://forum.xda-developers.com/sho....php?t=2450045

            This post explains everything needed
            Thanks and once I extract partitions and dump using your tool then re-pack I don't have to do anything else? I read somewhere that once you repack if image sizes are above 2GB they won't work because they are too big is that true?

            Comment


              #51
              It depends on your device, but you may want to shrink the image using resize2fs before flashing it

              Comment


                #52
                Originally posted by natinusala View Post
                It depends on your device, but you may want to shrink the image using resize2fs before flashing it
                My device is M8SPro L, is there a way to check that limitation?

                Comment


                  #53
                  Check on the web, I only have a GT1 and I know that it works for at least images as big as 2.2Gb

                  Comment


                    #54
                    Originally posted by natinusala View Post
                    Check on the web, I only have a GT1 and I know that it works for at least images as big as 2.2Gb
                    So basically anything above won't work? I think GT1 is similar to this device.

                    Comment


                      #55
                      I didn't say anything above won't work, but it supports at least 2.2Gb images.

                      Comment


                        #56
                        Originally posted by natinusala View Post
                        I didn't say anything above won't work, but it supports at least 2.2Gb images.
                        Went on getting partitions etc. however ran into a few roadblocks you might know ...
                        So I try to run parted /dev/block/mmcblk0 print and it gives me an error that uncorecognised disk label. I then try to mount mmcblk0p13 which is "data" and it tells me no such file or directory. It also seems that there is no /dev/block/partitions/by-name there is only /dev/block/partitions/by-num. So something here is definitely wrong. If I try to do dd if=/dev/block/data of=/sdcard/data.img and I get one huge data.img file. Is this data.img in fact my overall data folder?

                        I have attached a file, you can see clearly that mmcblk0p13 exists but give no file or directory. What is the issue?
                        Attached Files
                        Last edited by korgix300; 03-31-2018, 14:55.

                        Comment


                          #57
                          Natinusala, there has been a long-standing error in abootimg (and unmkbootimg, although that doesn't affect your toolkit). Would you be willing to fix it in your copy of abootimg? Here's a diff of the bad and fixed versions of abootimg:

                          721c721
                          < printf (" second stage size = %u bytes (%.2f MB)\n", ramdisk_size, (double)ramdisk_size/0x100000);
                          ---
                          > printf (" second stage size = %u bytes (%.2f MB)\n", second_size, (double)second_size/0x100000);
                          846c846
                          < unsigned n = (rsize + ksize + psize - 1) / psize;
                          ---
                          > unsigned n = (rsize + psize - 1)/psize + (ksize + psize - 1)/psize;

                          This problem shouldn't affect Nougat and Oreo images but it definitely affected previous versions of Android.

                          Thanks for making your toolkit available to everyone!

                          Comment


                            #58
                            korgix300 what are you trying to achieve with parted ? It is not clear

                            01520717 sure, what issue does this fix ?

                            Comment


                              #59
                              Originally posted by natinusala View Post
                              korgix300 what are you trying to achieve with parted ? It is not clear

                              01520717 sure, what issue does this fix ?
                              Well I followed the guide yiu suggested and at some point they were suggesting to use parted.

                              But regardless of parted I am confused why M8SPro L doesn't have /dev/block/platform/d0074000.emmc/by-name ?
                              Every single posting on freaktab I investigated and all the people that had only by-num vs by-name never got a response how to do "dd". Do you know how to do "dd" in cases like these?
                              I did dd if=/dev/block/dataof=/sdcard/data.img and got a 9.19GB file even though my overall internal storage ihas been only 2.12 used, how did it create a 9.19GB file?. What's happening here?

                              I am basically looking to backup "data". "data" is showing mmcblkop13 if I execute cat /proc/partitions

                              If you know how to resolve this you are the master.

                              Comment


                                #60
                                Originally posted by natinusala View Post

                                01520717 sure, what issue does this fix ?
                                The starting address of the second bootloader in the boot partition is calculated wrong in ~20% of the cases. This usually doesn't cause a problem since the second bootloader isn't used very often. But since Amlogic stored their DTBs in the second bootloader for Marshmallow and earlier versions of Android, this will affect them.

                                I tried out your code and it works pretty well. It's nice being able to save an unpacked image and work on it slowly over time rather than doing it all at once when using the Customization tool.

                                I noticed your copy of the logo_img_packer is a 64-bit binary whereas all of the other executables are 32-bit so that stops 32-bit Linux users from using your toolkit. I've attached the 32-bit version.
                                Attached Files
                                Last edited by 01520717; 04-02-2018, 00:40. Reason: Added attachment

                                Comment

                                Working...
                                X