Building your own ROM

You had offline-charging right all along Tom, just needed a slight change in the order I believe. Seems your test for last_kmsg does work, but the tails were not applied appropriately.

Note- I have included root/sbin/ftmpower and system/bin/battery_charging binaries from the stock OV system dump in the build I tested this on via device_thunderc.mk. I haven't tried without them yet, so I don't know if they have any impact. They were not added in as part of this commit, will test without them tomorrow (too tired now).

In init.c, there was already a battchg_pause variable being used, but it was never flagged properly I assume due to the OS and kernel not communicating the reboot command. We can use the last_kmsg test to set that variable appropriately, and then it adds the boot-pause queue-tail at the right moment. No need to add warm/cold tails, or write new drivers for the kernel.

Great work! Thanks for investigating this. I totally missed the battchg_pause variable in init.c.
 
  • Like
Reactions: JerryScript
I believe this is the behaviour we have been looking for. Now users can have offline-charging, and I can charge my phone overnight without worrying about some random crash rebooting it into offline-charging mode and making me miss alarms and phone calls!

Thanks again Tom!

This is impressive, Jerry. Thank you!

Edit: I can also confirm that it works perfect as described in your post.
 
Last edited:
  • Like
Reactions: JerryScript
I decided to go with including a modified xda/CM bootsound binary in the build. This way, a setting can be added to the CMParts Sound menu to allow it to be disabled even if the bootanimation is still enabled. I'll probably change it in init.thunderc.rc to fire on it's own instead of with the bootanimation, that way users who want bootsound but not bootanimation can have it their way. I changed the check in the xda/cm bootsound shell script to use getprop persist.sys.bootsound instead of a build.prop grep.

CMParts commit
Vendor commit (dirty)
Device commit (dirtier)

@Tim: thanks for the help with the stock bootsound, but as you said, this is open source, and easier to modify to our liking.

Thanks to eollie for originally letting us know about the CM (xda) version of bootsound!
 
  • Like
Reactions: mrg666 and BobZhome
Did a build today to get the updates ya'll have done. Everything works fine with the exception of the power button. It turns the phone on but will not wake the phone or turn it off. Any ideas. This is just a straight build from the repo, I didn't change anything. Thanks for any help.
 
I added an option to set a user defined image as the background in the notification dropdown. Added the option to the same array as the previous ones.

Instead of building it into CMParts, I followed the template of Pedlar's CMBootanimation, and created a helper package named android_packages_apps_CMBackgroundChooser. This can be easily extended to set background images for other gui elements as well. However, each gui element will need it's own preference detection and file IO to grab the selected image.

All changes have been pushed to github, but as usual, I derped one in with a commit to add an option to disable ICS rotation animations, all you need from that one is the changes to UIStatusBarActivity. ;)
 
  • Like
Reactions: BobZhome
Hey there, I had a question for you guys, hopefully you can help me out.

I'm new to building my own ROMs here, although I successfully built my own using your tutorial!

Just a few things....

I want to make my own custom ROM and maintain and keep the code in Github.

I already went ahead and forked the IHO repo mentioned in the 3rd post on this thread, but then I got a little lost.

Ideally what I want to do is have my own repo that is forked from IHO, but have the updates coming from the IHO repo come to my repo as well.

I want to be able to push my own changed to my repo while also being able to fetch the changes from the IHO repo when it is updated.

I'm not really sure how to use repo and git commands in conjunction, and I was hoping somebody could help me get started.

*EDIT* I also think i might have forked the wrong repo or I might need to fork another one...
 
