Tweaking the minfree settings on boot - Galaxy Tab Q&A, Help & Troubleshooting

I'd like to tweak the minfree settings on boot up but am struggling to find an editable script that I can sneak the command into. Googling around I see that other Galaxy devices hijack the playlogo script, but this is a binary on the Tab. Are there any Samsung-heads out there (I'm from HTC-land) who can point me at some resources that might help, or have a suggestion for an appropriate alternative editable script?

The .rc scripts on the Tab all seem to get rebuilt at boot-time, I've spent quite a while trying to find some alternative so that we can auto-load the CIFS modules and haven't had any joy. If someone can find an alternative somewhere then it'd make things much easier.
I wonder if mounting the appropriate .RFS partition file, editing the init.rc file (or similar) within it to chain-load a user-editable .rc from the /data/ folder, and then reflashing the RFS would do the job? The girlfriend has me booked out until Sunday evening so I won't be able to try it until then, if someone else could have a look...

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..

[Android] Dr. NoMoRootfs! or How I learned to stop worrying and love the extra space

Everything needs to go in /sdcard/andboot
FILES YOU NEED:
the nbh flashed to your phone
an sd card with the andboot folder at the top level
an androidinstall.tar file plopped into the andboot folder
thats it
then just hold down volume up or dpad center or the middle of your touchscreen when booting and go through the menu to choose where to put things and then install the system. (for those without a dpad, pretend the touchscreen is a giant dpad)
if you're doing it with haret, extract basefiles to your sd, plop the androidinstall.tar into the same folder, and boot, hold down volume up (camera on kaiser/polaris) just like the nand people (but don't pick nand to store the files, it won't work)
---------
all the files
basefiles for the haret folks out there
Grab the nbh files for your device. Only difference between eclair and non-eclair is that eclair is set up to use the newer hw3d driver, non-eclair is set to use the older one (for donut/cupcake)
These do not use rootfs. They remove it completely and free up that extra space in your nand for a bigger, cleaner system.
They also have my new menu-based installer! Yay! Just hold-down volume-up or dpad center or the middle of your touchscreen
THIS WON'T WORK WITH ANY OF THE OLDER SYSTEMS! THE SYSTEM MUST INCORPORATE THE APPROPRIATE FILES FROM ROOTFS (and the rom cooks will let you know when theirs is ready)
The first system to use this is based on eclair 2.1 with working sleep and audio
Here's my tattoo system for this method
FYI Craig & I spent a lot of time on these!!!
How to create a build
How to make your build work with this
So it actually isn't that hard.
Extract your sqsh to a folder somewhere, so you have, say /android/system
Mount/extract whichever rootfs worked best with your system somewhere else, say /android/rootfs
Code:
cp -a /android/rootfs/init.etc/* /android/system/etc
cp /android/rootfs/lib/donut/* /android/system/lib
cp /android/rootfs/lib/modules/* /android/system/lib/modules
cp /android/rootfs/lib/hw/* /android/system/lib/hw
cp /android/rootfs/init.cfg/init.donut.rc /android/system/sysinit.rc
You'll need to modify the sysinit.rc a bit, as in the rootfs some things are commented out that shouldn't be, and it references a few things in /bin or /etc that aren't there anymore.
Also, don't forget to uncomment the line near the top of sysinit.rc that creates a symlink from /system/etc to /etc
Once you are done, just do this to create the installer:
Code:
cd /android
tar cvf androidinstall.tar system
Soon, I may upload some packs for making the process easier, with updated sysinit.rc's for each system type. If I have time, we'll see...
Note, you can update the contents of the .tar file from windows/izarc/winrar/etc and it'll still work. you don't need to keep messing about with linux anymore if you don't want to
How to update things
How to create an update pack
Since not everyone gets things right the first time, and we keep getting updates, the rootfs made it easy to install updates without downloading the whole system again.
Well now anyone can create an update pack
just create a tar file called androidupdate.tar, make sure it has everything in a /system folder with whatever files you want, drop it into /sdcard/andboot and reboot holding down volume-up (camera on kaiser/polaris). Choose the update option and you should be good to go.
If things get wonky when you try to boot up, give the fix permissions option a shot in the installer, if it still fails, try wiping the dalvik cache, that can fix things up too.
About the installer
I ripped it off from here, but put about 6 or 7 solid hours into getting it to fit and react with the keys/screen
May be new
rootfs
may be new
better eclair support
---
with android development this fast for "yomama so old" phone, who knows what future holds?
sshark said:
May be new
rootfs
may be new
better eclair support
---
with android development this fast for "yomama so old" phone, who knows what future holds?
Click to expand...
Click to collapse
whats a rootfs hahaha
Might be something called "Code Name Ginger"....or our tame racing car driver, we call the Stig.
nabicat said:
Might be something called "Code Name Ginger"....or our tame racing car driver, we call the Stig.
Click to expand...
Click to collapse
what the..... that was random
Holy cow.. like there's nothing even in this thread and it's already filling up..
I think I know what it is..
Vilord ported Dalvik from 2.5 which now includes native support for HW accel for MSM7500..
jesus.
Do we still need to have three partitions on the card? Or would one FAT32 partition be sufficient?
@vilord:
is everything needed for the rootfsless nbh in the git? I would like to test this with ´my kaiser
This works for Polaris? Really thanks!
the bootenv git should have everything needed for this. I haven't tested on my polaris yet, but it should "just work" on polaris and kaiser as long as martin's method to drop the active key into /proc works on all hardware.
What happens to the .conf files?
What about /media ?
Thanks for all of your efforts
conf files are no longer used from the sd card.
If the cook put things in the right places, there should be a /system/etc/userinit.conf that gets parsed during android boot, but it is up to the cook to not screw that up.
This way is a lot cleaner, but it does a LOT less handholding for lazy cooks.
the upside is that it is *very* easy for anybody to fix a broken androidinstall by just piecing together what needs to change into an androidupdate.tar
/media is still used if it is on your SD card, but there's enough space and things are fast enough that media files should be included in /system now
This is a HUGE development for rom devs.
I will be honest in saying I've been having a hard time not hitting the 90MB cap with my next Warm Donut release.
Infact, I spent 4 hours yesterday de-odexing and compressing the classes.dex back into the jars and apks to save space.
With this new method this gives us ALOT more space. I applaud you for doing this. It breaks alot of the current builds but at the same time gives us a ton more flexibility for future.
And what I really like from this is it removes the confusion and headaches on configuration, giving the power to the ROM dev to include the necessary settings.
Question though. Different phones (Vogue, Polaris, Kaiser) may require different configurations. In the past it was a simple "just use this conf with this phone"
Thanks again
so when running from haret - getting an error about looking for a system file, I have all the files in andboot folder, any ideas on what I'm missing.
Know what would be really nice? In the setup, the ability to change LCD_Density and resolution.
This would eliminate the confusion users may have in editing the build.prop and rom files to change these values.
I guess the ROM devs could distribute separate files/tars for each res/density but that gets redundant if you know what I mean.
I'm using haret, but I dont see any option to choose to install not to nand, i get into the installer and it says install system so i click that but then it just goes through installation and fails. How do i choose to install to sd card?

[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?

How to make a Magisk module replace a certain string inside a system-file?

Hi there!
I am searching for an easy way to make a Magisk module that can do the following:
Look for file /system/<whatever>
Look inside this file for a string, e.g. value = 0
Replace this string with value = 1
Systemlessly replace the modified file.
I'm pretty sure this should be possible with post-fs scripts, but I'm too bad at shell-scripts to know how.
I am aware that I could just copy the file, edit it on the computer and create a simple replacement module, but this solution would always replace the whole file and would thus possibly be device specific. It would give trouble on devices which need other content around the line to be replaced.
The solution that I'm looking for would be much more universal and would work on any device which has that file, regardless of the content.
Can anybody help?
DISCLAIMER! The following is pure guesswork and airscripting:
In your modules post-fs-data.sh:
Code:
cp /system/<filenamehere> /magisk/<yourmodulename>/system/<filenamehere>
sed -i 's/<originalstring>/<newstring>/g' /magisk/<yourmodulename>/system/<filenamehere>
If my slightly tipsy and tired as f brain isn't completely misleading me, this would copy the file to your modules path, replace the string and then mount the new file systemlessly. I've been thinking of doing something similar, but never tried it. Let me know if it works... And if someone who knows anything about scripting can correct me, please do.
Edit: No... wait... That wouldn't work, would it? Or? Bugger... I'll just leave it here until someone who knows what they're talking about comes around.
Didgeridoohan said:
DISCLAIMER! The following is pure guesswork and airscripting:
In your modules post-fs-data.sh:
If my slightly tipsy and tired as f brain isn't completely misleading me, this would copy the file to your modules path, replace the string and then mount the new file systemlessly. I've been thinking of doing something similar, but never tried it. Let me know if it works... And if someone who knows anything about scripting can correct me, please do.
Edit: No... wait... That wouldn't work, would it? Or? Bugger... I'll just leave it here until someone who knows what they're talking about comes around.
Click to expand...
Click to collapse
The idea looks kinda interesting. Wouldn't the cp command be obsolete if I could make the sed command take /system/<file> as input and output to /magisk/<Modname>/system/<file> ?
I guess I'll try to study some documents about sed before continuing. But the idea is already pretty good I think.
Naudiz said:
The idea looks kinda interesting. Wouldn't the cp command be obsolete if I could make the sed command take /system/<file> as input and output to /magisk/<Modname>/system/<file> ?
I guess I'll try to study some documents about sed before continuing. But the idea is already pretty good I think.
Click to expand...
Click to collapse
You need to copy the file to the magisk module folder for it to work as a magisk mod properly. Essentially this is necessary.
Sed is what removes, finds, replaces, or injects lines or matches within a file.
How can I modify or replace /proc/sys/net/ip_default_ttl
Which is better option?
To modify I would change from 64 to 65 or put new file..
Thanks in advanced
RawSlugs said:
How can I modify or replace /proc/sys/net/ip_default_ttl
Which is better option?
To modify I would change from 64 to 65 or put new file..
Thanks in advanced
Click to expand...
Click to collapse
Magisk can't mount anything there (only to /system). If you don't want to do it manually, you can create a module with a boot script (post-fs-data.sh or service.sh, depending on the timing you want) that modifies the file (with sed), or simply use a boot script in post-fs-data.d or service.d.
You can find more details on the different boot stages and stuff in the official Magisk docs.
Didgeridoohan said:
DISCLAIMER! The following is pure guesswork and airscripting:
In your modules post-fs-data.sh:
Code:
cp /system/<filenamehere> /magisk/<yourmodulename>/system/<filenamehere>
sed -i 's/<originalstring>/<newstring>/g' /magisk/<yourmodulename>/system/<filenamehere>
If my slightly tipsy and tired as f brain isn't completely misleading me, this would copy the file to your modules path, replace the string and then mount the new file systemlessly. I've been thinking of doing something similar, but never tried it. Let me know if it works... And if someone who knows anything about scripting can correct me, please do.
Edit: No... wait... That wouldn't work, would it? Or? Bugger... I'll just leave it here until someone who knows what they're talking about comes around.
Click to expand...
Click to collapse
Code is good, and adding the --archive flag to the cp command will make it preserve the older properties, mode, contexts, etc
And also if the string contains any PATHs or just a slash in it, then sed will not recognize the pattern and give an error, so using pipes as sed delimeters will prevent this
This is all I could say
MCMotherEffin' said:
Code is good, and adding the --archive flag to the cp command will make it preserve the older properties, mode, contexts, etc
And also if the string contains any PATHs or just a slash in it, then sed will not recognize the pattern and give an error, so using pipes as sed delimeters will prevent this
This is all I could say
Click to expand...
Click to collapse
Thanks, but that's a year old post and I've since had plenty of opportunity to test. And yes, what you say is true. :good:
Didgeridoohan said:
Thanks, but that's a year old post and I've since had plenty of opportunity to test. And yes, what you say is true. :good:
Click to expand...
Click to collapse
Oops, forgive me, I forgot to see the date

[Help] Trying to make module, getting stuck at bootloop

I'm trying to make a module that tricks the Nexus 6 to thinking it's a Pixel for the unlimited, original quality photo backup. Not really experienced in doing this stuff and not sure what I'm doing wrong. When I flash this, it won't boot.
The Disclaimer for anyone trying this: This will likely ONLY work on Nexus 6. The XML system file is named differently on the 6p and 5x and the rest of the xml code here might be different, breaking other features.
In a nutshell, what this is supposed to do is replace /system/etc/sysconfig/google.xml with a modified xml file. I was considering looking up how to simply add the code to the xml file, but not sure how you'd target a location to inject the code to in the file. There's an opening and closing tag it needs to sit between. But if this can be done, it would probably expand support to more devices than just the Nexus 6.
EDIT: I found a typo in my module. This was the problem
Have you made sure you're using the correct encoding and line endings, and that it doesn't need any other permissions than those set by the module? Also, have you made sure that there are no other files that also need changing so there'll be conflict if you don't change them all?
In theory, you should be able to use a script (in post-fs-data.sh maybe?) to copy (cp command) the original file into your module folder and then use more scripting to edit/replace/prepend/append (sed, echo, and so on) the lines you want. I've never tried it myself or seen anyone do it though, that's why I'm saying "in theory".
Didgeridoohan said:
Have you made sure you're using the correct encoding and line endings, and that it doesn't need any other permissions than those set by the module? Also, have you made sure that there are no other files that also need changing so there'll be conflict if you don't change them all?
In theory, you should be able to use a script (in post-fs-data.sh maybe?) to copy (cp command) the original file into your module folder and then use more scripting to edit/replace/prepend/append (sed, echo, and so on) the lines you want. I've never tried it myself or seen anyone do it though, that's why I'm saying "in theory".
Click to expand...
Click to collapse
Thanks for the suggestion. I am a visually creative person. My extent of programming is HTML and CSS. So this is a quite the learning experience for me. Plus statistically, learning a language (and programming is similar to language) is more difficult for people as they get older... I'm not that old, but I'm not young either lol.
I'm not sure what you mean about encoding. I mean, I understand what encoding is, but not how to check it or verify what it should be.
If it helps, directly replacing the file in System by itself (not using Magisk) does work and make the necessary changes/affect. So I am assuming no other files are necessary to be modified or replaced. In fact, the XML doesn't reference any other outside files that I've noticed. I thought simply replacing it through Magisk would work as well. I haven't tried specifying permissions, but I can try that next.
Glad it worked. Typos can be a pain in the ass!
Now on to making it device independent...

Categories

Resources