[Tutorial] How to change kernel logo (1st boot srceen) [COMPLETED]

Search This thread

nelikp

Senior Member
Oct 25, 2011
1,122
2,853
lost world
We have 3 major works here... So I gonna to make it seperated
-1st post is HOW TO EXTRACT kernel.img (boot.img)
-2nd post is HOW TO CONVERT PICTURE FILE to BOOT.RLE
-3rd post is HOW TO REPACK THE KERNEL PAKAGE into boot.img


Requiredment
-Window machine
-installed cygwin
-the full boot.img/kernel (some kernel won't work because there is no full pakage/ i mean we can't)
-bootimg.zip (tool for UNPACK and REPACK kernel)
-boot_screen_logo_creation_package.rar

Thank and Credit
i- Credit to DooMLoRD Recognized Developer over most of XPERIA devices for his own tool and tutor that I learned before
ii- Credit to jimbo77 Senior Member for his tutorial that I used and learned and tool for unpack and repack
ii- Don't forget to give them a thanks meter

=============================================================================


Here we go

1-This section I will show u how to unpack and repack the boot.img
just see from original thread by jimbo77 from here and download the UNPACK and REPACK tool by him HERE

this is a fast guide from me:-
1-extract the bootimg-tools.zip into new folder (name it 'boot' folder)
2-move it into cygwin directory (cygwin/boot)
3- move your fav kernel into same directory
4-run cygwin.bat

Step4.png


5-Now, unpack your boot.img by running the following command:

./extractboot boot.img
Step41.png

If your output looks like this, then the extraction has worked correctly! Note that the Command Line string has also been read from the source file, this will be used later when you go to re-pack your file.

Your script folder should now look like this:
STEP4.2.png

boot.img-kernel is the compiled kernel blob that was inside the source boot.img, if you want to replace the kernel with another compiled kernel image, you can replace this file with another one (but leave the file name the same)

boot.img-ramdisk.gz is the gzipped ramdisk image which has been split from the boot.img, you should leave this file alone.
The “out” folder contains the EXTRACTED ramdisk, and this is where you should make your changes to the ramdisk.

Important Note!

Remember, when editing files in the ramdisk through Windows, such as init.rc, Windows notepad will not format the files correctly, making them almost impossible to read, wheras Wordpad will LOOK like it is formatting the files correctly, if you save one of these files from the Wordpad application it will BREAK the file and it will no longer be able to be read correctly by Android. To edit these files you MUST use an editor such as Notepad++ which you can download for free.

AGAIN...
Special thanks/credit to jimbo77 for his excellent guide
 

nelikp

Senior Member
Oct 25, 2011
1,122
2,853
lost world
So.. NEXT step to change a kernel logo is here

Requiredment
1-a picture what are u like to look into the 1st boot screen (kernel logo) (make sure it size/resolution same your device resolution)
2-boot_screen_logo_creation_package.rar
3-some infos and knowledges here
4-window machine like i explained on 1st post


My quick guide
-extract the tool.rar
-move extracted files into new folder (name it 'rle' folder without quote)
-move into cygwin folder (to make it easy to follow my simple guide)
-copy your own logo.png (a picture u want to use on a kernel) into same rle folder
(for 4 steps above it shold look like tis)
capturesnd.png


-now launch cygwin.bat
capture2vk.png


./convert_image_to_rle.bat logo.png
capture4g.png


Ah...my mistake..don't forget to move/copy/replace new logo.rle into
C/cygwin/boot/out/ramdisk/here
45076514.png


if you done good...follow next step on next post (to repack your moded kernel)
 

nelikp

Senior Member
Oct 25, 2011
1,122
2,853
lost world
Last step before you flash a new look kernel (boot.img) is

Repack your moded kernel

STEP4.3.png



One thing to note that people may mention in other guides, is that when packing boot.img files, you will usually have to declare a base address, and a command line to the packaging tool. This set of scripts reads the existing command line and base address from the boot.img file you originally provided at the time of repacking, so always make sure you leave your original source boot.img file in the folder and do not re-name it after extraction, your newly created boot.img file will be named boot_new.img and will NOT overwrite the original.


