Hey folks. I've wanted to add this functionality to Android Builder for a while, but being me... I've done other things. We'll here's what I have now. It's a script that grabs CM6 source, Conap's vendor tree, and compiles it all into a zip. It's currently a standalone script and has some remnants from the Froyo AOSP version, but anyway... It seems to work although the resulting ROM needs tweaking.
(I had to change out the kernel and modules and it still wouldn't pull up the home screen. It did flash and boot though. Progress!)
Many thanks to Armin Čoralić for the first part of the script, Conap for the vendor tree and helping me to work this out, and the CM team for their awesome work.
Code:
#!/bin/bash
# Armin Čoralić http://blog.coralic.nl
# Part 1 modified by gnarlyc
# Part 2 created mostly by gnarlyc although I just took the commands from the CM site and made them into a script.
# Set $KITCHEN_ROOT equal to the current directory. This makes the code 'portable'.
export KITCHEN_ROOT=`pwd`
echo "Setting up the folders....."
# Create the folder structure. This can be slimmed down, but I made this script by cutting and pasting some of Android Builder...
mkdir -p $KITCHEN_ROOT/builder/source/projects/CM6/
if [ ! -d $KITCHEN_ROOT/builder/bin ]
then
mkdir $KITCHEN_ROOT/builder/bin
fi
# Make sure that buidler/bin is in the path and then get the repo binary.
export PATH=$PATH:$KITCHEN_ROOT/builder/bin
curl http://android.git.kernel.org/repo > $KITCHEN_ROOT/builder/bin/repo
chmod a+x $KITCHEN_ROOT/builder/bin/repo
# Initialize the repo.
echo "Initialize GIT repo....."
cd $KITCHEN_ROOT/builder/source/projects/CM6
repo init -u git://github.com/CyanogenMod/android.git -b froyo
# grab the CM6 source. This will just do updates after you do it once, so there's no harm in doing this every time. Although, you could start over if you wanted...
echo "Sync repo....."
repo sync
# Probably not needed for CM6...
echo "Import GPG key"
echo "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
/HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----" > /tmp/android.gpg
gpg --import < /tmp/android.gpg
rm -rf /tmp/android.gpg
echo "All Done."
# Cleanup (optional, but I like to start fresh... Just comment out if you want.)
cd $KITCHEN_ROOT/builder/source/projects/CM6/device/htc
rm -rf desirec/
# grab vendor tree
git clone https://github.com/Conap30/android_device_htc_desirec.git
# rename the resulting folder
mv android_device_htc_desirec/ desirec/
#remove unneeded folder
rm -rf desirec/vendor/
# I have already grabbed the needed proprietary files and zipped them up into a zip in a folder above the current folder.
# There are different ways that you can do this.
mkdir -p $KITCHEN_ROOT/builder/source/projects/CM6/vendor/htc/desirec/proprietary
rm -rf $KITCHEN_ROOT/builder/source/projects/CM6/vendor/htc/desirec/proprietary/*
cd $KITCHEN_ROOT
cp ../proprietary.zip $KITCHEN_ROOT/builder/source/projects/CM6/vendor/htc/desirec/proprietary
cd $KITCHEN_ROOT/builder/source/projects/CM6/vendor/htc/desirec/proprietary
unzip proprietary.zip
# I don't know why it wouldn't work for me without modding this. I can't change the source directly, so...
echo 'ro.modversion=CyanogenMod6-Eris' >> $KITCHEN_ROOT/builder/source/projects/CM6/device/htc/desirec/system.prop
# run extract-files.sh --- This needs to be run even though the proprietary files are already there.
cd $KITCHEN_ROOT/builder/source/projects/CM6/device/htc/desirec
./extract-files.sh
# setup the enviroment
cd $KITCHEN_ROOT/builder/source/projects/CM6
. build/envsetup.sh
# If you take out the 'generic_desirec-eng', it will give you a menu instead.
lunch generic_desirec-eng
# This compiles the source with the vendor tree included, makes the zip, signs it, and drops it into the out/target/product/desirec directory. It will tell you this.
make -j$(grep -c processor /proc/cpuinfo) otapackage
Please feel free to use this and help me tweak it. Your comments will be appreciated. You can cut and paste the code or download the attachment and take the '.txt' off of the end. This is LINUX ONLY by the way...
EDIT: Adding latest version to OP.
Thanks!
Thanks for doing this!
It'll be great when this is finished into something that can prompt you for which kernel you would like to use (e.g. conap's CFS) and build a working rom that will always be as up to date as often each of us is willing to build. When I get some time I'll take a look at helping to make contributions back to this.
This is delicious gold. Thanks so much! I know an early version of this helped me out immensely!
Sent from my ERIS using XDA App
Yeah, I thought about pulling the kernel source down too. That won't be hard to add at all.
Thanks!
hoban_eris said:
Thanks for doing this!
It'll be great when this is finished into something that can prompt you for which kernel you would like to use (e.g. conap's CFS) and build a working rom that will always be as up to date as often each of us is willing to build. When I get some time I'll take a look at helping to make contributions back to this.
Click to expand...
Click to collapse
Ok. I am going to run another test with a freshly wiped directory, but here's what I have now...
I've added the code to make it grab the current CFS kernel source from Conap's github, compile it and wlan module, and insert them into the tree... This currently does not get the other modules or give you the option for different kernels, but those can be added later.
great....i'm being replaced by a script....thanks alot lmao....
Conap said:
great....i'm being replaced by a script....thanks alot lmao....
Click to expand...
Click to collapse
ConapBot. 10 char....
It'll be great when this is ready. Good luck guys.
Sent from my Tazz Vanilla
Conap said:
great....i'm being replaced by a script....thanks alot lmao....
Click to expand...
Click to collapse
I've been looking for a good name for the standalone version of this. Maybe I should call it ConapScript? Or how about just c0nap?
Can you tell me what else you can do, so I can add that to the script?
lol
Thanks man for sticking in there and just getting neat things done. Maybe I can 'finish' this one...
EDIT: Sorry, 'roirraW "edor" ehT', I missed this one - "ConapBot". That's it! We have a winner.
gnarlyc said:
... Maybe I can 'finish' this one...
Click to expand...
Click to collapse
I highly doubt it
Conap said:
great....i'm being replaced by a script....thanks alot lmao....
Click to expand...
Click to collapse
lol, I for one, will not be using this script, conap... so, you can feel wanted/needed still
... you know how gnarly gets man, pay no attention
workshed said:
I highly doubt it
Click to expand...
Click to collapse
Well. Since these kinds of things are never really done, I highly doubt it too. As long as it helps others to save time or understand something a little quicker & better than they would otherwise, I'm happy with it.
Jerk. I think you made me cry again. lol
EDIT: Oh, yeah. I forgot to mention. I wrote Android Builder. And this ROM sucks.
gnarlyc said:
Well. Since these kinds of things are never really done, I highly doubt it too. As long as it helps others to save time or understand something a little quicker & better than they would otherwise, I'm happy with it.
Jerk. I think you made me cry again. lol
EDIT: Oh, yeah. I forgot to mention. I wrote Android Builder. And this ROM sucks.
Click to expand...
Click to collapse
Obviously you DIDN'T forget to mention anything
And who's really the "Jerk" here? I don't give people false hopes lol
Oh, and btw... nice job gnar!
workshed said:
Oh, and btw... nice job gnar!
Click to expand...
Click to collapse
Thanks. You're the best. If you weren't in Delaware, I'd hug you.
Polished it up a little and ran it successfully from a fresh and clean directory. My next step is to test the resulting ROM again. Anybody else is free to give it a go and report back though.
gnarlyc said:
Thanks. You're the best. If you weren't in Delaware, I'd hug you.
Click to expand...
Click to collapse
lol, you're thinking of a different, awesomely cool dev named nocap
Awesome. Definitely going to try this...
So it creates a ROM or an update script?
Hungry Man said:
Awesome. Definitely going to try this...
So it creates a ROM or an update script?
Click to expand...
Click to collapse
From the OP page...
It's a script that grabs CM6 source, Conap's vendor tree, and compiles it all into a zip. It's currently a standalone script and has some remnants from the Froyo AOSP version
Click to expand...
Click to collapse
Hungry Man said:
Awesome. Definitely going to try this...
So it creates a ROM or an update script?
Click to expand...
Click to collapse
Yeah man. It creates a ROM. The next update should allow you to select between different kernels too. If I get around to converting it to a plugin for the kitchen, it will drop the ROM into the original_update folder just like Android Builder does.
Related
the title says it
after many requests here is the guide
most of this is spread around the vogue
forum here and there, i just wanted to bring it all together
goal-seeing lately we have lost some good developers, this is a shot at getting more involvement in vogue/android development
I.SETTING UP YOUR SYSTEM
1. GETTING LINUX you will need to have Linux installed on your computer(dual-boot, vm, whatever). i recommend Ubuntu karmic (9.10) because its pretty new-user friendly. It can be found at http://www.ubuntu.com/
for you windows lovers here is a guide to setting up a ubuntu VM(virtual machine (if you really didnt know ))
2. THINGS/TOOLS YOU WILL NEED download these:
original 8/8/09 ion 1.5 build HERE(we are gonna use the bin-files and the apns-conf.xml, and a few apps)
the latest rootfs.img (find it)
these android tools (included are genext2fs (android version), split_bootimg.pl, and extract_ramdisk.sh)
after downloading, extract the zip to a folder. open a terminal and cd to the dir of the tools. click applications>accesories>terminal and type:
Code:
cd ~/whatever/
sudo rm -rf /bin/genext2fs
#dont type whats after the pound signs
#type in your password
#if you havent set up a su password yet type:
sudo passwd
#then make one, next
sudo cp -r ./whatever/genext2fs /bin/
squashfs-tools (if you have ubuntu 9.10-karmic first you will have to uninstall squashfs-tools 4.0(4.0 WILL NOT NOT NOT NOT NOT WORK) that is installed during the installation of linux ): go to system>administration>synaptic package manager. type squashfs-tools in the quick search, then right click and click mark for complete removal. then hit apply. then download and install this here http://http://ftp.us.debian.org/debian/pool/main/s/squashfs/squashfs-tools_3.3-7_i386.deb
i also strongly recommend downloading the sdk-tools v1.1(adb is almost essential when porting, for debugging purposes) enatefox has it posted on his media fire. (search for it)
3. ORGANIZATION
now that we have what we need. lets get organized.
a.mount points
we are going to use mount points while porting.
terminal:
Code:
sudo mkdir /mnt/rootfs
sudo mkdir /mnt/system
#i also have one for mounting data files
mkdir /mnt/data
b. directories
terminal:
Code:
mkdir ~/Desktop/android
mkdir ~/Desktop/android/ion
mkdir ~/Desktop/android/donut
#you get the point...
now put the ion 8/8/09 build in the ~/Desktop/android/ion folder and rename it system.sqsh then
terminal:
Code:
cd ~/Desktop/android/ion
unsquashfs ./system.sqsh
you should now have a folder called squashfs-root in the ion directory. it contains all the guts from the ion build. feel free to look around in that folder as you should get familiar with the folders and things in there
II PORTING
1. PORTING A HERO ROM(this was in zens how-to-make-a-hero-rom.txt im just adding on to it)
a. Download a rom from the dream/sapphire development forums.
b. Extract what you downloaded to ~/Desktop/android/hero. It is usually an update.zip.
c. Open the extracted folder. Inside you should see a data directory and a system directory.
d. Open the data directory and look for an app or app_s folder.
e. Open those folders and copy the apks to the system/app/ folder. Leave out what you don't need. feel free to add any custom apps. as long as they are from the same sdk number. ie 1.5, 1.6, 2.0.1, 2.1 most are pretty cross-compatible though.
f. Delete system/xbin from the rom your porting and replace it with the one from Ion.
g. Copy ~/Desktop/android/ion/squashfs-root/etc/apns-conf.xml from Ion to ~/Desktop/android/hero/system/etc/
h. Mount the latest rootfs.img
terminal:
Code:
sudo mount ~/whereever/rootfs.img -o loop /mnt/rootfs
i. Copy libaudio.so libaudioflinger.so libcameraservice.so libgps.so from /lib in the mounted rootfs over to system/lib in the rom you are porting*(donut and eclair really dont need this step because those files are in most of the latest rootfs.img's but be sure to check)
j. Edit the system/build.prop or even use the Ion build.prop.*(for donut/eclair you may want to edit the lcd density to 120 or 110 in the build.prop for qvga and 160 for 320x480)
k. Create a blank file in system/ called hero.build*(for eclair/donut create donut.build or eclair.build or eclairhero.build.....etc)
*l. for hero any systems too big to run on nand, here is a script to make a data file. put this in the ~/Desktop/android/hero directory. cut the app folder from ~/Desktop/android/hero/system and paste it to ~/Desktop/android/hero , and rename it too app_s . next run the mkdataimg.sh it should ask for you password in a terminal. type it in and then it should mount the data.img to data-mnt folder in ~/Desktop/android/hero . keep that terminal open copy the app_s folder in to data-mnt. then type y in the terminal to unmount the data.img. next:
terminal:
Code:
cd ~/Desktop/android/hero
ln -s /data/app_s ./system/app
that should make a broken symlink in system
2. Mount it and squash it
ok now that we are done porting lets put it together
terminal:
Code:
cd ~/Desktop/android/hero
genext2fs -d ./system -b 180000 -a system.ext2
sudo mount -o loop ./system.ext2 /mnt/system
sudo mksquashfs /mnt/system system.sqsh
sudo chown $USER ./system.sqsh
#and if you want
rm -rf ./system.ext2
from zenulator:
There are other little tweaks here and there but thats basically it. Now you can roll your own.
Click to expand...
Click to collapse
im gonna clean this up a bit later just wanted to get this out to you guys
nice thanks jamezelle
zen's manup456-based Eclair build contains different libaudio.so & libaudioflinger.so than the rootfs, and Eclair wouldn't boot if I replaced them with the libs from the rootfs. This might be due to the rootfs libs not being updated for Eclair yet (also why voice search/dial doesn't work) but I'm not sure. I don't know if this will be the case for 2.1, just wanted to add that in.
I really appreciate the guide and look forward to hearing more. I've learned a lot from zen as well but a lot of the work the devs do is so hard to follow because it's undocumented.
Do you know why the xbin has to be from Ion? Is it because of our kernel version or the squashfs ver that our kernel contains? I've been wanting to grab some of the tools from the xbin of other builds but have been unsure about compatibility.
Also, for more advanced Android ROM building, I'd like to add a link to zipalign optimization.
polyrhythmic said:
zen's manup456-based Eclair build contains different libaudio.so & libaudioflinger.so than the rootfs, and Eclair wouldn't boot if I replaced them with the libs from the rootfs. This might be due to the rootfs libs not being updated for Eclair yet (also why voice search/dial doesn't work) but I'm not sure. I don't know if this will be the case for 2.1, just wanted to add that in.
I really appreciate the guide and look forward to hearing more. I've learned a lot from zen as well but a lot of the work the devs do is so hard to follow because it's undocumented.
Do you know why the xbin has to be from Ion? Is it because of our kernel version or the squashfs ver that our kernel contains? I've been wanting to grab some of the tools from the xbin of other builds but have been unsure about compatibility.
Also, for more advanced Android ROM building, I'd like to add a link to zipalign optimization.
Click to expand...
Click to collapse
we need to move back to a more standardized comunity rootfs.img. i'm seeing more and more different rootfs.imgs that vary little by little. it is kind of hard to really document all of the development. but i see your point. the xbin(are just eXtended bin files) doesnt have to come from ion. the xbin in ion is actually empty
yes our kernel doesnt support LZMA compression which is what 4.0 uses. more info on it here http://www.squashfs-lzma.org/ i dont know why out kernel has not been updated to support it(you would have to ask DZO), i just know is isnt supported
thanks for the link to zipalign. i usually zipalign my apps. btw most dream and sapphire devs are already zipaligning there apks so we dont have to
I agree, I don't like forking the rootfs but the latest ones don't contain the correct WiFi files & settings for Kaiser. I know our kernel is way behind, I've asked several questions in the kernel thread about it but then the thread goes OT and I've never gotten an answer to most of the questions. Newbie16 has been compiling kernels but we've had trouble finding all the updated source files.
Oh, the PNG optimization in the zipalign thread is useful also, I easily saved 5 MB in the Eclair build.
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
ln -s help. hero nand porting
When ever I'm trying to port a hero build to nand ln -s gives me "operation not permitted" during boot. I used -a during genext2fs. Also data didn't work, even though I have the right apns-conif.xml. any idea? I was trying to port hero revolution (I think thats it ). Thanx
TheKartus said:
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
Click to expand...
Click to collapse
i fixed(add the missing steps) it but i dont have a copy of 8/8 ion personally. any ion system.sqsh build will work. if anyone has one please post it!
TheKartus said:
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
Click to expand...
Click to collapse
jamezelle said:
i fixed(add the missing steps) it but i dont have a copy of 8/8 ion personally. any ion system.sqsh build will work. if anyone has one please post it!
Click to expand...
Click to collapse
i just mounted the system.img and copied all the files to a new folder....that way then u dont have to mount the system.img everytime u are porting a rom
my steps to do that
[email protected]:~# cd Android
[email protected]:~/Android# dir
hi Inferno sensehero13 SenseHERO-v1.4_NoTheme senshero
signed-Hero_Inferno_Final signed-Hero_Inferno_Final.zip
system-2009-08-08.img system-sensehero-20091009.sqsh
TOOLS
ZipAlign.sh
[email protected]:~/Android# mkdir ion
[email protected]:~/Android# mount -o loop system-2009-08-08.img ion
[email protected]:~/Android#
Could someone please define...
Could someone please define rootfs, zIMage and the other parts that go into an Android build? If you're going from say, donut, to eclair, which ones can you reuse? I think I understand that the system.sqsh is what makes a build donut or eclair and actually is the file that has the customizations in it. But, what do the other parts do? If this is the wrong place to post this, mods, please move this. Thanks.
Sally
Hey guys, don't know if anyone else is having this issue or not.
I'm trying to work with the Topaz kernals...I downloaded the XDAndroid 2.1 system.sqsh and was able to unsquashfs it fine on my Vector Linux box...but I want to do the same to the TopazKernal16 system.sqsh (donut) but when I run unsquashfs it makes it to about 70% (highest I got to was 80% on one try) and then stops saying "killed".
any way to remedy this? also, what is the simplest way to "re"squash it?
Thanks!
iceman198 said:
Hey guys, don't know if anyone else is having this issue or not.
I'm trying to work with the Topaz kernals...I downloaded the XDAndroid 2.1 system.sqsh and was able to unsquashfs it fine on my Vector Linux box...but I want to do the same to the TopazKernal16 system.sqsh (donut) but when I run unsquashfs it makes it to about 70% (highest I got to was 80% on one try) and then stops saying "killed".
any way to remedy this? also, what is the simplest way to "re"squash it?
Thanks!
Click to expand...
Click to collapse
You just posted in the wrong forum altogether. This section is for the Vogue, not for the Topaz. Try to ask there on in one of the xdandroid threads. This project is different from xdandroid. Thanks.
egzthunder1 said:
You just posted in the wrong forum altogether. This section is for the Vogue, not for the Topaz. Try to ask there on in one of the xdandroid threads. This project is different from xdandroid. Thanks.
Click to expand...
Click to collapse
Sorry, thanks...
iceman198 said:
Sorry, thanks...
Click to expand...
Click to collapse
No prob
I would be interested in the Android's filesystem breakdown. Just some guide on what exactly is in the system, and then rootfs.img and then the modules. If someone could point me in the right direction, that would be much appreciated!
Thanks!
iceman198 said:
I would be interested in the Android's filesystem breakdown. Just some guide on what exactly is in the system, and then rootfs.img and then the modules. If someone could point me in the right direction, that would be much appreciated!
Thanks!
Click to expand...
Click to collapse
pm dzo, he will probably be able to help you there.
egzthunder1 said:
pm dzo, he will probably be able to help you there.
Click to expand...
Click to collapse
Thanks egzthunder1!
iceman198 said:
Thanks egzthunder1!
Click to expand...
Click to collapse
Not a problem. Good luck!
I'm baaaack
Andrizoid's Linux Deodex Kitchen V4
This has been an ongoing project for a while now.
Since all the other deodexers are windows .bat scripts, i decided to make one for those of us on Ubuntu/Mac/etc
Extract to your desktop and check the README file for full instructions and more information.
Changelog
V4
Fixed some of the code, added the optional make-rom.sh which adds the freshly de-odexed files to the original rom and signs it making it ready to flash.
V3
Everything is fully automated, and will deodex the whole rom rather than one file at a time. Smali and Baksmali version updated to 1.2.3
V2
Added setup.sh to make things easier.
V1
Original script.
Love me or hate me, its a great little setup. It can be used with any rom on any device.
Interesting
Sounds interesting. I'll have to play with it this weekend.
I hope the drama is settled down now... I get enough when my wife watches "real housewives"
theres a few issues, it only de-odexes apk WELL for now. for the framework files it gets kind tricky. ill work on it a bit when i get some time.
I've been looking over your source code, I notice few lines could use simple shortcuts, for example
Code:
/home/ken/deodex-kitchen
you can change that to
Code:
~/deodex-kitchen
~ will tell shell to use current user's home directory, just make it more universal for anyone to use. Just my 2 cents.
it even work with cd, cp, mv, mkdir commands, ~ is very handy, and save you from having to type in full path.
firestrife23 said:
I've been looking over your source code, I notice few lines could use simple shortcuts, for example
Code:
/home/ken/deodex-kitchen
you can change that to
Code:
~/deodex-kitchen
~ will tell shell to use current user's home directory, just make it more universal for anyone to use. Just my 2 cents.
it even work with cd, cp, mv, mkdir commands, ~ is very handy, and save you from having to type in full path.
Click to expand...
Click to collapse
ya, a lot of the code could be cleaned up but thats the very basic version. i put it together to help build my rom, i got it working enough to do that and kinda forgot about it. i need to clean it up and put out another verison
too many projects at once haha.
found few bugs with your make-rom.sh script, on last couples of lines starting with rm will fail, because you forgot to add cd to rom-output and your script also left framework-res.apk at root of rom-output folder which should be moved to /system/framework
in your readme file, you forgot to add a step to run setup.sh script before de-odexing apk/jar files.
firestrife23 said:
found few bugs with your make-rom.sh script, on last couples of lines starting with rm will fail, because you forgot to add cd to rom-output and your script also left framework-res.apk at root of rom-output folder which should be moved to /system/framework
in your readme file, you forgot to add a step to run setup.sh script before de-odexing apk/jar files.
Click to expand...
Click to collapse
ya when i used it i made some heavy modifications to it before i got a rom to boot. i need to update this thing but ive got a few other projects im the making.
not enough people seemed interested in this to make it my priority
Andrizoid said:
ya when i used it i made some heavy modifications to it before i got a rom to boot. i need to update this thing but ive got a few other projects im the making.
not enough people seemed interested in this to make it my priority
Click to expand...
Click to collapse
I use Ubuntu, and your script fit the bill and spare me from having to reboot into windoze to use their crappy batch files. Of course your hands is all tied up with other projects, however I'll be watching this tread once you get around to updating this. Just keep bring out the great stuff!
I like people like you that make contribute back to community such as this valuable tools, unlike other developers which pretty much rather keep it to themselves (I won't list their names here, and not trying to start a flame-war) as the rest of first time ROM cooker have to figure it out the hard way.
I've just been pointed to this thread while looking for a way to deodex
the link works still, but the file has been deleted by Rapidshare, "due to inactivity"
Any chance of it being uploaded again please?
lew247 said:
I've just been pointed to this thread while looking for a way to deodex
the link works still, but the file has been deleted by Rapidshare, "due to inactivity"
Any chance of it being uploaded again please?
Click to expand...
Click to collapse
why not just use dsixda's kitchen?
http://forum.xda-developers.com/showthread.php?t=633246
then you'll also have just about everything you need (not just a deodex-er)
plus, don't think you'll get any "support" on this anymore... whereas, with dsixda's kitchen, you'll have LOTS of support for quite a while
firestrife23 said:
I've been looking over your source code, I notice few lines could use simple shortcuts, for example
Code:
/home/ken/deodex-kitchen
you can change that to
Code:
~/deodex-kitchen
~ will tell shell to use current user's home directory, just make it more universal for anyone to use. Just my 2 cents.
it even work with cd, cp, mv, mkdir commands, ~ is very handy, and save you from having to type in full path.
Click to expand...
Click to collapse
Use $HOME instead of ~. ~ doesn't always refer to the home directory.
I can help you with the need to rename $path in the script before it will work are you interested?
Upload to mediafire please.
Trent said:
Upload to mediafire please.
Click to expand...
Click to collapse
Double that. Please do this, since Multiupload has been closed.
*EDIT*
Solved, new thread with download here: http://forum.xda-developers.com/showthread.php?t=887567
*/EDIT*
Hey everyone,
I'm trying to re-compile the Hastarin kernel for DarkStone1337's SuperRAM 1.5 to include CIFS support. I've compiled many a linux kernel, but never for Android, so can anyone point out what I'm doing wrong? Here are the commands I've run through:
Added android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin to PATH
git clone git://gitorious.org/~hastarin/linux-on-wince-htc/hastarins-linux_on_wince_htc.git
Grabbed DarkStone1337's patch from: http://pastebin.com/6qjkb4Hh
Renamed hastarins-linux_on_wince_htc to "a" to match the patch
patch -p0 < patch.txt (This did report a pre-mature ending on the patch, but everything appears to have patched OK)
make
The result:
arch/arm/mach-msm/built-in.o: In function `dex_cb_interrupt':
/files/Software/Android/hastarin/source/a/arch/arm/mach-msm/dex_comm.c:248: undefined reference to `notify_vbus_change_intr'
make: *** [.tmp_vmlinux1] Error 1
Click to expand...
Click to collapse
Any ideas?
Thanks,
B.
Hi!
Try using this toolchain instead! http://www.codesourcery.com/sgpp/lite/arm/portal/release1293
Then follow these commands to build the kernel:
make clean
make ARCH=arm htcleo_defconfig
Then change what is necessary to add the CIFS support
make ARCH=arm CROSS_COMPILE=/path-to-toolchain/bin/arm-none-linux-gnueabi- zImage
Taken from: http://htc-linux.org/wiki/index.php?title=QuickDeveloperStartGuide#Kernel
Then follow the same guide I linked to, to create the modules.
Hey Darkstone i saw the thread for SuperRAM 1.5 has been closed requested by you. Was there a major reason? Are we not supposed to use it anymore or was it put on hold. just asking because Im still testing it out and its been rock solid after several reboots.
PENKO956 said:
Hey Darkstone i saw the thread for SuperRAM 1.5 has been closed requested by you. Was there a major reason? Are we not supposed to use it anymore or was it put on hold. just asking because Im still testing it out and its been rock solid after several reboots.
Click to expand...
Click to collapse
prob due to folks refusing to read and do a little research before posting common problem Roth common fixes...
DarkStone1337 said:
Hi!
Try using this toolchain instead! http://www.codesourcery.com/sgpp/lite/arm/portal/release1293
Then follow these commands to build the kernel:
make clean
make ARCH=arm htcleo_defconfig
Then change what is necessary to add the CIFS support
make ARCH=arm CROSS_COMPILE=/path-to-toolchain/bin/arm-none-linux-gnueabi- zImage
Taken from: http://htc-linux.org/wiki/index.php?title=QuickDeveloperStartGuide#Kernel
Then follow the same guide I linked to, to create the modules.
Click to expand...
Click to collapse
First off, thanks a ton for responding, this was very helpful. Secondly, sorry for the threadjackers. Lastly, this both works, and doesn't. The following works fine:
# git clone git://gitorious.org/~hastarin/linux-on-wince-htc/hastarins-linux_on_wince_htc.git
# make CROSS_COMPILE=/files/Software/Android/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ARCH=arm clean
# make CROSS_COMPILE=/files/Software/Android/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ARCH=arm htcleo_defconfig
# make CROSS_COMPILE=/files/Software/Android/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ARCH=arm zImage -j 4
Click to expand...
Click to collapse
But when I try to make an exact copy of the kernel you created for SuperRAM 1.5 (without modifying for CIFS), it doesn't, so I must be doing something wrong. Here was my process there:
# git clone git://gitorious.org/~hastarin/linux-on-wince-htc/hastarins-linux_on_wince_htc.git
# mv hastarins-linux_on_wince_htc a
# cd a
# patch -p0 < patch
(Stripping trailing CRs from patch.)
patching file a/arch/arm/mach-msm/qdsp6_1550/q6audio.c
(Stripping trailing CRs from patch.)
patching file a/drivers/video/msm/gpu/kgsl/kgsl_ringbuffer.c
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 786:
# make CROSS_COMPILE=/files/Software/Android/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ARCH=arm clean
# make CROSS_COMPILE=/files/Software/Android/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ARCH=arm htcleo_defconfig
# cp ../../config ./.config (This config was pulled from SuperRAM 1.5's /proc/config.gz)
# make CROSS_COMPILE=/files/Software/Android/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ARCH=arm menuconfig
# make CROSS_COMPILE=/files/Software/Android/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ARCH=arm zImage -j 4
arch/arm/mach-msm/built-in.o: In function `dex_cb_interrupt':
/files/Software/Android/hastarin/source/a/arch/arm/mach-msm/dex_comm.c:248: undefined reference to `notify_vbus_change_intr'
make: *** [.tmp_vmlinux1] Error 1
Click to expand...
Click to collapse
Any additional help would be appreciated. Also, is there a reason (performance, size, etc) CIFS is not included by default? I've noticed a lot of other builds are like that, too.
*EDIT* Is it possible I need to checkout a specific version of Hastarin's kernel?
Thanks,
B.
I posted this in the main thread before it was closed -
insmod: init_module 'cifs.ko' failed (Exec format error)
and I looked in dmesg -
cifs: version magic '2.6.32.15r8.6-gb02686c preempt mod_unload ARMv7' should be '2.6.32.15-g2ef5752.dirty preempt mod_unload ARMv7'
Looks like this might be a side effect of the custom kernel and the magic not matching up with the cifs.ko from hastarin. Could this be recompiled with the correct kernel?
Looks like the cifs.ko that was included in the build was the stock module from hastarin - so when you do recompile it, could you post the module as well? I'd love to help, but I don't have a whole lot of experience with compiling kernels.
Thanks.
indecided said:
I posted this in the main thread before it was closed -
insmod: init_module 'cifs.ko' failed (Exec format error)
and I looked in dmesg -
cifs: version magic '2.6.32.15r8.6-gb02686c preempt mod_unload ARMv7' should be '2.6.32.15-g2ef5752.dirty preempt mod_unload ARMv7'
Looks like this might be a side effect of the custom kernel and the magic not matching up with the cifs.ko from hastarin. Could this be recompiled with the correct kernel?
Looks like the cifs.ko that was included in the build was the stock module from hastarin - so when you do recompile it, could you post the module as well? I'd love to help, but I don't have a whole lot of experience with compiling kernels.
Thanks.
Click to expand...
Click to collapse
Hi indecided,
This is the post I'm looking to resolve for everyone. Once I figure this out, I'll post how to patch the SuperRAM 1.5 to support CIFS.
Thanks,
B.
this is great news and i'm looking forward to this - i hope your efforts can accomplish this - it probably won't be easy, which is why hastarin and darkstone might have needed to focus their efforts on other things first -- i'm not being negative, i'm just saying that if you guys get this to work it might be an impressive thing you did. I need it bad too.
OK, unfortunately I've hit a bit of a roadblock. I've got the kernel to compile using nearly all the same config settings as DarkStone with CIFS added, but upon booting the kernel the phone acts as if there is 0% battery and instantly shuts itself off. I'm guessing it has to do with the one problem I had in compiling explained below.
The only difference in the configs for compiling were (removed CIFS info):
# diff MY.config DARKSTONES.config
119,120c119
< CONFIG_SLOW_WORK=y
< # CONFIG_SLOW_WORK_DEBUG is not set
---
> # CONFIG_SLOW_WORK is not set
241,242c240
< CONFIG_HTC_BATTCHG=y
< # CONFIG_HTC_BATTCHG_SMEM is not set
---
> # CONFIG_HTC_BATTCHG is not set
Click to expand...
Click to collapse
So basically, DarkStone's version had SLOW_WORK and HTC_BATTCHG disabled. I have no idea how he accomplished this. No matter what I set SLOW_WORK to, the compilation always changes it back. And if I try to disable HTC_BATTCHG, the kernel errors out with the message from my previous posts.
I'm also not entirely sure the patch DarkStone posted is complete (unless he responds otherwise) because it does end prematurely and was perhaps cut off by pastebin.
I wish I knew what else to try, but I'm not knowledgable enough to know why it thinks the battery is at 0%. I'm guessing it has something to do with the BATTCHG config, but I have no way around it at the moment.
Thanks,
B.
sorry to disturb here, but if you where to successfully recompile, what will be the benefit?
thanks you
there should be tons of warnings though correct?
Fmstrat said:
Any additional help would be appreciated. Also, is there a reason (performance, size, etc) CIFS is not included by default? I've noticed a lot of other builds are like that, too.
*EDIT* Is it possible I need to checkout a specific version of Hastarin's kernel?
Thanks,
B.
Click to expand...
Click to collapse
Hi! Sorry to hear you're having issues with building the kernel.
Here is a properly formatted patch that I've made: http://www.multiupload.com/FDJ4FXZ4L9
I used the eb_oldcam branch (or was it oldcam_eb? I've forgotten )
Try using the htcleo_hastarinconfig as the defconfig file.
I recommended that toolchain because Hastarin and myself have experienced issues with other toolchains causing the proximity/light sensor to eat up more battery during standby.
Hope this helps!
-------
Oh and Merry Christmas folks!
dapoharoun said:
sorry to disturb here, but if you where to successfully recompile, what will be the benefit?
thanks you
Click to expand...
Click to collapse
Ability to mount shares computers over wifi for playing media.
Fmstrat said:
Ability to mount shares computers over wifi for playing media.
Click to expand...
Click to collapse
It's like having a 4 terabyte sdcard. If you have say a 30,000 song collection, and you connect to your home computer via wifi at home you click the songs and they play instantly. For me, I click any one of my 3000 movies and they play on my hd2 in 10 seconds, and I can fast forward and rewind almost instantly.
If you are on the road and have a vpn to your computer and you 'mount the home share remotely' you now have a "virtual sd card" with 30,000 songs that play when you click the songs after about a 6 second lag.
DarkStone1337 said:
Hi! Sorry to hear you're having issues with building the kernel.
Here is a properly formatted patch that I've made: http://www.multiupload.com/FDJ4FXZ4L9
I used the eb_oldcam branch (or was it oldcam_eb? I've forgotten )
Try using the htcleo_hastarinconfig as the defconfig file.
I recommended that toolchain because Hastarin and myself have experienced issues with other toolchains causing the proximity/light sensor to eat up more battery during standby.
Hope this helps!
-------
Oh and Merry Christmas folks!
Click to expand...
Click to collapse
Good news everyone. It's working.
Thanks DarkStone for all your input, using the default config and eb_oldcam worked with the new patch you provided on the first try this time (Btw, I am using the toolchain you recommended now). I do have one last question though, how do I get it to load cifs.ko on boot? Android doesn't appear to have any modprobe.conf or anything similar that I see, so I must be missing something. I have to insmod it manually right now.
*EDIT*: I ended up rebuilding it directly into the kernel instead of a module for now, which works. I know that's not "proper" but that will ensure CIFS is always loaded even if the build doesn't load it by default. If you know a better way, I'm all ears Thanks again! */EDIT*
For everyone else, this is not an EXACT copy of the SuperRAM kernel that DarkStone used, but it's pretty close and seems to be the config they recommend going forward. Rather than post it here right now, I'll give it out as a Christmas gift later today in the Development forum since it will really apply to any RAM release going forward that uses Hastarin's kernel and post a link here. This will give me some time to test and ensure nothing goes weird.
Thanks,
B.
OK, it's all done: Download, installation instructions, and FAQ
I've also opened a thread back in the Android Development section since this is no longer a Q&A: http://forum.xda-developers.com/showthread.php?t=887567
Thanks,
B.
[SCRIPT] A Handy Script to build CyanogenMod from source: "It does stuff" [v0.2]
I know everyone's probably like, hey, since CM is officially released, why do we need this? I'll tell you why. You know how all of the other phones get nightlies? I feel left out. That's why I've created this handy script to walk you through everything from getting source to building and eventually flashing. The script will be updated somewhat frequently as I add features and such. To start off, I'll walk you through how to use it. There are several switches that you can use, such as setup, init, clean, or dirty. Setup will do the initial setup for you, installing packages and repo and rebooting your computer. Init will initialize the CyanogenMod repository on your computer. Clean will build with a "make clean" to be sure everything is fresh. Dirty will, you guessed it, build what I consider a "dirty" build, with no make clean. Much faster, but more prone to glitches. Usage is simply cd'ing to where you saved the file, possibly chmod a+x'ing it (I'm not sure if mediafire retains the permissions set on a file locally), and then running ./buildscript.sh your_option_here. (Example:
Code:
./buildscript.sh clean
will clean your repositories and build from scratch.) Thats it! Have fun, and be safe.
*I am not responsible for any damages, emotional harm, dead puppies or goldfish caused by using this script.
Download: HERE
Come here to report issues, glitches, and/or enhancements.
https://github.com/ytt3r/buildscripts/issues
v0.3(Coming Soon)
Fixed running the radio script
A few minor changes
More aesthetic changes
v0.2
Added an option not to reboot on setup of repo
Aesthetic changes
Added copying of modules to the correct locations
Other stuff I can't remember (maybe, I'm too lazy to diff) lol
v0.1
Initial script: enables users to do several things very easily
You're just trying to make me boot into Linux more often, aren't you? I will definitely be taking advantage of this.
Sent from my CM7 powered captivate
Brilliant.
I still haven't synced the repo, I started to but it ate up so much bandwidth on my network.
This'll do it for you
Sent from my Captivate using XDA App
I am wondering if you can give the exact process we need to run this script in and what os it supports.
Currently trying to run it on an ubuntu install and having some problems. I run setup and it eventually asks to reboot and continue the script, i hit yes and it exits the script. nothing more. I reboot and then try to do the script with init but complains about missing directories.
found some errors when doing setup
E: Unable to locate package lib32z1-dev
E: Unable to locate package lib32ncurses5-dev
E: Unable to locate package lib32readline5-dev
./buildcaptivate.sh: line 22: curl: command not found
Click to expand...
Click to collapse
Are you on a 64 bit system?
Sent from my Captivate using XDA App
ytt3r said:
Are you on a 64 bit system?
Sent from my Captivate using XDA App
Click to expand...
Click to collapse
Its in vmware an very well could be 64-bit, or 32-bit.
looked it up and its 32-bit i guess.
Is the script for only 64-bit?
for the sake of learning something, could i get a laymans explanation of what this does?
or am i on the right track by...
it builds a captivate CM rom from (Android? not samsung) source?
ccdoggy said:
Its in vmware an very well could be 64-bit, or 32-bit.
looked it up and its 32-bit i guess.
Is the script for only 64-bit?
Click to expand...
Click to collapse
Only runs on a 64 bit system.
Trusselo said:
for the sake of learning something, could i get a laymans explanation of what this does?
or am i on the right track by...
it builds a captivate CM rom from (Android? not samsung) source?
Click to expand...
Click to collapse
You can run it every night by saying something like
Code:
./buildcaptivate.sh clean
which will build CyanogenMod clean for you, as an unofficial self-built nightly.
Do Not Run Current Version
This script makes some alarming system-wide changes:
Code:
sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh
and that's just in the first few lines, I haven't even read through the rest of the way through the script yet.
y3ttr, you need to go through this script and find ways of doing this with less system wide impact, and you need to spell out in the OP exactly what system changes are still made (the new apt repositories, for instance, which is a system change you likely won't be able to get around, for instance). Also, I recommend having stuff like the source location and stuff to be a variable that can be changed (for instance, lots of people would prefer to keep source in /usr/src, etc).
Another option you could look into is using a chroot jail for a lot of the build process, so you don't impact the wider system. Also, add some if/else statements so that this can run on something other than Ubuntu 64bit. Shouldn't be that hard.
Edit: i've read through some more of the script, here are some more thoughts:
no need to reboot, use source ~/.bashrc. But even for that, you shouldn't be adding stuff to a users' PATH permanently. Just do it in the script leave it at that.
to make it i386 or x64 compatible, use a uname -p to determine the arch type and a switch statement
do not change the default shell. there should be no need.
too many hard coded paths. use some variables, $PWD, and which to figure out locations and paths.
to make this really cool, have an option to automatically copy it to /usr/local/bin and have it run from cron every night.
have an variable to set where the build root is located, and another one to set where the final builds will be dumped (for instance: build in /usr/src, but place the final builds in ~/cyanogenmod/).
DamnMersault said:
This script makes some alarming system-wide changes:
Code:
sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh
and that's just in the first few lines, I haven't even read through the rest of the way through the script yet.
y3ttr, you need to go through this script and find ways of doing this with less system wide impact, and you need to spell out in the OP exactly what system changes are still made (the new apt repositories, for instance, which is a system change you likely won't be able to get around, for instance). Also, I recommend having stuff like the source location and stuff to be a variable that can be changed (for instance, lots of people would prefer to keep source in /usr/src, etc).
Another option you could look into is using a chroot jail for a lot of the build process, so you don't impact the wider system. Also, add some if/else statements so that this can run on something other than Ubuntu 64bit. Shouldn't be that hard.
Click to expand...
Click to collapse
This removal of sh is required as ubuntu defaults to using dash for some god-forsaken reason instead of bash. so the symlink must be placed in (most people won't even notice a difference for the remainder of their ubuntu lifespans) to guarantee that bash is used for all the building process (as it's required).
also, this isn't meant to truly be "configurable" as you're describing, it's merely meant to be simple/easy for people to build their own nightly (at their own risk)
Kaik541 said:
This removal of sh is required as ubuntu defaults to using dash for some god-forsaken reason instead of bash. so the symlink must be placed in (most people won't even notice a difference for the remainder of their ubuntu lifespans) to guarantee that bash is used for all the building process (as it's required).
also, this isn't meant to truly be "configurable" as you're describing, it's merely meant to be simple/easy for people to build their own nightly (at their own risk)
Click to expand...
Click to collapse
If the build process requires bash, then the build scripts should specify #!/bin/bash, not #!/bin/sh.
E: Unable to locate package lib32z1-dev
E: Unable to locate package lib32ncurses5-dev
E: Unable to locate package lib32readline5-dev
Click to expand...
Click to collapse
I believe are
lib64z1-dev
libncurses5-dev
libreadline5-dev
on a 32bit system. At least from what I gathered reading a CM forum post.
Hopefully that will save a little bit of time for anyone trying to build on 32bit, there are some extra steps once you start compiling, but I still haven't been able to to figure out why I'm getting fatal errors during the syncing/download process. So I have no idea if the workarounds for a 32bit system work for CM7 during the build process.
Here is the CM thread, post #21. Link.
ytt3r, regarding your script...
It does stuff !
Truly priceless quote.
Sent from my SAMSUNG-SGH-I897 using XDA App
Thank you for this! It seems to be working... I don't know if it's the repo or my ubuntu acting weird....
Kernel don't want to build (either manually or with this)
But I was able to do it 2 days ago with the same computer.! Will try again later.
Since this is in the Moto G (Falcon) forum, these steps are for the Falcon. This does not mean that it isn't the same for other phones! Even if you don't own a Falcon device, feel free to ask for help here!
Prerequisites:
- You must have a Linux firmware running on your computer (I suggest Builduntu because you can skip the next one [build environment setup])
- Build environment setup (Put the this in terminal and follow instructions)
- Patience and a heart willing to learn
- You need to know the languages C, C++, Java, Ruby, Python... NOT! You don't need to know ANY coding languages.
[MOTIVATIONAL SPEECH]
Truth be told, when I first started out developing, I knew NO coding languages except for HTML and a little bit of Java. Both have nothing to do with kernels! I actually learned how to do this when I suffered from a concussion. So if you really want to learn how to kernel dev and you give up halfway, just know that a 14 year old kid with a concussion beat you .
[/MOTIVATIONAL SPEECH]
Click to expand...
Click to collapse
WARNING: I am not responsible for any damages to your phone or computer or pet unicorn. When you modify the wrong partitions, set too many jobs for your compiler etc., that is not anyone's fault but yours.
Your Personal Handbook to the Following:
- Anything inside "CODE" boxes, type it into your terminal. If you can't find terminal, then press CTRL, ALT, t.
- If I were you, I would write these by hand instead of copying and pasting it because after a certain amount of times, you will remember the linux commands and it will be easier for you to compile more kernels for different devices
- Use this thread as a "Help Me" button. Ask for help!
Click to expand...
Click to collapse
A New Beginning:
Let's start out with something simple, getting the actual code:
Code:
git clone https://github.com/cyanogenmod/android_kernel_motorola_msm8226
This could range from 3 minutes to 2 hours! Read a book, count your fingers, watch ****, and wait patiently.
Once that's done, open up your file manager and rename the folder (should be android_kernel_motorola_msm8226) to whatever you want. I will refer it as "mykernel".
Click to expand...
Click to collapse
Pokemon!
For this tutorial, we will be using a Sabermod 4.7 toolchain to compile. I WOULD teach you how to compile with 4.8+, but it creates errors that will take even longer for me to write about sooooooooo :fingers-crossed:. Now to get the toolchain:
Code:
git clone https://github.com/SaberMod/android_prebuilts_gcc_linux-x86_arm_sabermod-arm-eabi-4.7
Rename this to whatever you like, but I will be referring this as "toolchain"
Now go into you folder where the kernel source is stored...
Code:
cd mykernel
Click to expand...
Click to collapse
Almost done :
Time to set-up the compiler!
Code:
export CROSS_COMPILE=/home/*your linux name*/toolchain/bin/arm-eabi-
This tells the toolchain that "OK, we want to make ALL this code here into a kernel".
This next line tells it that your defconfig (the toolchain's manual for compiling the kernel) that it's in the arch/arm/configs folder.
Code:
export ARCH=arm
Now to tell the it what the defconfig is!
Code:
make falcon_defconfig
Hehe, now to the hardest part of all...
MuHAHHAHAHa
Click to expand...
Click to collapse
THE HARD PART
You ready for this? HERE IT IS! TIME TO BUILD THE KERNEL!
Code:
make -j4
Now sit back, relax, and watch the code! Or you could read a book, watch ****, count your fingers, play with your toes...
If you have an error during the waterfall of code, find the part where it actually says *error* (you'll probably have to scroll upwards) and search it on Google or post it here.
Click to expand...
Click to collapse
THE EASY PART
If you manage to get something that says "the kernel zImage is ready" or something like that, that means you've made it!
You have officially compiled your own kernel from source! Now you need to put it in a flashable zip.
Download this file and open it up, but DON'T EXTRACT IT.
Now go to your kernel source then "CTRL + F" and search for "zimage-dtb".
Find it and put it in the "kernel" folder of "FalconKernel - Signed.zip". Then "CTRL + F" and search ".ko".
Copy radio-iris-transport.ko and put it in the system/lib/modules (not pronto) of the zip.
Then find wlan.ko and rename it to pronto_wlan.ko. Copy and paste it in system/lib/modules/pronto of the zip.
Click to expand...
Click to collapse
Now you can put it on your phone and flash it!
Reserved
Here I will walk you through on how to add the intelliplug feature made by @faux123
First, fetch my Green Machine kernel source (go into your kernel folder in terminal):
Code:
git fetch https://github.com/YoshiShaPow/green_machine_falcon
Then you could cherry-pick (basically copy) all my cherry picks for intelliplug from my source.
If you do check my source out, you can see there's a little link to a history of commits near the middle of the screen, right above the files/folders. You can see at this page of my features history, you'll see a bunch of commits for intelliplug. I will use those commits and copy it to your own kernel.
This copies the initial coding/first commit of intelliplug!
Code:
git cherry-pick 01a850f
This cherry-picks the remaining commits so that your newly added intelliplug is updated.
Code:
git cherry-pick 6623f2f^..4e1ece7
One more thing though, you need to add the line to compile intelliplug!
Almost all things compiled along with the zImage are in a file called defconfig. What a defconfig does, is tell your machine to build certain modules, kernel objects, drivers, governors, etc.etc.etc.. Now, all of them are found in the folder
arch/arm/configs
Click to expand...
Click to collapse
As stated in the OP, you have to modify the defconfig you use. (CM11 Kernel is falcon_defconfig, Gummy Kernel is msm8226_mmi_defconfig). Open up the corresponding defconfig and add this to ANY line anywhere.
Code:
CONFIG_INTELLI_PLUG=m
Now, for those who are familiar with "y=yes/n=no/m=maybe", you'll see that I specifically told you to put the "m=maybe" one. That's because when you compile the kernel again, right after you're about to start your build. Since you put that "m", the terminal will prompt you with a "y=yes/n=no" question on whether or not you would like to add the following feature. Since you would like to add the feature, put in "y". Later on when you feel more comfortable with adding features to your kernel, you can go back into the defconfig and put it as
Code:
CONFIG_INTELLI_PLUG=y
So that it will compile it without asking, since you have given it an answer.
Now you have officially compiled a "Custom Kernel" and with the knowledge you know, you could create a feature packed one by just kanging (copying one's work/features).
Always remember to
Code:
make clean && make mrproper
after every build to prevent errors and such!
Click to expand...
Click to collapse
One More
One more
Nice guide!
I think it lacks one thing- how to modify the kernel.
The guide only mentions how to compile a preconfigured kernel, just the way it is. Modding kernels and adding new features (like OC, schedulers, s2w etc.) is the cool part about making a kernel yourself IMO.
Just a suggestion.
Sent from my XT1033 using XDA Premium 4 mobile app
KDB223 said:
Nice guide!
I think it lacks one thing- how to modify the kernel.
The guide only mentions how to compile a preconfigured kernel, just the way it is. Modding kernels and adding new features (like OC, schedulers, s2w etc.) is the cool part about making a kernel yourself IMO.
Just a suggestion.
Sent from my XT1033 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Well, I will be putting the reserve posts to good use later
What would be the best way to test a kernel w/o bricking the phone?
adizz4 said:
What would be the best way to test a kernel w/o bricking the phone?
Click to expand...
Click to collapse
You can't brick a phone with an unmodified kernel!
Oops double post
adizz4 said:
What would be the best way to test a kernel w/o bricking the phone?
Click to expand...
Click to collapse
Does "fastboot boot kernel.img" work from bootloader mode?
Also why wouldn't the any kernel zip work if I decompressed and compressed it again. I did that before this thread and it didn't work.
P.Kosunen said:
Does "fastboot boot kernel.img" work from bootloader mode?
Click to expand...
Click to collapse
I've been using that to test. Its a really good way but you'll have to build a boot.img
adizz4 said:
Also why wouldn't the any kernel zip work if I decompressed and compressed it again. I did that before this thread and it didn't work.
I've been using that to test. Its a really good way but you'll have to build a boot.img
Click to expand...
Click to collapse
I specifically said in the tutorial nor to unzip it... The zip is already signed (a prerequisite for flashing) and unzipping will break it.
Did we need sudo before make -j4 command?
Sent from my XT1032
Siekil said:
Did we need sudo before make -j4 command?
Sent from my XT1032
Click to expand...
Click to collapse
Not necessary
I'll be writing more posts on how to add features to your kernel and basic cherry-picking features
I syncd gummy kernel sources and tried to build using linaro and sm but I keep getting this error.
sound/soc/msm/msm8226.c:30:40: fatal error: qdsp6v2/msm-pcm-routing-v2.h: No such file or directory
Click to expand...
Click to collapse
Any inputs on that?
adizz4 said:
I syncd gummy kernel sources and tried to build using linaro and sm but I keep getting this error.
Any inputs on that?
Click to expand...
Click to collapse
Probably a gcc error... I'd try compiling with a 4.7 toolchain. And also, make sure you're using the msm8226_mmi_defconfig since gummy's different
@YoshiShaPow thanks for the guide. I'm using it to begin fooling around with some building.
May I be a pain in the *** and ask you for a lil help? If using the file you provided to insert the build, I get trouble with wifi (in latest Aospa). I don't expect you to solve that, but I was wondering how to make out of the zimage a boot.img file, but I've read around the ramdisk needs to be merged into that, and honestly I'm not so sure how to do that. I found some guides, but none of them is specific for falcon, so I might be goofing around if I follow them?
Also checked the flashing script in the file you provided and noticed that it makes a boot.img on the go, but couldn't figure out how to reproduce that either.
If what I'm asking is too hard or long to be answered , I understand :good:
Edit: now I tried building with Linaro and after sorting out a couple of errors, voilá, I got a build. But again, my wifi gets smashed. Everything else seems to work fine, but when I try to turn wifi on, it's dead, nothing happens. My ideas: could it be something about the way the kernel's flashed skipping a boot.img (ramdisk?)? Is it something about AOSPA (think it shouldn't since it uses CM kernel)? Or should I be looking into my build, making a logcat about the issue and working it back?
fermasia said:
@YoshiShaPow thanks for the guide. I'm using it to begin fooling around with some building.
May I be a pain in the *** and ask you for a lil help? If using the file you provided to insert the build, I get trouble with wifi (in latest Aospa). I don't expect you to solve that, but I was wondering how to make out of the zimage a boot.img file, but I've read around the ramdisk needs to be merged into that, and honestly I'm not so sure how to do that. I found some guides, but none of them is specific for falcon, so I might be goofing around if I follow them?
Also checked the flashing script in the file you provided and noticed that it makes a boot.img on the go, but couldn't figure out how to reproduce that either.
If what I'm asking is too hard or long to be answered , I understand :good:
Edit: now I tried building with Linaro and after sorting out a couple of errors, voilá, I got a build. But again, my wifi gets smashed. Everything else seems to work fine, but when I try to turn wifi on, it's dead, nothing happens. My ideas: could it be something about the way the kernel's flashed skipping a boot.img (ramdisk?)? Is it something about AOSPA (think it shouldn't since it uses CM kernel)? Or should I be looking into my build, making a logcat about the issue and working it back?
Click to expand...
Click to collapse
Sorry, I wanted to wait till I could use a computer to respond.
You must be missing the *.ko files:
You have officially compiled your own kernel from source! Now you need to put it in a flashable zip.
Download this file and open it up, but DON'T EXTRACT IT.
Now go to your kernel source then "CTRL + F" and search for "zimage-dtb".
Find it and put it in the "kernel" folder of "FalconKernel - Signed.zip". Then "CTRL + F" and search ".ko".
Copy radio-iris-transport.ko and put it in the system/lib/modules (not pronto) of the zip.
Then find wlan.ko and rename it to pronto_wlan.ko. Copy and paste it in system/lib/modules/pronto of the zip.
Click to expand...
Click to collapse
kernel for x86 device [Asus zenfone5] can be made using this method?
YoshiShaPow said:
Sorry, I wanted to wait till I could use a computer to respond.
You must be missing the *.ko files:
Click to expand...
Click to collapse
Uhm, no, I followed that part step by step. I did it once more to double check, and I'm still in the same place. Actually, I suspected something and tried your kernel (TGM) and had the same problem (WTF?). I need to try wiping everything and reinstalling aospa to make sure there isn't some other thing going on down there.
But it's ok, I'll figure it out somehow. What I'd really need if you can point me in the right direction, si how to step further into building a boot.img
Or for that I MUST follow the official CM method, meaning syncing the full repo and building just the kernel?
Thanks for your help!
---------- Post added at 10:42 AM ---------- Previous post was at 10:18 AM ----------
sanjib734 said:
kernel for x86 device [Asus zenfone5] can be made using this method?
Click to expand...
Click to collapse
I'd guess it's not about the method. I think there's no CM official support for this device. Do you have any unofficial source to build from (Github)? If so, I guess you could try.
Edit: should check if Sabermod is compatible with the device's arch too.