FORUMS
Remove All Ads from XDA

[TOOL] Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux/Mac]

13,672 posts
Thanks Meter: 30,196
 
By osm0sis, Recognized Developer / Recognized Contributor on 30th December 2012, 03:55 PM
Post Reply Email Thread
6th February 2016, 08:39 PM |#821  
Senior Member
Thanks Meter: 456
 
More
Quote:
Originally Posted by osm0sis

--original uses the ramdisk it split from the .img which is why it's literally identical with no changes. Still not sure why normal repacking doesn't work for your device, obviously something's going on in the ramdisk that not even unpacking/repacking as root on Linux can resolve, which is a new one.

My best suggestion is to look into the build process that created the original ROM .img and see if there's anything extra in there we're missing. If it's only that signing then perhaps the bootloader's more strict than previously on your device and doesn't allow unsigned at all anymore.

Edit: Hey @arter97, I see you build a Note 5 kernel.. Any ideas what we're missing here that's causing a hung boot with a "kernel not seandroid enforcing" message after an unpack+repack with no changes? Thanks for any help you can provide!

Hilariously this has been his kernel that we have been trying to take apart the whole time. I reached out to him and another kernel dev with no response. I believe they are afraid of giving information to potential competition. His kernel is amazing and I had no intentions of releasing a rom with his kernel, it was just for personal use.

I was trying to edit a script in the kernel which is building Knox folders on each boot. I wanted to just take one line out of the init.d script to fix it. That's all I was doing.

Being that I am typing this from my brand new nexus 6p I'm not sure how much more energy I will have for the note 5. But I will try to test if possible.
 
 
7th February 2016, 01:01 PM |#822  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,196
 
Donate to Me
More
Quote:
Originally Posted by seh6183

Hilariously this has been his kernel that we have been trying to take apart the whole time. I reached out to him and another kernel dev with no response. I believe they are afraid of giving information to potential competition. His kernel is amazing and I had no intentions of releasing a rom with his kernel, it was just for personal use.

I was trying to edit a script in the kernel which is building Knox folders on each boot. I wanted to just take one line out of the init.d script to fix it. That's all I was doing.

Being that I am typing this from my brand new nexus 6p I'm not sure how much more energy I will have for the note 5. But I will try to test if possible.

@seh6183, seeing as you had an issue with your flash of --original originally, and were mistaken, can you double check that my root repack (attached on the previous page) actually doesn't work? Thanks in advance.
7th February 2016, 09:28 PM |#823  
SidRobo's Avatar
Senior Member
Flag Tehran
Thanks Meter: 88
 
Donate to Me
More
hi. sorry for replying here as a noob but i have a question
i flashed android 6.0.1 beta rom to my s6 edge... and still there isn't twrp that be compatible with new sboot so is there anyway to edit ramdisk of twrp 2.7.8.1 that is compatibe with my device in android 5.1.1 and old sboot, to be used in 6.0.1 ?
8th February 2016, 01:09 AM |#824  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,196
 
Donate to Me
More
Quote:
Originally Posted by SidRobo

hi. sorry for replying here as a noob but i have a question
i flashed android 6.0.1 beta rom to my s6 edge... and still there isn't twrp that be compatible with new sboot so is there anyway to edit ramdisk of twrp 2.7.8.1 that is compatibe with my device in android 5.1.1 and old sboot, to be used in 6.0.1 ?

How would I know? No way to know unless you try.
8th February 2016, 10:09 AM |#825  
Senior Member
Flag Ha Tinh
Thanks Meter: 169
 
Donate to Me
More
Code:
[email protected]:~/AIK-Linux$ sudo sh unpackimg.sh boot.img

 
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers
 
Supplied image: boot.img
 