Last edited:
`Repo sync is used to grab all the package files you need.

If you want to fork and maintain your own repositories, you will need to fork the following from IHO:
-android
-device_lge_thunderc
-vendor_lge_thunderc
-vendor_cyanogen
-system_core
-dalvik
-frameworks_base

Once you fork them via the github webpages, you can cd into your repo synced matching directories and do the following:

first your repositories are called origin:
git remote add origin git@github.com:YOUR_REPO_NAME/NAME_OF_REPO_DIRECTORY.git
then set up the iho remote:
git remote add iho git://github.com/inferiorhumanorgans/NAME_OF_REPO.git
Note- your repository is added via git@, other repositories are added via git://


Then you need to set up the gingerbread branch in each directory:

git branch gingerbread
git checkout gingerbread

(or git branch ics ;))

Now you can fetch/merge or pull (auto fetch/merge) changes from IHO, I use pull, but I always check the github website so I know what changes I'm pulling in first, and am prepared to deal with merge conflicts as necessary:

git pull iho gingerbread

Once you have pulled in changes, or made your own, you have to commit them to your local directories:

git commit -a
<enter a commit message>
<press cntrl+o>
<press cntrl+x>


Now your changes are a part of your local directories, so you can now push them back to your github repositories:

git push origin

I would suggest you read the github man pages, and follow their examples before attempting something as large and complex as IHO. ;)
 
Last edited:
So I went ahead and forked all those repos, now about the remotes...

Do I add remotes for all the repos on my local devbox, and is that just a matter of running:

Code:
git remote add origin git@github.com:YOUR_REPO_NAME/NAME_OF_REPO_DIRECTORY.git

for each of the repos? and then also should i do the same for each of the IHO repos to keep my forked repos synced with the IHO repo?

Sorry, hope this makes sense. Thanks so much for the help, I'm already starting to understand this better.

*EDIT* One more thing. I am developing for the LS670, and selected LS670 when I ran lunch. Just thought that might be helpful just in case there are any OV-specific repos I don't need or something. Thought it would be helpful to mention.
 
Last edited:
Jerry, you're a life saver. I felt stupid because I only forked a few things from BobZHome, and then got lost and decided to stay away from git until I learned a little more.
It's so ironic :)
 
So I went ahead and forked all those repos, now about the remotes...

Do I add remotes for all the repos on my local devbox, and is that just a matter of running:

Code:
git remote add origin git@github.com:YOUR_REPO_NAME/NAME_OF_REPO_DIRECTORY.git

for each of the repos? and then also should i do the same for each of the IHO repos to keep my forked repos synced with the IHO repo?

Sorry, hope this makes sense. Thanks so much for the help, I'm already starting to understand this better.

*EDIT* One more thing. I am developing for the LS670, and selected LS670 when I ran lunch. Just thought that might be helpful just in case there are any OV-specific repos I don't need or something. Thought it would be helpful to mention.

You only need to add remotes to those repos you are making changes to, or are expecting to make changes to.

Remember, all the packages you downloaded via repo sync come from other repositories, see your android/default.xml file for details about each package and where they sync from.
 
Alright, so I think I figured out a little more about the building process.

I took a look at the default.xml file in the android repository I forked from IHO, and I'm pretty sure I now know how the rest of the repositories fit in. For example, on line 235:

Code:
  <project path="frameworks/base" name="inferiorhumanorgans/android_frameworks_base" />

I'm guessing if i replace "inferiorhumanorgans/android_frameworks_base" with "something15525/android_frameworks_base" that it would now grab from my repo instead of the IHO repo.

One more thing...on line 322:

Code:
  <project path="system/bluetooth" name="inferiorhumanorgans/android_system_bluetooth" />

I went ahead and forked that repo as well, even though you didn't tell me to...

How am I doing so far?

*EDIT* One more thing:

Is the default.xml file in the android repository what is responsible for syncing with the latest cyanogen upstream? I think this is actually starting to make sense!
 
Hey Jerry, I ran into an error last night that I couldn't for the life of me get past.
So, doing what every great developer doesn't do, I deleted my ~/android/system file. ;) (thinking that now because I've set up my repo, I can just sync from that and get everything back to the way it was.
But, an odd thing, when I had my repo, I edited a file that wouldn't let me make bacon, so that it would. Then I pushed that change to github, and I saw it go in successfully.
When I built from my repo today, it gave me the same error that I recieved before, even though I changed it. It wasn't so hard to change it again, but it got to me a little. How come I edited a file and it didn't go through in a repo sync?

Hopefully this was specific enough. I'm a git noob, in case you haven't noticed yet.. :)
 
And one more question while I'm at it.. (this is going to sound real stupid, lol)
How do you delete an apk from being in your build anymore?
I tried deleting it from /out/target/product/thunderc/system/app, but it just keeps showing up after make bacon.
I do realize that there is a directory that tells the terminal to put the apk in there, (hence the word "out")
but I can't find that directory for the life of me.
This will save a lot of my time with the process :)
 
And one more question while I'm at it.. (this is going to sound real stupid, lol)
How do you delete an apk from being in your build anymore?
I tried deleting it from /out/target/product/thunderc/system/app, but it just keeps showing up after make bacon.
I do realize that there is a directory that tells the terminal to put the apk in there, (hence the word "out")
but I can't find that directory for the life of me.
This will save a lot of my time with the process :)

I'm not aware that you can, at least easily. Best is to find where the package is being referenced and remove it there.

That said, I have done a little hook to the build script to install zip files (for the recent gapps inclusion) and you could use a similar mechanism (but again I don't recommend it).

I called the script vendor/cm/tools/install_package.pl. I set PRODUCT_INSTALL_PACKAGE in my device .mk fragment to invoke it.

Code:
diff --git a/core/Makefile b/core/Makefile
index fd1c06b..8ee89f9 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -872,6 +872,9 @@ endef
 endif # INTERNAL_USERIMAGES_USE_EXT
 
 $(BUILT_SYSTEMIMAGE): $(FULL_SYSTEMIMAGE_DEPS) $(INSTALLED_FILES_FILE)
+ifneq ($(PRODUCT_INSTALL_PACKAGE),)
+       vendor/cm/tools/install_package.pl $(PRODUCT_INSTALL_PACKAGE) $(TARGET_OUT)
+endif
        $(call build-systemimage-target,$@)
 
 INSTALLED_SYSTEMIMAGE := $(PRODUCT_OUT)/system.img
 
Alright, so I think I figured out a little more about the building process.

I took a look at the default.xml file in the android repository I forked from IHO, and I'm pretty sure I now know how the rest of the repositories fit in. For example, on line 235:

Code:
  <project path="frameworks/base" name="inferiorhumanorgans/android_frameworks_base" />

I'm guessing if i replace "inferiorhumanorgans/android_frameworks_base" with "something15525/android_frameworks_base" that it would now grab from my repo instead of the IHO repo.

One more thing...on line 322:

Code:
  <project path="system/bluetooth" name="inferiorhumanorgans/android_system_bluetooth" />

I went ahead and forked that repo as well, even though you didn't tell me to...

How am I doing so far?

*EDIT* One more thing:

Is the default.xml file in the android repository what is responsible for syncing with the latest cyanogen upstream? I think this is actually starting to make sense!

Sorry, did you guys see this? Just wondering if i'm doing things right....
 
Alright, so I think I figured out a little more about the building process.

I took a look at the default.xml file in the android repository I forked from IHO, and I'm pretty sure I now know how the rest of the repositories fit in. For example, on line 235:

Code:
  <project path="frameworks/base" name="inferiorhumanorgans/android_frameworks_base" />

I'm guessing if i replace "inferiorhumanorgans/android_frameworks_base" with "something15525/android_frameworks_base" that it would now grab from my repo instead of the IHO repo.

One more thing...on line 322:

Code:
  <project path="system/bluetooth" name="inferiorhumanorgans/android_system_bluetooth" />

I went ahead and forked that repo as well, even though you didn't tell me to...

How am I doing so far?

*EDIT* One more thing:

Is the default.xml file in the android repository what is responsible for syncing with the latest cyanogen upstream? I think this is actually starting to make sense!
Sorry it took a while to respond, I'm busy with ICS and finishing up some changes to CM7.2

The /android/default.xml is what controls the packages that repo sync will grab.

If you want to grab from a different repository, you need to add the details at the top of the file, use this as a template:
Code:
  <remote  name="github"
           fetch="git://github.com/"
           review="review.cyanogenmod.com" />
Change the name to something unique for your build, then lower down where you were looking, you'll be able to add your github as the leading qualifier, example:
Code:
  <project path="system/bluetooth" name="JerryScript/android_system_bluetooth" />

And yes, I forgot to include bluetooth as one of the repositories you should fork for IHO-CM7.2 ;)