Done! If your screen looks like the image above, then you should now have a freshly created boot_new.img file, ready to be flashed to Android for testing, you can now go ahead and flash it through FASTBOOT one thing I'll recommend though is to first do
 

seamo123

Senior Member
Jun 8, 2012
687
85
Well I've been scratching my head about this and just can't work out what's going wrong - after I run the ./extractboot boot.img command I keep getting the message: './extractboot: ./split_bootimg.pl: /usr/bin/perl: bad interpreter: Permission denied
./extractboot: line 17: cpio: command not found
gzip: ../../boot.img-ramdisk.gz: No such file or directory'

I followed your instructions as below:
1-extract the bootimg-tools.zip into new folder (name it 'boot' folder)
2-move it into cygwin directory (cygwin/boot)
3- move your fav kernel into same directory
4-run cygwin.bat

When you say "move your fav kernel into same directory", what do you mean? Move it into the 'boot' folder? Or do you mean the 'cygwin' folder?

Any help you could give would be greatly appreciated - confused.com! :)
 
Last edited:

hail12

New member
Apr 3, 2013
1
0
boot.img file problem

HTC ONE X beataudio

ENDEAVORU PVT SHIP S-ON RL
HBOOT-1.36.0000
CPLD-None
MICROP-None
RADIO-5.1204.162.29
eMMC-bootmode:disabled
CPU-bootmode: disabled
HW Secure boot:enabled
MODEM PATH : OFF
Nov 16 2012,18:32:39
cid: HTC__044

i install this ROM (cm-10.1-20130404-NIGHTLY-endeavoru.zip) file but can't boot.
boot problem how to fix pls i did flash boot.img file also but same problem.pls help
 

3X4MPL3

Senior Member
Jul 25, 2013
65
30
Error when extracting

Hey Guys,
If you get this error:

Code:
./extractboot: ./split_bootimg.pl: /usr/bin/perl: bad interpreter: Permission denied
./extractboot: line 17: cpio: command not found
gzip: ../../boot.img-ramdisk.gz: No such file or directory
you need to install Perl & cpio packages. Just run the installation of cygwin again and choose them.
The problem is, now i get the following error:

Code:
./extractboot boot.img
Android Magic not found in ./boot.img. Giving up.
gzip: ../../boot.img-ramdisk.gz: No such file or directory
cpio: verfrühtes Ende des Archivs

Does anyone now how to fix that? :confused:
 
Last edited:

FinixZ

Member
May 9, 2013
39
6
Colombo
Hey Guys,
If you get this error:

Code:
./extractboot: ./split_bootimg.pl: /usr/bin/perl: bad interpreter: Permission denied
./extractboot: line 17: cpio: command not found
gzip: ../../boot.img-ramdisk.gz: No such file or directory
you need to install Perl & cpio packages. Just run the installation of cygwin again and choose them.
The problem is, now i get the following error:

Code:
./extractboot boot.img
Android Magic not found in ./boot.img. Giving up.
gzip: ../../boot.img-ramdisk.gz: No such file or directory
cpio: verfrühtes Ende des Archivs

Does anyone now how to fix that? :confused:

Same problem here Bro... So how did you manage to fix it ?
 
Last step before you flash a new look kernel (boot.img) is

Repack your moded kernel


STEP4.3.png



One thing to note that people may mention in other guides, is that when packing boot.img files, you will usually have to declare a base address, and a command line to the packaging tool. This set of scripts reads the existing command line and base address from the boot.img file you originally provided at the time of repacking, so always make sure you leave your original source boot.img file in the folder and do not re-name it after extraction, your newly created boot.img file will be named boot_new.img and will NOT overwrite the original.


Done! If your screen looks like the image above, then you should now have a freshly created boot_new.img file, ready to be flashed to Android for testing, you can now go ahead and flash it through FASTBOOT one thing I'll recommend though is to first do

why i am getting this error?
any idea?

