Developed and tested on Linux. Its a shell script that requires the Android SDK to be installed with the tools directory in the PATH variable.
INTRO
Android Binary Resource Compiler (abrc). This is a command-line
script to compile resources such as NinePatch PNGs and layout XML
files to Android binary format. The compiled resources named in the
command are extracted and saved out into a separate location. This
script was developed as an alternative to using Eclipse and "unzip" to
compile and extract NinePatch PNGs during the creation of custom
Android UI themes.
USAGE
abrc usage
abrc help
abrc [options] compile <project dir> <output dir> <resource file1> <resource file2> ...
abrc [options] setup <project dir>
OPTIONS:
-v Enable verbose output
-o Overwrite files without prompting
Click to expand...
Click to collapse
COMPILE
The compile operation compiles the resources in the <project dir>
location. This can be any Android Eclipse project directory which
contains the resources you wish to compile and extract. You can also
use this script's "setup" syntax to create a minimal project without
using Eclipse. See the SETUP section below for more information.
The named resource files <resource file1> <resource file2>, etc., are
then extracted into the <output directory>. Parent path components in
the resource file names are preserved and also determine the extracted
location within the output directory.
Example:
Consider the following path in "MyProject" which contains, among other
things, the statusbar_background.9.png file. This file is in the format
created by draw9patch program.
MyProject/res/drawable-mdpi/statusbar_background.9.png
The following command compiles the resources in MyProject and writes
the output to the MyTheme/framework-res directory using the leading
path components of the specified resource file(s). I.e., In this
example the resulting output file is
MyTheme/framework-res/res/drawable-mdpi/statusbar_background.9.png
abrc compile MyProject MyTheme/framework-res res/drawable-mdpi/statusbar_background.9.png
Click to expand...
Click to collapse
SETUP
The setup operation is completely optional. It creates a minimal
project skeleton for compiling resources. Eclipse projects can also
be used in the compile step above.
abrc setup MyProject
Click to expand...
Click to collapse
The above command creates the following directory structure/files:
MyProject/res/drawable
MyProject/res/drawable-mdpi
MyProject/res/drawable-hdpi
MyProject/res/layout
MyProject/AndroidManifest.xml
Click to expand...
Click to collapse
Copy your resources into the appropriate location within the project
and then use the compile operation to compile and extract the binary
files.
How does it work? It calls aapt and then unzip compiled resources? It's too small to do this directly.
Yes, that's what it does. It's just a shell script so you can look at it and see. There are some comments in the script that explains things.
It relies on the Android SDK which is assumed to already be installed.
Sent from my FroyoEris using XDA App
Nice! Makes a lot of things easier.
how can we use this script with windows 7?
h_zee13 said:
how can we use this script with windows 7?
Click to expand...
Click to collapse
There's a chance it might work using Cygwin (www.cygwin.com). Be sure to include the zip compression utilities package when installing.
this is great! i hated having to fire up eclipse for this. thanks!
This is a great tool. It was a little confusing at first, I don't think I had my path set up correctly. I've found the easiest way to use this, for me anyway, was to use the setup command and make a new folder with it, I deleted the m and ldpi folders because i'm not using them, copied my .9s into the drawable-hdpi folder, and from inside the "project" directory ran,
abrc compile . done res/drawable-hdpi/*
This compiles all the images in there and places them in the done folder.
Hope i'm not stepping on any toes, just what I found to be the easiest after placing aapt in /usr/tools/ and android.jar in /usr/ as I was kinda confused when I first downloaded it.
abrc for cygwin
h_zee13 said:
how can we use this script with windows 7?
Click to expand...
Click to collapse
I've edited this script and it works on cygwin. go here and download it. -> https ://plus.google.com/118270346235276777406/posts/EJGWifY5kTh
so im trying to get this to work but no luck if someone could help me
first i set paths
Code:
export PATH=${PATH}:/home/suphi/Documents/android-sdk-linux/tools:/home/suphi/Documents/android-sdk-linux/platform-tools:/home/suphi/Documents/android-sdk-linux/apktool
then i run this code
Code:
abrc compile before after res/drawable-hdpi/*
then i get this error
Code:
Using aapt to compile resources to /tmp/resources-82KEfVduDK.zip
W/asset ( 4429): Asset path /home/suphi/Documents/android-sdk-linux/android.jar is neither a directory nor file (type=1).
ERROR: Asset package include '/home/suphi/Documents/android-sdk-linux/android.jar' not found.
i also put the aapt from platform-tools into tools folder as i was getting errors before saying aapt was missing from tools folder
Splder said:
so im trying to get this to work but no luck if someone could help me
<snip>
i also put the aapt from platform-tools into tools folder as i was getting errors before saying aapt was missing from tools folder
Click to expand...
Click to collapse
There are several 'tools' folders. It belongs in the platforms/android-N/tools folder where the 'N' in android-N is a number (API level). Making copies might also cause problems, so I would try and figure out why its missing from the tools directory in the first place.
Ken
no need to use abrc to prepare compiled 9patch pngs, just using aapt in android-sdk is ok, the command line is like this: aapt.exe c -v -S /path/to/project -C /path/to/destination
Hi @kellinwood and ALL
Had being advised by your awesome work by @Modding.MyMind here, I've came to ask for your orientation.
At the moment, AFAIK, we are uncapable to compile xml's without providing all the resources addressed by them.
My objective here is try to compile modded XMLs only. While trying to accomplish this task, I've got to the following Python script that will generate all the /res/values/*.xml's that addresses local resources.
Code:
import os
import shutil
input_folder = '/home/Kdio/apk/Phone'
output_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "out")
if not os.path.isdir(output_folder):
os.mkdir(output_folder)
tokens = {}
xmlExist = {}
for root, dirs, files in os.walk(input_folder):
for f in files:
inputFile = os.path.join(root, f)
filename, ext = os.path.splitext(inputFile)
if (ext != '.xml'):
continue
xmlExist[os.path.basename(inputFile)] = 1
with open(inputFile, 'r') as f:
for line in f:
token = ''
read_token = False
for c in line:
if (c == '@'):
read_token = True
continue
if (read_token is True):
if (c == '"'):
read_token = False
tokens[token] = 1
token = ''
else:
token += c
f.close()
xmls = {}
for token in sorted(tokens):
if (token == 'null'):
continue
if (':' in token):
continue
#token = token.split(':')[-1]
head, tail = token.split('/')
if (head == 'anim'):
continue
if ((tail + '.xml') in xmlExist.keys()):
continue
if (not head in xmls.keys()):
xmls[head] = {}
xmls[head][tail] = 1
#for xml in xmls:
# for res in xmls[xml]:
# print(xml + ' -> ' + res)
for xml in xmls:
xmlText = '<?xml version="1.0" encoding="utf-8"?>\n<resources>\n'
for res in xmls[xml]:
if (xml == 'bool'):
xmlText += ' <bool name="' + res + '">false</bool>\n'
if ((xml == 'id') or (xml == 'drawable') or (xml == 'style') or (xml == 'layout')):
xmlText += ' <item type="' + xml + '" name="' + res + '">false</item>\n'
if (xml == 'array'):
xmlText += ' <string-array name="' + res + '">\n <item>array-dummy</item>\n </string-array>\n'
if (xml == 'attr'):
xmlText += ' <attr name="' + res + '" format="string" />\n'
if (xml == 'color'):
xmlText += ' <color name="'+ res + '">#00000000</color>\n'
if (xml == 'dimen'):
xmlText += ' <dimen name="' + res + '">1.0dip</dimen>\n'
if (xml == 'integer'):
xmlText += ' <integer name="' + res + '">1</integer>\n'
if (xml == 'plural'):
xmlText += ' <plurals name="' + res + '">\n <item quantity="other">a</item>\n <item quantity="one">b</item>\n </plurals>\n'
if (xml == 'string'):
xmlText += ' <string name="' + res + '">a</string>\n'
if (xml == 'fraction'):
xmlText += ' <fraction name="' + res + '">1%</fraction>\n'
xmlText += '</resources>\n'
f = open(os.path.join(output_folder, xml + 's.xml'), 'w')
f.write(xmlText)
f.close
Please edit 'input_folder' accordingly.
Then, issuing the below command:
Code:
aapt p -f -M onlyXMLs/AndroidManifest.xml -F onlyXMLs.zip -S onlyXMLs/res -I android.jar
What I get from it now are errors regarding external resources references not being found only.
This is exactly the point where my shallow knowledge ends ...
Could you (and all) someway point me the light (if there is any) how could we 'dummy' external resources as done with local ones?
Thank you all.
Nice regards.
.
i get this error in repo cyanogenmod 7:
Fetching projects: 100% (238/238), done.
Syncing work tree: 71% (169/238) Traceback (most recent call last):
File "/home/utente/.repo/repo/main.py", line 238, in <module>
_Main(sys.argv[1:])
File "/home/utente/.repo/repo/main.py", line 220, in _Main
repo._Run(argv)
File "/home/utente/.repo/repo/main.py", line 125, in _Run
cmd.Execute(copts, cargs)
File "/home/utente/.repo/repo/subcmds/sync.py", line 360, in Execute
project.Sync_LocalHalf(syncbuf)
File "/home/utente/.repo/repo/project.py", line 688, in Sync_LocalHalf
head = self.work_git.GetHead()
File "/home/utente/.repo/repo/project.py", line 1380, in GetHead
fd = open(path, 'rb')
IOError: [Errno 2] No such file or directory: u'/home/utente/packages/apps/Bluetooth/.git/HEAD'
anyone know a solution??
Alberto96 said:
i get this error in repo cyanogenmod 7:
Fetching projects: 100% (238/238), done.
Syncing work tree: 71% (169/238) Traceback (most recent call last):
File "/home/utente/.repo/repo/main.py", line 238, in <module>
_Main(sys.argv[1:])
File "/home/utente/.repo/repo/main.py", line 220, in _Main
repo._Run(argv)
File "/home/utente/.repo/repo/main.py", line 125, in _Run
cmd.Execute(copts, cargs)
File "/home/utente/.repo/repo/subcmds/sync.py", line 360, in Execute
project.Sync_LocalHalf(syncbuf)
File "/home/utente/.repo/repo/project.py", line 688, in Sync_LocalHalf
head = self.work_git.GetHead()
File "/home/utente/.repo/repo/project.py", line 1380, in GetHead
fd = open(path, 'rb')
IOError: [Errno 2] No such file or directory: u'/home/utente/packages/apps/Bluetooth/.git/HEAD'
anyone know a solution??
Click to expand...
Click to collapse
Delete "/home/utente/packages/apps/Bluetooth" and try your repo sync again. It's possible your initial repo sync was interrupted.
ok , thanks for the solution . it worked .
please close this thread
For any CM10 ROM, except new bootloader one, hackfest, and CM10.1
This tutorial shows you how to build CM10 kernel from RC and the CM team's source(it is their work), and using wkpark's ramhack patch or other patches
If you are uncomfortable in building the kernel, you use my flashable sample kernel at the end of the post, which uses 56 MB RAM hack.
Pre-requistes:
A Linux system
An internet connectionc
Some time and patience
But the time required for downloading resources, and building once everything is set up, is only a fraction of the time required for a full CM10 ROM
You can follow this guide, with or without having built CM10 following Raum1807's excellent CM10 building guide. At one of the places, the difference occurs whether you had built CM10 before or not, and I have listed it at that place
For a first time build, you need to follow all the steps, but 2nd time onwards, you can skip to the build step or RAM hack setting step
Instructions:
STEP 1: SETTING UP THE ENVIRONMENT
Install any CM10 ROM on the device (old bootloader, non-hackfest, non-CM10.1 one)
If you already have CM10 environment set up, skip to "Create an environment variable..." part
Install development support packages:
Debian based Linux distributions (like Ubuntu)
64bit systems:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils schedtool pngcrush xsltproc zlib1g-dev:i386
then
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Red Hat based Linux distributions
32bit and 64bit systems:
git gnupg java-1.6.0-openjdk-devel flex bison gperf SDL-devel esound-devel wxGTK-devel zip curl ncurses-devel zlib-devel gcc-c++ glibc-devel
64bit only:
glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686
Setting up Java (thanks to Raum for the java setup guide)
You need a Java Development Kit for building CM10. Recommended is the SUN JDK 6. As of writing the most recent version is SUN JDK 6 Update 37.
1. Download the jdk-6u37-linux-i586.bin from the Oracle/Sun Java Download Area. If you are on 64-bit Ubuntu as I am, you should grab jdk-6u37-linux-x64.bin.
2. Make the bin file executable:
Code:
$ chmod +x jdk-6u37-linux-x64.bin
3. Extract the bin file:
Code:
$ ./jdk-6u37-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
$ sudo mv jdk1.6.0_37 /usr/lib/jvm/./jdk-6u37-linux-x64.bin
5. Install the new Java source in system:
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/java 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javaws 1
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javadoc 1
$ sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javah 1
$ sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javap 1
$ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
7. Check Java version:
Code:
$ java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
Now,
If you have CM10 source fetched already (if you have built cm10)
If the directory name where the cm10 source exists is "cm10" (as in Raum's building guide)
Create an environment variable denoting the location of the android toolchain as follows:
Code:
export CCOMPILER=${HOME}/cm10/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Or else, replace the path/name if yours is different
(If your arm-eabi version is not 4.4.3, check the folder name and change it accordingly)
If you do not have cm10 source on your pc, then you need to download the ARM EABI Toolchain separately
Download link, ready to extract
If above does not work, download from official site here
Download and extract then, create an environment variable denoting the location of the toolchain as follows:
Code:
export CCOMPILER=[extraction directory]/bin/arm-eabi-
Download Kernel Source Code:
Code:
mkdir -p ~/kernel
cd ~/kernel
Now download RC's CM10 kernel source
In terminal, do
Old bootloader:
Code:
git clone git://github.com/CyanogenMod/lge-kernel-star.git -b jellybean
New bootloader:
Here, pengus77 has made the necessary changes in his repo, so we fetch from that
Code:
git clone git://github.com/pengus77/lge-kernel-star.git
Thus, there should be a folder named "lge-kernel-star" inside /kernel folder
Then in terminal, cd to that directory "lge-kernel-star"
Code:
cd lge-kernel-star
Getting the config file
The next step is to copy the file "/kernel/lge-kernel-star/arch/arm/configs/cyanogenmod_p990_defconfig" to "/kernel/lge-kernel-star and rename it to ".config"
using the command:
Code:
cp arch/arm/configs/cyanogenmod_p990_defconfig .config
(Thanks to tonyp for the tip!)
STEP 2: CONFIGURATION
Configure the build:
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER oldconfig
If it happens to ask anything, just accept the defaults at every step by pressing enter.
STEP 3: APPLYING PATCHES
Applying patches like wkpark's RAM hack patch
If you skip this step, the kernel will work, but you'll have a completely stock kernel without RAM hack or other tweaks
Download wkpark's two patches from here and here, and put them in your /kernel directory
Code:
cd ~/kernel
Now to apply the patches, we use the patch command like this:
Code:
patch -Np1 -d lge-kernel-star < patchname.patch
(replace patchname with name of the patch file)
Here, -N is for ignoring patches that seem to be already applied or reversed
p<num> Strip the smallest prefix containing num(here num=1) leading slashes from each file name found in the patch file
In this case, num=1 according to the path names in wkpark's patch, and in a lot of cases, the value of 1 is common
-d is to change to the directory immediately, before doing anything else
You need to apply wkpark's two patches one by one (0001-..., then bootloader-...)
If you get errors while patching, if they are basic errors like file not found etc. then you should manage to fix it yourself.
But if you get errors like "HUNK ... failed",
try
Code:
patch -Np1 --ignore-whitespace -d lge-kernel-star < patchname.patch
A "HUNK ignored" is ok, if patch was attempted previously, since that file might have been successfully patched last time
if a HUNK still fails, then read the troubleshooting guide
Setting RAM hack size (If you skipped the above patching step, dont do this)
wkpark's patch makes it possible for you to set ramhack size in kernel command line parameter.
The cmdline parameter has to have the full boot.img command line parameters, which you can obtain from dmesg. I have done it for you, so you can save time on that
Here's how it looks for the old bootloader: (for the new one, ignore this)
Code:
<5>[70:01:01 00:00:00.000] Kernel command line: loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097
Paste the line starting from loglevel=0 till the end (serialno) into .config file in lge-kernel-star folder in
CONFIG_CMDLINE="<here>"
Insert a carveout size in between vmalloc and androidboot.mode
Determing carveout size: carveout=<152 - RAM hack size>M
For example, if RAM hack size is 56, then carveout is 96M
So in that case, the cmdline is like this:
old bootloader:
Code:
CONFIG_CMDLINE="loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M carveout=96M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097"
new bootloader:
Code:
CONFIG_CMDLINE="tegraid=20.1.4.0.0 [email protected] carveout=152M android.commchip=0 vmalloc=128M androidboot.serialno=037c7006421f6097 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,-3 androidboot.mode=normal usbcore.old_scheme_first=1 [email protected] [email protected] muic_state=0 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,boot:34700:1000:800,mbr:400:200:800,persist:600:2bc00:800,cache:2c200:7f00:800,misc:34200:400:800,userdata:38700:c0000:800,bcttable:0:600:800,bootloader:100:300:800,data/ve:f8800:1400:800,system:34c000:40000:800 "
and save the file
Dont set carveout too low, or else some gpu-intensive stuff may not work properly.
STEP 4: BUILDING THE KERNEL
In terminal,
Code:
cd ~/kernel/lge-kernel-star
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
This step may take a while, depending on your computer. Took ~5-10 mins for the first build for me, and ~1 min for the second build onwards.
If it asks in the terminal "use default config?" then say "y", if not, then ignore this
If you get some error and the building aborts within a few seconds, try the "Create environment variable part" again, and then return back directly to the build step.
After it is done, you should have a kernel stored in ~/kernel/lge-kernel-star/arch/arm/boot/zImage
Preparing the flashable zip for the kernel
Some compiled modules need to be included so that problems like wifi not switching on dont occur.
They are:
drivers/misc/bthid/bthid.ko
drivers/scsi/scsi_wait_scan.ko
drivers/net/wireless/bcm4329/wireless.ko
They will be used while preparing the flashable zip below.
Thanks to feav's compiled modules and benee's anykernel updater for star, all this is ready-made and you can simply:
Download the sample kernel zip attached below and replace /kernel/zImage and and the above modules in system/lib/modules/hw in that with yours, edit updater-script if you want.
Your flashable zip is now ready
STEP 5: FLASHING AND TESTING THE KERNEL
Put the sample kernel below as a backup in case your kernel does not boot and you need a working phone immediately.
Flash the kernel in recovery, wipe cache, dalvik cache and reboot.
If the phone goes past the LG logo screen(s) and into the bootscreen of the ROM, then it should work
Then you can check "kernel version" in settings->about phone to see your kernel information,
and you can see the new RAM size (which should be 342 MB + RAM hack size) in some app like battery dr saver, or antutu benchmark's system info.
If it doesnt work, make sure you have followed the entire guide properly and then ask queries
If you want to revert to another kernel, flash that kernel in recovery, or for stock kernel, flash your ROM.
Keeping kernel source up to date (for building again later after RC has made changes to the source):
Code:
cd ~/kernel/lge-kernel-star
git pull
This will update your source with the latest commits by RC. Then you can rebuild the kernel by doing the "create environment variable" and then skip directly to the build stage
Standard disclaimer:
I am not responsible if anything goes wrong with your phone or anything else.
Credits:
aremcee/RC and the rest of the CM team for all their work. This is their kernel you are building
wkpark for his valuable contributions, including the ramhack patches and cracking the new bootloader
benee for his Anykernel updater for star, and other tweaks
feav for his compiled wifi modules
pengus77 for the work to make it suitable for the new bootloader
Download links for sample kernels:
SAMPLE 56 MB RAMHACK KERNEL
SAMPLE 32 MB RAMHACK KERNEL
SAMPLE 24 MB RAMHACK KERNEL
Troubleshooting guide:
1. Patch failure
HUNK failed means that a particular file was not patched to some problem. In this case, a .rej file is saved in the same folder as the file to be patched, and it contains the stuff not patched.
Do not neglect "failed" hunk since it means a partially applied patch(some files patched, some files not), and may cause problems. "Ignored hunk" is ok, if the patch had been attempted before on a file and had succeeded on that file last time.
To manually patch the failed hunk, go that file where the hunk failed (has same name as .rej file without .rej extension)
For example, if .rej file is board-star.c.rej, and it contains the following sample lines (look for lines beginning with '+' and remove the + before adding, similar for -) go to board-star.c, and add the lines manually like this:
Code:
#if defined (CONFIG_STAR_REBOOT_MONITOR) || defined (CONFIG_BSSQ_REBOOT_MONITOR)
#define RAM_RESERVED_SIZE 100*1024
/* Force the reserved_buffer to be at its old (Froyo/GB) location
for reboot to work with the older bootloader */
if (strstr(saved_command_line, "brdrev=")) {
extern void *reserved_buffer;
pr_info("The older bootloader detected\n");
if (memblock_end_of_DRAM() > 0x17f80000) {
if (memblock_reserve(0x17f80000, RAM_RESERVED_SIZE)) {
pr_err("Fail to get reserved_buffer for the older bootloader\n");
} else {
pr_info("Change reserved_buffer for the older bootloader\n");
reserved_buffer = phys_to_virt(0x17f80000);
}
} else {
pr_info("Change reserved_buffer\n");
reserved_buffer = ioremap(0x17f80000, RAM_RESERVED_SIZE);
}
}
#endif
This was in the .rej file, and is to be added immediately after
Code:
#if defined(CONFIG_LGE_BROADCAST_TDMB)
star_dmb_init();
#endif /* CONFIG_LGE_BROADCAST */
in board-star.c (and before the next #if defined or closing bracket)
Similarly, the - lines to be deleted and + lines are to be added in that failed hunk file
(do this manual stuff only if hunk fails)
2. If ramhack kernel fails, but normal kernel works:
From your pc, in terminal do
adb shell dmesg > dmesg.txt
or from your phone, in android terminal emulator, do
dmesg > /sdcard/dmesg.txt
Copy it from your dmesg.txt starting from loglevel=0 till the end (serialno)
Look for a line in dmesg.txt which resembles this:
Code:
<5>[70:01:01 00:00:00.000] Kernel command line: loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097
Use your own phone's parameters instead of this and then set carveout size.
3. Problem with config file:
Pulling kernel config from device:
You need to retrieve a working kernel config from the device, and unzip it.
For that, connect your phone to your pc, enable USB debugging if it was disabled, and then in terminal
Code:
adb pull /proc/config.gz ~/kernel/lge-star-kernel-jellybean/config.gz
cat config.gz | gunzip > .config
Alternatively, you can pull the .config from the newest boot.img
Code:
scripts/extract-ikconfig boot.img > .config
Changes and updates:
25/12/12:
Added changes to be made for the new bootloader (in red color)
24/12/12:
Updated the guide, added some fixes and changes
22/12/12:
Slightly modified version of wkpark's 2nd patch (bootloader one) which may possibly fix one of the errors and may remove need for manually adding some lines
Last one
rugglez.....you rock mate....
I am not sure if I will really do something as I am getting old(lolz) and if I understand enough....
but thanks mate, for keeping spirits alive for this device
rugglez,
Did you see these posts: http://forum.xda-developers.com/showpost.php?p=34600723&postcount=189
http://forum.xda-developers.com/showpost.php?p=34601277&postcount=192
Did you experienced any ploblem with USB?
SREEPRAJAY said:
rugglez.....you rock mate....
I am not sure if I will really do something as I am getting old(lolz) and if I understand enough....
but thanks mate, for keeping spirits alive for this device
Click to expand...
Click to collapse
There are always some things worth experiencing once in life, like if you are an Android user, building a ROM and a kernel. You have experienced it with your wonderful AF kernel, thats important
feav said:
rugglez,
Did you see these posts: http://forum.xda-developers.com/showpost.php?p=34600723&postcount=189
http://forum.xda-developers.com/showpost.php?p=34601277&postcount=192
Did you experienced any ploblem with USB?
Click to expand...
Click to collapse
USB works fine, both adb and mass storage
This guide may seem intimidating, but trust me, once you complete it the first time, you'll find it really simple from the next build onwards.
Uploaded a slightly modified version of wkpark's 2nd patch (bootloader one) which may possibly fix one of the errors and may remove need for manually adding some lines. Updated link in OP and attached here too.
I tried the sample kernel and my camera stops functioning and so with other apps such as contacts, they don't start at all. Im on dec 20 nightly. Could it be the ramhack size? Maybe 32mb will suffice. Just saying.
Thanks to this, will probably try this next week..
aldyu said:
I tried the sample kernel and my camera stops functioning and so with other apps such as contacts, they don't start at all. Im on dec 20 nightly. Could it be the ramhack size? Maybe 32mb will suffice. Just saying.
Thanks to this, will probably try this next week..
Click to expand...
Click to collapse
Uploaded 32 MB ram hack kernel for those having problem with camera, try it out.
Download link 32MB RH
Update:
Added 24MB version too. Here you go:
24MB RH kernel
Thanks rugglez, 32 mb rh is ok so far, cm10 is way smoother and can still play nfs most wanted. Btw, can you apply the patch for double lg logo too by wkpark?
Sent from my P990-CM10
After installing the new kernel, if some apps still don't work or there any lag, disable "force gpu rendering" and "disable hardware overlays" in developer settings.
Thank you for your work! Just flashed the 32mb version without any problem. On cm7 the 48mb ramhack was the biggest without breaking 720p recording. Maybe you should give it a try!
Uhm download a kernel zip file?
How about git clone?
Sent from my Nexus 7 using xda app-developers app
tonyp said:
Uhm download a kernel zip file?
How about git clone?
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
Git clone size = ~440mb
Zip size = 120mb which extracts to that same size
Takes more time to download more for people like me with slow Internet, no other reason
Hi rugglez, got the ff. error when installing the required packages, Im on ubuntu 12.10 x64.
Note, selecting 'libsdl1.2-dev' instead of 'libsdl-dev'
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'sun-java6-jdk' has no installation candidate
E: Unable to locate package libwxgtk2.6-dev
E: Couldn't find any package by regex 'libwxgtk2.6-dev'
How to fix? Thanks.
aldyu said:
Hi rugglez, got the ff. error when installing the required packages, Im on ubuntu 12.10 x64.
Note, selecting 'libsdl1.2-dev' instead of 'libsdl-dev'
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'sun-java6-jdk' has no installation candidate
E: Unable to locate package libwxgtk2.6-dev
E: Couldn't find any package by regex 'libwxgtk2.6-dev'
How to fix? Thanks.
Click to expand...
Click to collapse
Can you install the dependencies from Raum's CM10 building thread here?
Follow steps 1 and 2 there.
Let me know if that works, ive updated the guide's step 1(setting up environment)
Installing the dependencies from this guide was the only thing i didnt test, since i had the CM10 environment set up already
a step is missing from this guide.
adb pull /proc/config.gz ~/kernel/lge-star-kernel-jellybean/config.gz
cat config.gz | gunzip > .config
Click to expand...
Click to collapse
then
mv config arch/arm/configs/<your_config_name>_defconfig
make ARCH=arm CROSS_COMPILE=$CCOMPILER oldconfig
make <your_config_name>_defconfig
make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
Click to expand...
Click to collapse
then continue...
if you don't make the default config the compiler throws out some errors.
ps: nice guide btw
rugglez said:
Git clone size = ~1.5gb
Zip size = 440mb which extracts to that same size
Takes forever to download more than a gig for people like me with slow Internet, no other reason
Click to expand...
Click to collapse
Hmm.. downloading it now and wondering why it's only 120mb, not 440mb as you said.
rugglez said:
Can you install the dependencies from Raum's CM10 building thread here?
Follow steps 1 and 2 there.
Let me know if that works, ive updated the guide's step 1(setting up environment)
Installing the dependencies from this guide was the only thing i didnt test, since i had the CM10 environment set up already
Click to expand...
Click to collapse
Thanks, ok now using your updated guide.
Btw, did you happen to upload a copy of the kernel zip file? Downloading from github takes forever, only 8 kb/s.
aldyu said:
Thanks, ok now using your updated guide.
Btw, did you happen to upload a copy of the kernel zip file? Downloading from github takes forever, only 8 kb/s.
Click to expand...
Click to collapse
Just use "git clone git://github.com/CyanogenMod/lge-kernel-star.git", it should give you better download speed than for the zipped archive.
I synced the whole CM10 source tree on the remote buildbox in about 5-10 minutes - so github does provide great downspeed
@rugglez: You should add to the OP that you don't have to use adb to get the kernel config, it's already there
arch/arm/configs/cyanogenmod_p990_defconfig
Please refer to the old cm7 kernel how to by pastime: http://forum.xda-developers.com/showthread.php?t=1227241
I really like the fact that more and more building guides get posted here - and that more and more people are building their own ROMs and kernels these days.
After building (which already is a great start) many people even want to learn more about android development in general. That's the true xda spirit!
Kudos!
Hi,
I successfully built the rom for a couple months on Ubuntu 13.10 following wiki's instructions, as an exercise on learning how to 'cherry-pick' stuff into a work-tree, now wanna add Hammerhead to the working tree BUT it seems that the building system for GT-I9300 is actually broken (maybe by an update?), here's the log:
mkdir -p /media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/jni; cd external/chromium_org/ui; ../base/android/jni_generator/jni_generator.py --input_file android/java/src/org/chromium/ui/WindowAndroid.java --output_dir "/media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/jni" --optimize_generation 0 --jarjar ../android_webview/build/jarjar-rules.txt
[32mImport includes file:[0m /media/reS28raM/android/omni/out/target/product/i9300/obj/STATIC_LIBRARIES/ui_ui_gyp_intermediates/import_includes
[32mExport includes file:[0m external/chromium_org/GypAndroid.linux-arm.mk -- /media/reS28raM/android/omni/out/target/product/i9300/obj/STATIC_LIBRARIES/ui_ui_gyp_intermediates/export_includes
Gyp action: Generating JNI bindings from /media/reS28raM/android/omni/prebuilts/sdk/17/android.jar/android/view/Surface.class (/media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h)
Traceback (most recent call last):
File "../../base/android/jni_generator/jni_generator.py", line 1070, in <module>
sys.exit(main(sys.argv))
File "../../base/android/jni_generator/jni_generator.py", line 1066, in main
options.optimize_generation)
File "../../base/android/jni_generator/jni_generator.py", line 1001, in GenerateJNIHeader
jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
File "../../base/android/jni_generator/jni_generator.py", line 514, in CreateFromClass
jni_from_javap = JNIFromJavaP(stdout.split('\n'), namespace)
File "../../base/android/jni_generator/jni_generator.py", line 457, in __init__
contents[1]).group('class_name')
AttributeError: 'NoneType' object has no attribute 'group'
make: *** [/media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Errore 1
make: *** Attesa per i processi non terminati....
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
real 4m21.228s
user 4m4.210s
sys 0m53.027s
Don't understand that reference to SDK API 17 at all, are you guys still using Ubuntu 13.10 to build OmniROM for Galaxy S3? Thx
reS28raM said:
Hi,
I successfully built the rom for a couple months on Ubuntu 13.10 following wiki's instructions, as an exercise on learning how to 'cherry-pick' stuff into a work-tree, now wanna add Hammerhead to the working tree BUT it seems that the building system for GT-I9300 is actually broken (maybe by an update?), here's the log:
mkdir -p /media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/jni; cd external/chromium_org/ui; ../base/android/jni_generator/jni_generator.py --input_file android/java/src/org/chromium/ui/WindowAndroid.java --output_dir "/media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/jni" --optimize_generation 0 --jarjar ../android_webview/build/jarjar-rules.txt
[32mImport includes file:[0m /media/reS28raM/android/omni/out/target/product/i9300/obj/STATIC_LIBRARIES/ui_ui_gyp_intermediates/import_includes
[32mExport includes file:[0m external/chromium_org/GypAndroid.linux-arm.mk -- /media/reS28raM/android/omni/out/target/product/i9300/obj/STATIC_LIBRARIES/ui_ui_gyp_intermediates/export_includes
Gyp action: Generating JNI bindings from /media/reS28raM/android/omni/prebuilts/sdk/17/android.jar/android/view/Surface.class (/media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h)
Traceback (most recent call last):
File "../../base/android/jni_generator/jni_generator.py", line 1070, in <module>
sys.exit(main(sys.argv))
File "../../base/android/jni_generator/jni_generator.py", line 1066, in main
options.optimize_generation)
File "../../base/android/jni_generator/jni_generator.py", line 1001, in GenerateJNIHeader
jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
File "../../base/android/jni_generator/jni_generator.py", line 514, in CreateFromClass
jni_from_javap = JNIFromJavaP(stdout.split('\n'), namespace)
File "../../base/android/jni_generator/jni_generator.py", line 457, in __init__
contents[1]).group('class_name')
AttributeError: 'NoneType' object has no attribute 'group'
make: *** [/media/reS28raM/android/omni/out/target/product/i9300/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Errore 1
make: *** Attesa per i processi non terminati....
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
real 4m21.228s
user 4m4.210s
sys 0m53.027s
Don't understand that reference to SDK API 17 at all, are you guys still using Ubuntu 13.10 to build OmniROM for Galaxy S3? Thx
Click to expand...
Click to collapse
Wrong Java version or Python version.
I was using OpenJDK and was happy to see it working, maybe it is time to switch to Oracle's
Sent from my Nexus 5 using Tapatalk