[Q] How do I go from ICS to CM7? - Xperia Arc Q&A, Help & Troubleshooting

Hi Guys...
I really can't figure out how I go about installing CM7.2 on my arc again, after upgrading to BaseBand70 + ICS.
I tried a lot of different stuff and what ussually happens, is when I install the CM bootmloader, the phone won't turn on and the screen keeps on being black.
Right now I have the Arconium rom installed and it works fine, but I miss the smootness and the awesome battery life I had on with CM7.2
I've tried to install various tft files flashtool, but the only thing I can get to work is the BB70 one.
Hope you guys can help

You can return to CM7 but you must flash CM7 kernel with flash tool.
view topic : here

fabou said:
You can return to CM7 but you must flash CM7 kernel with flash tool.
view topic : here
Click to expand...
Click to collapse
Thanks...
But I have already tried that and that doesn't work... I thought it was because I needed to flash an older baseband or something similar?

i think the baseband is not linked with the kernel, but you can flash the kernel and you can upgrade baseband.
Did you try the FXP117 kernel? maybe the kernel work, it's a bluid problem.
On CM9 I had the same problem .
adrianom said:
Guys,
The problem of boot image is again in ramdisk, and is only a build problem, I extract the 117 boot.img and only recompress and work.
If someone wants to build for other devices, the command to build the boot.img, is:
Use unpack-bootimg.pl to extract the boot.img:
Code:
unpack-bootimg.pl boot.img
Rebuild the ramdisk:
Code:
cd boot_117.img-ramdisk
find . -name ".DS_Store" -depth -exec rm {} \;
find . | cpio -o -H newc | gzip > ../ramdisk.cpio.gz;
cd ..
Rebuild the boot.img:
Code:
mkbootimg --base 0x00200000 --kernel boot_117.img-kernel --ramdisk ramdisk.cpio.gz -o boot.img
Ps.: the script above is for Mac, but should also work for Linux.
Attached below is the fix boot.img.
Click to expand...
Click to collapse
WARNING : this quote is for CM9!!
follow this thread and maybe it will have a patch

Related

[Kernelpatch][25.03.2011] Bluetooth battery drain fix