$ ./extractboot boot.img
Page size: 131072 (0x00020000)
Kernel size: 4584280 (0x0045f358)
Ramdisk size: 3831016 (0x003a74e8)
Second size: 0 (0x00000000)
Board name:
Command line:
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
./extractboot: line 17: cpio: command not found

gzip: ../../boot.img-ramdisk.gz: not in gzip format
 

FinixZ

Member
May 9, 2013
39
6
Colombo
Finally i manage to extract...

Not at all, I didn't changed it and waited for an other kernel :p


Finally i manage to extract the boot image by using this script... :victory:

Thanks to the author "Beide" for his script :highfive:

Code:
#!/usr/bin/perl -W

use strict;
use bytes;
use File::Path;

die "did not specify boot img file\n" unless $ARGV[0];

my $bootimgfile = $ARGV[0];

my $slurpvar = $/;
undef $/;
open (BOOTIMGFILE, "$bootimgfile") or die "could not open boot img file: $bootimgfile\n";
my $bootimg = <BOOTIMGFILE>;
close BOOTIMGFILE;
$/ = $slurpvar;

# chop off the header
$bootimg = substr($bootimg,2048);

# we'll check how many ramdisks are embedded in this image
my $numfiles = 0;

# we look for the hex 00 00 00 00 1F 8B because we expect some trailing padding zeroes from the kernel or previous ramdisk, followed by 1F 8B (the gzip magic number)
while ($bootimg =~ m/\x00\x00\x00\x00\x1F\x8B/g) {
	$numfiles++;
}

if ($numfiles == 0) {
	die "Could not find any embedded ramdisk images. Are you sure this is a full boot image?\n";
} elsif ($numfiles > 1) {
	die "Found a secondary file after the ramdisk image.  According to the spec (mkbootimg.h) this file can exist, but this script is not designed to deal with this scenario.\n";
}

$bootimg =~ /(.*\x00\x00\x00\x00)(\x1F\x8B.*)/s;

my $kernel = $1;
my $ramdisk = $2;


open (KERNELFILE, ">$ARGV[0]-kernel.gz");
print KERNELFILE $kernel or die;
close KERNELFILE;

open (RAMDISKFILE, ">$ARGV[0]-ramdisk.cpio.gz");
print RAMDISKFILE $ramdisk or die;
close RAMDISKFILE;

print "\nkernel written to $ARGV[0]-kernel.gz\nramdisk written to $ARGV[0]-ramdisk.cpio.gz\n";
if (-e "$ARGV[0]-ramdisk") { 
	rmtree "$ARGV[0]-ramdisk";
	print "\nremoved old directory $ARGV[0]-ramdisk\n";
}

mkdir "$ARGV[0]-ramdisk" or die;
chdir "$ARGV[0]-ramdisk" or die;
system ("gunzip -c ../$ARGV[0]-ramdisk.cpio.gz | cpio -i");

print "\nextracted ramdisk contents to directory $ARGV[0]-ramdisk/\n";
 
  • Like
Reactions: 3X4MPL3
Last step before you flash a new look kernel (boot.img) is

thank you for your n00b-friendly tut., but for some reason it already goes wrong in step 1, 'cause when I extract the kernel the folder out/ramdisk remains empty, so nothing to replace. Have I done something wrong or is my Arc S just not suitable for this sort of tinkering?
 
  • Like
Reactions: tashik19

BordenG

Member
Jun 7, 2012
44
19
I think you should install perl (for splitting bootimg) and cpio (to create ramdisk.gz ) packages from cygwin.
without this packages, extractboot script will just create an empty ramdisk folder.
 
I think you should install perl (for splitting bootimg) and cpio (to create ramdisk.gz ) packages from cygwin.
without this packages, extractboot script will just create an empty ramdisk folder.

