building an NBH - Touch CDMA Android Development

I was wondering how I would go about building an NBH file. I do dev for and use OpenAFS, and I would like to be able to install an OpenAFS client on my vogue. As I understand it, the NBH contains the kernel, and OpenAFS requires a kernel module.
If I'm barking up the wrong tree, and it's possible to insert a kernel module without needing an entire NBH file, I'd be interested to know if there's anything special that needs to be done for that, or if the standard linux 'insmod' method would work.
I'm also open to any thoughts or feedback on this idea/concept.

summatusmentis said:
I was wondering how I would go about building an NBH file. I do dev for and use OpenAFS, and I would like to be able to install an OpenAFS client on my vogue. As I understand it, the NBH contains the kernel, and OpenAFS requires a kernel module.
If I'm barking up the wrong tree, and it's possible to insert a kernel module without needing an entire NBH file, I'd be interested to know if there's anything special that needs to be done for that, or if the standard linux 'insmod' method would work.
I'm also open to any thoughts or feedback on this idea/concept.
Click to expand...
Click to collapse
insmod will work, just build your module against this kernel:
http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-vogue
If your module needs something enabled in the kernel you may need to build a new nbh, in that case use this:
http://androidhtc.git.sourceforge.net/git/gitweb.cgi?p=androidhtc/tinboot.git;a=summary

Related

Tutorial For building custom rom for G1

Can any body post tutorial for building a custom rom for G1 and Hero?
wrong area to post this... probably should take it off.
were should i put this thread then
Q&A buddy.
I wrote a few how-to's on compiling your own android build from source, i recommend starting here:
http://robblue2x.blogspot.com/2009/07/how-to-set-up-ubuntu-virtual-machine.html
it is a bit out of date now because android moves so fast, its incredibly hard to keep up to date!
robblue2x said:
I wrote a few how-to's on compiling your own android build from source, i recommend starting here:
http://robblue2x.blogspot.com/2009/07/how-to-set-up-ubuntu-virtual-machine.html
it is a bit out of date now because android moves so fast, its incredibly hard to keep up to date!
Click to expand...
Click to collapse
Just visited this link But how do modify the existing files of android OS ?
If you have to ask how to change the files then you probably shouldn't be messing with the code for an OS. There is alot to it. You need to know how to set up linux, Git, repo, sdk, emulator, learn java,maybe some C++, edit xml files, and compile the edited code just to name a few.
read this
If you get that working then all you need is a text editor to start changing code.
Good luck!
What about modding existing roms?
Here is what I know so far...
system apps are not individualy signed
Rom must be packaged in zip having 3 root directories.
data (holds apps normaly)
META-INF (holds some kind of build files... and android manifest)
system (holds the OS and scripts and such.)
Also boot.img in the root dir.
The update.zip needs to be resigned if repackaged.
=) that is it all that I have gathered after hours of searching.
I dont want to recompile a kernel as I dont need to modify one. I would rather leave that to the more experienced DEVs. All I want is to remove/replace few apps...
My questions:
How do you sign a file... (tried the sign java thing in ubuntu and I get some king of error... could not find library and what not...)
There is a windows batch file floating around I have not tryed that.
I have some basic understanding of code language and I can flollow instructions even if I have to find my way around some stuff... but this rom building is like black magic... Everyone is doing it no one wants to explain how its done... If its too damn hard then so be it. I can modify it on the back end after installing. I just believe in clean simple installs.
What generates the META-INF directory and the files in there. Seems like there is some instructions on setting permissions for certain files and (manifest) seems like signiture keys..
Is that generated when the file is signed?
is it manualy generated?
is can those files be modified?
I know if this is answered it would be helpful in letting people optimize the builds for their own needs.
Sorry for the long post. I hope this gets explained or I dont care if I have to read, give me a bunch of homework (links).
zambezy said:
What about modding existing roms?
Here is what I know so far...
system apps are not individualy signed
Rom must be packaged in zip having 3 root directories.
data (holds apps normaly)
META-INF (holds some kind of build files... and android manifest)
system (holds the OS and scripts and such.)
Also boot.img in the root dir.
The update.zip needs to be resigned if repackaged.
=) that is it all that I have gathered after hours of searching.
I dont want to recompile a kernel as I dont need to modify one. I would rather leave that to the more experienced DEVs. All I want is to remove/replace few apps...
My questions:
How do you sign a file... (tried the sign java thing in ubuntu and I get some king of error... could not find library and what not...)
There is a windows batch file floating around I have not tryed that.
I have some basic understanding of code language and I can flollow instructions even if I have to find my way around some stuff... but this rom building is like black magic... Everyone is doing it no one wants to explain how its done... If its too damn hard then so be it. I can modify it on the back end after installing. I just believe in clean simple installs.
What generates the META-INF directory and the files in there. Seems like there is some instructions on setting permissions for certain files and (manifest) seems like signiture keys..
Is that generated when the file is signed?
is it manualy generated?
is can those files be modified?
I know if this is answered it would be helpful in letting people optimize the builds for their own needs.
Sorry for the long post. I hope this gets explained or I dont care if I have to read, give me a bunch of homework (links).
Click to expand...
Click to collapse
my advice for signing files would be to read through this thread. stericson says that JF's autosigning tool will work in linux. if you still can't get it pm stericson, he is a very nice member and should be able to help you
Thanks... That worked in windows.
Im getting some FC's but I can at least work on that now...
I did remove everything from the MANIFEST before signing just in case something did not get overwriten correctly.
I don't mess with the manifest files, so try not touching them and see if that helps
Can any body describe what does these files do while building a theme and how to edit these files:
android.policy.jar
framework.jar
services.jar
build.prop
build.sapphire.prop
build.trout.prop
sabin123 said:
Can any body describe what does these files do while building a theme and how to edit these files:
android.policy.jar
framework.jar
services.jar
build.prop
build.sapphire.prop
build.trout.prop
Click to expand...
Click to collapse
the prop files are configuration files and should NOT be replaced if your making a theme.
the .jar's should only be messed with if your adding stericsons lockscreen. you will have to decompile them for it to work
How to decompile the services.jar files?
Check out my theme thread. It's from when I was porting Android but most of these questions are explained in pretty good detail with links for more info. That should help you out quite a bit:
http://forum.xda-developers.com/showthread.php?t=578421
Go to the second post
Thanks for the link..