Hi all,
i think i have fixed the ugly bluetooth battery drain bug.
It works for me since yesterday evening. Battery drain is between 2ma and 5ma with GSM and BT enabled. Also the headset in my car works very well.
Base for my work was tytungs kernel git - i think it was v8, but not sure...
In this post you will find a patch file, the compiled kernel and the source files i have modified. I'm a absolutly beginner with compiling linux, so i am not sure that the patch file will work, diff has a realy big manual
http://gitorious.org/~tytung/linux-on-wince-htc/tytungs-hastarins-linux_on_wince_htc
Also i am not sure how this kernel will work with Sense roms, because Sense use btld which has the power saving features in the binary and not in the kernel.
Last but not least i will thank Charansingh for the work he has done on the BT problem and tytung for his kernel base.
If you like to test the kernel, please take also my modules, because i get with the precompiled files from tytung a version magic error.
Your feedback is highly appreciated.
Best regards
trilu
In this Post you will find the zip file for updating magldr
http://forum.xda-developers.com/showpost.php?p=12374073&postcount=7
Here you find the zip file for updating clk
http://forum.xda-developers.com/showpost.php?p=12378215&postcount=34
Just found another point to save 3 to 5ma more
I installed Typhoons CM7 Image and was wondering why me drain in standby was 7 to 10ma with BT enabled.
Yesterday with Charansingh's nightly it was arround 3 to 5ma.
The solution is to set the low power flag on brcm_patchram_plus in init.rc
service hciattach /system/bin/brcm_patchram_plus --enable_lpm --enable_hci \
--baudrate 3000000 --patchram /etc/firmware/bcm4329.hcd /dev/ttyHS0
Also seen that in a lot of images hciattach service is set in init.rc and init.htcleo.rc
In my experience the hciattach service should start only in init.rc, before bluetoothd service.
Wow!
Thank God for this.
Finally and hopefully this matter is solved.
Which Rom have you tested this kernel with?
Can I use the latest Tween's Rom?
ohohohohohoooooho!!!1
super man!! many many thanks
will try it now!
silverbluem said:
ohohohohohoooooho!!!1
super man!! many many thanks
will try it now!
Click to expand...
Click to collapse
pls report
I've tested with Charansingh CM7 nightly - but it should work with every rom which uses tytungs kernel v8 and is Gingerbread.
As mentioned, feedback for Froyo and Sense is welcome...
can anybody build a boot.img to flash via cwm?
mponte said:
can anybody build a boot.img to flash via cwm?
Click to expand...
Click to collapse
here you are magldr version; for cLK use fastboot flash:raw command. (you'll need your own initrd.gz or the one delivered with build).
seadersn said:
here you are magldr version; for cLK use fastboot flash:raw command. (you'll need your own initrd.gz or the one delivered with build).
Click to expand...
Click to collapse
i got cLK in Typhoon 2.8.0.
kernel is on a boot.img file to flash. can i only flash this file with cwm as is?
as i see the updater-script only updates the zImage file and modules
P.S.
what's about this?
Code:
package_extract_dir("boot", "/boot");
there is no boot folder, only zImage file
cLK version doesn't exist for now. i will make one, but this will take roundabout 4-6 hours, as i have to sleep a little bit now (only two hours the last 24h).
Works like a charm!! On hyperdroid cm7
thanks!!
how can i build a boot.img file for clk?
so great news...thanks a lot
i'll try it just now
Anyone try this on a sense rom yet? I'm running boy ppc rom has 60ma bt drain in stand by! !
Sent from my HTC HD2 using XDA Premium App
trilu said:
Hi all,
i think i have fixed the ugly bluetooth battery drain bug.
It works for me since yesterday evening. Battery drain is between 2ma and 5ma with GSM and BT enabled. Also the headset in my car works very well.
Base for my work was tytungs kernel git - i think it was v8, but not sure...
In this post you will find a patch file, the compiled kernel and the source files i have modified. I'm a absolutly beginner with compiling linux, so i am not sure that the patch file will work, diff has a realy big manual
http://gitorious.org/~tytung/linux-on-wince-htc/tytungs-hastarins-linux_on_wince_htc
Also i am not sure how this kernel will work with Sense roms, because Sense use btld which has the power saving features in the binary and not in the kernel.
Last but not least i will thank Charansingh for the work he has done on the BT problem and tytung for his kernel base.
If you like to test the kernel, please take also my modules, because i get with the precompiled files from tytung a version magic error.
Your feedback is highly appreciated.
Best regards
trilu
Click to expand...
Click to collapse
Hi trilu,
Great job.
Thank you.
Regarding diff command:
Code:
cd tytungs-hastarins-linux_on_wince_htc
git diff > ../bt.diff
{or}
git format-patch -o ../patches origin
trilu said:
how can i build a boot.img file for clk?
Click to expand...
Click to collapse
Create a folder including unyaffs, mkyaffs2image, unpack.sh, pack.sh, and boot.img (Get boot.img from cLK thread).
1. unpack.sh
Code:
if [ -f boot.img ]; then
rm -rf boot
mkdir boot
cd boot
../unyaffs ../boot.img
cd ..
rm -rf initrd
mkdir initrd
cd initrd
gzip -dc ../boot/initrd.gz | cpio -i
else
echo cannot find boot.img
fi
2. replace boot/zImage
3. pack.sh
Code:
cd initrd
find . | cpio -o -H newc | gzip -9 > ../boot/initrd.gz
cd ..
mkyaffs2image boot/ boot.img
Then you will get a modified boot.img.
5-7mA with WLAN, BT and GPS on MIUI 1.3.18 (Froyo 2.2.1)
Thank a lot
tytung said:
Create a folder including unyaffs, mkyaffs2image, unpack.sh, pack.sh, and boot.img (Get boot.img from cLK thread).
1. unpack.sh
Code:
if [ -f boot.img ]; then
rm -rf boot
mkdir boot
cd boot
../unyaffs ../boot.img
cd ..
rm -rf initrd
mkdir initrd
cd initrd
gzip -dc ../boot/initrd.gz | cpio -i
else
echo cannot find boot.img
fi
2. replace boot/zImage
3. pack.sh
Code:
cd initrd
find . | cpio -o -H newc | gzip -9 > ../boot/initrd.gz
cd ..
mkyaffs2image boot/ boot.img
Then you will get a modified boot.img.
Click to expand...
Click to collapse
trilu, can you make now a boot.img to test typhoon build?
If ur on clk and fastboot commands work i think u should be able to fastboot flash zimage zimage to update the kernel
is the hd2 now officially supported? cant see any news.. all devices have working RC2. what about official cyanogenmod for hd2 leo? cant see anything on their website
Evil_enc said:
is the hd2 now officially supported? cant see any news.. all devices have working RC2. what about official cyanogenmod for hd2 leo? cant see anything on their website
Click to expand...
Click to collapse
We'll never get official CM7 for the HD2 as the HD2 is not a native Android device, and there is licensing issues because of that.

[GUIDE] How to build kernel from source

Overview
Here are the steps to build your own kernel from source. This example does nothing special. It just shows you how to build the stock kernel. It is a good starting point to making your own stuff. Experts, please correct me where I am wrong. This stuff is still new to me also.
These instructions work for both T989 (T-Mobile) and I727 (AT&T) variants of the Samsung Galaxy S2 phones.
Special Thanks
Special thanks to "interloper" and "dtm_stretch" for helping me learn all of this. Couldn't have done it without them.
Requirements
I am using Ubuntu 10.10 32-bit to do all my builds
Instructions
1) Get Samsung Source Code
First you need to get a copy of the kernel source code from Samsung. You can download it from the link below.
For T-Mobile users download the one that says T989:
https://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=SGH-T989
For AT&T users download the one that says SGH-I727:
https://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=SGH-I727
2) Unzip Samsung Source Code
Unzip the source code you just download with this command:
For T989:
Code:
unzip SGH-T989_GB_Opensource.zip
For I727:
Code:
unzip SGH-I727_ATT_Opensource.zip
There will be 4 files extracted. The one we are interested in for this exercise is SGH-T989_Kernel.tar.gz for T989 devicees or SGH-I727_ATT_Kernel.tar.gz for I727 devices.
3) Extract Kernel
Next we need to extract the kernel into a directory.
For T989:
Code:
mkdir kernel
tar xzf SGH-T989_Kernel.tar.gz -C kernel
or
For I727:
Code:
mkdir kernel
tar xzf SGH-I727_ATT_Kernel.tar.gz -C kernel
4) Get a Copy of initramfs
Next you need to get a copy of the initramfs for your phone. For T989 users you can get the stock initramfs from bubby323's github here: https://github.com/bubby323/anomaly_kernel_platform_SGH-T989
For I727 users you must use the alternate method below to get the initramfs. T989 users can choose to use the link above or go with the alternate method below.
Alternate method:
You can extract it yourself from an existing boot.img file. I got mine off of my phone using clockworkmod backup (boot.img file) and using the extractboot tool to extract the initramfs. The tool can be downloaded here: http://www.mediafire.com/?lc12eceeh617b97
Extract extractboot.tar.gz
Code:
tar xzf extractboot.tar.gz
Call this to extract your boot.img to get the initramfs folder
Code:
extractboot boot.img
If you get any errors with calling extractboot, make sure "extractboot" and "split_bootimg.pl" are executable first. If not, use "chmod a+x extractboot" (do the same for split_bootimg.pl).
Once extracted, the "out/ramdisk" folder is your extracted initramfs folder.
reference: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
5) Download Arm Toolchain
This toolchain will allow you to cross compile for your phone. There are several versions to choose. I currently use the 2010q1 version here: https://sourcery.mentor.com/sgpp/li...1-188-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
Or choose another version if you like (version 2009q3 seems to be popular): https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription3053
6) Extract Toolchain
Code:
tar xjf arm-2010q1-188-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
7) Download mkbootimg Tools
Download mkbootimg tools from here: http://www.mediafire.com/?w06d1m6n1dgo4op
Extract the file with
Code:
tar xzf mkboottools.tar.gz
There will be three files
Code:
mkbootfs
mkbootimg
mkbootimg-sg2x
"mkbootimg" is the original program to make the boot image but is not used for our phone. Our phone requires an edit to the ramdisk address which is why I also included "mkbootimg-sg2x" which we will use instead.
*Extra Info: the default ramdisk offset is 0x01000000 while our phone needs 0x01400000.
Move the three files to somewhere in your system PATH.
8) Compile Script
Now we are ready to compile the kernel. I have provided a script below to automate the process. You will need to change the paths to work with your environment.
*For I727 users only: change "msm8660_celox_usa_tmo_defconfig" to "msm8660_celox_usa_att_defconfig" in the script below.
*Update: Thanks to InstigatorX for his comment:
Also, for ATT the celox make command should be "make msm8660_celox_usa_att_rev02_defconfig" to make the latest 2.3.6 kernel.
Click to expand...
Click to collapse
Code:
INITRAMFSDIR=~/t989/initramfs
export ARCH=arm
export CROSS_COMPILE=~/arm-2010q1/bin/arm-none-eabi-
cd kernel
make clean
make mrproper
make msm8660_celox_usa_tmo_defconfig
make -j4
# copy the freshly compiled modules to the initramfs.
cp crypto/ansi_cprng.ko $INITRAMFSDIR/lib/modules/
cp drivers/bluetooth/bthid/bthid.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/common/cpaccess.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/mach-msm/dal_remotetest.ko $INITRAMFSDIR/lib/modules/
cp drivers/net/wireless/bcm4330/dhd.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/mach-msm/dma_test.ko $INITRAMFSDIR/lib/modules/
cp drivers/input/evbug.ko $INITRAMFSDIR/lib/modules/
cp drivers/media/video/gspca/gspca_main.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/perfmon/ksapi.ko $INITRAMFSDIR/lib/modules/
cp drivers/video/backlight/lcd.ko $INITRAMFSDIR/lib/modules/
cp drivers/net/wireless/libra/librasdioif.ko $INITRAMFSDIR/lib/modules/
cp drivers/misc/msm_tsif.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/oprofile/oprofile.ko $INITRAMFSDIR/lib/modules/
cp drivers/crypto/msm/qcedev.ko $INITRAMFSDIR/lib/modules/
cp drivers/crypto/msm/qce.ko $INITRAMFSDIR/lib/modules/
cp drivers/crypto/msm/qcrypto.ko $INITRAMFSDIR/lib/modules/
cp drivers/scsi/scsi_wait_scan.ko $INITRAMFSDIR/lib/modules/
cp drivers/spi/spidev.ko $INITRAMFSDIR/lib/modules/
cp drivers/misc/tsif_chrdev.ko $INITRAMFSDIR/lib/modules/
cp drivers/misc/vibetonz/vibrator.ko $INITRAMFSDIR/lib/modules/
9) Get Compiled Kernel
The compiled kernel image is in the kernel source folder under "arch/arm/boot/zImage"
Copy the zImage file to a working area, preferably where you keep your initramfs folder.
Here is an example folder structure:
Code:
work
- zImage
- initramfs
10) Make boot.img File
Next we need to merge the kernel and initramfs directory into a boot.img file.
zip up ramdisk
Code:
mkbootfs initramfs | gzip > ramdisk.gz
make boot image
Code:
mkbootimg-sg2x --kernel zImage --ramdisk ramdisk.gz --cmdline "androidboot.hardware=qcom msm_watchdog.appsbark=0 msm_watchdog.enable=1 loglevel=4" -o boot.img --base 0x40400000 --pagesize 2048
11) tar boot.img
Tar your boot.img file so it can be flashed with Odin.
Code:
tar cvf MyKernel.tar boot.img
md5sum -t MyKernel.tar >> MyKernel.tar
mv MyKernel.tar MyKernel.tar.md5
12) Flash with Odin
Flash MyKernel.tar.md5 with odin under PDA. Please follow the flashing guides found in other posts. They do a better job at explaining.
13) Experiment *
Now try to customize your kernel to add in new features and experiment. I am going to learn how to compile the stock platform also. Once I know how I will post up a guide for that also. If someone already has a guide to build the platform please post. Also it would be great if you can post sources for me to read so I can learn how to build the platform. Thanks.
Optional
You might notice that the modules you compiled are significantly bigger than the original stock modules that came with the phone. That is because the stock modules were stripped of all debug info. To do this you need to run the below command at the end to get the "stripped" modules. Change INSTALL_MOD_PATH to point to any folder you like to hold the modules. You then need to copy these modules instead of the ones in the build script above.
Code:
make INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=~/stripped/modules modules_install
What's Next?
Go here to learn how to start making changes to your ROM: http://forum.xda-developers.com/showthread.php?p=23343879
Good heads up. Thanks for putting this out there.
Once edited this needs to get stuckod
Sent from my SGH-T989 using xda premium
Thanks so much for this! I've been trying to figure this out for months. (Learned alot in that time).
Kernel Built!
Daunting....ill stick to this side of the fence
Thanks though. Must be tough explaining all of that...
Sent from my Phablet. The Purple Phone Tablet.
Great info !! Super !
Some questions: 1. How does one allow for SELECTION of custom boot animation? Is that a kernel thing or some thing else?
2. What about adding things like Voodoo Sound or some mod like that?
Thanks for any info !!
chappatti said:
Great info !! Super !
Some questions: 1. How does one allow for SELECTION of custom boot animation? Is that a kernel thing or some thing else?
2. What about adding things like Voodoo Sound or some mod like that?
Thanks for any info !!
Click to expand...
Click to collapse
I am glad you like it. I wanted to post this guide up so that noobs like me have a good starting point to learn this stuff.
I can take a crack at answering your questions, but do note that I am also a noob:
1) I would think a custom boot animation would be part of the ROM but not sure
2) I do not know what Voodoo Sound is but if it is an application then it would be modifying the ROM. If it is an enhancement to the audio drivers then it is kernel. Either way I would not know what to change. Sorrry.
I know I wasn't much help. But I tried
By the way, I am currently trying to learn how to make my own custom ROM. If you know of any guides that would be great if you can post them here. I will definitely post what I find. Currently I am downloading ROMs from this forum and seeing what they did to learn. One thing I am still confused about is if these guys built these ROM from source or used the binaries from the Stock ROM as base.
Thanks.
Nice Guide man...
datzstr8 said:
I am glad you like it. I wanted to post this guide up so that noobs like me have a good starting point to learn this stuff.
I can take a crack at answering your questions, but do note that I am also a noob:
1) I would think a custom boot animation would be part of the ROM but not sure
2) I do not know what Voodoo Sound is but if it is an application then it would be modifying the ROM. If it is an enhancement to the audio drivers then it is kernel. Either way I would not know what to change. Sorrry.
I know I wasn't much help. But I tried
By the way, I am currently trying to learn how to make my own custom ROM. If you know of any guides that would be great if you can post them here. I will definitely post what I find. Currently I am downloading ROMs from this forum and seeing what they did to learn. One thing I am still confused about is if these guys built these ROM from source or used the binaries from the Stock ROM as base.
Thanks.
Click to expand...
Click to collapse
Roms such as AOKP or CM are compiled from source, otherwise known as AOSP. However, the majority of the roms you'll find here are not. To build a non-source rom a good starting point would be a system dump from your own phone, or find a pre-deodexed, stock base rom. From there, the tool of the trade is 7zip. View all the file via 7zip, pull files and modify. Now obviously, this is only a starting point, couldn't possibly go into advanced development with you. It takes time to learn and it's a lot of trial and error. Another helpful tool to learn is ADB commands and functionality. If you know this, it will save you a lot of time. Good luck!
This guide is a life-saver. I have compiled my own kernel for my desktop literally dozens of times, and have built distributions entirely from scratch two or three times (using Linux From Scratch), but was unable to figure this out myself due to the lack of a guide and things being scattered everywhere and people unwilling to help.
THANK YOU!!!!
I am really looking forward to your guide on how to build an Android system from scratch. I have also been trying to do this as well (Cyanogen), but am running into the same lack of information.
sombionix said:
Roms such as AOKP or CM are compiled from source, otherwise known as AOSP. However, the majority of the roms you'll find here are not. To build a non-source rom a good starting point would be a system dump from your own phone, or find a pre-deodexed, stock base rom. From there, the tool of the trade is 7zip. View all the file via 7zip, pull files and modify. Now obviously, this is only a starting point, couldn't possibly go into advanced development with you. It takes time to learn and it's a lot of trial and error. Another helpful tool to learn is ADB commands and functionality. If you know this, it will save you a lot of time. Good luck!
Click to expand...
Click to collapse
So Som,
When are we going to see another nice Bionix build from you. anything in plan or not really.
An automation script would be a juicy treat and i may have just the thing...will need to be modified for this and tested but tomorrow (today, oh look at the time) i can put it together. Also, try building using make gconfig. Load your default config with the gui and you can see what bits of the kernel can be changed.
Sent from my SPH-D710 using xda premium
Very nice guide! Thanks a lot!
I wondering about what is the difference between Hercules and Skyrocket sources? Is it only this "*For I727 users only: change "msm8660_celox_usa_tmo_defconfig" to "msm8660_celox_usa_att_defconfig" in the script below." ?
erickwill said:
Very nice guide! Thanks a lot!
I wondering about what is the difference between Hercules and Skyrocket sources? Is it only this "*For I727 users only: change "msm8660_celox_usa_tmo_defconfig" to "msm8660_celox_usa_att_defconfig" in the script below." ?
Click to expand...
Click to collapse
You will still need the proper source for i727. Config file just tells the compiler what to build.
:: LOVE MY HATERS :: DARKSIDE ::
These instructions assume the user already has the boot.img tools, bubby's initramfs and source code from the OP
1. Create a directory called t989-kernel
2. Download this package of tool chains and unzip it, making sure it is named "toolchains" toolchains
NOTE: There are many toolchains included in this pack and I have used them all to make kernel for the E4GT and they are all
sufficient for this task. However, should you move on to 3.X kernel I suggest using the Mjolnar or Linaro tools as they
are more suitable for that version.
3. Inside the "t989" directory deposit bubby's initramfs, the kernel source (extracted directory), toolchains and boot.img tools.
4. The names of the directories must be "ramdisk", "kernel" (kernel source), "toolchain", and "bin". Change them accordingly.
5. Put the attached "tmo-build.sh" into the "kernel" directory
6. Edit line 9 to reflect you version number and name. It will be what you see when you look at the phone properties
7. Change line 20 of the script to reflect your machine's name
8. cd into "kernel"
9. Type "./tmo-build.sh" and watch the magic as your kernel is made right before your eyes!
10. Go to "kernel_tmp/out" and get your shiny new homemade kernel complete with custom recovery and all the fixins'
NOTE: You can change line 41 to say "make gconfig" if you have GTK2 installed on your system. This will allow you to launch a GUI
through the script to make changes in a visual manner. If you get any "file not found" or "no such file" etc, make sure the
permissions are set to executable for all directories/files.
I'm still working on the error logging output so I will post an updated script as soon as it's ready. For the i727 users I will post a script for you too, but to make this work for you all you need to do is choose the make gconfig route and load your def_config from /arch/arm/configs/
Enjoy the silence!
interloper, thanks for the great script!!! This will help a lot of people.
afawzi said:
So Som,
When are we going to see another nice Bionix build from you. anything in plan or not really.
Click to expand...
Click to collapse
+1
From a galaxy better than yours.
I am starting another GUIDE post on how to modify your ROM here: http://forum.xda-developers.com/showthread.php?p=23343879
Sweet guide. Worked great. Only thing I had issue with was Haptic feedback and WiFi wouldn't work. Any ideas? I'm on the SkyRocket.
Also, for ATT the celox make command should be "make msm8660_celox_usa_att_rev02_defconfig" to make the latest 2.3.6 kernel.
how do you make it cwm flashable?

