I have a Nook HD+ that I want to root myself, and I'm looking for a simple CM (or whatever) bootable SD card image that does nothing to the HD+'s internal storage. I just want it to boot up so that I can connect via ADB, and do what I want on the HD+'s internal storage myself via ADB and shell commands.
Yes, I know I can use "Universal Root", but that does more than I want, and I think I want to root a different way anyway. I know what I'm doing, having published a similar rooting procedure for the Nook Tablet a year ago. I just need to boot from a SD card and have ADB/shell command-line access to the HD+'s internal storage.
I think I see a couple of bootable images, but they all seem centered around CWR. I do not want to install CWR on the HD+, and the descriptions seem vague as to exactly what the images contain.
Dean, you can go to my HD/HD+ CWM thread and make a bootable CWM card. It does nothing to internal memory until you flash something. Then you can connect to ADB and it gives you root access, again with no mods yet to internal. Then you can do what you want to the system. But remember, if you change anything on /system, it will reset on the next reboot. Look at my HD/HD+ tips thread item 15 to understand this.
Sent from my Nook HD+ running CM10.1 on emmc.
Simple (basic) root
Thanks; I wasn't sure that the CWR images included ADB enabled.
I came up with a slightly simpler solution that uses a "remount,suid" on "/data". This is no longer necessary. The prerequisites are:
The HD or HD+ is running B&N v2.1.x or v2.2.0 (other versions unknown/untested).
SuperSU is already installed (but need not be working) on the HD/HD+ via Google Play.
At http://www.mailpen.com/download/HdP_2.1.x-Root_0.05.zip
Note to lurkers: Don't quote this message with the above link intact, as it will change (and has):
Revision history:
2013-06-13 v0.01: Original release.
2013-06-14 v0.02: Avoid CWR set_perm bug?
2013-06-14 v0.03: Modify to use /system/bin/clrbootcount.sh. Include busybox and sqlite3.
2013-08-13 v0.04: Add updateSU.sh for easy update after su binary change.
2013-08-30 v0.05: Install files in /system/xbin/.bin and create links to them. Remove installation of a custom /system/bin/clrbootcount.sh. Add /system/xbin/.bin/busybox.sh (but don't execute it), which the user can use to create the required busybox links in /system/xbin (from where it should be run).
You are free to adapt this as you see fit.
You really should include an assert statement there for ovation (or ovation/hummingbird) in case it somehow gets out somewhere else. And the title says HD+, but inside the script it says HD/HD+. Also this should work on all versions of stock.
It does not install busybox or its symlinks.
Edit: Verygreen's original root did something similar where he put the su in /res, I think, set suid and symlinked it. But his root also failed to address busybox.
Edit 2: also some of my other zips will not work with your root because you removed the userinit.d implementation from install-recovery.sh. I suggest that you move your root to /system/bin/clrbootcnt.sh and symlink that. It also gets run on each boot. Then it would not interfere with my other zips that use install-recovery.sh to set up userinit.d.
Sent from my Nook HD+ running CM10.1 on emmc.
Details, details ...
leapinlar said:
...
It does not install busybox or its symlinks.
Edit #1: Verygreen's original root did something similar where he put the su in /res, I think, set suid and symlinked it. But his root also failed to address busybox.
Edit #2: also some of my other zips will not work with your root because you removed the userinit.d implementation from install-recovery.sh. I suggest that you move your root to /system/bin/clrbootcnt.sh and symlink that. It also gets run on each boot. Then it would not interfere with my other zips that use install-recovery.sh to set up userinit.d.
Click to expand...
Click to collapse
#2: OK, I don't have a problem with that. Stand by for v0.3 ...
#1: I personally install busybox (and sqlite3) in /data/local/sbin, and they work there. The reason I don't create the busybox links is due to the PATH value, which usually has the value:
Code:
/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
In most busybox installations, busybox is in /system/xbin, and so when the links are created, if there is a name conflict between a busybox link in /system/xbin and a pre-existing one in /system/bin, the one in /system/bin takes precedence in a PATH search. That means that pre-existing apps that count on a particular standard behavior, will find the one in /system/bin. I think the probability of a problem due to a pre-existing app finding different behavior is very small, but it's one less thing to think about. Note that "mount" on the Acer Iconia A500 is nonstandard ...
Also, in most installations, /system/xbin is empty, or very nearly so, so putting the busybox links there (which I certainly could do on the HD+ as well) made it "cleaner" for maintaining that directory.
However, there are good arguments for putting the busybox links in /system/sbin (now aka /data/local/sbin). In addition to the same "cleaner" argument above, the busybox links would now supercede names in /system/bin. That might be an advantage, since usually the busybox versions of common utilities are more capable (more options) than those provided by the tablet vendor (usually in a similar program named "toolbox").
The point of all this is that I didn't want to rush in making a decision. Suggestions/comments welcome!
PATH priority
DeanGibson said:
...
In most busybox installations, busybox is in /system/xbin, and so when the links are created, if there is a name conflict between a busybox link in /system/xbin and a pre-existing one in /system/bin, the one in /system/bin takes precedence in a PATH search. That means that pre-existing apps that count on a particular standard behavior, will find the one in /system/bin. I think the probability of a problem due to a pre-existing app finding different behavior is very small, but it's one less thing to think about.
...
However, there are good arguments for putting the busybox links in /system/sbin (now aka /data/local/sbin). In addition to the same "cleaner" argument above, the busybox links would now supercede names in /system/bin. That might be an advantage, since usually the busybox versions of common utilities are more capable (more options) than those provided by the tablet vendor (usually in a similar program named "toolbox").
The point of all this is that I didn't want to rush in making a decision. Suggestions/comments welcome!
Click to expand...
Click to collapse
OK, I tried creating links in /system/sbin, and that caused SuperSU (and other apps requiring root) to not work. The apps work if the links are in /system/xbin. I've added a "busybox.sh" script to the above .ZIP to allow the user to create the links wherever he/she wants.
Related
MORE INFO IN POST 3 HERE
I am happy to announce the release of my new utility script. This script currently has 11 functions as noted below. It runs in recovery with the help of sdutility which is another script that procures the necessary permissions and file location for some of the features. Some of these options are copied from Cyanogen's various scripts located in his recovery image.
Option 11 will ask you what size to make the swap and ext partitions and then it will partition your sdcard for you using the remaining space for fat32.
The menu looks like this:
Code:
1) Enable SDcard to USB
2) Disable SDcard to USB
3) Upgrade ext2 > ext3
4) Upgrade ext3 > ext4
5) Fix Permissions
6) Repair Filesystem
7) Clear Dalvik-Cache
8) Clear ext partition
9) Backup APPS on ext to FAT32
10) Restore APPS from FAT32 to ext
11) Partition SDcard
Q) Quit Utiltity Menu
Enter Number> _
i am going to get you samuel jackson's wallet from pulp fiction because that is what you are with these scripts.
I think these scripts, along with miketaylor00's fix_rotate script, need to be included in every ROMs /system/bin folders.
Btw, why the . in "./sdcard/sdutility"? I'll probably just move these scripts over to the /system/bin folder on my phone for consistency.
That is an execute command and is required because /sdcard is not in $PATH. sdutility copies the utility script which is the actual script doing all the work to /sbin, setting permissions to 755, and launching it. The point of all of that is with the script on the sdcard it can't partition it without deleting itself.
Fingerlickin said:
That is an execute command and is required because /sdcard is not in $PATH. sdutility copies the utility script which is the actual script doing all the work to /sbin, setting permissions to 755, and launching it. The point of all of that is with the script on the sdcard it can't partition it without deleting itself.
Click to expand...
Click to collapse
I follow... guess I can just keep it on SDcard to run it from.
I looked at the files and figured that's how it worked... I did copy utility to my system/bin and ran it from recovery console. I even backed up my apps using option 9. It gave me an access denied error from line 173 (the fi command in the script). However, it seems it did back up the apps.
dude, this is awesome. im gunna try it out later... using my ubuntu partition.
anyways, when you backup your apps from the ext partition, does it copy over the google apps as well?
backing up the apps copies the /system/sd/app folder to /sdcard/appbackup.
To the best of my knowledge this is NOT a violation because you are backing up your OWN apps including any closed source apps. As long as you don't distribute these apps you are fine.
P.S. I bought a movie tonight and immediately put it in my computer and ripped it. My reason for this is my computer stores all my movies and my xbox streams them to my TV. Nothing wrong with this because I am not distributing the movie to other people.
Fingerlickin said:
backing up the apps copies the /system/sd/app folder to /sdcard/appbackup.
To the best of my knowledge this is NOT a violation because you are backing up your OWN apps including any closed source apps. As long as you don't distribute these apps you are fine.
P.S. I bought a movie tonight and immediately put it in my computer and ripped it. My reason for this is my computer stores all my movies and my xbox streams them to my TV. Nothing wrong with this because I am not distributing the movie to other people.
Click to expand...
Click to collapse
hey finger, let your xbox stream video to my tv as well.
Fingerlickin said:
backing up the apps copies the /system/sd/app folder to /sdcard/appbackup.
Click to expand...
Click to collapse
I feel the urge to clarify this.
mounts both ext and fat32
check to see if both folders exist and creates /sdcard/appbackup if it doesn't
THEN it copies the CONTENTS OF /system/sd/app to /sdcard/appbackup
but david, I'm a good law abiding citizen and that would be illegal.
catch me on gtalk
So has anyone else had the access denied error referencing line 173?
Fingerlickin... any chance you could work with Cyanogen to integrate this with his recovery? I'm thinking it's time for a Cyanogen Recovery v1.5.
Great work fingerlickin
Unasari, the orig plan for this was to make cyan's recovery more noob friendly, hopefully cyan will roll this into his new recovery and add trackball support to it for the mt3g users. Don't be surpised if you see a wrecking crew modified recovey image
Great work I see all of us got something to keep us busy now.
I am looking into the line 173 error now. We need MT3G support before cyan will touch it, working on that too.
I can't recreate the error at line 173. Lets see if others have the problem as well.
Updated to v1.1 see post 3 HERE for details.
This has a possible fix for your line 173 error. I didn't anticipate someone trying to backup apps when they don't have any apps installed on the ext or you try to backup apps after partitioning the card because there obviously isn't a /system/sd/app directory in this case. I have no idea if this will fix your problem or not.
I also included support for ADB (MT3G) YAY
Updated again.
v1.2
updated to fix_permissions v1.29
fix_permissions always has the -r option
I understand that the solution to this question may already exist in the forums, however, I did check high and low for it, and was unable to locate one.
Here goes:
I like (as I'm sure others do) to install apps2sd, something I'm able to do thanks to the actively-rooted and cyanogen-modded N1 that I use.
Unfortunately, the actual *install* files *themselves* from all Market-downloaded apps seem to remain in the phone's internal memory, clogging up preciously limited space. How do I get rid of these install files? I tried using a file manager to go into the mnt/asec directory to get rid of *.pkg's, but these seem to be uninstall-protected (I'm not even sure if I'm making a mistake from the get-go in trying to purge the *.pkg's), so I'm kind of back to the drawing board on this one.
Any help on this would be pretty invaluable folks.
Thanks,
Eli
If you've installed a lot, your dalvik cache will grow pretty big. That's found in /data/dalvik-cache.
Thanks Rusty - but my /data dir is completely empty (unless there are invisible folders; if there are, who you know how I can make them visible?).
Best,
Eli
You need SU access to view /data, make sure what you're using to browse it supports that.
Ahh, thanks Rusty - will do that
Your DATA folder is inaccessible, unless you use Root Explorer or other file explorer with root privileges (ES Explorer, for example - but it doesn't work with all ROMs).
There are no PKGs. There are APKs. And you're wrong in your assumption that they aren't used. This is no PC, this is Android, forget what you used to know, you need to learn again. APKs are the actual applications being ran, without them you can't execute anything, and using old Apps2SD, AKA Apps2EXT, you can move your /data/data to SD (EXT partition) and /data/dalvik-cache to /cache. CM doesn't support Apps2EXT, but it can be easily installed and used, following the guide in DarkTremor's thread. Read Wiki in my sig, it'll point you in the right direction. You can start by reading FAQ, question 9.
seekingandroid said:
I understand that the solution to this question may already exist in the forums, however, I did check high and low for it, and was unable to locate one.
Here goes:
I like (as I'm sure others do) to install apps2sd, something I'm able to do thanks to the actively-rooted and cyanogen-modded N1 that I use.
Unfortunately, the actual *install* files *themselves* from all Market-downloaded apps seem to remain in the phone's internal memory, clogging up preciously limited space. How do I get rid of these install files? I tried using a file manager to go into the mnt/asec directory to get rid of *.pkg's, but these seem to be uninstall-protected (I'm not even sure if I'm making a mistake from the get-go in trying to purge the *.pkg's), so I'm kind of back to the drawing board on this one.
Any help on this would be pretty invaluable folks.
Thanks,
Eli
Click to expand...
Click to collapse
1) The .apk isn't the install file it _is_ the application. The are no "install only" parts to an android app
2) Anything on /mnt/asec is already on your sdcard using froyo-style a2sd
3) .so files in /data/data/xxx/lib and /data/dalvik-cache are the primary causes of full /data partitions
I found on another post:
http://forum.xda-developers.com/showthread.php?t=1341514
that the User: Rick#2 suggested using paid programs to which I've found free alternatives. I'd have posted as a direct reply there, but as "noob", I'm unable.
Anyways:
First thing that I noticed was this comment: "Unzip the attachment from the first post to the root of your sdcard, ie: don't unzip it into any folders after browsing to your phone on your PC, just put them in the root of the drive." <==Suggesting that users unzip and then stating to not unzip becomes a contradiction. I think what you meant to say was more along the lines of "Unzip the files directly into your SDCard, as there's no need to do it on you PC".
It would also be wise to state that some "NooB" users might not realize that there's more than one version of an SDCard for this phone, the Droid 3, available to be putting the files into. Standard transfer methods go to the EXTERNAL SDCard, not the internal one, so this alone could cause some users to fail at being able to do this procedure. Since this is likely the case to happen, a suggestion to verify that it's in the /sdcard and not the /external/sdcard might be of note, and those users reading this attempting this mod with the "no file in this area" problem simply need to use a file manager like File Expert (free) to do move the files from the External SDCard to the SDCard.
Next up, the apps needed to do this:
You suggested SetCPU (not free)
I suggest AnTuTu CPU Master Free
You suggest Root Explorer (not free)
I suggest Mount /system (rw / ro) (free, does the same thing, with a lot more ease than Root Explorer's way)
You suggested Better Terminal Emulator (not free)
Don't know the how much benefit of this might be over the free Terminal Emulator you thankfully suggested might be, but I can't imagine it'd be worth paying for.
Otherwise, I'd like to thank you for your post. Very nice work, and happy to say that I personally got mine to work without error the first time via your instructions.
There's a new method to overclock on rootzwiki I would suggest using. It uses a kernel module rather than a binary. Although it's in a boinic forum it is availabe for many other devices including the droid 3. It's not that difficult to accomplish and can also be done with free apps. Antutu will show the correct frequency and the min frequency does not have to be maxed out.
do you have to unzip via pc?
Do you have to unzip to sd via pc or can you just dl to your phone and unzip to sd is there a diff?
jwood3535 said:
Do you have to unzip to sd via pc or can you just dl to your phone and unzip to sd is there a diff?
Click to expand...
Click to collapse
There's a few extra steps if you unzip on a pc, you have to push more, usually have to set permissions.
Honestly, if you wanted to tell this to Rick#2 you could have done it in a pm, there's no guarantee he'll even read this here...
INTERESTED IN A BETTER LAGFIX?
Here is a small script which goes a little further than the Lagfix app in the PlayStore. This was originally posted in a different thread dedicated to a ROM so I'm trying to clean this post up as much as possible.
Caution!
A quick word of warning. Take the same safety precautions with this as you would the LagFix app. Both use the same utility which has been found to brick some devices. This was originally written for the VS980 (LG G2) and for a 4.2.2 ROM (fstrim support is native in 4.3+) though it should work fine as long as your device is compatible with the LagFix app (although you may need to tweak a few things)
Prerequisites
To begin with, you'll need a fstrim binary located in one of your device's PATH directories. A safe bet would be to drop it in /system/bin/ or /system/xbin/. Don't forget to change the permissions as well so it can run. If in doubt it's safe to give it full read/write/execute (I vouch for the one I link to at least...)
If you'd like the script to run on boot, then having init.d support on your ROM is ideal. If you don't have native init.d support, search xda as I've seen a "How to Enable init.d on Any Device Even Stock" how to floating around somewhere.
Finally, you'll need the filesystems-fstrim script that's also linked to at the end. The script basically performs three actions. First, it remounts all the filesystems (see note at the end if not on a LG G2) without the 'discard' flag. Since we will be running the fstrim utility on boot (or manually of you desire), having the OS clean up after deleted/moved files on the fly isn't necessary at all and just slows performance down noticeable. After that it attempts to trim each mounted volume oo your device (think defragment), then finally it writes all output to /$ANDROID_USER/logs/ (bytes trimmed from each mount, etc).
This script will trim other mounts besides /system, /cache, and /data. That and the fact that it removes the 'discard' flag is why I wrote it for personal use instead of using the app in the PlayStore (also nice having a record I'm /data/logs as well).
How to Run At Boot
With the fstrim utility in .../bin or .../xbin (with proper permission, and init.d support on your ROM and the 03-filesystems-fstrim script you're ready to go. Drop the 03-filesystems-fstrim script into your init.d directory and set permissions (it's safe to give it full read/write/execute access if unsure) and you're ready to go. Your init.d directory may vary depending on ROM. I'm used to always using /system/etc/init.d, but some ROMS (CyanogenMod for example) uses a different path. Ensure that it runs after any other scripts you may have in init.d which remount the filesystems to ensure that the filesystems aren't remounted elsewhere with the 'discard' flag. You can do this by appending a number to the beginning of the filename that's higher then the others (for example you could rename it 99-filesystem-fstrim and it will run after 01tweaks or whatever might be there already). More information on init.d can be found with a Google search as it's covered everywhere.
Now, at this point on next boot the script should run and if there are logs in /data/logs/ you can read them to determine if it succeeded or not. If successful, you won't see any error messages and on the mounts that were trimmed it will let you know how many bytes off each.
Notes
I wasn't expecting this post to get moved into its own thread and was sharing this to oothers using the same ROM I was. The section of code that remounts all the filesystems is hardcoded, so that section may fail on other devices that have a different structure {and having a filesystem mounted with 'discard' flag kind of defeats the purpose of trimming to begin with ), so you may need to change this section. If editing, use a text editor that allows you to turn word wrap off as for one, it can create nasty messes in the code with strange like breaks/etc and two, it's good habit anyways when dealing with any script or programming language. I used 920 Text Editor which is pretty decent but there are plenty other good ones in the Play Store. Running the 'mount' command with no arguments after it at the command prompt can help you map the filesystem on your device with the corresponding LG G2 one.
Files are currently hosted on my Drive until I find another browser that works or get on a PC. If you already have the fstrim binary you don't need this one..Feel free to PM Amy questions or ask here.
download ~ fstrim binary (rename to 'fstrim' without any extension
download ~ filesystems-fstrim script (again, strip off any extensions in the file name
MidnightHarvester said:
INTERESTED IN A BETTER LAGFIX?
Why would you want to use this (especially if using the LagFix in the PlayStore)? Good question!
Optimized Filesystem Mounts
If you use the lagfix app off the PlayStore (or any script/app/utility/etc that uses fstrim) then mounting the filesytems with the 'discard' option is not only redundant, but also gives a performance penalty since with 'discard', the file index AND OS are both made aware immediately when memory is free up to enable garbage collection. This sounds fine, except that doing this on the fly like this also slows things down a lot. Since we will he using fstrim ourselves we don't need this extra overhead. In the script is a good link to read that explains things better than I can.
More Thorough!
Every other method I've seen so far only trims /system, /data, and /cache. There are many other mounts that can be trimmed, and some are written to quite frequently (/persist as an example).
Maintains Lots of All Activity
All activity is logged and sent to $ANDROID_DATA/logs/ where it's then saved. That way you can tell if it's running on boot or on the schedule as it's supposed to he running.
OK well, there's not a lot going on here, just felt like being overly dramatic as it's boring over here at the moment. All of the above is true, and after deciding to post it in here I cleaned it up quite a bit so even the most novice at BASH (any language really) can understand what's going on and change it to suit your needs.
A few things to point out. You WILL need to have the fstrim binary located somewhere in one of your environment paths. A good spot for it is always /system/bin or /system/xbin of you are having trouble deciding where You will probably want to also ensure that the fstrim binary has the correct permissions. If you are unsure of what those are, just give it all read/write/execute.
Second, you will need the script and figure how out how you'll be using it. You need to keep in mind that in the /system/init.d/ directory there is a script there called 03filesystem (something like that) which also mounts the fileaystems. If you like, you can move that script to you sdcard (don't keep it in init.d though or it'll be run..I don't know if having a .bak file extension will stop it as I've never tried) and copy this script over. This script's mounts are EXACTLY the same (even includes the break lease at the end) as what Jake uses as default except without the 'discard' flag. Replacing the default 03filesystems with this one is a perfect place to run the script if you reboot your phone at least once every few days (can always run it manually as well if needed). If you leave Jake's in and still use this, then ensure this one is named appropriately so that it runs after his does, or his script will remount the filesystems again with 'discard'.
There are plenty of explanations in the script as well. Point is, just he aware that of it runs before Jake's filesystem mounts do his will overwrite this one's and you'll lose the advantage of trimming on startup (or a schedule).
Check the /data/logs/ directory for output from the script, and be sure to also give this script the correct permissions as well. If in doubt just give it all read/write/execute permissions (well that's what I've been using on both this and the fstrim binary. I've linked both of the files below. I couldn't upload as an attachment so I uploaded to my Drive. Enjoy.
Edit: This was written for and intended for the VS980 (Verizon G2). Other G2s should he perfectly fine and any device that is compatible to run LagFix off the Play Store (you don't need to use LagFix either BTW if using this). Just be sure that you device is on the compatible list before using, otherwise there is a possibility of bricking your device. If using a G2 you're fine, but I never know who else reads these threads.
download ~ fstrim binary
download ~ filesystems-fstrim script
Sorry everyone, I posted this late last night and didn't realize that the directory I uploaded the files to was private. The links should work now as I've set them to be Public.
If you have any questions, feel free to PM me.
Click to expand...
Click to collapse
Can someone chime in on what he's talking about in this very long winded post.
Sent from my VS980 4G using Tapatalk
friguy3 said:
Can someone chime in on what he's talking about in this very long winded post.
Sent from my VS980 4G using Tapatalk
Click to expand...
Click to collapse
If you can't be bothered to read it, it's probably not for you.
Dearborn1977 said:
If you can't be bothered to read it, it's probably not for you.
Click to expand...
Click to collapse
I did read it thank you very much sir. But, not all of us are devs or in the tech industry and understand this. Someone posts something, sometimes its nice to have others chime in or get a more simplified explanation. He posted it last night and nobody really commented on it (one maybe?)....makes you be cautious.
Sent from my VS980 4G using Tapatalk
The information is useful and should be in a thread of its own or maybe okibi can incorporate in 1.2.3
VS980 4G
friguy3 said:
Can someone chime in on what he's talking about in this very long winded post.
Sent from my VS980 4G using Tapatalk
Click to expand...
Click to collapse
It's a utility for trimming (defrafmenting) certain filesystems. This is built into 4.3+ and tries to run at least once every day or two, but we don't have it on 4.2.2 ROMs. The fstrim file is the binary that can run at the command prompt -
Code:
# usage
# fstrim [-v] {/mount-to-trim} // -v flag runs fstrim and sends output to stdout
#
# Example for trimming /data
fstrim -v "/data"
So fstrim goes into /system/bin or /system/xbin (set the permissions correctly so it can run. The other file is a script that I use to replace the /system/etc/init.d/03filesystems file that runs at boot that's included with the ROM (its named something like that, can't check at the moment). First it remounts all the filesystems just like the one in ROM does except they are mounted without 'discard' since we are trimming and don't need it. Then the script runs fstrim on all mounted volumes that it can run on and logs output to /$ANDROID_DATA/logs (/data/logs). Need to be sure to give this script the correct permmisions as well.
There's an app in the PlayStore that does the same thing except it doesn't tell all the filesystems or remount all your filesystems without the 'discard' flag which is really easy to use. This is just a more thorough method of trimming what that app doesn't and optimizing your mounts accordingly to take advantage of it (using trim on filesystems with 'discard' is redundant and using 'discard' slows performance down as the OS notifies in real time what files in the file index have been deleted/moved..
---------- Post added at 05:04 PM ---------- Previous post was at 05:01 PM ----------
smacklayer said:
What does this have to do with this ROM/Thread?
Click to expand...
Click to collapse
Well, it is meant (as is) to replace the 03filesystems script in the /system/etc/init.d folder. Or it can be noticed and set to run on a schedule. It was to written on a vs980 running this ROM, so that's where I'm sharing it.
Will the script trim on its own?
VS980 4G
veloct said:
The information is useful and should be in a thread of its own or maybe okibi can incorporate in 1.2.3
VS980 4G
Click to expand...
Click to collapse
Hopefully soon we won't have to worry about it since it's built into 4.3+. I might post it in the G2 (all) development area later this evening if it proves helpful to anyone.
This should really be the Themes and App thread not in a Rom thread.
Link to where it should be below.
http://forum.xda-developers.com/lg-g2/themes-apps
MidnightHarvester said:
INTERESTED IN A BETTER LAGFIX?
Why would you want to use this (especially if using the LagFix in the PlayStore)? Good question!
Optimized Filesystem Mounts
If you use the lagfix app off the PlayStore (or any script/app/utility/etc that uses fstrim) then mounting the filesytems with the 'discard' option is not only redundant, but also gives a performance penalty since with 'discard', the file index AND OS are both made aware immediately when memory is free up to enable garbage collection. This sounds fine, except that doing this on the fly like this also slows things down a lot. Since we will he using fstrim ourselves we don't need this extra overhead. In the script is a good link to read that explains things better than I can.
More Thorough!
Every other method I've seen so far only trims /system, /data, and /cache. There are many other mounts that can be trimmed, and some are written to quite frequently (/persist as an example).
Maintains Lots of All Activity
All activity is logged and sent to $ANDROID_DATA/logs/ where it's then saved. That way you can tell if it's running on boot or on the schedule as it's supposed to he running.
OK well, there's not a lot going on here, just felt like being overly dramatic as it's boring over here at the moment. All of the above is true, and after deciding to post it in here I cleaned it up quite a bit so even the most novice at BASH (any language really) can understand what's going on and change it to suit your needs.
A few things to point out. You WILL need to have the fstrim binary located somewhere in one of your environment paths. A good spot for it is always /system/bin or /system/xbin of you are having trouble deciding where You will probably want to also ensure that the fstrim binary has the correct permissions. If you are unsure of what those are, just give it all read/write/execute.
Second, you will need the script and figure how out how you'll be using it. You need to keep in mind that in the /system/init.d/ directory there is a script there called 03filesystem (something like that) which also mounts the fileaystems. If you like, you can move that script to you sdcard (don't keep it in init.d though or it'll be run..I don't know if having a .bak file extension will stop it as I've never tried) and copy this script over. This script's mounts are EXACTLY the same (even includes the break lease at the end) as what Jake uses as default except without the 'discard' flag. Replacing the default 03filesystems with this one is a perfect place to run the script if you reboot your phone at least once every few days (can always run it manually as well if needed). If you leave Jake's in and still use this, then ensure this one is named appropriately so that it runs after his does, or his script will remount the filesystems again with 'discard'.
There are plenty of explanations in the script as well. Point is, just he aware that of it runs before Jake's filesystem mounts do his will overwrite this one's and you'll lose the advantage of trimming on startup (or a schedule).
Check the /data/logs/ directory for output from the script, and be sure to also give this script the correct permissions as well. If in doubt just give it all read/write/execute permissions (well that's what I've been using on both this and the fstrim binary. I've linked both of the files below. I couldn't upload as an attachment so I uploaded to my Drive. Enjoy.
Edit: This was written for and intended for the VS980 (Verizon G2). Other G2s should he perfectly fine and any device that is compatible to run LagFix off the Play Store (you don't need to use LagFix either BTW if using this). Just be sure that you device is on the compatible list before using, otherwise there is a possibility of bricking your device. If using a G2 you're fine, but I never know who else reads these threads.
download ~ fstrim binary
download ~ filesystems-fstrim script
Sorry everyone, I posted this late last night and didn't realize that the directory I uploaded the files to was private. The links should work now as I've set them to be Public.
If you have any questions, feel free to PM me.
Click to expand...
Click to collapse
veloct said:
Will the script trim on its own?
VS980 4G
Click to expand...
Click to collapse
The script needs the fstrim binary, which you can grab elsewhere if worried about this one. I also went in and made the script as readable as I could. Without the fstrim binary, all this script does is remount all the filesystems without the 'discard' flag. If you are using the LagFix app then that's still useful as we don't need discard if manually trimming.
---------- Post added at 05:27 PM ---------- Previous post was at 05:14 PM ----------
Jimi Mack said:
This should really be the Themes and App thread not in a Rom thread.
Link to where it should be below.
http://forum.xda-developers.com/lg-g2/themes-apps
Click to expand...
Click to collapse
I need to clean it up in a proper text editor first before sharing to everybody. The built in text editor is not to useful when scripting because of the screen sizes and blocks of text often become mangled (especially in the comment). I'm going through it now and reediting with the proper text encoding. Won't take long but in the meantime I need to fix the encoding. I added the commenting in last night using the built in editor with Root Explorer which .. Well .. not too useful lol.
Once I'm sure the encoding will work across the board I'll post in that forum.
friguy3 said:
I did read it thank you very much sir. But, not all of us are devs or in the tech industry and understand this. Someone posts something, sometimes its nice to have others chime in or get a more simplified explanation. He posted it last night and nobody really commented on it (one maybe?)....makes you be cautious.
Sent from my VS980 4G using Tapatalk
Click to expand...
Click to collapse
I didn't mean to sound like a jerk, was just trying to say that given this mod has you replacing a script and adding a binary, if it's over your head I wouldn't mess with it.
Dearborn1977 said:
I didn't mean to sound like a jerk, was just trying to say that given this mod has you replacing a script and adding a binary, if it's over your head I wouldn't mess with it.
Click to expand...
Click to collapse
Went in and cleaned the formatting up using 920,l text editor and updated the original post I made with the updated link. If downloading, use the links on my posts and not any of the links from the quotes. If editing, it's best to use an editor that doesn't have word wrap enabled or at least an option to turn it off. That applies to any type of scripting or programming language. Otherwise, be careful that commented text doesn't get cut and interpreted code.
Anyways, he's right. If something looks like a foreign language to youz be sure to study up on it or bring along a good translator/guide before going to visit for a while. There's nothing complicated going on but the terminology obscufcates even the simplest of sentences. See? Malladus doesn't (I should say stock 4.2.2) doesn't include fstrim, a feature that's in 4.3+. You won't replacing any binaries unless you've already added fstrim yourself, in which case all you'd need is the script.
I think this is definitely a useful post for those interested, but has anyone actually verified that running fstrim on the G2 is 100% safe from the EMMC corruption issues that had plagued other devices in the past? Downloading Lagfix wouldn't be a good test as that program hasn't been updated since long before the G2 release (March 2013).
Just reporting back, I'm generally dubious of mods promising to smooth out the ui and have found things like entropy seeders to be more trouble than they're worth, but this mod works, plain and simple. Not that the G2 needs much smoothing out but if you've ever tried a CM based ROM on the G2, you can tell stock based ROMs aren't as smooth.
I was under the impression fstrim was only useful on older hardware.
Sent from my VS980 4G using Tapatalk
soapinmouth said:
I was under the impression fstrim was only useful on older hardware.
Sent from my VS980 4G using Tapatalk
Click to expand...
Click to collapse
The fstrim utility is built into Android 4.3/4.4 ROMs by way of baking it in the vold deamon. For more information you can read this page. Basically it's responsible for mounting the /system and /data, ... on start and running the init startup stuff (init.rc for example). They use analgorithm for fstrim as to attempt to have it run at least once every 24-48 hours.
On 4.2.2 we don't have fstrim and instead volumes are mounted so that the OS and disk are both kept up to date on which blocks of memory are free and that can be used. Doing this on the fly slows down performance, and that's why I remount the volumes without that option at the beginning of the script, so we can take advantage of the performance gains and run fstrim ourselves on all volumes (ffilesystem's that are able to be trimmed at least...if the file system doesn't support it then it won't be trimmed).
By placing this script in our init.d folder we can run keep our volumes 'defragmented' without having that extra process run all the time (simple way of pitting it). It should run at least once every 5 days or so at the least. Fstrim is relevent for ext4 volumes (and a handful of other types) and therefore relevant to any device where all filesystem layers support it. One other advantage of fstrim is that it returns a value whereby setting the 'discard' does not. If you run fstrim in verbose more or assign the result to a variable and it returns either "0 bytes were trimmed..." or "xxxx bytes were trimmed..." then you know it's supported and relevant. You can also check your mounts by typing 'mount' at a command prompt. There you can check and see if your filesystems are using discard or not.
Devices that mount their filesystems without discard and without the fstrim utility eventually can and will become intolerably slow or usable due to a process called "write amplification". Eventually it will become hard for the disk to find blocks of memory to erase. Only empty blocks of memory can be deleted. When writing to memory, the smallest is a page. A block holds many pages, so eventually space becomes a premium and it becomes difficult to find empty blocks to erase so that a page in the block can be used to write something do. The more complicated mappings and having to shuffle data around is a huge culprit of 'lagging' ones' device.
It gets confusing, especially when I'm deciding what's important enough to work on and use as there are a lot of tweaks out that don't actually do anything but are still used for some reason (probably out of habit over time). This is definitely one of the more useful tweaks to make on 4.2.x for improving performance (as long as the filesystem mount changes are used alongside it).
I'm not familiar with all the G2 ROMs (as in I've only used one and I use that as a base to build on), and this could possibly be built in in the form of init.d scripts or built into vold if on AOSP (though I haven't seen any AOSP 4.2.x ROMs for the G2 considering the newer versions). In that ca
xdabbeb said:
I think this is definitely a useful post for those interested, but has anyone actually verified that running fstrim on the G2 is 100% safe from the EMMC corruption issues that had plagued other devices in the past? Downloading Lagfix wouldn't be a good test as that program hasn't been updated since long before the G2 release (March 2013).
Click to expand...
Click to collapse
is just dared to try lagfix and it worked like a charm!
This is only good for Android 4.2.2 builds and older
Sent via Crossbreeded, 100% V6 Supercharged. KT747'd and Linaro Built Paranoid Android 3.10
I've been running LagFix Premium since the first day the G2 was rooted. Every morning at 5AM. Overkill, perhaps, but this is what kept me sane with the old Galaxy Nexus. When I first used LagFix on the GNex it changed my world.
luv2increase said:
This is only good for Android 4.2.2 builds and older
Click to expand...
Click to collapse
That's exactly what the OP said in the long post two above yours.
---------- Post added at 09:47 AM ---------- Previous post was at 09:45 AM ----------
MidnightHarvester said:
You can also check your mounts by typing 'mount' at a command prompt. There you can check and see if your filesystems are using discard or not.
Click to expand...
Click to collapse
What specifically should we see when we type "mount" if the filesystems are using discard?
Good day,
I recently discovered malware in the root directory under the / prism folder that installed an app called Yandex into my system and contained various hidden APKs. (and files with .sogou at the end).
These manipulated my internet browser in some way and I was only able to remove them by flashing the stock rom.
Now I get the message from TWRP that the partition / prism could not be mounted. Even so, everything seems to be working fine on the device.
Now there is no more content in the / prism directory. What is usually stored there and what is its purpose?
Do I have to rework something?
I can't find an explanation anywhere else on the Internet ...
Thank you and best regards
According to https://github.com/PrismLibrary/Prism
Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, EventAggregator, and others.
Click to expand...
Click to collapse
In short Prism is a framework to build applications which in turn it's built on top of another framework called Xamarin (XAML for Android).
As of why it's in the root directory I suspect is part of AppCloud, Samsung's system app, that basically does remote installation of apks.
If it is correlated to AppCloud (Big IF) then:
If you are rooted and on stock OS and have that app enabled it's not far fetched to think that there is an exploit for it out there and basically anyone could remote install any APK through root privileges and the backdoor that AppCloud system app gives the.
It's could be as easy as editing a file from within the malicious app which could change the behaviour and URL from which it fetches the needed apks. Whereas installing apks from within the malicious app needs explicit OS permissions (which AppCloud has).
I too had apps installed post-upgrade by the AppCloud system app, but I don't have root to analyse this further so all the above are just speculations based on the two things you said and my previous observations.
In the end you could have contracted the malware in a million different ways. That's how it goes with root access on OS and careless root management.
I have to admit that I was too careless with root privileges and experimented with little knowledge.
Hope that helps others to deal with it more intensively beforehand.
Your explanation helped me, the problem is a bit more serious, it is probably about corrupt security certificates in the system that are administered from outside
In this case, is it even possible to reset or delete the CA certificates? I guess I fell into a spoofing trap.
Maybe flash the stick rom again through Odin?
Is that embarrassing: D
Sorry for the graveyard post but I don't see any other threads about this.
Prism is the name of the NSA surveillance program. I guess that this is exactly that.
It's hidden because you can only see that it exists with root and most people don't have root.
I have this folder too on my rooted Galaxy Fold 4. It was already in the stock ROM and I cannot remove it because the directory is mounted as read only.
If found the mounts file (which is also read-only) and it says:
Code:
/dev/block/platform/soc/1d84000.ufshc/by-name/prism /prism ext4 ro,seclabel,relatime,i_version 0 0
I tried to give me the permission to write / delete the folder but "permission denied" ... and yes I did that as root.
Nexariuss said:
Sorry for the graveyard post but I don't see any other threads about this.
Prism is the name of the NSA surveillance program. I guess that this is exactly that.
It's hidden because you can only see that it exists with root and most people don't have root.
I have this folder too on my rooted Galaxy Fold 4. It was already in the stock ROM and I cannot remove it because the directory is mounted as read only.
If found the mounts file (which is also read-only) and it says:
Code:
/dev/block/platform/soc/1d84000.ufshc/by-name/prism /prism ext4 ro,seclabel,relatime,i_version 0 0
I tried to give me the permission to write / delete the folder but "permission denied" ... and yes I did that as root.
Click to expand...
Click to collapse
did you ever find anymore about this? ive found it on two of my phones. both samsung. cant find much online about it...