Tools for extracting samsung kernel - Galaxy S I9000 General

Could anyone give me the right tools for unpacking the ramdisk and the zimage.
Cant find the right one!
Thanks!

in linux you can extract Image from zImage using this :
dd if=zImage bs=1 skip=16541 | gunzip > Image
where 16541 is number from this output : grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' zImage | cut -f 1 -d
you can get zImage as file from kies firmware download roms

Related

a problem happened in flashing the rom of my SDAmusic

originally I thought that it is dangerous to flash the phone with .bin file. So I planned to export the os.nb from the .bin file and make a .nbf file only using the os.nb. but after I created the .bf file with perl typhoonnbfdecode.pl, and use patch_RUU to flash the phone, patch_RUU displayed the message as the following picture saying that "invalid vender ID"
could somebody tell me what did I do wrong? (the original .bin is usable for flashing the phone)
the following is my failure process
1. exporting os. nb from .bin rom:
perl typhoonnbfdecode.pl -x 585yscn30w.bin
I got several .nb files
2. convert os.nb to nk.nbf:
perl typhoonnbfdecode.pl -s -r os=OS.nb -p device=SP3i -p language=ENGLISH -p magic=HTC -p operator=CDL___02 -p flags=17 -p version=2.0.33.21 -p blversion=2.0.3.23 -c nk.nbf
I also tried again getting the "-s" off:
perl typhoonnbfdecode.pl -r os=OS.nb -p device=SP3i -p language=ENGLISH -p magic=HTC -p operator=CDL___02 -p flags=17 -p version=2.0.33.21 -p blversion=2.0.3.23 -c nk1.nbf
3.use the .nbf rom and patch_ruuto flash the phone, but patch_ruu showed me the error page, how to solve this, please?

[Q] compile own kernel? configuration