[PATCH] Replace built-in gapps by Cache gapps and avoid flashing errors

Hello,
As you maybe know there are several types of Wildfire S : some seem to have more internal space than others. So it isn't rare for the owners of Wildfire S with less internal space to get errors while flashing roms in recovery. I think about
Code:
Error status 7 : some symlinks failed.
. I personnally have one of these Wildfire S, and I fix the problem by deleting the built-in gapps that are included in the ROM and replacing them by the cfx ones, that are installed in the /cache partition. But most of people don't do that, or don't know how to do that, and they often can't flash all the roms they want. That's why I've made a linux script to replace automatically built-in gapps by cache ones.
HOW TO USE
Basically, this script is a Bash shell. Just launch it with
Code:
bash patch_gapp_cache.sh <name_of_the_rom_to_patch.zip>
(be sure it is executable with
Code:
chmod +x patch_gapp_cache.sh
before !)
You have one option : if you launch the script with -d, it will just remove built-in gapps and re-zip the ROM. Useful for people who do not want to depend on Google...
WHAT IT DOES
It will extract the rom file to a temp folder, download the gapps adapted to the rom's android version, install them in cache, update the updater-script and re-zip the file. You'll get your patched rom in the folder .patch_gapps_cache located in your home directory. be careful, it is a hidden folder, you may not see it at first sight. If so, just select "Show hidden files" in the options of your fifle explorer.
For now, it works only with Android 4.1 as it is the only android version that takes too much space in /system. I'll add support for other Android versions if you want.
CREDITS
rallapag for the idea of cache gapps and the first jb ones
SeeKai for proposing a remove-only option
Google Drive for hosting
Bash shell that allow us to make fantastic scripts easily
DOWNLOADS
Sorry, there is only a Linux version for now... I don't know how to make scripts without C++ or Python on Windows, tell me if you know.
You can find the latest version for Linux here.
CHANGELOG
2/4/2013 - Fixed a little bug
1/4/2013 - Added -d option for remove only
1/4/2013 - First release
WHAT'S THE POINT OF THIS SCRIPT ???
For every Wildfire S with less internal storage owner, it allow you to flash every rom, without any bugs and without asking the dev to slim it. For example by patching the 28-03 version of djolivier's Nameless ROM you will be able to flash it without any problems
For the devs, it clears your rom's thread of all the posts like
noob said:
Dude your ROM isn't working every time I try to flash it I get error status 7 in recovery !
Click to expand...
Click to collapse
Correct me if I'm wrong, I'm not that familiar with ROM-packaging, but could I remove GAPPS altogether by removing these lines in your script:
Code:
mkdir ~/tmp/patch_gapps_cache_temp/cache_gapps
wget -P ~/tmp/patch_gapps_cache_temp/cache_gapps http://205.196.121.248/ebe0qr6bmepg/5t5gdv55vcdvewr/gapps_cache-cfx-jb-20120815-stripped.zip
echo "Extracting..."
unzip -q ~/tmp/patch_gapps_cache_temp/cache_gapps/gapps_cache-cfx-jb-20120815-stripped.zip -d ~/tmp/patch_gapps_cache_temp/cache_gapps/
echo "Copying new files..."
cp -R ~/tmp/patch_gapps_cache_temp/cache_gapps/system ~/tmp/patch_gapps_cache_temp/original_ROM
cp -R ~/tmp/patch_gapps_cache_temp/cache_gapps/cache ~/tmp/patch_gapps_cache_temp/original_ROM
echo "Updating updater-script..."
updater_script_cache=`cat ~/tmp/patch_gapps_cache_temp/cache_gapps/META-INF/com/google/android/updater-script`
echo -e $updater_script_cache >> ~/tmp/patch_gapps_cache_temp/original_ROM/META-INF/com/google/android/updater-script
Or will that render the newly created ROM unusable?
I love CM7 for not including GAPPS as it gives me the liberty to NOT use Google when I don't want to. (I get my apps form androidpit.)
SeeKai said:
Correct me if I'm wrong, I'm not that familiar with ROM-packaging, but could I remove GAPPS altogether by removing these lines in your script:
Code:
mkdir ~/tmp/patch_gapps_cache_temp/cache_gapps
wget -P ~/tmp/patch_gapps_cache_temp/cache_gapps http://205.196.121.248/ebe0qr6bmepg/5t5gdv55vcdvewr/gapps_cache-cfx-jb-20120815-stripped.zip
echo "Extracting..."
unzip -q ~/tmp/patch_gapps_cache_temp/cache_gapps/gapps_cache-cfx-jb-20120815-stripped.zip -d ~/tmp/patch_gapps_cache_temp/cache_gapps/
echo "Copying new files..."
cp -R ~/tmp/patch_gapps_cache_temp/cache_gapps/system ~/tmp/patch_gapps_cache_temp/original_ROM
cp -R ~/tmp/patch_gapps_cache_temp/cache_gapps/cache ~/tmp/patch_gapps_cache_temp/original_ROM
echo "Updating updater-script..."
updater_script_cache=`cat ~/tmp/patch_gapps_cache_temp/cache_gapps/META-INF/com/google/android/updater-script`
echo -e $updater_script_cache >> ~/tmp/patch_gapps_cache_temp/original_ROM/META-INF/com/google/android/updater-script
Or will that render the newly created ROM unusable?
I love CM7 for not including GAPPS as it gives me the liberty to NOT use Google when I don't want to. (I get my apps form androidpit.)
Click to expand...
Click to collapse
Yes I think it should not make the ROM unusable do you think I should provide an option just to remove gapps and not to replace them ?
Envoyé depuis mon Wildfire S A510e
izi501 said:
do you think I should provide an option just to remove gapps and not to replace them ?
Click to expand...
Click to collapse
Well, you could make your script more versatile if it would accept a parameter by which it wouldn't replace GAPPS, but just delete it. Or post a version without the replace code, that's up to you of course.
Or you could spare yourself the hassle and let me edit the script myself
SeeKai said:
Well, you could make your script more versatile if it would accept a parameter by which it wouldn't replace GAPPS, but just delete it. Or post a version without the replace code, that's up to you of course.
Or you could spare yourself the hassle and let me edit the script myself
Click to expand...
Click to collapse
If you wanna do it, no problem, but I can do it myself as it is just a little condition to add Will upload asap, this evening I hope...
Envoyé depuis mon Wildfire S A510e
Merci bien, pas de précipitation!