(Is it possible to) edit boot.img under Windows?

The title says it all... I need to change that boot.rc script... and maybe replace the kernel.
Do I need windows for that?
somebody said something about cygwin... or anything...
Will that do the trick? and how?
Or can I use the shell on my phone for unpacking and creating boot.img files? (via adb for example)
Thanks in advance
check out the link in my sig.
it's a kitchen that can be run in windows under cygwin.
it allows you to extract the kernel from your rom and repack it, among other things.
not sure if that's quite what you need, but it might be worth looking at.

Kernel quesions:

Is there a reliable way to split the initramfs out of the zImage, make adjustments and re-combine it with the kernel? I know on the i9000 series there was a script that could do this, and I've found a script for extracting just the initramfs but nothing to put it back together..
mssmison said:
Is there a reliable way to split the initramfs out of the zImage, make adjustments and re-combine it with the kernel? I know on the i9000 series there was a script that could do this, and I've found a script for extracting just the initramfs but nothing to put it back together..
Click to expand...
Click to collapse
You have to recompile the kernel. In the .config file there's a variable you change to point it to your modified rootfs so the kernel compile can include it.
CONFIG_INITRAMFS_SOURCE="/path/to/rootfs"
(For Sorint you make the changes in p1_defconfig)
BTW, I'm in need of a stock Sprint EF17 zImage. If you have one, I'd appreciate a copy!
That's unfortunate. I was really hoping to be able to do it without recompiling the kernel.
Oh well. Thanks for the info!

