[HOW TO]Unpack/Repack initramfs in zImage (update for cygwin) - Galaxy S II Themes and Apps

The latest version:
https://github.com/xiaolu/galaxys2_kernel_repack
update for cygwin
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

I hate GFW

I got a problem after repacked the new zImage.
The original size of zImage is 8MB, but the new zImage is 5MB...

Chenglu said:
Unpack:
Code:
./k-unpack zImagexwki8 initramfs-ki8
[I] Extracting gzip'd kernel image from file: zImagexwki8 (start = 16621)
[I] CPIO compression type detected = none | offset = 163840
[I] Extracting non-compressed CPIO image from kernel image (offset = 163840)
[I] Expanding CPIO archive: initramfs.cpio to initramfs-ki8.
Create newinitramfs.cpio:
Code:
./gen_initramfs.sh -o newinitramfs-ki8.cpio -u 0 -g 0 ./initramfs-ki8
or
Code:
cd initramfs-ki8
find . | cpio -o -H newc > ../newinitramfs-ki8.cpio
Edit k-repack Modified to your cross-compiler:
Code:
COMPILER=/home/xiaolu/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi
COMPILER_LIB=/home/xiaolu/CodeSourcery/Sourcery_G++_Lite/lib/gcc/arm-none-eabi/4.5.2
Rebuild kernel:
Code:
./k-repack zImagexwki8 newinitramfs-ki8.cpio
[I] ---------------------------kernel repacker for i9100---------------------------
[I] Extracting gzip'd kernel from zImagexwki8 (start = 16621)
[I] Non-compressed CPIO image from kernel image (offset = 163840)
[I] CPIO image MAX size:3044984
[I] head count:3208824
[I] Making head.img ( from 0 ~ 163840 )
[I] Making a tail.img ( from 3208824 ~ 13773971 )
[I] Current ramdsize using cat : 3045376 with required size : 3044984
[I] Current ramdsize using gzip -fc : 1888879 with required size : 3044984
[I] gzip -fc accepted!
[I] Merging [head+ramdisk] + padding + tail
[I] Now we are rebuilding the zImage
[I] Image ---> piggy.gzip
[I] piggy.gzip ---> piggy.gzip.o
[I] Compiling head.o
[I] Compiling misc.o
[I] Compiling decompress.o
[I] Compiling lib1funcs.o
[I] Create vmlinux.lds
[I] head.o + misc.o + piggy.gzip.o + decompress.o + lib1funcs.o---> vmlinux
[I] vmlinux ---> zImage
[I] Re-compiled to new_zImage
[I] Cleaning up...
[I] finished...
Resources form GT-I9100_OpenSource_Update2(https://opensource.samsung.com )
initramfs-xwki8-cwm5.0.2.6.zip is modified initramfs for xwki8 stock kernel.
Click to expand...
Click to collapse
You are my hero
Thanks for making it

rock_shen said:
I got a problem after repacked the new zImage.
The original size of zImage is 8MB, but the new zImage is 5MB...
Click to expand...
Click to collapse
No problem,CPIO image is gzipped

rock_shen said:
I got a problem after repacked the new zImage.
The original size of zImage is 8MB, but the new zImage is 5MB...
Click to expand...
Click to collapse
use command Filled to 8387840 bytes
Code:
dd if=new_zImage of=zImage bs=8387840 conv=sync

I have writed a script for easy repacking/unpacking/padding
Code:
#!/bin/sh
REUNPACK=$1
if [ $REUNPACK == repack ]; then
cd initramfs_root
find . | cpio -o -H newc > ../initramfs.cpio
cd ..
./k-repack zImage initramfs.cpio
fi;
if [ $REUNPACK == unpack ]; then
./k-unpack zImage
fi;
if [ $REUNPACK == cpio ]; then
cd initramfs_root
find . | cpio -o -H newc > ../initramfs.cpio
fi;
if [ $REUNPACK == padding ]; then
rm -rf zImage
dd if=new_zImage of=zImage bs=8387840 conv=sync
fi;
if [ $REUNPACK == clean ]; then
rm -rf zImage initramfs_root initramfs.cpio new_zImage
echo "Done!"
fi;

netchip said:
I have writed a script for easy repacking/unpacking/padding
Code:
#!/bin/sh
REUNPACK=$1
if [ $REUNPACK == repack ]; then
cd initramfs_root
find . | cpio -o -H newc > ../initramfs.cpio
cd ..
./k-repack zImage initramfs.cpio
fi;
if [ $REUNPACK == unpack ]; then
./k-unpack zImage
fi;
if [ $REUNPACK == cpio ]; then
cd initramfs_root
find . | cpio -o -H newc > ../initramfs.cpio
fi;
if [ $REUNPACK == padding ]; then
rm -rf zImage
dd if=new_zImage of=zImage bs=8387840 conv=sync
fi;
if [ $REUNPACK == clean ]; then
rm -rf zImage initramfs_root initramfs.cpio new_zImage
echo "Done!"
fi;
Click to expand...
Click to collapse
good work

Chenglu said:
I hate GFW
Click to expand...
Click to collapse
haha
me too

guaiwujia said:
haha
me too
Click to expand...
Click to collapse
hiahia

nice scripttl there. makes it easier for devs.
Sent from my GT-I9100 using xda premium

update to v3

Chenglu said:
I hate GFW
Click to expand...
Click to collapse
me too!~

thx
.......

What is GFW?
Sent from my GT-I9100

The Great Fire Wall of China

Chenglu said:
The Great Fire Wall of China
Click to expand...
Click to collapse
I dont like that too xD

black-snowflake said:
me too!~
Click to expand...
Click to collapse
Foreigners don't know what’s GWF you said here, but I think you know who I am!

I'm having a problem. Whenever I try to repack a kernel, it says the ramdisk size is too big. It also says realpath command isn't found on line 12.
Code:
[email protected]:~/Desktop/Kernel/tools# ./repack zImage newinitramfs.cpio
./repack: line 12: realpath: command not found
[I] ---------------------------kernel repacker for i9100---------------------------
[I] Extracting gzip'd kernel from zImage (start = 16621)
[I] CPIO compression type detected = gzip | offset = 163840
[I] CPIO image MAX size:2860094
[I] Head count:3023934
[I] Making head.img ( from 0 ~ 163840 )
[I] Making a tail.img ( from 3023934 ~ 10612864 )
[I] Current ramdsize using cat : 4573696 with required size : 2860094 bytes
[I] Current ramdsize using gzip -f9 : 2866888 with required size : 2860094 bytes
[E] New ramdisk is still too big. Repack failed. 2866888 > 2860094
Tried both 4.4.1 & 4.5.2 version of G++ Lite, none of them is fixes the problem.
Looks like there's something wrong with gzip..
Help?

Padding big binary files to end of the zImage files.
Example(initramfs-tools-v5 Padding sufiles to zImage files):
How to use:
Code:
busybox dd if=/dev/block/mmcblk0p5 of=/system/app/Superuser.apk skip=7026336 seek=0 bs=1 count=196640
busybox dd if=/dev/block/mmcblk0p5 of=/system/bin/su skip=7000000 seek=0 bs=1 count=26336

Related

How to unpack/repack initramfs in zImage

Here we go.
I'm saying that I'm not a very good developer so this information could be messy, contain unnecessary works or a bit wrong.
And also I'm not sure if this method will work with every zImage from every device.
I've tested with
I9000-JM2/JM7 : ECLAIR
JPC : FROYO
and they work like a charm.
OK, now we start.
Download this file
http://www.multiupload.com/GSVLO15WDL
It has cross-compiler in it so that it's slightly big.
------------------------------------------------------------
This is basically for devs so I won't tell you specifically. (or I can't...maybe)
1. Extract cpio'ed initramfs file from zImage.
## EDIT : In order to extract initramfs.cpio, go through from step4 to step11.
A file which starts with "30 37 30" means that this is a cpio'ed file.
So, trim the Image-Orig file from the beginning to the point just before "30" then, you've got a cpio compressed file.
You can now simply decompress it.
cat initramfs.cpio | cpio -i --no-absolute-filenames
Click to expand...
Click to collapse
2. Decompress and edit these files. Make sure you shouldn't go over the original size. (simply, I removed redbend_ua in /sbin forder)
3. Recompress to cpio. ( I've used scripts/gen_initramfs_list.sh which is in the kernel source for a safe bet)
## EDIT : What I've done is here. chdir to "zImage_repack/2.6.29" forder then
/bin/bash scripts/gen_initramfs_list.sh -o usr/initramfs_data.cpio -u 0 -g 0 /home/zero/Desktop/JPC/initramfs/i9000_initramfs_list
Click to expand...
Click to collapse
4. open the zImage with a hexeditor.
5. find "1f 8b 08".
6. cut off from the beginning to the point just before the "1f" so that this file begins with "1f 8b 08".
7. save as anyname.gz
8. in terminal >>>> gunzip anyname.gz
Now, you've got an Image file. I'll call this as an Image-Orig.
9. open the Image-Orig file with a hexeditor.
10. remember the entire size of this file. One of mine was "0xb9a5df".
11. find "30 37 30" hexademical code and "TRAILER!!!" text.
12. cut off from the first "30" to the last "!".
an example is here
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
13. open the cpio file you had recompressed with the hexeditor.
14. paste this codes to the exactly same place where the former initramfs was, in Image-Origin file. (Up to now, I feel like English is more difficult than this trick...sigh, sorry for my bad english!)
15. Almost done. We're gonna make the modified Image file's size identically to the Image-Orig. It's simple. just fill the hole with a bunch of NULLs. put your finger on "0" button and have a little sleep.
I think I need a visual assistant.
Save it as "Image".
At this point, you should have an Image file which size is the same as Image-Orig.
Now open the file you've downloaded at the first.
there is a forder called place_Image_here
yeah, place the Image there and execute the "Repack_kernel.sh" file.
In several seconds, you'll have a zImage file.
I'm so tired and I can't last this writing so, if you have any question, I'll give you a reply.
Thanks!
## PLUS : I've attached the modified JPC kernel which supports /system/etc/init.d/userscripts.sh
It's named JPC_modified_kernel.tar.zip and you should take the ".zip" off in order to use with Odin.
## PLUS2 : I've compiled gnu_parted! also attached. good luck, RyanZA!
-info : GNU parted v2.2 (original version, didn't apply bug fixes.)
disabled device-mapper and read-line while compiling, does this matter?
...Wow.
Good job, sir. Good job.
dkcldark said:
1. Extract cpio'ed initramfs file from zImage.
Click to expand...
Click to collapse
I mostly followed along through the later steps and I don't see any issues, but unfortunately the first step leaves me clueless. How would you do that?!
@dkcldark: good job. nice pictures.
Thats what i do to extract initramfs, basically the same. But i have added instructions to extract from kernels compiled by kernel devs here at xda.
(kernels with gzipped cpio)
Uncompressing the zImage:
$ grep -a -b --only-matching $'\x1f\x8b\x08\x00' < zImage
12896:�
$ dd if=zImage bs=1 skip={number from above command} | zcat - > Image
if not gzipped cpio (this one for stock-samsung-kernel):
$ grep -a -b --only-matching '070701' Image
$ dd if=Image bs=1 skip={your first matching number from line above} > initramfs.cpio
else if cpio is gzipped:
$ grep -a -b --only-matching $'\x1f\x8b\x08' < Image
84448:�
2639420:�
Only the first number is interesting, so we can fetch the initramfs:
$ dd if=Image bs=1 skip={your first number, in my case 84448} | gzip -d -c - > initramfs.cpio
Now extract initramfs.cpio:
$ mkdir somedirtoextract
$ cd somedirtoextract/
$ cpio -i --no-absolute-filenames < ../initramfs.cpio
If you want to have device nodes created, make sure you do it as root:
sudo cpio -i --no-absolute-filenames < ../initramfs.cpio
I'm stunned...
wondewring if theres a way to change this:
c002e660 T __initramfs_start
c035d949 T __initramfs_end
I've compiled a short page about extracting initramfs some time ago here: http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
(also accessible from the SGS wiki page).
Please feel free to extend this page with more instructions / scripts on how also re-pack it back.
hi dkcldark, as i sayed i try to do this with the kernel from i5800 galaxy3, but ran into first problem after saving the image-orig.gz, i get a gz filke with a file image-orig with 0 bytes size and extracting results in an error.
hope you can somehow help me. like i sayed already, i am not really used to such blackbelt stuff, just trying to get a working lagfix for the g3
FadeFx said:
hi dkcldark, as i sayed i try to do this with the kernel from i5800 galaxy3, but ran into first problem after saving the image-orig.gz, i get a gz filke with a file image-orig with 0 bytes size and extracting results in an error.
hope you can somehow help me. like i sayed already, i am not really used to such blackbelt stuff, just trying to get a working lagfix for the g3
Click to expand...
Click to collapse
hello would you give me the kernel file please?
I'll have a look and give you an instruction
here you go: http://archiv.to/GET/FILE4C99994EB1316
thanx for help...
As far I understand this method -> Could we have JPK's kernel initramfs repacked in similar manner, to include EXT2/4 support?
Hello.
dkcldark & neldar , What a great work you ´have done!
Unfortunately im lost at the point when to create the Image.
I followed neldar´s instructions to expand zImage to Image and
My files are extracted from JPK kernel and i have edit some files.
What to do?
xan said:
As far I understand this method -> Could we have JPK's kernel initramfs repacked in similar manner, to include EXT2/4 support?
Click to expand...
Click to collapse
ext2 support is (most likely) already in the kernel. the problem with adding ext4 is that we don't have a ext4 module compatible with this kernel and no source (yet) to compile one ... so we have to wait for samsung to release the source ...
@dkcldark, neldar ... awesome tutorials, thanks!
Has anyone figured out how to find the end of the ramdisk when it's compressed? I'm fooling with some Java code to try it, but the inflater class doesn't like the data that should be the start of the compressed data. No idea why yet. I can parse the gzip header, and it's right, but no decompression. From what I have read, gzip doesn't have a trailer, the only way to find the end is to decompress it.
We can decompress it and get the ramdisk contents, but knowing where to put it back in the file is the tricky part.
heh... I convinced GzipInputStream to do my bidding.
humph.. I was going to attach the java code to do it, but XDA is pissing and moaning about me using up a lot of storage space, a whole 35MB apparently. sigh. I'll try to inline it in a code block, hopefully you get the idea. I'll see about creating a little utility to pull, extract, and put back the ramdisk image, basically the hex editor part without the hex editor.
This is a prototype, change the filenames for your system. This will output the decompressed cpio image as well as give you the offsets for where to put it in a hex editor. It's a bit on the slow side, as it uses byte-at-a-time reading. Much like the dd command earlier in the thread. I'll see about buffering the I/O as well, I just wanted to get it out there to hopefully help out.
Another update. I added input buffering and it's a LOT faster. Hope it helps.
Just to make sure there's no question on it, the code is GPL2 licensed. I should have included the banner.
Code:
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
public class FindCompressedRamdisk
{
int numRead = 0;
int totRead = 0;
public FindCompressedRamdisk()
{
try
{
File f = new File("/home/travis/kernel.img");
if (f.exists())
{
FileInputStream in = new FileInputStream(f);
byte[] rData = new byte[4096];
byte[] oData = new byte[4096];
byte[] gzipKey = { 0x1F, (byte) 0x8B, 0x08, 0x00 };
int pos = 0;
while ((numRead = in.read(rData)) != -1)
{
pos = findBytes(rData, numRead, gzipKey);
if (pos != -1)
{
int start = pos + totRead;
System.out.println("GZIP Start: " + start);
in.close();
in = new FileInputStream(f);
in.skip(start);
InputStream gin = new BufferedInputStream(new GZIPInputStream(in));
int len = 0;
OutputStream out = new BufferedOutputStream(new FileOutputStream("/home/travis/out.img"));
int b;
for ( ; (b = gin.read()) != -1; len++)
{
out.write(b);
}
System.out.println("GZIP End: " + len);
out.close();
break;
}
totRead += numRead;
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
public int findBytes(byte[] data, int dSize, byte[] search)
{
int found = -1;
for (int i = 0; i < dSize && found == -1; i++)
{
if (data[i] == search [0])
{
for (int j = 1; j < search.length; j++)
{
if (data[i + j] != search[j])
break;
if (j == search.length-1)
found = i;
}
}
}
return found;
}
/**
* @param args
*/
public static void main(String[] args)
{
FindCompressedRamdisk rd = new FindCompressedRamdisk();
}
why i could see the graphs??????
Dkcldark did you find a way for the i5800 zimage i provided?
jodue said:
ext2 support is (most likely) already in the kernel. the problem with adding ext4 is that we don't have a ext4 module compatible with this kernel and no source (yet) to compile one ... so we have to wait for samsung to release the source ...
@dkcldark, neldar ... awesome tutorials, thanks!
Click to expand...
Click to collapse
I am perfectly happy with either EXT2/4 (no comments here).
can you tell me how to unpack the factoryfs.rfs ?
I grep the '1F8B0B' and cut the bytes (between '1F8B0B' and 'another 1F8B0B') to a file,,,,a.img,,,,then gunzip it,,,but console println " gzip: a.img is encrypted -- not supported "
why?
sharetop said:
can you tell me how to unpack the factoryfs.rfs ?
I grep the '1F8B0B' and cut the bytes (between '1F8B0B' and 'another 1F8B0B') to a file,,,,a.img,,,,then gunzip it,,,but console println " gzip: a.img is encrypted -- not supported "
why?
Click to expand...
Click to collapse
That's a filesystem image for the /system partition IIRC. I have used it on my phone via a loopback mount, but you can't extract stuff from it using this method. This is for zImage files.
sharetop said:
can you tell me how to unpack the factoryfs.rfs ?
I grep the '1F8B0B' and cut the bytes (between '1F8B0B' and 'another 1F8B0B') to a file,,,,a.img,,,,then gunzip it,,,but console println " gzip: a.img is encrypted -- not supported "
why?
Click to expand...
Click to collapse
You can't. The easiest way to unpack factory.rfs (if you don't have linux) is to copy it to your phone, mount it in a directory using a loopback device, and copy everything from it to another directory on your sdcard.
thank you. If i have a linux system, can i copy the .rfs to ubuntu, then mount it as a virtual device?

Updated: expand initramfs ramdisc from zImage kernel, supports gzip, lzma, bzip2 (?)

If you are interested in building your own kernels (from the Samsung-released open-source code, or any other source), you may need to extract initramfs ramdiscs from existing kernels.
There is a well-known script to achieve that goal, but it only supports uncompressed and gzip'ed kernels, and it doesn't unpack the CPIO archive for further inspection of the actual initramfs "source code" (the output trace is also not easy to debug when working with "weird" zImages). The original script is explained in the XDA wiki: http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage.
For my personal convenience, I tweaked the original bash script so I thought I'd share it with the XDA devs. I added support for lzma-compressed initramfs ramdiscs (thanks to koxudaxi for reminding me of the lzma "magic string"), please let me know if you know the "magic string" for bzip2 archives (EDIT: "0x314159265359" 6 bytes "start of block", 4 bytes header at the beginning...experimental untested support is now available in the script below).
Note that the latest Samfirmware ROMs include encrypted boot.bin and Sbl.bin bootloaders, but I'm not sure how the zImage kernels are encoded...so this script may not work.
Also note that zImage files patched with z4mod require further decoding work, see the XDA wiki page mentioned above for instructions.
Code:
#!/bin/bash
zImage=$1
read -rp "Enter any text to skip extraction (assumes /tmp/kernel2.img already exists): " input
if [ ${input}" " = " " ]; then
echo "==> deleting /tmp/kernel1.img"
rm /tmp/kernel1.img
echo "==> deleting /tmp/kernel2.img"
rm /tmp/kernel2.img
echo "==> searching for gzip header in $zImage"
skip=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' $zImage | cut -f 1 -d :`
echo "==> found gzip header at $skip"
echo "==> unzipping $zImage to /tmp/kernel1.img"
dd if=$zImage bs=1 skip=$skip | gunzip > /tmp/kernel1.img
echo "==> searching for gzip header in /tmp/kernel1.img"
poszip=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' /tmp/kernel1.img | cut -f 1 -d :`
if [ ! $poszip = "" ]; then
echo "==> gzip header at $poszip in /tmp/kernel1.img"
echo "==> extracting /tmp/kernel2.img from /tmp/kernel1.img using gunzip"
dd if=/tmp/kernel1.img bs=1 skip=$poszip | gunzip > /tmp/kernel2.img
else
echo "==> no gzip header in /tmp/kernel1.img"
echo "==> searching for lzma header in /tmp/kernel1.img"
poslzma=`grep -P -a -b -m 1 --only-matching '\x{5D}\x{00}\x..\x{FF}\x{FF}\x{FF}\x{FF}\x{FF}\x{FF}' /tmp/kernel1.img | cut -f 1 -d :`
if [ ! $poslzma = "" ]; then
echo "==> lzma header at $poslzma in /tmp/kernel1.img"
echo "==> extracting /tmp/kernel2.img from /tmp/kernel1.img using lzma"
dd if=/tmp/kernel1.img bs=1 skip=$poslzma | unlzma > /tmp/kernel2.img
else
echo "==> no lzma header in /tmp/kernel1.img"
echo "==> searching for bzip2 header in /tmp/kernel1.img"
posbzip2=`grep -P -a -b -m 1 --only-matching $'\x{42}\x{5A}\x{68}\x{39}\x{31}\x{41}\x{59}\x{26}\ x{53}\x{59}' /tmp/kernel1.img | cut -f 1 -d :`
if [ ! $posbzip2 = "" ]; then
echo "==> bzip2 header at $posbzip2 in /tmp/kernel1.img"
posbzip2=$((posbzip2 - 4))
echo "==> adjusted bzip2 header with -4 bytes offset: $posbzip2"
echo "==> extracting /tmp/kernel2.img from /tmp/kernel1.img using bzip2"
dd if=/tmp/kernel1.img bs=1 skip=$posbzip2 | bunzip2 > /tmp/kernel2.img
else
echo "==> no bzip2 header in /tmp/kernel1.img"
echo "==> assuming no compression for /tmp/kernel1.img, copying to /tmp/kernel2.img"
cp /tmp/kernel1.img /tmp/kernel2.img
fi
fi
fi
fi
# '070701' == $'\x30\x37\x30' == '\x{30}\x{37}\x{30}'
echo "==> searching for cpio header in /tmp/kernel2.img"
start=`grep -a -b -m 1 --only-matching '070701' /tmp/kernel2.img | head -1 | cut -f 1 -d :`
echo "==> cpio header at $start in /tmp/kernel2.img"
echo "==> searching for cpio footer in /tmp/kernel2.img"
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' /tmp/kernel2.img | head -1 | cut -f 1 -d :`
echo "==> cpio footer at $end in /tmp/kernel2.img"
# 14 bytes = length of "TRAILER!!!" (zero-terminated string) + padding => fixes premature end of file warning in CPIO
end=$((end + 14))
echo "==> adjusted cpio footer with 14 bytes offset: $end"
count=$((end - start))
echo "==> cpio size is $count bytes ($end - $start)"
if (($count < 0)); then
echo "==> error in cpio positions, aborting"
exit
fi
cpio_file="initramfs.cpio"
cpio_dir=`echo "${cpio_file}.expanded"`
cpio_ls=`echo "${cpio_file}.ls"`
echo "==> deleting ${zImage}_${cpio_file}"
rm ${zImage}_${cpio_file}
echo "==> deleting ${zImage}_${cpio_dir}"
rm -r ${zImage}_${cpio_dir}
echo "==> deleting ${zImage}_${cpio_ls}"
rm -r ${zImage}_${cpio_ls}
echo "==> extracting initramfs ramdisc from /tmp/kernel2.img to ${zImage}_${cpio_file}"
dd if=/tmp/kernel2.img bs=1 skip=$start count=$count > ${zImage}_${cpio_file}
echo "==> expanding ${zImage}_${cpio_file} into ${zImage}_${cpio_dir} directory"
mkdir ${zImage}_${cpio_dir}
curdir=`pwd`
(cd ${zImage}_${cpio_dir} && cpio --quiet -id --no-absolute-filenames < ${curdir}/${zImage}_${cpio_file})
echo "==> generating ls-like file list in ${zImage}_${cpio_ls}"
cpio --quiet -tvnF ${zImage}_${cpio_file} > ${zImage}_${cpio_ls}
echo "==> DONE."
- heads-up - nice rewrite/cleanup by Mistadman:
https://github.com/mistadman/Extract-Kernel-Initramfs/

[VRTHEME][JB 4.1.2 LSx] Change updater-script & installtheme.sh [FOR 2dn ROM Only]

[VRTHEME][JB 4.1.2 LSx] Change updater-script & installtheme.sh [FOR 2dn ROM Only]
VRTHEME FILES for 2ND ROM ONLY
Original user of S2 I9100 JB 4.1.2 ROM on 2ND ROM, i also want to use Themes and Mods for JB 4.1.2 LSx ROM i found on XDA I9100 threads.
Most are based on http://forum.xda-developers.com/showthread.php?t=1207017 .
To flash them on 2nd ROM, again we have to re-script updater-script and installtheme.sh scripts.
REMEMBER, when we use a 4.1.2 JB ROM as second rom, most of the files which are in /preload/symlink/system/app/* are finaly placed in /data/sec_data/*
so we have to use this PATH in updater-script and installtheme.sh .
In most of the themed ZIP original file we find on XDA, some apks system are in /system/app or /preload/symlink/system/app , be carrefull of this,
in VR-Themed ZIP file we want to moddify for 2nd ROM , sometimes, we have to move /preload/symlink/system/app/xxxxxxxx.apk in /vrtheme/system/app/xxxxxxxx.apk before using it.
so, about using the original VR-Theme or VR-Mod zipped files found on XDA, my different purposes for theming are :
if system files are in /preload/symlink/system/app , they will be themed in /data/sec_data
if system files are in /preload/symlink/system/app , they will be themed in /preload/symlink/system/app (if you use on 1rst ROM)
if system files are in /system/app , they will be themed if they are in /system/app or /data/sec_data/ or /preload/symlink/system/app too
At my sens, the only way to have an error is to put some xxxxxxx.apk folders in /vrtheme/system/app/
which are in fact LNs files in /system/app/ on TEL, (in 2nd ROM, partition /system/ = /preload/ !)
Another way to undertand it, it's that there is no way to destroy symlinked files in /system/app/* (on tel) because no files from /vrtheme/system/app are unknow from you, (the only files we find in are managed by you, by deplacing some themed xxxxxxxx.apk folder from /preload/symplink/system/app, because ROM on TELhave on 2nd ROM too. On another terms too, we can manage apks systems files in /data/sec_data/* instead of /system/app/* (preload/app/*) so only xxxxxxxx.apk directories which are volontary in /vrtheme/system/app/* would be themed in /system/app/ on your 2nd ROM.
for example, flashbarservice.apk can be found sometimes in/system/app and sometimes in /data/sec_data/
Anyway you have to ALWAYS verify the xxxxxxxx.apk directories placement in the Original ZIP Theme or Mod file before flashing it
i think my updater-script and installtheme.sh are also fonctional for apks in /data/app/
Remember that generaly, a file xxxxxxxx.apk is patched on phone only if it exist a ZIP folder named xxxxxxxx.apk in /vrtheme/system/app/, /vrtheme/system/framework/, /vrtheme/preload/symlink/system/app/, /vrtheme/data/app or now /vrtheme/data/sec_data/ , and in the TEL, in /system/app/ , /preload/symlink/system/app/ , /system/framework/ , /data/app/ and /data/sec_data/
Give a try on my sample MIX here : https://mega.co.nz/#F!bhww0QYT!L2cnHS84iZJC7aCvdTmFjg
updater-script and installtheme.sh in attachments are to replace those in your original theme or mod files you find , at the same place which there are , to avoid the desired theme or mod in your 2nd ROM.
(delete ".pdf" at the of name file to use it)
i try to be explicit as i can with my (very limited) bad school english
Thanks.
New Update V2 version of this particular updater-script, only for file which are in \vrtheme\data\sec_data\, (and usual \vrtheme\system\app\ and \vrtheme\system\framework\ for sure)
Version before managed \vrtheme\preload\symlink\system\app\ so it was a waste of space in sdcard, i reduce that because THIS IS only for second rom usage, so update if you use.
lines from new updater-script :
package_extract_dir("vrtheme/data/app", "/sdcard/vrtheme/data/app");
package_extract_dir("vrtheme/data/sec_data", "/sdcard/vrtheme/data/sec_data");
package_extract_dir("vrtheme/system/app", "/sdcard/vrtheme/system/app");
package_extract_dir("vrtheme/system/framework", "/sdcard/vrtheme/system/framework");
NO PRELOD here.
Thanks
toolpack and how to for 2nd ROM ONLY
hope it's the best how too i post for adapt mod and vrtheme for 2nd ROM use !
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
updater-script details :
HTML:
ui_print("");
ui_print(" Mounting Filesystems... ");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/cache");
mount("ext4", "EMMC", "/dev/block/mmcblk0p12", "/preload");
ui_print("");
ui_print(" Clearing dalvik-cache... ");
delete_recursive("/data/dalvik-cache");
ui_print("");
ui_print(" Flashing new extra files before vrtheme them... ");
package_extract_dir("system/app", "/system/app");
package_extract_dir("data/sec_data", "/data/sec_data");
package_extract_file("vrtheme/symlink_data-data_sec_to_system_app", "/tmp/symlink_data-data_sec_to_system_app");
set_perm(0, 0, 0777, "/tmp/symlink_data-data_sec_to_system_app");
run_program("/tmp/symlink_data-data_sec_to_system_app");
set_perm_recursive(0, 0, 0755, 0644, "/data/sec_data");
ui_print("......extracting.vrtheme.to.sdcard.....");
package_extract_dir("vrtheme/data/app", "/sdcard/vrtheme/data/app");
package_extract_dir("vrtheme/data/sec_data", "/sdcard/vrtheme/data/sec_data");
package_extract_dir("vrtheme/system/app", "/sdcard/vrtheme/system/app");
package_extract_dir("vrtheme/system/framework", "/sdcard/vrtheme/system/framework");
ui_print("......extracting.files.to.work.....");
package_extract_file("vrtheme/installtheme.sh", "/sdcard/vrtheme/installtheme.sh");
package_extract_file("vrtheme/cleanup.sh", "/sdcard/vrtheme/cleanup.sh");
package_extract_file("vrtheme/zipalign", "/sdcard/vrtheme/zipalign");
package_extract_file("vrtheme/zip", "/sdcard/vrtheme/zip");
set_perm(0, 0, 0755, "/sdcard/vrtheme/installtheme.sh");
set_perm(0, 0, 0755, "/sdcard/vrtheme/cleanup.sh");
set_perm(0, 0, 0755, "/sdcard/vrtheme/zipalign");
set_perm(0, 0, 0755, "/sdcard/vrtheme/zip");
ui_print("..now.patching.with.installthem.sh....");
run_program("/sdcard/vrtheme/installtheme.sh");
ui_print(" Cleaning up... ");
run_program("/sdcard/vrtheme/cleanup.sh");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/data");
run_program("/sbin/umount", "/cache");
run_program("/sbin/umount", "/preload");
Installtheme.sh detail :
HTML:
#!/sbin/sh
# Copyright VillainROM 2011. All Rights Reserved
# cleanup from last time
[ -d /sdcard/vrtheme-backup ] && rm -r /sdcard/vrtheme-backup
# we need to first go through each file in the "app" folder, and for each one present, apply the modified theme to the APK
# let us copy each original APK here first.
echo "Processing /system/app/"
busybox mkdir -p /sdcard/vrtheme-backup/system/app
busybox mkdir -p /sdcard/vrtheme/apply/system/app
cd /sdcard/vrtheme/system/app/
for f in $(ls)
do
echo "Processing $f"
cp /system/app/$f /sdcard/vrtheme/apply/system/app/
cp /system/app/$f /sdcard/vrtheme-backup/system/app/
done
echo "Backups done for system apps"
# repeat for /preload/symlink/system/app now
[ -d /sdcard/vrtheme/preload/symlink/system/app ] && preload=1 || preload=0
if [ "$preload" -eq "1" ]; then
echo "Processing /preload/symlink/system/app/"
busybox mkdir -p /sdcard/vrtheme-backup/preload/symlink/system/app
busybox mkdir -p /sdcard/vrtheme/apply/preload/symlink/system/app
cd /sdcard/vrtheme/preload/symlink/system/app/
for f in $(ls)
do
echo "Processing $f"
cp /preload/symlink/system/app/$f /sdcard/vrtheme/apply/preload/symlink/system/app/
cp /preload/symlink/system/app/$f /sdcard/vrtheme-backup/preload/symlink/system/app/
done
echo "Backups done for preload apps"
fi
# repeat for /system/framework now
[ -d /sdcard/vrtheme/system/framework ] && framework=1 || framework=0
if [ "$framework" -eq "1" ]; then
echo "Processing /system/framework"
busybox mkdir -p /sdcard/vrtheme-backup/system/framework
busybox mkdir -p /sdcard/vrtheme/apply/system/framework
cd /sdcard/vrtheme/system/framework
for f in $(ls)
do
echo "Processing $f"
cp /system/framework/$f /sdcard/vrtheme/apply/system/framework/
cp /system/framework/$f /sdcard/vrtheme-backup/system/framework/
done
echo "Backups done for frameworks"
fi
# repeat for /data/sec_data now
[ -d /sdcard/vrtheme/data/sec_data ] && datasecapps=1 || datasecapps=0
if [ "$datasecapps" -eq "1" ]; then
echo "Processing /data/sec_data/"
busybox mkdir -p /sdcard/vrtheme-backup/data/sec_data/
busybox mkdir -p /sdcard/vrtheme/apply/data/sec_data/
cd /sdcard/vrtheme/data/sec_data/
for f in $(ls)
do
echo "Processing $f"
cp /data/sec_data/$f /sdcard/vrtheme/apply/data/sec_data/
cp /data/sec_data/$f /sdcard/vrtheme-backup/data/sec_data/
done
echo "Backups done for data sec data"
fi
# repeat for /data/app now
[ -d /sdcard/vrtheme/data/app ] && dataapps=1 || dataapps=0
if [ "$dataapps" -eq "1" ]; then
echo "Processing /data/app/"
busybox mkdir -p /sdcard/vrtheme-backup/data/app/
busybox mkdir -p /sdcard/vrtheme/apply/data/app/
cd /sdcard/vrtheme/data/app/
for f in $(ls)
do
echo "Processing $f"
cp /data/app/$f /sdcard/vrtheme/apply/data/app/
cp /data/app/$f /sdcard/vrtheme-backup/data/app/
done
echo "Backups done for data app"
fi
# for each of the system apps needing processed
cd /sdcard/vrtheme/apply/system/app/
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/vrtheme/system/app/$f/
/sdcard/vrtheme/zip -r /sdcard/vrtheme/apply/system/app/$f *
done
echo "Patched system files"
if [ "$preload" -eq "1" ]; then
cd /sdcard/vrtheme/apply/preload/symlink/system/app/
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/vrtheme/preload/symlink/system/app/$f/
/sdcard/vrtheme/zip -r /sdcard/vrtheme/apply/preload/symlink/system/app/$f *
done
echo "Patched preload files"
fi
if [ "$framework" -eq "1" ]; then
cd /sdcard/vrtheme/apply/system/framework
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/vrtheme/system/framework/$f/
/sdcard/vrtheme/zip -r /sdcard/vrtheme/apply/system/framework/$f *
done
echo "Patched framework files"
fi
if [ "$datasecapps" -eq "1" ]; then
cd /sdcard/vrtheme/apply/data/sec_data/
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/vrtheme/data/sec_data/$f/
/sdcard/vrtheme/zip -r /sdcard/vrtheme/apply/data/sec_data/$f *
done
echo "Patched sec data files"
fi
if [ "$dataapps" -eq "1" ]; then
cd /sdcard/vrtheme/apply/data/app/
for f in $(ls)
do
echo "Working on $f"
cd /sdcard/vrtheme/data/app/$f/
/sdcard/vrtheme/zip -r /sdcard/vrtheme/apply/data/app/$f *
done
echo "Patched data app files"
fi
# and now time to zipalign
cd /sdcard/vrtheme/apply/system/app/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/vrtheme/zipalign -f 4 $f ./aligned/$f
done
if [ "$preload" -eq "1" ]; then
cd /sdcard/vrtheme/apply/preload/symlink/system/app/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/vrtheme/zipalign -f 4 $f ./aligned/$f
done
fi
if [ "$framework" -eq "1" ]; then
cd /sdcard/vrtheme/apply/system/framework/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/vrtheme/zipalign -f 4 $f ./aligned/$f
done
fi
if [ "$datasecapps" -eq "1" ]; then
cd /sdcard/vrtheme/apply/data/sec_data/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/vrtheme/zipalign -f 4 $f ./aligned/$f
done
fi
if [ "$dataapps" -eq "1" ]; then
cd /sdcard/vrtheme/apply/data/app/
busybox mkdir aligned
for f in $(ls)
do
echo "Zipaligning $f"
/sdcard/vrtheme/zipalign -f 4 $f ./aligned/$f
done
fi
# time to now move each new app back to its original location
cd /sdcard/vrtheme/apply/system/app/aligned/
cp * /system/app/
chmod 644 /system/app/*
if [ "$preload" -eq "1" ]; then
cd /sdcard/vrtheme/apply/preload/symlink/system/app/aligned/
cp * /preload/symlink/system/app/
chmod 644 /preload/symlink/system/app/*
fi
if [ "$framework" -eq "1" ]; then
cd /sdcard/vrtheme/apply/system/framework/aligned/
cp * /system/framework/
chmod 644 /system/framework/*
fi
if [ "$datasecapps" -eq "1" ]; then
cd /sdcard/vrtheme/apply/data/sec_data/aligned/
cp * /data/sec_data/
chmod 644 /data/sec_data/*
fi
if [ "$dataapps" -eq "1" ]; then
cd /sdcard/vrtheme/apply/data/app/aligned/
cp * /data/app/
chmod 644 /data/app/*
fi
# Do not remove the credits from this, it's called being a douche
echo "VillainTheme is done"
# we are all done now
Cleanup.sh detail :
#!/sbin/sh
rm -rf /sdcard/vrtheme/
echo "Cleanup complete"
Hi readers !
post 1 updated.

[SCRIPT][BACKUP][TOOL]Preserve addon , dpi , Xposed app_process /system files

Hi,
i flash many roms and sometimes after new rom flashed , i see dpi preserved my change before flash, even some rom preserve xposed framework still activated...maybe you have experience with some other backup/restore /system files during flash, maybe have you another idea to preserve some stuff.
For my part, i make a new backuptool.sh and backuptool.functions scripts compiled with some i find over roms i tried....
We have:
save dpi
save xposed framework
save addond
i think in red are the line you can personalize, i hope you know what to do with.
backuptool.sh
Code:
#!/sbin/sh
#
# Backup and restore addon /system files
#
export C=/tmp/backup
export S=/system
[COLOR="Red"]export V=what you want[/COLOR]
persist_props="ro.sf.lcd_density"
sysroot="/system"
saveroot="/tmp/save"
# Preserve DPI
save_props()
{
rm -f "$saveroot/prop"
for prop in $persist_props; do
echo "save_props: $prop"
grep "^$prop=" "$sysroot/build.prop" >> "$saveroot/prop"
done
}
# Restore DPI
restore_props()
{
local sedargs
sedargs="-i"
for prop in $(cat $saveroot/prop); do
echo "restore_props: $prop"
k=$(echo $prop | cut -d'=' -f1)
sedargs="$sedargs s/^$k=.*/$prop/"
done
sed $sedargs "$sysroot/build.prop"
}
# Backup Xposed Framework (bin/app_process)
xposed_backup()
{
if [ -f /system/bin/app_process.orig ]
then
cp /system/bin/app_process /tmp/backup/
fi
}
# Restore Xposed Framework (bin/app_process)
xposed_restore()
{
if [ -f /tmp/backup/app_process ]
then
mv /system/bin/app_process /system/bin/app_process.orig
cp /tmp/backup/app_process /system/bin/
fi
}
# Preserve /system/addon.d in /tmp/addon.d
preserve_addon_d() {
mkdir -p /tmp/addon.d/
cp -a /system/addon.d/* /tmp/addon.d/
chmod 755 /tmp/addon.d/*.sh
}
# Restore /system/addon.d in /tmp/addon.d
restore_addon_d() {
cp -a /tmp/addon.d/* /system/addon.d/
rm -rf /tmp/addon.d/
}
[COLOR="Red"]# Proceed only if /system is the expected major and minor version
check_prereq() {
if ( ! grep -q "^ro.cm.version=$V.*" /system/build.prop ); then
echo "Not backing up files from incompatible version: $V"
return 0
fi
return 1
}[/COLOR]
check_blacklist() {
if [ -f /system/addon.d/blacklist ];then
## Discard any known bad backup scripts
cd /$1/addon.d/
for f in *sh; do
s=$(md5sum $f | awk {'print $1'})
grep -q $s /system/addon.d/blacklist && rm -f $f
done
fi
}
check_whitelist() {
found=0
if [ -f /system/addon.d/whitelist ];then
## forcefully keep any version-independent stuff
cd /$1/addon.d/
for f in *sh; do
s=$(md5sum $f | awk {'print $1'})
grep -q $s /system/addon.d/whitelist
if [ $? -eq 0 ]; then
found=1
else
rm -f $f
fi
done
fi
return $found
}
mkdir -p $saveroot
# Execute /system/addon.d/*.sh scripts with $1 parameter
run_stage() {
for script in $(find /tmp/addon.d/ -name '*.sh' |sort -n); do
$script $1
done
}
case "$1" in
backup)
save_props
mkdir -p $C
[COLOR="Red"]# if check_prereq; then[/COLOR]
if check_whitelist system; then
exit 127
fi
[COLOR="Red"]# fi[/COLOR]
check_blacklist system
xposed_backup
preserve_addon_d
run_stage pre-backup
run_stage backup
run_stage post-backup
;;
restore)
restore_props
[COLOR="Red"]# if check_prereq; then[/COLOR]
if check_whitelist tmp; then
exit 127
fi
[COLOR="Red"]# fi[/COLOR]
check_blacklist tmp
xposed_restore
run_stage pre-restore
run_stage restore
run_stage post-restore
restore_addon_d
rm -rf $C
rm -rf /data/data/android.pacstats
sync
;;
*)
echo "Usage: $0 {backup|restore}"
exit 1
esac
exit 0
backuptool.functions
Code:
#!/sbin/sh
#
# Functions for backuptool.sh
#
export C=/tmp/backup
export S=/system
export V=what you want
backup_file() {
if [ -e "$1" ]; then
local F=`basename "$1"`
local D=`dirname "$1"`
# dont backup any apps that have odex files, they are useless
if ( echo "$F" | grep -q "\.apk$" ) && [ -e `echo "$1" | sed -e 's/\.apk$/\.odex/'` ]; then
echo "Skipping odexed apk $1";
else
mkdir -p "$C/$D"
cp -p $1 "$C/$D/$F"
fi
fi
}
restore_file() {
local FILE=`basename "$1"`
local DIR=`dirname "$1"`
if [ -e "$C/$DIR/$FILE" ]; then
if [ ! -d "$DIR" ]; then
mkdir -p "$DIR";
fi
cp -p "$C/$DIR/$FILE" "$1";
if [ -n "$2" ]; then
echo "Deleting obsolete file $2"
rm "$2";
fi
fi
}
the files in attachments. just remove ".txt' at end to use them as well.
thanks.

LineageOS source compilation fails

I'm trying to build Lineage 14.1 for serranoltexx (for 5 days now).
When I started the compilation using "breakfast serranoltexx" an error appears after the 7 percent mark (~2minutes).
I followed this guide: wiki.lineageos. org/devices/serranoltexx/build
with a fresh Ubuntu 17.04 VM Box installation two times but that error always appears.
The only thing I still could mention is that pulled the proprietary blobs using my phone as stated in the instructions not with the stock Rom but Lineage 14.1 already installed.
Full console output:
(error at line #321) pastebin. com/vC06fV36
Error:
Code:
make: Leaving directory '/home/mrglue/android/lineage/kernel/samsung/msm8930-common'
[ 7% 2535/34256] Building Kernel
FAILED: /bin/bash -c "(make -j4 CFLAGS_MODULE=\"-fno-pic\" -C kernel/samsung/msm8930-common O=/home/mrglue/android/lineage/out/target/product/serranoltexx/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\"/home/mrglue/android/lineage/prebuilts/misc/linux-x86/ccache/ccache arm-linux-androidkernel-\" zImage ) && (if grep -q 'CONFIG_OF=y' /home/mrglue/android/lineage/out/target/product/serranoltexx/obj/KERNEL_OBJ/.config ; then echo \"Building DTBs\" ; make -j4 CFLAGS_MODULE=\"-fno-pic\" -C kernel/samsung/msm8930-common O=/home/mrglue/android/lineage/out/target/product/serranoltexx/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\"/home/mrglue/android/lineage/prebuilts/misc/linux-x86/ccache/ccache arm-linux-androidkernel-\" dtbs ; else echo \"DTBs not enabled\" ; fi ) && (if grep -q 'CONFIG_MODULES=y' /home/mrglue/android/lineage/out/target/product/serranoltexx/obj/KERNEL_OBJ/.config ; then echo \"Building Kernel Modules\" ; make -j4 CFLAGS_MODULE=\"-fno-pic\" -C kernel/samsung/msm8930-common O=/home/mrglue/android/lineage/out/target/product/serranoltexx/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\"/home/mrglue/android/lineage/prebuilts/misc/linux-x86/ccache/ccache arm-linux-androidkernel-\" modules && make -j4 CFLAGS_MODULE=\"-fno-pic\" -C kernel/samsung/msm8930-common O=/home/mrglue/android/lineage/out/target/product/serranoltexx/obj/KERNEL_OBJ INSTALL_MOD_PATH=../../system ARCH=arm CROSS_COMPILE=\"/home/mrglue/android/lineage/prebuilts/misc/linux-x86/ccache/ccache arm-linux-androidkernel-\" modules_install && mdpath=\`find /home/mrglue/android/lineage/out/target/product/serranoltexx/system/lib/modules -type f -name modules.order\`; if [ \"\$mdpath\" != \"\" ];then mpath=\`dirname \$mdpath\`; ko=\`find \$mpath/kernel -type f -name *.ko\`; for i in \$ko; do arm-linux-androidkernel-strip --strip-unneeded \$i; mv \$i /home/mrglue/android/lineage/out/target/product/serranoltexx/system/lib/modules/; done; fi && mdpath=\`find /home/mrglue/android/lineage/out/target/product/serranoltexx/system/lib/modules -type f -name modules.order\`; if [ \"\$mdpath\" != \"\" ];then mpath=\`dirname \$mdpath\`; rm -rf \$mpath; fi ; else echo \"Kernel Modules not enabled\" ; fi )"

Categories

Resources