Making a CM11.0 kernel for E980?

Hello fellow OGPers...
So I've been jumping from ROM to ROM for a solid few months now. Really enjoyed my time as an Android user and soaked in a lot. I've been learning (well... teaching myself) about Linux and other related things. But I've been busy with classes, a social life, and other commitments. Anyway let me cut to the chase. I really enjoyed it in 4.3 ROMs when I could use all the settings on the AOSP custom kernel for our device and among other things liked the experience of a custom kernel. It's about time we got one for 4.4.x Kitkat... right?
I am currently running Windows 7 (if specs are important I will post them) with a Linux Mint distro (both are 64-bit). I have downloaded the CM11.0 from github and a few toolchains. I haven't untared them yet or anything, but I have some. One is specialized for Cortex A-15, which I read our device's CPU is much alike to. Anyway I just wanted some help getting started with making a kernel is what it comes down to. I have basic Linux knowledge and that's about it. I just want to get a custom kernel out and then maybe in the future get a nice battery-optimized kernel out. I forgot to grab a kernel patch and I'll download it tomorrow probably. But I really don't know where to start at all. Do I need knowledge of anything or some more experience knowledge? If anybody can point me in a good direction that would be great. Everything is appreciated.
Oh and feel free to PM me answers as well if it's easier or more convenient for you.
Thanks guys!
This would be great as we need a kernel Dev ... Good luck on your journey !
2SHAYNEZ
If you only want to compile kernel,clone this repository.
git clone https://github.com/CyanogenMod/lge-kernel-gproj/tree/cm-11.0
make any change you want to do with the source.
Download android toolchain and extract it.
Compile the kernel sources with
export ARCH=arm CROSS_COMPILE=/path.to.toolchain/bin/arm-eabi- && make cyanogenmod_e980_defconfig && make -j#
(# is the number of your computer cores +1)
you will get zimage in /arch/arm/boot folder
Using boot.img(the kernel) from official CM build zip to get the ramdisk is easier
abootimg -x boot.img
you will see:
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
put the extracted initrd.img and bootimg.cfg to /arch/arm/boot(where your compiled zimage are)
run:
abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img
You will get the boot.img!
This is the complete kernel!
Use any previous kernel zip, and replace the boot.img inside the zip with yours.
Flash it and test it.
My TWRP 2.8.0.0 or TWRP from freegee or Philz Touch will auto lokify the kernel.
Wing
Attached is the kernel.zip that i use.
Replace the your finished boot.img with it~~
Wing
BTW i am not programmer, but i am a very long time gentoo linux and archlinux user, long before android exist~
mukwing said:
If you only want to compile kernel,clone this repository.
git clone https://github.com/CyanogenMod/lge-kernel-gproj/tree/cm-11.0
make any change you want to do with the source.
Download android toolchain and extract it.
Compile the kernel sources with
export ARCH=arm CROSS_COMPILE=/path.to.toolchain/bin/arm-eabi- && make cyanogenmod_e980_defconfig && make -j#
(# is the number of your computer cores +1)
you will get zimage in /arch/arm/boot folder
Using boot.img(the kernel) from official CM build zip to get the ramdisk is easier
abootimg -x boot.img
you will see:
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
put the extracted initrd.img and bootimg.cfg to /arch/arm/boot(where your compiled zimage are)
run:
abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img
You will get the boot.img!
This is the complete kernel!
Use any previous kernel zip, and replace the boot.img inside the zip with yours.
Flash it and test it.
My TWRP 2.8.0.0 or TWRP from freegee or Philz Touch will auto lokify the kernel.
Wing
Click to expand...
Click to collapse
Wow thank you so much... definitely going to give this a shot today! So I didn't have to download the 12 GB source... good to know.
Oh and one more thing. Is there any difference from building a CM11 kernel vs an AOSP 4.4.x kernel? I figured since most of our device's ROMs are CM based this would work fine... Thank you very much for the information at hand! Appreciated.
CM kernel is different from AOSP kernel from what i know.
CM kernel is base on CAF(which is optimized for msm chip) and AOSP kernel base on google original code.
They are a bit different so imcompatible from what i know.
Wing
When I compile there are loads of errors and eventually it stops (at different times each attempt...) anyway, the first thing I notice is this:
warning: (ARCH_MSM7X27 && ARCH_MSM8960 && ARCH_MSM8930 && ARCH_MSM8974) selects DONT_MAP_HOLE_AFTER_MEMBANK0 which has unmet direct dependencies (SPARSEMEM)
warning: (ARCH_MSM7X27 && ARCH_MSM8960 && ARCH_MSM8930 && ARCH_MSM8974) selects DONT_MAP_HOLE_AFTER_MEMBANK0 which has unmet direct dependencies (SPARSEMEM)
Is that anything I have to worry about? I can't find anything online about it. Thanks in advance.
First, is it unmodified cm kernel sources?
Make sure to use unmodified sources to test building first.
Somes errors can safely ignored.The msm8960 error can safty ignore. It has nothing to do with our device.
If it failed to build, try using option like -Xlint.
Sometimes, using older build of toolchain is easier to build, e.g.gcc4.7 or 4.8
Gcc 4.9 always failed to build e980 cm kernel.
mukwing said:
First, is it unmodified cm kernel sources?
Make sure to use unmodified sources to test building first.
Somes errors can safely ignored.The msm8960 error can safty ignore. It has nothing to do with our device.
If it failed to build, try using option like -Xlint.
Sometimes, using older build of toolchain is easier to build, e.g.gcc4.7 or 4.8
Gcc 4.9 always failed to build e980 cm kernel.
Click to expand...
Click to collapse
Ohhh okay. Yeah it's all unmodified and I've downloaded tons of "needed" packages (including most likely unnessesary ones too). I'm using a 4.9 GCC. That might be it. Okay thanks. I'll give another shot tomorrow when I have access to my VM.
Kernel has been successfully compiled. Check here for download and further discussion...
http://forum.xda-developers.com/optimus-g-pro/orig-development/kernel-e980-kernel-t2872514

unpack/repack boot.img : Here is the solution ! :)

Hi everynone,
I was building a kernel for the pixel c. I could build it, now the only problem i have is i can't unpack / repack boot.img of the pixel c (i would like to unpack it in order to extract the ramdisk ans generate the boot.img).
How do you generate boot.img after you have the compiled kernel image on a pixel c ?
These informations are very important to understand and mod Pixel C.
I will be very interested too to have some info about how to unpack/repack boot.img for pixel c (as it's a chromeos boot image)
Thanks a lot in advance,
Mathieu
Ok so after some analysis, here is what i understood :
boot.img contains in itself an android boot.img at the adress 0x1000.
So to extract the android boot.img image, we can use dd :
dd if=chromeosBoot.img of=androidBoot.img skip=8192 bs=8
This will extract the androidBoot.img. Then we will be able to use split_bootimg.pl to extract the kernel and the ramdisk (compressed in gz).
Now my questions : from 0x0 to 0x1000 in chromos boot img, there is some data i still don't understand clearly.
I would like to try to replace the kernel and the ramdisk, and then repack all keeping the same data from 0x0 to 0x1000.
Do you think it's gonna work ?
What are the risks to do so (i don't want to brick too much my tablet...)
Thanks a lot for your help,
Hope my researches will be helpful for other developers.
Mathieu
Samt434 said:
Ok so after some analysis, here is what i understood :
boot.img contains in itself an android boot.img at the adress 0x1000.
So to extract the android boot.img image, we can use dd :
dd if=chromeosBoot.img of=androidBoot.img skip=8192 bs=8
This will extract the androidBoot.img. Then we will be able to use split_bootimg.pl to extract the kernel and the ramdisk (compressed in gz).
Now my questions : from 0x0 to 0x1000 in chromos boot img, there is some data i still don't understand clearly.
I would like to try to replace the kernel and the ramdisk, and then repack all keeping the same data from 0x0 to 0x1000.
Do you think it's gonna work ?
What are the risks to do so (i don't want to brick too much my tablet...)
Thanks a lot for your help,
Hope my researches will be helpful for other developers.
Mathieu
Click to expand...
Click to collapse
Thanks for the unpacking help .. works quick and good.
It´s actually the same like ..
Code:
dd if=boot.img of=unpacked.img ibs=65536 skip=1
Have the same problem, as I want to repack Pixel C boot.img ..etc.
For the repacking part I was searching heavily .. like you.
boot-split.pl or mkbootimg is done ... only the signing part is missing ?!?
Here is a part of the solution : ( working on ubuntu 14.04 )
Code:
apt-get install vboot-kernel-utils
Code:
vbutil_kernel --repack boot.img --oldblob xceed-kernel-google-dragon-v6.10-RELEASE-mxc14g.img --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk
the output ...
Code:
Key block:
Size: 0x4b8
Flags: 7 !DEV DEV !REC
Data key algorithm: 4 RSA2048 SHA256
Data key version: 1
Data key sha1sum: d6170aa480136f1f29cf339a5ab1b960585fa444
Preamble:
Size: 0xfb48
Header version: 2.2
Kernel version: 1
Body load address: 0x100000
Body size: 0x57d000
Bootloader address: 0x67c000
Bootloader size: 0x1000
Body verification succeeded.
Just took the xceed kernel as example .. works with all other "CHROMEOS" images too.
But to sign a changed kernel it seems you need more/other parameter.
Still searching ...
Time to boot soon
Cheers
More infos !
Here is where my researches are :
You need to get and compile vboot_reference in order to have the lastest version :
git clone https://chromium.googlesource.com/chromiumos/platform/vboot_reference
after this :
futility vbutil_keyblock --pack boot.img.keyblock --datapubkey kernel_data_key.vbpubk --signprivate kernel_data_key.vbprivk
and next :
echo " " > empty.txt
futility vbutil_kernel --pack boot.img --keyblock boot.img.keyblock --signprivate kernel_data_key.vbprivk --version 1 --vmlinuz boot.img.unsigned --config empty.txt --arch arm --bootloader empty.txt --flags 0x1
And now it seems we have a valid boot.img image !
Thanks a lot for your researches followmsi, i was blocked due to the fact i couldn't generate a signing key, but it seems that the keys are public finally (in tests/devkeys/ of vboot_reference project) !!
Next step for me :
fastboot flash boot boot.img
This comment here helped me a lot :
https://bbs.archlinux.org/viewtopic.php?id=207385
Thanks anatolik if you read this !
Mathieu
I could unpack/repack the stock kernel with this :
From the boot.img :
dd if=boot.img of=androidBoot.img skip=8192 bs=8
Click to expand...
Click to collapse
This gives you the Android boot.img
then, we can use
split_bootimg.pl androidBoot.img
Click to expand...
Click to collapse
in order to extract the kernel.img and the ramdisk.gz.
To repack :
mkbootimg --kernel kernel.img --ramdisk ramdisk.gz --output boot.img.unsigned
futility vbutil_keyblock --pack boot.img.keyblock --datapubkey kernel_data_key.vbpubk --signprivate kernel_data_key.vbprivk --flags 7
futility vbutil_kernel --pack boot.img --keyblock boot.img.keyblock --signprivate kernel_data_key.vbprivk --version 1 --vmlinuz boot.img.unsigned --config empty --arch arm --bootloader empty --flags 0x1
Click to expand...
Click to collapse
We flash the new kernel :
fastboot flash boot boot.img : the kernel repacked is booting correctly !!
Samt434 said:
I could unpack/repack the stock kernel with this :
From the boot.img :
This gives you the Android boot.img
then, we can use
in order to extract the kernel.img and the ramdisk.gz.
To repack :
We flash the new kernel :
fastboot flash boot boot.img : the kernel repacked is booting correctly !!
Click to expand...
Click to collapse
Well done!
Works like a charm .. Thanks !
Just made a new stock rooted encrytable kernel for Pixel C .. to be installed via TWRP.
http://forum.xda-developers.com/pixel-c/development/twrp-flashable-monthly-update-zip-pixel-t3375591
Cheers
How to build pixel c kernel
Hi Samt434,
I have downloaded pixel c kernel code from chrome os git.
But I don't know which build config should I use or set.
When build other nexus device, from example, Nexus 9, I use:
make tegra_defconfig
make -j4
But what I should to do this for pixel c kernel code?
Thanks very much!
Samt434 said:
Ok so after some analysis, here is what i understood :
boot.img contains in itself an android boot.img at the adress 0x1000.
So to extract the android boot.img image, we can use dd :
dd if=chromeosBoot.img of=androidBoot.img skip=8192 bs=8
This will extract the androidBoot.img. Then we will be able to use split_bootimg.pl to extract the kernel and the ramdisk (compressed in gz).
Now my questions : from 0x0 to 0x1000 in chromos boot img, there is some data i still don't understand clearly.
I would like to try to replace the kernel and the ramdisk, and then repack all keeping the same data from 0x0 to 0x1000.
Do you think it's gonna work ?
What are the risks to do so (i don't want to brick too much my tablet...)
Thanks a lot for your help,
Hope my researches will be helpful for other developers.
Mathieu
Click to expand...
Click to collapse
make dragon_defconfig
Cheers
Sent from my Nexus 10 using Tapatalk
Samt434 said:
I could unpack/repack the stock kernel with this :
From the boot.img :
This gives you the Android boot.img
then, we can use
in order to extract the kernel.img and the ramdisk.gz.
To repack :
We flash the new kernel :
fastboot flash boot boot.img : the kernel repacked is booting correctly !!
Click to expand...
Click to collapse
hi Samt434,
I followed the instructions to flash my repacked boot image, and fastboot boot boot.img
After the boot animation, my Pixel C keeps telling me "To start Android, enter your password"
But I didn't setup any password
any clue? thanks
Samt434 said:
Here is where my researches are :
You need to get and compile vboot_reference in order to have the lastest version :
git clone https://chromium.googlesource.com/chromiumos/platform/vboot_reference
Click to expand...
Click to collapse
Is there someplace that I can download this from (already compiled)? Thanks, in advance.
I'm just trying to edit fstab.dragon, changing from force encrypt to encrytable.
cam30era said:
Is there someplace that I can download this from (already compiled)? Thanks, in advance.
I'm just trying to edit fstab.dragon, changing from force encrypt to encrytable.
Click to expand...
Click to collapse
if you have TWRP, do you mind testing https://build.nethunter.com/android-tools/no-verity-opt-encrypt/no-verity-opt-encrypt-5.1.zip for me?
It should do what you want if it succeeds. I'd like a recovery.log either way.
jcadduono said:
if you have TWRP, do you mind testing https://build.nethunter.com/android-tools/no-verity-opt-encrypt/no-verity-opt-encrypt-5.1.zip for me?
Click to expand...
Click to collapse
I will try it and report back, in a day or two. Thank you very much for the response.
@jcadduono,
It works. Thank you very much. Recovery log attached.
cam30era said:
@jcadduono,
It works. Thank you very much. Recovery log attached.
Click to expand...
Click to collapse
Thanks a lot! This is great news It also means Pixel C custom kernel dev can take advantage of https://github.com/jcadduono/lazyflasher now if they like!
It allows you to simply git clone, put an Image.gz-dtb in the folder, and type 'make' and you've got a TWRP flashable kernel!
If you guys want a simpler way to extract the boot images, you can use https://github.com/jcadduono/android_external_libbootimg
"make" will produce bootimg.exe for windows, bootimg for linux & mac. you can use "make bootimg" for just linux/mac.
Unfortunately it can only unpack ChromeOS images (bootimg xv boot.img) and not modify or create them. It will strip the ChromeOS signature and header if you do use the create/update functions of it, but you can just use futility vbutil_kernel to sign it again.
While it would certainly be nice to add the option to pack/modify ChromeOS images without needing futility, the feature alone would make my project increase in size tenfold.
Prebuilt binaries are here: https://build.nethunter.com/possibly-the-coolest-things/bootimg/
jcadduono said:
It will strip the ChromeOS signature and header if you do use the create/update functions of it, but you can just use futility vbutil_kernel to sign it again.
Click to expand...
Click to collapse
Where can I find the futility vbutil_kernel? I'd still like to be able to manually modify fstab.dragon myself.
Thanks for all of this. Much appreciated.
cam30era said:
Where can I find the futility vbutil_kernel? I'd still like to be able to manually modify fstab.dragon myself.
Thanks for all of this. Much appreciated.
Click to expand...
Click to collapse
It depends on Android libc and libcrypto inside Android build environment so it's not exactly portable but might be possible to force it static and include libc. I tried to do that myself but libcrypto doesn't seem to want to build staticly.
I'd suggest doing a shallow depth repo init of Omni 6.0 TWRP manifest if you want a smallish Android build tree to work with, allowing you to build the tool.
jcadduono said:
It depends on Android libc and libcrypto inside Android build environment so it's not exactly portable but might be possible to force it static and include libc. I tried to do that myself but libcrypto doesn't seem to want to build staticly.
I'd suggest doing a shallow depth repo init of Omni 6.0 TWRP manifest if you want a smallish Android build tree to work with, allowing you to build the tool.
Click to expand...
Click to collapse
I didn't understand a word you said.... You might as well have been speaking Greek!
I did get the part about it not being portable though. Obviously, I'm not a developer.
I'll just stick with your TWRP flashable zip!
Thanks for the feedback, though. I do appreciate it.
cam30era said:
I didn't understand a word you said.... You might as well have been speaking Greek!
I did get the part about it not being portable though. Obviously, I'm not a developer.
I'll just stick with your TWRP flashable zip!
Thanks for the feedback, though. I do appreciate it.
Click to expand...
Click to collapse
Another option as well is to flash your modified normal android boot image to your device.
Download no-verity-opt-encrypt zip 5.1+ and add a file in the patch.d folder of the zip, this should be the file's contents:
Code:
#!/sbin/sh
. "$env"
> "$split_img/boot.img-chromeos"
exit 0
(you can remove the verity/opt encrypt scripts from patch.d if you want to as well)
This will convince the zip to sign it for ChromeOS before flashing it back to the device
jcadduono said:
Another option as well is to flash your modified normal android boot image to your device.
Download no-verity-opt-encrypt zip 5.1+ and add a file in the patch.d folder of the zip, this should be the file's contents:
Code:
#!/sbin/sh
. "$env"
> "$split_img/boot.img-chromeos"
exit 0
This will convince the zip to sign it for ChromeOS before flashing it back to the device
Click to expand...
Click to collapse
I'll give it a try and let you know. Thank you.
@jcadduono,
Why don't you post your mods in the Android Development section for Pixel C. This doesn't get much visibility here, in Q&A.

Categories

Resources