[Q] Chromecast command line primer

Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.
bobcat987 said:
Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.
Click to expand...
Click to collapse
I think we need to edit /init.rc
but it's write protected =/
bobcat987 said:
Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.
Click to expand...
Click to collapse
Mape0661 said:
I think we need to edit /init.rc
but it's write protected =/
Click to expand...
Click to collapse
You can, but you would have to do the modifications with an extracted system image, re-squashfs it back up, and then flash it back to the device.
Thanks for the replies. If I'm feeling bold this weekend I'll take a look at creating a one-off /system for this.
bobcat987 said:
Thanks for the replies. If I'm feeling bold this weekend I'll take a look at creating a one-off /system for this.
Click to expand...
Click to collapse
I've been writing some, gonna post it later on git if you want to see it.
mostly stuff to make it easy to start ftp, samba etc.
/mape
ddggttff3 said:
You can, but you would have to do the modifications with an extracted system image, re-squashfs it back up, and then flash it back to the device.
Click to expand...
Click to collapse
Seeing this you guys are making me think (always dangerous!)
Is it possible to code and inject an on device player app that could be inserted into the system (similar to Netflix) that could be triggered by another app for local playback without the need for an Internet connection?
Something like that would really increase the streaming capability for areas where Internet connection is not available.
And if the right code is found could even give local streams DHT capability if we had the ability to add those codecs to the player system.
ddggttff3 said:
You can, but you would have to do the modifications with an extracted system image, re-squashfs it back up, and then flash it back to the device.
Click to expand...
Click to collapse
I've been looking at system.img from 19084.001.zip
it seems it only got this then I unsquashfs it
[email protected]:~/squashfs-root# ls
bin boot chrome etc lib netflix res usr
I'm I looking in the wrong file?
Mape0661 said:
I've been looking at system.img from 19084.001.zip
it seems it only got this then I unsquashfs it
[email protected]:~/squashfs-root# ls
bin boot chrome etc lib netflix res usr
I'm I looking in the wrong file?
Click to expand...
Click to collapse
if you want to modify init.rc, then you need to extract the initramfs from the kernel, modify it, repackage the initramfs, compile the kernel from src (as the default one is signed, and can't be merged with a modified initramfs), and then merge the compiled kernel with the initramfs you modified.
ddggttff3 said:
if you want to modify init.rc, then you need to extract the initramfs from the kernel, modify it, repackage the initramfs, compile the kernel from src (as the default one is signed, and can't be merged with a modified initramfs), and then merge the compiled kernel with the initramfs you modified.
Click to expand...
Click to collapse
Looks like this gonna be my "children are sleeping" project for some time .-)
Well I extracted initramfs from boot.img and mounted it with cpio. At least I'm looking at the right files. I have never compiled a kernel for this kind of devices before (only for my computer) and I having trubble to cross compile, my arm compiled programs wont run on CC.
Do you got some good pages I can read and learn this stuff from?

[REQUEST] Module to replace a file in vendor/etc

I have an LG V60 phone and I would like to put the phone in "high impedance mode" all the the time for more power to the earphones even if they are less than 50 ohm impedance.
In LG V40/50, it was very simple by rooting the phone and making some modifications in the one of the files that was in the "vendor/etc" directory. The problem with LG V60 is it does not allow any write access to the vendor folder at all.
So the only feasible option that I can think of is to create a Magisk module that replaces the original file with the modified one. My biggest disadvantage is not knowing anything about writing codes including Magisk module ones. So I was wondering if anyone could create a Magisk module that would replace the original file through Magisk?
ADDTIONAL INOFRMATION:
I am running Magisk 25 on a fully rooted LG V60.
The file that needs to be changed is mixer_paths.xml and it resides in the "vendor/etc" folder. I have created the modified file.
So if someone is able to develop a module to accomplish this, I will place the modified file in the "system/vendor/etc" folder of the Magisk module, as I understand it.
Many thanks for your support!
You can use this template system in future as its super easy
The template itself is here
GitHub - Zackptg5/MMT-Extended: Magisk Module Template Extended
Magisk Module Template Extended. Contribute to Zackptg5/MMT-Extended development by creating an account on GitHub.
github.com
click the Code button, then download zip
then extract the zip into a folder and rename the folder "MMT-Extended-master" to the something more meaningful, like the name of your module
Read the wiki and docs here to go step by step to create your first module:
Home
Magisk Module Template Extended. Contribute to Zackptg5/MMT-Extended development by creating an account on GitHub.
github.com
Notably the heading:
How do I make a MMT Extended mod?​
The steps for a simple file addition/replacement module, which are simple, should be steps 1-4, then 8. Then zip up the modules (as a zip) and test.
For you, if you read along (in Step 3) you will need to create a folder vendor, under the existing system one, and then a further etc folder under vendor, and put the necessary file (mixer_paths.xml in there.
If you try and fail, post back and someone will assist. But we prefer people to at least read the documentation and try first, ideally...this is the way the great didgeridoohan mentored myself and many others, he was not big on spoonfeeding
Imagine the satisfaction you might get finding out youre capable of such feats...i promise its not rocket surgery
Feel free to PM even, if you get stuck and think you have a silly question - of course knowing me, and i do, you'll probably get an even sillier, and off topic answer as well...
hint: you can knock out this basic module in far far less time than it took me to write all this
Thank you!
So my changes look like this:
1. Put the modified file in the system/vendor/etc folder of the Magisk module.
2. Made the needed changes to the customize.sh as attached.
Royaltiger said:
Thank you!
So my changes look like this:
1. Put the modified file in the system/vendor/etc folder of the Magisk module.
2. Made the needed changes to the customize.sh as attached.
Click to expand...
Click to collapse
Yes, though you'll need to uncomment (remove the leading #) from the set_perm lines to make them active, also you only really need the 2nd one
Royaltiger said:
Thank you
73sydney said:
Yes, though you'll need to uncomment (remove the leading #) from the set_perm lines to make them active, also you only really need the 2nd one
Click to expand...
Click to collapse
Click to expand...
Click to collapse
So I made the module with the suggested changes in customize.sh and put the modified mixer_path.xml file in the system/vendor/etc folder of the module. Module installs fine with Magisk but when it reboots, the device hangs on the initial LG screen and does not go anywhere from there.
I am attaching the customize.sh snapshot. Also, attached is the module file.
See here under "Disabling/uninstalling modules manually" if youre not able to boot
Module Issues:Magisk and MagiskHide Installation and Troubleshooting guide
www.didgeridoohan.com
I am assuming that it is not possible to accomplish what I wanted to achieve.
Royaltiger said:
I am assuming that it is not possible to accomplish what I wanted to achieve.
Click to expand...
Click to collapse
mixer_paths files have been replaced for years, long before magisk even...i did it back as far as the Galaxy S2 from memory, so im not sure why this didnt work for you, was the mxer_paths file specifically for your device? i have no clear idea why it hasnt worked for you
this thread has a guide to making /system RW, so you could manually copy the file and overwrite it, but id really consider how much you want to replace mixer_paths before i set out to do that
V60 Bootloader Unlock and Magisk Root
Earlier today I was alerted to https://www.cnblogs.com/yanhua-tj/p/15525593.html which has the actual firehose and steps to unlock! However it seems to be in Simplified Chinese so I'll translate it here for you. The firehose is attached below...
forum.xda-developers.com
73sydney said:
mixer_paths files have been replaced for years, long before magisk even...i did it back as far as the Galaxy S2 from memory, so im not sure why this didnt work for you, was the mxer_paths file specifically for your device? i have no clear idea why it hasnt worked for you
this thread has a guide to making /system RW, so you could manually copy the file and overwrite it, but id really consider how much you want to replace mixer_paths before i set out to do that
V60 Bootloader Unlock and Magisk Root
Earlier today I was alerted to https://www.cnblogs.com/yanhua-tj/p/15525593.html which has the actual firehose and steps to unlock! However it seems to be in Simplified Chinese so I'll translate it here for you. The firehose is attached below...
forum.xda-developers.com
Click to expand...
Click to collapse
Actually I had no problem in editing the mixer_tavil.xml file in LG V40/50. But when it comes to LG V60, the file is read-only. There is no way to edit it due to dynamic partition. Hence, I was seeking the only option available i.e., via Magisk module.
Royaltiger said:
Actually I had no problem in editing the mixer_tavil.xml file in LG V40/50. But when it comes to LG V60, the file is read-only. There is no way to edit it due to dynamic partition. Hence, I was seeking the only option available i.e., via Magisk module.
Click to expand...
Click to collapse
So, I encountered the same problem and found what you did wrong. I was able to write my own Magisk module and it works wonderfully. It took so much time to understand how to do it because there is no proper tutorial.
If you are still active and trying to know how to do it the right way, here comes the explanation:
The Replace = " /system/vendor/etc/ " must not be written as it completely wipes the actual folder from your phone. This is why you were not able to turn the phone on. It should be like this:
Replace = " " (That part must be blank)
The rest of the code is good. If you try it like this now, you will see it will work, just like mine did.
Cheers
Does not work. May I see your module? Please upload it here as attachment.
I even put my edited file under /data/adb/modules/<my directory>/system/vendor/etc. It shows up in Magisk as a module and the file loads (as it is not visible in file explorer) but there is no change in volume. So the thing is not working.

Categories

Resources