I used rotohammer's method for backing up the AT&T Galaxy Tab and it worked wonderfully. I compiled the GT-P1000_Kernel patched with SGH-I987_Kernel and did a standard make and then flashed the zImage onto the galaxy. It resulted in kernel panic. Does anyone know what parameters to use with make or configuration changes that need to be made?
Thanks
ps. when I used heimdall, I only "heimdall flash --kernel zImage".
I also couldn't find a config.gz in the /proc dir. Does anybody know why it is missing and what has taken its place?
success at last
Yay, it works now! thanks roto for the initramfs tip.
what kind of modification did u make to the kernel? do you mind sharing?
[Q] how did you compile your own kernel?
Hi,
I'm in disperate need to do this. I have downloaded the sources from samsung opensource -> followed the instruction in the README.txt -> compiled the kernel and the modules successfully -> used the initramfs from the stock zImage -> but when I flash the zImage (Size ~ 432 KB) I get kernel panic.
I do not think it is possible to boot in verbose mode or have a serial port console log.
letolkki: please share with us how you did it? how did you compile a zImage which boots.??????
share with us please!
I used make menuconfig to specify the location of the initramfs (compression to none). Do not use the build script above the root as that seemed to mess things up for me. The size of my kernel is approx ~5meg with the initramfs included and ~3 without. Then used Heimdall to push it on.
I didn't make any mods as of yet. Just a quest for knowledge and tinkering. Just making sure I can when I need to.
What exactly did you modify? Here's my config, as related to INITRAMFS:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_NONE=y
# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
My kernel size is only 2.9 megs. What else did you specify that has your kernel at 5 megs?
Thanks
you don't have the initramfs source file specified. Put the complete path to the initramfs in the config.
Even when I specified the file location generated during the compile, it still didn't work...size only 3 meg. Are you using the ramdisk.img generated and output into Android/out/target/product/...? Or, did you pull boot.img from the device and split ramdisk.img from the kernel?
chuckbeasley said:
Even when I specified the file location generated during the compile, it still didn't work...size only 3 meg. Are you using the ramdisk.img generated and output into Android/out/target/product/...? Or, did you pull boot.img from the device and split ramdisk.img from the kernel?
Click to expand...
Click to collapse
yep, i pulled it from the device
Would you please tell me how you did it exactly? I've been attempting over the past several hours and haven't been able to find a tool that would split boot.img. They keep telling me that it's not a valid image, but I pulled it from the device.
chuckbeasley said:
Would you please tell me how you did it exactly? I've been attempting over the past several hours and haven't been able to find a tool that would split boot.img. They keep telling me that it's not a valid image, but I pulled it from the device.
Click to expand...
Click to collapse
I used the script from
http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
to get the initramfs from the zImage pulled from the device.
Much appreciated! I'll try this later tonight. Right now, I need a break...
I used verizon_zImage from ClockworkMod, but it fails the extraction with a gzip invalid compressed data--format violated error. How can I pull the zImage directly from the phone? It seems that boot.img doesn't work either.
Thanks
Here are the error messages I'm receiving for both verizon_zImage and boot.img, which I pulled from the GT:
[email protected]:~/ramdisk$ ./extract_initramfs verizon_zImage
-I- Extracting kernel image from verizon_zImage (start = 13117)
gzip: stdin: decompression OK, trailing garbage ignored
5979431+0 records in
5979431+0 records out
5979431 bytes (6.0 MB) copied, 195.453 s, 30.6 kB/s
-I- Extracting compressed cpio image from kernel image (start = 5410216)
gzip: stdin: invalid compressed data--format violated
-I- Extracting initramfs image from /tmp/cpio.img (start = , end = 11)
dd: invalid number `'
[email protected]:~/ramdisk$ ./extract_initramfs boot.img
-I- Extracting kernel image from boot.img (start = 13117)
gzip: stdin: decompression OK, trailing garbage ignored
-I- Extracting compressed cpio image from kernel image (start = 5410216)
gzip: stdin: invalid compressed data--format violated
-I- Extracting initramfs image from /tmp/cpio.img (start = , end = 11)
dd: invalid number `'
Looks like the script had a bug and has been updated. Here's the link: http://forum.xda-developers.com/showthread.php?p=8679959
Here's the updated script that allowed me to extract initramfs.cpio from boot.img:
#!/bin/sh
# This is an update version of the script found at
# http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
#
# The problem with that script is that the gzip magic number occasionally occur
# naturally, meaning that some non-compressed files get uncompressed.
zImage=$1
#========================================================
# find start of gziped kernel object in the zImage file:
#========================================================
pos=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' $zImage | cut -f 1 -d :`
echo -n "-I- Extracting kernel image from $zImage (start = $pos)"
dd if=$zImage bs=1 skip=$pos | gunzip > /tmp/kernel.img
#==========================================================================
# find start and end of the "cpio" initramfs image inside the kernel object:
# ASCII cpio header starts with '070701'
# The end of the cpio archive is marked with an empty file named TRAILER!!!
#==========================================================================
start=`grep -a -b -m 1 --only-matching '070701' /tmp/kernel.img | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' /tmp/kernel.img | head -1 | cut -f 1 -d :`
if [ $start = "" || $end = "" ]; then
#========================================================================
# the cpio archive must be archived
#========================================================================
echo "-I- Extracting compressed cpio image from kernel image (start = $pos)"
pos=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' /tmp/kernel.img | cut -f 1 -d :`
dd if=/tmp/kernel.img bs=1 skip=$pos | gunzip > /tmp/cpio.img
start=`grep -a -b -m 1 --only-matching '070701' /tmp/cpio.img | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' /tmp/cpio.img | head -1 | cut -f 1 -d :`
inputfile=/tmp/cpio.img
else
echo -n "-I- Already uncompressed cpio.img, not decompressing"
inputfile=/tmp/kernel.img
fi
end=$((end + 10))
count=$((end - start))
if (($count < 0)); then
echo "-E- Couldn't match start/end of the initramfs image."
exit
fi
echo "-I- Extracting initramfs image from $inputfile (start = $start, end = $end)"
dd if=$inputfile bs=1 skip=$start count=$count > initramfs.cpio
chuckbeasley said:
I used verizon_zImage from ClockworkMod, but it fails the extraction with a gzip invalid compressed data--format violated error. How can I pull the zImage directly from the phone? It seems that boot.img doesn't work either.
Thanks
Click to expand...
Click to collapse
I used rotohammer's backup method to pull the zImage from the device.
http://forum.xda-developers.com/showthread.php?t=850359&highlight=backup+install+kernel
So do you guys have working kernels ?
I know from my Nexus days that custom kernels can made a massive difference to performance on the beast, so I am looking forward to seeing what people can do with the TAB
Keep up the good work !
I've built my own kernel to see if I could work around the dialing limitation on my VZW tab. Right now, it crashes randomly, but it does boot! I'm looking into the difference between the international version of Onedram and Verizon's version and why Verizon includes a OnedramRecovery unit. My kernel doesn't reference OnedramRecovery and I made more mods. So, I haven't isolated what is causing the instability. Right now, I'm back to Koush's kernel. I'll keep you informed on my progress.
Sent from my SCH-I800 using XDA App

Custom Boot/Splash Screen within NAND Android

Does anyone know how to customize the splash/boot screen after booting into MAGLDR.
Changing the default splash/boot screen before MAGLDR is easy enough, but I can't find any information as how to change the splash/boot screen of the android build stored on NAND.
Appreciate a point in the right direction.
Thanks!
Look Here!
http://forum.xda-developers.com/showthread.php?t=895089
Saw this post, very helpful but I think its for the splash/boot screen that pops up before the MAGLDR boot.
I'm interested in changing the boot/splash screen for the Android that executes after 12345 gogogo!
THanks!
To clear up my terminology, I'm looking to change the android boot animation after it loads from MAGLDR
akapaul26 said:
Look Here!
http://forum.xda-developers.com/showthread.php?t=895089
Click to expand...
Click to collapse
Okay So i figured out where the bootanimation.zip is held in system/customize/resource/bootanimation.zip
Does anyone know were are the splash files located for nand android?
Oh ok, interesting, I'd like to know too!
xxljmzlxx said:
Okay So i figured out where the bootanimation.zip is held in system/customize/resource/bootanimation.zip
Does anyone know were are the splash files located for nand android?
Click to expand...
Click to collapse
I believe splash located inside initrd.gz
justwonder said:
I believe splash located inside initrd.gz
Click to expand...
Click to collapse
any idea of how to edit initrd.gz?
xxljmzlxx said:
any idea of how to edit initrd.gz?
Click to expand...
Click to collapse
extract
mkdir initdir
cd initdir
zcat ../initrd.gz | cpio -i -d
compress
cd initdir
find . | cpio -o -H newc | gzip -9 > ../initrd.gz
justwonder said:
extract
mkdir initdir
cd initdir
zcat ../initrd.gz | cpio -i -d
compress
cd initdir
find . | cpio -o -H newc | gzip -9 > ../initrd.gz
Click to expand...
Click to collapse
what program do you use for the above commands?
You can use any terminal emulator on Your phone, or You can use a terminal on a PC under Linux OS. This in Linux commands.
justwonder said:
extract
mkdir initdir
cd initdir
zcat ../initrd.gz | cpio -i -d
compress
cd initdir
find . | cpio -o -H newc | gzip -9 > ../initrd.gz
Click to expand...
Click to collapse
so what is that line, is that an "L"? just wanna make sure I type **** **** correctly.
there's a tool in this thread to change splash screen + a load of splash screens:
http://forum.xda-developers.com/showthread.php?t=895089
matt

I'm trying to boot my Nexus 10 with your linux-kvm-arm kernel version 3.13...

Hello to everyone,
I'm trying to boot my Nexus 10 with another kind of kernel version,because I'm not interested to use the Android kernel,but the Ubuntu pure kernel. I've chosen to use the linux-kvm-arm kernel version 3.13 :
These are the commands that I have used :
git clone git://github.com/virtualopensystems/linux-kvm-arm.git
cd linux-kvm-arm
git checkout origin/chromebook-3.13 -b chromebook-3.13
curl http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/config > .config
and then I've added these lines to the .config file :
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ASHMEM=y
CONFIG_ANDROID_LOGGER=y
CONFIG_ANDROID_PERSISTENT_RAM=y
CONFIG_ANDROID_RAM_CONSOLE=y
CONFIG_ANDROID_TIMED_OUTPUT=y
CONFIG_ANDROID_TIMED_GPIO is not set
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
CONFIG_ANDROID_SWITCH is not set
CONFIG_ANDROID_INTF_ALARM is not set
CONFIG_FB_TILEBLITTING=y
CONFIG_PHONE is not set
CONFIG_USB_WPAN_HCD is not set
CONFIG_WIMAX_GDM72XX is not set
CONFIG_ARM_PLATFORM_DEVICES=y
CONFIG_ARM_CHROMEOS_FIRMWARE=y
CONFIG_CHROMEOS=y
CONFIG_CHROMEOS_VBC_BLK=y
CONFIG_CHROMEOS_VBC_EC=y
CONFIG_CHROMEOS_RAMOOPS_RAM_START=0x41f00000
CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE=0x00100000
CONFIG_CHROMEOS_RAMOOPS_RECORD_SIZE=0x00020000
CONFIG_CHROMEOS_RAMOOPS_DUMP_OOPS=0x1
CONFIG_CLKDEV_LOOKUP=y
and then I did :
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make uImage dtbs
from here I've followed the tutorial that I've found here :
http://forum.xda-developers.com/showthread.php?t=1981788
and here :
http://forum.xda-developers.com/showthread.php?t=1981788&page=2
mkdir -p newkernel
cd newkernel
wget -c https://dl.google.com/dl/android/aosp/mantaray-kot49h-factory-174ba74f.tgz
tar xvzf mantaray-kot49h-factory-174ba74f.tgz
cd mantaray-kot49h
unzip image-mantaray-kot49h.zip
wget -c http://android-serialport-api.googlecode.com/files/getramdisk.py
chmod +x getramdisk.py
./getramdisk.py boot.img --> ramdisk.img
wget -c http://android-serialport-api.googlecode.com/files/android_bootimg_tools.tar.gz
tar xvf android_bootimg_tools.tar.gz
./mkbootimg --kernel ../../linux-kvm-arm/arch/arm/boot/zImage --ramdisk ramdisk.img --cmdline bootimg.cfg -o new-boot.img
fastboot flash boot new-boot.img
I think that something is wrong here,because it is not able to boot....I see a black screen and nothing else happens...
Hi,
probably too simple, but:
How does your .config look?
Did the curl actually work? (I ask because I tried your URL and it didn't work for me).
Did you actually compile a guest kernel too and boot it?
Special ChromeOS suupport does not exist in that branch.
Keep up the work, if you succeed booting linux, I got a prize for you.
Don't take it wrong, I'm just too bored of the tablet as it is now.
Wejgomi

Can't repack boot image

Hello,
I am trying to edit the boot.img (modified to not force encrypt the userdata) of my device.
I extracted the boot image with umkbootimage and then I extracted the initramfs with the following command:
Code:
gunzip -c ../initramfs.cpio.gz | cpio -i
Then i repacked the ramfs with the command (without changing nothing):
Code:
find . | cpio -o -H newc | gzip > ../new-ramdisk.cpio.gz
Finally, I repacked the boot image with mkbootimg and the following arguments:
Code:
mkbootimg --kernel zImage --ramdisk new-ramdisk.cpio.gz --base 0x0 --ramdisk_offset 0x002000000 --tags_offset 0x01e00000 --cmdline 'androidboot.hardware=angler androidboot.console=ttyHSL0 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3' --pagesize 4096 -o new_boot.img
The new boot image won't boot up. When I use the original initramfs to create the boot image, everything works great.
Another issue is that after the repacking the size of the initramfs changed.
Someone have any idea what should I do?
@batman1010 you need that

Categories

Resources