ok, found "perl" but for "cpio" I searched and installed the 3 items that had "cpio" in 'em (on top of my head "default '& "items" and a third I can't remember).
If it works the OP should add that info to the tut.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    We have 3 major works here... So I gonna to make it seperated
    -1st post is HOW TO EXTRACT kernel.img (boot.img)
    -2nd post is HOW TO CONVERT PICTURE FILE to BOOT.RLE
    -3rd post is HOW TO REPACK THE KERNEL PAKAGE into boot.img


    Requiredment
    -Window machine
    -installed cygwin
    -the full boot.img/kernel (some kernel won't work because there is no full pakage/ i mean we can't)
    -bootimg.zip (tool for UNPACK and REPACK kernel)
    -boot_screen_logo_creation_package.rar

    Thank and Credit
    i- Credit to DooMLoRD Recognized Developer over most of XPERIA devices for his own tool and tutor that I learned before
    ii- Credit to jimbo77 Senior Member for his tutorial that I used and learned and tool for unpack and repack
    ii- Don't forget to give them a thanks meter

    =============================================================================


    Here we go

    1-This section I will show u how to unpack and repack the boot.img
    just see from original thread by jimbo77 from here and download the UNPACK and REPACK tool by him HERE

    this is a fast guide from me:-
    1-extract the bootimg-tools.zip into new folder (name it 'boot' folder)
    2-move it into cygwin directory (cygwin/boot)
    3- move your fav kernel into same directory
    4-run cygwin.bat

    Step4.png


    5-Now, unpack your boot.img by running the following command:

    ./extractboot boot.img
    Step41.png

    If your output looks like this, then the extraction has worked correctly! Note that the Command Line string has also been read from the source file, this will be used later when you go to re-pack your file.

    Your script folder should now look like this:
    STEP4.2.png

    boot.img-kernel is the compiled kernel blob that was inside the source boot.img, if you want to replace the kernel with another compiled kernel image, you can replace this file with another one (but leave the file name the same)

    boot.img-ramdisk.gz is the gzipped ramdisk image which has been split from the boot.img, you should leave this file alone.
    The “out” folder contains the EXTRACTED ramdisk, and this is where you should make your changes to the ramdisk.

    Important Note!

    Remember, when editing files in the ramdisk through Windows, such as init.rc, Windows notepad will not format the files correctly, making them almost impossible to read, wheras Wordpad will LOOK like it is formatting the files correctly, if you save one of these files from the Wordpad application it will BREAK the file and it will no longer be able to be read correctly by Android. To edit these files you MUST use an editor such as Notepad++ which you can download for free.

    AGAIN...
    Special thanks/credit to jimbo77 for his excellent guide
    14
    Last step before you flash a new look kernel (boot.img) is

    Repack your moded kernel

    STEP4.3.png



    One thing to note that people may mention in other guides, is that when packing boot.img files, you will usually have to declare a base address, and a command line to the packaging tool. This set of scripts reads the existing command line and base address from the boot.img file you originally provided at the time of repacking, so always make sure you leave your original source boot.img file in the folder and do not re-name it after extraction, your newly created boot.img file will be named boot_new.img and will NOT overwrite the original.


    Done! If your screen looks like the image above, then you should now have a freshly created boot_new.img file, ready to be flashed to Android for testing, you can now go ahead and flash it through FASTBOOT one thing I'll recommend though is to first do
    11
    So.. NEXT step to change a kernel logo is here

    Requiredment
    1-a picture what are u like to look into the 1st boot screen (kernel logo) (make sure it size/resolution same your device resolution)
    2-boot_screen_logo_creation_package.rar
    3-some infos and knowledges here
    4-window machine like i explained on 1st post


    My quick guide
    -extract the tool.rar
    -move extracted files into new folder (name it 'rle' folder without quote)
    -move into cygwin folder (to make it easy to follow my simple guide)
    -copy your own logo.png (a picture u want to use on a kernel) into same rle folder
    (for 4 steps above it shold look like tis)
    capturesnd.png


    -now launch cygwin.bat
    capture2vk.png


    ./convert_image_to_rle.bat logo.png
    capture4g.png


    Ah...my mistake..don't forget to move/copy/replace new logo.rle into
    C/cygwin/boot/out/ramdisk/here
    45076514.png


    if you done good...follow next step on next post (to repack your moded kernel)
    7
    I need this for an extra (extra thanks..)

    (may U?)
    1
    please re upload this file "boot_screen_logo_creation_package.rar" link is dead on mediafire

    http://d-h.st/xwB