Setting up work folders...
 
Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 androidboot.selinux=permissive
BOARD_KERNEL_BASE 00000000
BOARD_NAME 
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02000000
BOARD_TAGS_OFFSET 01e00000
BOARD_DT_SIZE 129024
/home/kaotd99/AIK-Linux/bin/magic, 1293: Warning: string extension `l' invalid
file: could not find any valid magic files!
 
Unpacking ramdisk to "ramdisk/"...
 
Compression used: 
Error!
[email protected]:~/AIK-Linux$
The Following User Says Thank You to kaotd99 For This Useful Post: [ View ] Gift kaotd99 Ad-Free
8th February 2016, 02:11 PM |#826  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,196
 
Donate to Me
More
Don't quote the OP. The magic from file can make Linux file binary angry. I thought I'd removed all the troublesome entries since I had it working on my Ubuntu VM..

You're using v2.0?
8th February 2016, 05:37 PM |#827  
Senior Member
Flag Ha Tinh
Thanks Meter: 169
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

Don't quote the OP. The magic from file can make Linux file binary angry. I thought I'd removed all the troublesome entries since I had it working on my Ubuntu VM..

You're using v2.0?

of course !
8th February 2016, 05:52 PM |#828  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,196
 
Donate to Me
More
Quote:
Originally Posted by kaotd99

of course !

Okay. Please edit your post to remove the quoted OP.

Then edit AIK-Linux/bin/magic and go to line 1293 and remove the entire "# Android Backup archive # From: Ariel Shkedi" section that line is a part of. Let me know if AIK-Linux/unpackimg.sh executes correctly after.

If you want to do it as root, do: ./unpackimg.sh --sudo boot.img
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
8th February 2016, 06:29 PM |#829  
Senior Member
Flag Ha Tinh
Thanks Meter: 169
 
Donate to Me
More
Quote:
Originally Posted by osm0sis

Okay. Please edit your post to remove the quoted OP.

Then edit AIK-Linux/bin/magic and go to line 1293 and remove the entire "# Android Backup archive # From: Ariel Shkedi" section that line is a part of. Let me know if AIK-Linux/unpackimg.sh executes correctly after.

If you want to do it as root, do: ./unpackimg.sh --sudo boot.img

Code:
[email protected]:/home/kaotd99/AIK-Linux# ./unpackimg.sh boot.img

 
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers
 
Supplied image: boot.img
 
Setting up work folders...
 
Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 androidboot.selinux=permissive
BOARD_KERNEL_BASE 00000000
BOARD_NAME 
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02000000
BOARD_TAGS_OFFSET 01e00000
BOARD_DT_SIZE 129024
 
Unpacking ramdisk to "ramdisk/"...
 
Compression used: gzip
2127 blocks
 
Done!
[email protected]:/home/kaotd99/AIK-Linux# ./repackimg.sh boot.img

 
Android Image Kitchen - RepackImg Script
by osm0sis @ xda-developers
 
Packing ramdisk (as root)...
 
Using compression: gzip
 
Getting build information...
kernel = boot.img-zImage
cmdline = console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 androidboot.selinux=permissive
board = 
base = 00000000
pagesize = 2048
kernel_offset = 00008000
ramdisk_offset = 02000000
tags_offset = 01e00000
dtb = boot.img-dtb
 
Building image...
 
Done!
[email protected]:/home/kaotd99/AIK-Linux#
Thanks! It's work correctly
The Following User Says Thank You to kaotd99 For This Useful Post: [ View ] Gift kaotd99 Ad-Free
8th February 2016, 07:41 PM |#830  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,196
 
Donate to Me
More
Bugfix/maintenance releases up! These add support for devices with pre-header data greater than the original arbitrary unpackbootimg seek cutoff of 512KB; I have raised this to a reasonable 4096 which is the highest I've seen on an image. I went ahead and sync'd up everything else to AOSP master and the CM13 branches.

Android Image Kitchen v2.4:
- Update mkbootimg, unpackbootimg and mkbootfs binaries from my repos.
- Update to the latest Cygwin binaries and libraries.
- Fix slimmed magic file (from file 5.25) for certain file binaries.

AIK-mobile v2.1 + AIK-Linux v2.1:
- Update mkbootimg, unpackbootimg and mkbootfs binaries from my repos.
- Update busybox binary (still 1.24.1) with the latest official patches (AIK-mobile).
- Fix mounting/installation and improve systemless root detection/support on CM Simple Recovery (AIK-mobile).
- Fix slimmed magic file (from file 5.25) for certain file binaries.

More on my own build changes in the commits here: https://github.com/osm0sis/mkbootimg; https://github.com/osm0sis/mkbootfs.

Installation information and details on each edition can be found in the OP for Win32 or the AIK-mobile and AIK-Linux initial release notes.


If you are reporting a problem with your device, please clearly state your device name and model/variant as well as provide a link to the image file.
The Following 10 Users Say Thank You to osm0sis For This Useful Post: [ View ]
10th February 2016, 05:03 PM |#831  
Senior Member
Thanks Meter: 456
 
More
Quote:
Originally Posted by osm0sis

@seh6183, seeing as you had an issue with your flash of --original originally, and were mistaken, can you double check that my root repack (attached on the previous page) actually doesn't work? Thanks in advance.

Sorry I reflashed this 2 days ago but forgot to tell you. Still doesn't work sorry. Certainly did not make any mistakes. During the flashing process all readouts display on screen as if nothing is wrong and then it fails to boot.
The Following User Says Thank You to seh6183 For This Useful Post: [ View ] Gift seh6183 Ad-Free
Post Reply Subscribe to Thread

Tags
kernel, ramdisk, recovery, repack, unpack

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes