Userinit and Apps2SD for Vibrant(legacy) - Vibrant Android Development

NOTE: This method has been somewhat superseded by JustAnotherCrowd's method in this thread:
http://forum.xda-developers.com/showthread.php?t=744655
It should still work, however, if you don't want to mess with Odin, but if you want to use ext4 and get the max speed AND stability, I recommend using JACs method.
There are two zip files attached. Consider them "Beginner" and "Advanced". You can only use one or the other, not both. No wipe is required for either, but you will want to clean and repair your ext partition if you plan on using one.
Beginner: If you have an SD card with an ext partition on it (no swap partition, just FAT/ext), ttabal has created a fantastic script to mount it on startup. This zip file runs that script at startup. Credit to ttabbal for the script.
IMPORTANT: You will need to install the latest version of busybox before installing this update or it will not work. You can find busybox on the market for free; download and install it and then open it and click "update busybox".
http://getyourboneon.com/vibranta2sd.zip
Advanced: Enables you to place a custom userinit.sh script in /data/local (make sure premissions are set to 755) and it will run on startup.
http://getyourboneon.com/enableuserinit.zip
An explanation of how this was done:
When looking through the init.rc, I realized that there was only one thing running as root that could safely be replaced; the boot logo player. So, all this does is replace the boot logo player with a script that calls userinit.sh from /data/local and then calls the (now renamed) bootlogo player for those of you who want that nifty startup screen
A super simple (and slightly dirty) hack but I figured it might come in handy for those of us who are impatient and would like to do our own tweaks.

Nice....
I'll be looking forward to this.
Edit:
Working great.

??
Can some one elaborate on what this does?:

BM1515 said:
Can some one elaborate on what this does?:
Click to expand...
Click to collapse
http://wiki.cyanogenmod.com/index.php?title=Userinit.sh

anomalous3 said:
I found a way to get a userinit.sh script working for the vibrant for those of us who would like to run anything at startup. Already got the proof of concept working, and am now busy packaging it into an easy script that will set everything up for you. Will update this post later tonight with the finalized script once it's done.
Click to expand...
Click to collapse
Nice work. What can you do on bootup on the vibrant? I havent looked at all the kernel settings.

oh, just stuff like mounting an ext partition or initializing the modules for the FM radio (assuming we can find them and the hardware's there).

anomalous3 said:
oh, just stuff like mounting an ext partition or initializing the modules for the FM radio (assuming we can find them and the hardware's there).
Click to expand...
Click to collapse
Yes the userinit can contain quite a few script functions and technically almost all of them that would be needed on a modifed rom.
E.G
Code:
insmod /system/lib/compcache/ramzswap.ko;
rzscontrol /dev/block/ramzswap0 -i -d 32768;
busybox swapon /dev/block/ramzswap0;
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo 0 > /proc/sys/vm/page-cluster;
# Set "deadline" scheduler fifo batch to 1 for mtdblocks and mmc
for i in `ls -1 /sys/block/mtdblock*` /sys/block/mmcblk0
do
echo 1 > $i/queue/iosched/fifo_batch
done
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sdcard/sd;
if [ "$?" = 0 ];
then
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;

Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).

anomalous3 said:
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
Click to expand...
Click to collapse
Those were some examples not specifically for the Vibrant.

justanothercrowd said:
Those were some examples not specifically for the Vibrant.
Click to expand...
Click to collapse
I know I could tell by the echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
I was just sayin' though in case anyone was interested in making this work....too tired to mess with it anymore tonight.

anomalous3 said:
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
Click to expand...
Click to collapse
I've been trying to get the ext partition to mount, but I keep getting errors from mount. This is just with "adb shell". I did "su", and have root. What command are you using? Does it only work from the userinit?
# mount /dev/block/mmcblk1p2 /system/sd
Usage: mount [-r] [-w] [-o options] [-t type] device directory
# mount -t auto /dev/block/mmcblk1p2 /system/sd
mount: No such device
# ls /dev/block/mmcblk1p2
/dev/block/mmcblk1p2
The device and mount directory do exist, so I'm a bit lost. I'll give it a go with the userinit hack and see if that gets things running.
EDIT: Nevermind, I forgot to do "busybox mount". grrrrr.. that works now.
EDIT2: Ummm... it mounts as a j4fs with a bunch of crap I've never seen on there. WTF?!? I didn't even know that filesystem existed.

maybe try
Code:
busybox mount -t ext3 /dev/block/mmcblk1p1 /system/sd
? I got it to mount and recognize the ext partition, my trouble was getting the data over to it. maybe a symlink isn't the best way to do it and I could try a bind mount.....

OK. I got it working, had to use mkfs.ext2 to re-format the ext partition. I have no idea what put that other crap there, but it wasn't me and formatting doesn't seem to have bothered anything.
Here's a rough draft of my userinit.sh. I have booted with it, and it seems to work fine. No warranty, obviously. It bind mounts /data/data to a directory on the ext partition, copying files if needed. It might do with some more cleanup and safety checking, but seems to work OK for me.
Speed wise, it seems to work pretty good.
Oh, you need to create the /system/sd directory yourself. I didn't add that in the script. remount rw and "mkdir /system/sd". A root file manager should be able to handle that as well, or add it to the script.

I've never had lag on my Vibrant so the lag fixes have always confused me a bit. Screwing with the phone is what its all about though.

well I'll be damned. It works. I wonder if we'll see an improvement from moving the dalvik-cache over too, seeing as how those are the actual executables for the applications.
[edit] It seems to have killed my mobile data connection.[/edit]

anomalous3 said:
well I'll be damned. It works. I wonder if we'll see an improvement from moving the dalvik-cache over too, seeing as how those are the actual executables for the applications.
Click to expand...
Click to collapse
Possibly. I haven't tried that yet. Maybe I'll toss it on and see. I did another version that moves the mount to /sd-ext like CM5. I'll add that in here, it automated, no need to make the mount point yourself. It feels a little more "standard" to have it there.

OK. For grins, I moved dalvik-cache as well. Here's the update, same mechanism. It feels like it might be a little faster, I'm not sure. I'll let everyone have a try at it and see what you think.

it works and data works too! Also seems noticeably quicker!
With your permission, I'd like to package this into an update.zip along with the userinit enabler (once you feel it's ready) so we can have a reliable way to get apps2sd working.

so with this userinit.sh we can apply the mimocan fix, not that i have noticed a hell lot of stalling but there is somewhat stalling after a while. only to make a great phone even better.

anomalous3 said:
it works and data works too! Also seems noticeably quicker!
With your permission, I'd like to package this into an update.zip along with the userinit enabler (once you feel it's ready) so we can have a reliable way to get apps2sd working.
Click to expand...
Click to collapse
just one question... why would we need a2sd? i remember when i had my mt3g and whenever i ran any sense rom or regular rom that a2sd slows it down significantly but when i stored everything on the phone it was way smoother and its not like we dont have the space..

Related

Cannot install Debian on JF 1.5 US? Help?

Hey, Im following
http://www.androidfanatic.com/cms/community-forums.html?func=view&catid=9&id=2248
For how to set debian up. However chmod 4755 * fails for me saying operation not permitted when I am cd /sdcard/debian I read through a couple other posts on google and the site above where it says people can on versions pre 1.5 but once on 1.5 US it breaks the su whitelist some?
Anyways, Anyone have some ideas for me, as the google trail went cold for me as the people who had this issue was already at the end of the threads with no resolve or joy. Thanks. =)
too much in 'yo chmod!
hey i have set up mine. you just gotta forget about the chmod and just skip it and do the rest of the steps then type exit. then once it reboots, just type
su
cd /sdcard/debian
sh bootdeb
then it should be running
Yea I thought so too on the chmod step, so I tried going to the next, the installer.sh and said not allowed or something.
I tried running boot debian and so, and it came up with the load screen, then it had a chmod issue and then the G1 restarted. So what am I missing here? =/
hmm, im not entirely sure. when i installed it i simply
su
cd sdcard/debian
chmod 4755 *
su sh ./installer.sh
exit
su
cd sdcard/debian
sh bootdeb
Well I was reading other posts, Could it be a issue that Im already running apps off the EXT2 part of my SD card? I have the debian files on the FAT32 area. I saw some people saying that might be a cause of the issue?
if your debian dir is on fat32, you need to delete the first line of installer.sh script
Ok did that and the installer.sh ran did alot of not found errors then when I tried to bootdeb it looked like it was trying to load, then it rebooted the G1. =/
Any other ideas? Also if I wanna try to uninstall the work it did, what does it create to delete?
Mysticales said:
Ok did that and the installer.sh ran did alot of not found errors then when I tried to bootdeb it looked like it was trying to load, then it rebooted the G1. =/
Any other ideas? Also if I wanna try to uninstall the work it did, what does it create to delete?
Click to expand...
Click to collapse
Which image are you using? There's one for fat32 and one for ext2. Try this: download fat32 version http://www.androidfanatic.com/cms/unofficial-app-repo.html?func=fileinfo&id=21
you may need to remount when entering the following commands in the terminal
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
place zip file on sdcard. go to terminal and enter:
su
unzip "whatever_your_debian_file_is_named".zip (not sure what its called)
cd "whatever_your_debian_file_is_named"
cp installer.sh /sdcard/gscript
then go to Gscript and load installer.sh, before you save, delete the line that says "./fsrw"
then save this edited script as installer1.sh
go back to terminal
cp /sdcard/gscript/installer1.sh /sdcard/debian
cd /sdcard/debian
su
sh ./installer1.sh
sh ./bootdeb
if that doesnt work out try rebooting and doing these commands
cd /sdcard/debian
sh ./bootdeb
to delete, go to debian directory then
rm -r debian
afaik, all the data from debian is self-contained in debian.img
Ill try that, btw yea I have that file you linked to. But before I do this, the stuff your mentioning, wont affect the fact that I have my apps installed to the SD right? Mounting and unmounting things.
Mysticales said:
Ill try that, btw yea I have that file you linked to. But before I do this, the stuff your mentioning, wont affect the fact that I have my apps installed to the SD right? Mounting and unmounting things.
Click to expand...
Click to collapse
No, your apps should be safe. If you're using the link I posted, you need to put debian on /sdcard which is fat32
you're apps2sd should be mounted at /system/sd and should be unaffected by your debian installation/uninstallation.
I'm not sure if remounting /system is required, but i think it allows you permissions so you can use the utilities in /system/bin. I would remount just to save myself time.
Btw, I could not chmod my debian directory, but debian runs fine for me.
jonnybueno said:
to delete, go to debian directory then
rm -r debian
afaik, all the data from debian is self-contained in debian.img
Click to expand...
Click to collapse
Oops, my bad. Should be:
cd /sdcard or cd /system/sd depending on where you put your debian directory
the you can
rm -r debian
Jonny your great. =) The remounting thing worked! Then ran the installer, got alot of not found, but after that all, I booted into Debian, and did the onetime.sh to set the unix pw.
(Which for the record to anyone in the future doing a search on this once your in debian, do cd scripts and enter that folder and type sh onetime.sh )
Now onto the next step and adding a GUI Which gonna attempt that all now.
Edit: And Grr... not gonna try to do the rest of the repos on EDGE connection.. Gotta wait till I get home. =( (Wifi rules for linux starts lol)
I think the image we installed is only 750MB so from what I've read, it is advisable to resize your debian img. Thats another world of brain hurt for me... but there is this guy with this thread who is offering to upload his custom image.
http://forum.xda-developers.com/showthread.php?t=528262
5 more votes by the end of the day and maybe he'll upload it.
Well... I already did the resize heh. Got a 2.3GB image on right now, which fits on my 4GB, since I have a 1GB EXT2 Partition and rest is fat32.
I used ubuntu to make a image and mount both images and copied the data from one into the other, then did the tasks after I booted debian again to get everything smooth again. =) But I wont stop him from uploading his image if it has a GUI already installed, which is what im after atm. =)
Update, So far having a lil issue getting the desktop to show up on VNC, however I did get other tasks done and stable running. Also came across this post which is vital as the default install seems to want to give you a repo that 404s too much so before you start your tasks, after you install debian and get into it, do this stuff.
ZilverZurfarn said:
For those (like me) who get errors when apt-get'ing thightvncserver and/or lxde:
(from the thread at androidfanatic.com)
instructions
cd /etc/apt
nano sources.list
now add
deb http://ftp.debian.org/debian lenny main contrib non-free
deb-src http://ftp.debian.org/debian lenny main contrib non-free
after the first one
then hold down the trackball and hit o
then hit return (to save the new sources.list)
then hold the trackball and hit x (to exit nano)
then type
apt-get update
apt-get install tightvncserver
apt-get install lxde
That did the trick for me at least.
/Mats
Click to expand...
Click to collapse
yeahhh
now my problem is that debian is restarted all time
error
chroot: can't change root directory to /data/local/mnt: No such file or director
y
Well While mine worked, sorta, I just went with the 1 click debian install thread, made life a lil easier. Heh.

Delete old userinit or no?

So I have an old file left over that I never got rid of when I set up swap on Cyan 3.6.8.1 or whatever.
Since if I remember correctly swap/compcache is set up by default on the newer versions should I get rid of that old userinit file? If so how would I go about doing that from the console in recovery?
if you have no userinit.sh then compache is done by default in his newer builds
try
Code:
su
mount -o rw /dev/block/mmcblk0p2 /system/sd
rm /system/sd/userinit.sh
reboot
though just on general principle of the app i would get root explorer from the market bc you can access /system/sd from it and delete whatever you want while not having to do any terminal commands
Thanks!
Yaboiaj said:
Thanks!
Click to expand...
Click to collapse
your are welcome

Problems running a Blur rom on my G1

For the last couple of weeks i'm trying to get a Blur-rom working on my G1, but sadly it's giving me alot of problems.
I mainly tried flashing it from scratch, which means im running the following setup:
Running a class 6, microsd card;
fat32 (7200mb)
ext3 (500mb)
linux-swap (128mb)
Click to expand...
Click to collapse
I also tried the same setup, except i used ext2 instead of ex3.
The problems I have;
After flashing the rom everything works ok. I sign in to motoblur, and set everything up. But after doing a reboot, the problems start. Right after I enter my pincode, and the homescreen starts loading, i'm getting force closes all over. In the end all I see is a blackscreen, and the white taskbar.
Is my setup wrong? If you ppl want more information, I can flash it again, and will try to collect some logs.
Thx in advance.
*bump*
Still having the same problems, also when running the newest blur rom around (Motorola Blur / S-Blur_1.071 - Bluetooth).
Here is more info (my logs)
http://pastebin.com/m1b544f9c
Hopefully somebody can help, since I wanna run this one on my phone badly
FREAKJAM said:
*bump*
Still having the same problems, also when running the newest blur rom around (Motorola Blur / S-Blur_1.071 - Bluetooth).
Here is more info (my logs)
http://pastebin.com/m1b544f9c
Hopefully somebody can help, since I wanna run this one on my phone badly
Click to expand...
Click to collapse
First what kind of phone do you have? G1/MT3G/Hero ?
Next, did you make sure and do a COMPLETE wipe on your phone?
This means erase:
/system/sd/app_s
/system/sd/dalvik-cache
/system/sd/app
/system/sd/app-private
All of /data
You would do that from the Recovery screen. You can't just go into Recovery, then choose Drop to a terminal and then type
Code:
busybox rm -rf /system/sd
That won't work, when you boot into Recovery none of your partitions are mounted. And choosing "Do a data wipe" from the recovery menu DOES NOT erase your /system/sd partition. You need to mount /system/sd before clearing everything off of it.
As far as your partitions are concerned, keep it as ext2 and not ext3. Read the first post in the Blur thread and it explains how your sdcard should be partitioned.
You should also probably run a fsck on your ext2 partition to make sure it's still functional.
Code:
e2fsck -fy /dev/block/mmcblk0p2
And also verify your swap is still good
Code:
mkswap /dev/block/mmcblk0p3
Given the errors you're having it sounds like you did not do a complete wipe as explained in the first thread, or your ext2 partition is corrupt and you just need to run a fsck on it
I installed the rom completely fresh on a G1 (dream), formatted my sdcard and made 3 new partitions using parted on the recovery console.
So basically saying this isn't enough?
reformatting my sd card now and did the following;
mkpartfs primary fat32 0 7200
mkpartfs primary ext2 7200 7700
mkpartfs primary linux-swap 7700-7828
busybox rm -rf /system/sd
e2fsck -fy /dev/block/mmcblk0p2 (no errors)
mkswap /dev/block/mmcblk0p3 (swap information 128mb, so seems good)
Click to expand...
Click to collapse
will flash now, and get back to you when i have more info
FREAKJAM said:
I installed the rom completely fresh on a G1 (dream), formatted my sdcard and made 3 new partitions using parted on the recovery console.
So basically saying this isn't enough?
Click to expand...
Click to collapse
Technically yes that is all you would need, but once again follow the steps I outlined. No need to blow away partitions. I don't know your level of expertise so I don't know if you're doing it correctly. For all I know you could be creating the partitions, then forgetting to format /dev/block/mmcblk0p1 as fat32, or forgetting to format /dev/block/mmcblk0p2 as ext2, or forgetting to mkswap on /dev/block/mmcblk0p3.
Since you are the only one having this issue it basically means you are missing a step somewhere along the way. The ROM does not hate your phone, lol.
Please follow the regular ROM flashing guidelines. After you create the partitions make sure you can manually mount the fat32 partition at /sdcard and the ext3 partition at /system/sd. Also make sure you didn't somehow screw up the phone parititions, IE /dev/block/mtdblock[1-5]
I think I flashed my phone atleast 200x in the last 6 months..
I'm very addicited to flashing, and I setup a hero rom just like that using parted.
I always reformat my sdcard to start "fresh".
Anyways, flashing now
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Model: SD USD (sd/mmc)
Disk /dev/block/mmcblk0: 8017MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 512B 7200MB 7200MB primary fat32 lba
2 7200MB 7700MB 500MB primary ext2
3 7700MB 7828MB 128MB primary linux-swap(v1)
Click to expand...
Click to collapse
e2fsck -fy /dev/block/mmcblk0p2
e2fsck 1.41.6 (30-May-2009)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p2: 11/244320 files (0.0% non-contiguous), 30701/488281 blocks
Click to expand...
Click to collapse
mkswap /dev/block/mmcblk0p3
Setting up swapspace version 1, size = 127995904 bytes
Click to expand...
Click to collapse
FREAKJAM said:
I think I flashed my phone atleast 200x in the last 6 months..
I'm very addicited to flashing, and I setup a hero rom just like that using parted.
I always reformat my sdcard to start "fresh".
Anyways, flashing now
Click to expand...
Click to collapse
K lemme know how that goes. If it crashes like that again do something for me, open up a shell using "adb shell" and do "cat /data/a2sd.log" and tell me what it says
Here is my log, phone is still booting tho, but seems a2sd is done already.
Beginning a2sd at 05:50 06/16/2009
Does post install script exist: No
Does /dev/block/mmcblk0p2 exist: Yes
Running fsck ....
e2fsck 1.41.6 (30-May-2009)
ext2fs_check_if_mount: Can't check if filesystem is mounted due to missing mtab file while determining whether /dev/block/mmcblk0p2 is mounted.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p2: 11/244320 files (0.0% non-contiguous), 30701/488281 blocks
Mounting /system/sd : Ok
Changing owner on /system/sd to app user: Ok
Changing permissions on /system/sd to 771: Ok
Cleaning up any symlinks in /data
Moving apps to SD finally....
Created /system/sd/app
Changed uid/guid to app user on /system/sd/app
Changed permissions to 771 on /system/sd/app
*****CRITICAL / Watch below for errors ******
Moving /data/app: Ok
Deleting /data/app: Ok
Creating symlink to /system/sd/app: Ok
***** CRITICAL DONE ******
Created /system/sd/app-private
Changed uid/guid to app user on /system/sd/app-private
Changed permissions to 771 on /system/sd/app-private
Created /system/sd/dalvik-cache
Changed uid/guid to app user on /system/sd/dalvik-cache
Changed permissions to 771 on /system/sd/dalvik-cache
*****CRITICAL / Watch below for errors ******
***** CRITICAL DONE ******
Mounting dalvik-cache: Ok
Setting owner to app use for /data/dalvik-cache: Ok
Setting permissions to 771 on /data/dalvik-cache: Ok
Finished 05:50 06/16/2009
Click to expand...
Click to collapse
Still splashscreen on my phone atm.. booting takes longer then normal! Waiting for around 5 mins now.. will wait a bit longer
FREAKJAM said:
Here is my log, phone is still booting tho, but seems a2sd is done already.
Still splashscreen on my phone atm.. booting takes longer then normal! Waiting for around 5 mins now.. will wait a bit longer
Click to expand...
Click to collapse
Well what is adb logcat showing? Is it still progressing? Is it throwing errors?
Redid a total new format and flash cuz it was taking pretty long..
here is some stuff from the logcat;
http://pastebin.com/d2fef07f0
still on the splashscreen for some minutes now..
FREAKJAM said:
Redid a total new format and flash cuz it was taking pretty long..
here is some stuff from the logcat;
http://pastebin.com/d2fef07f0
Click to expand...
Click to collapse
The ONLY way to get the errors you got there are from a pre-existing installation on your phone.
#
E/PackageManager( 1714): Package com.arcsoft.mediagallery has no signatures that
#
match those in shared user android.media; ignoring!
Click to expand...
Click to collapse
Your md5sum for the update should be:
62b9b3925e95b70eda1c77e8317dc7a9 S-Blur_1.071-full.zip
If it is not then re-download the update again and try flashing.
Redo a wipe and when you are positive you have wiped, check manually that all the files are gone. Don't re-partition/format. Just do the following from recovery shell
Code:
mount /system/sd
busybox rm -f /system/sd/app_s/*
busybox rm -f /system/sd/dalvik-cache/*
busybox rm -f /system/sd/app/*
busybox rm -f /system/sd/app-private/*
umount /system/sd
mount /data
busybox rm -f /data/app/*
busybox rm -f /data/app_s/*
umount /data
mount /system
busybox rm -f /system/app/*
umount /system
Phewww, then do a flippin flash of the ROM. That should GUARANTEE that you have a clean wipe.
G:\>md5 S-Blur_1.071-full.zip
62B9B3925E95B70EDA1C77E8317DC7A9 S-Blur_1.071-full.zip
Click to expand...
Click to collapse
did the whipe just like u said..
and now flashing again.. pfew
will keep u posted!
thanks for the help so far!
It installed, and I logged in to gmail etc.
after first reboot, again FC all over. This rom really must hate my phone
http://pastebin.com/dc9c4e47
E/AndroidRuntime( 1844): java.lang.NullPointerException
E/AndroidRuntime( 1844): at java.util.Locale.setDefault(Locale.java:855)
did you make it through set up?
can u make it into settings and mess with that?
what blur rom are you flashing? it may be messed up
I can set everything up, all the info bout what rom I am currently trying to flash is found in the 2nd post.
After the first reboot, it's giving all the force closes.
FREAKJAM said:
It installed, and I logged in to gmail etc.
after first reboot, again FC all over. This rom really must hate my phone
http://pastebin.com/dc9c4e47
Click to expand...
Click to collapse
Where are you located? The US/Europe/somewhere else? It's having issues setting your locale. When the setup first comes up, are you selecting US English?
I'm from Holland. I select US English yes, but I vaguely remember that it jumped to Deutsch, and that I can't change it back to English.
Perhaps it won't let me run this rom since i'm from the EU.
FREAKJAM said:
I'm from Holland. I select US English yes, but I vaguely remember that it jumped to Deutsch, and that I can't change it back to English.
Perhaps it won't let me run this rom since i'm from the EU.
Click to expand...
Click to collapse
Hmmm there's a very good chance that it wouldn't work if you chose anything but English. You may need to use a different libril.so since the one in the ROM is for US. Or Motorola might have designated this only for US users as they will have a different device (the Dext ?) for Europe. Basically it's the Cliq but for overseas. Anyways, erase everything again, reflash and this time make sure you select US English and everything else US just in case Motorola is not allowing anyone outside of US. If that doesn't work you might be out of luck.
You would need to unpack the ROM and hack it to work on your device. Kind of how we hack it to work on G1's
I don't have to skills to "hack" system files. I'll try one more time, trying a US setup. Otherwise ill just have to live with it. Thanks for all the help, esp shafty.
So I tried this baby again after playing with Hero Eclair for a while.
The problem is that the setup-language during the first setup keeps jumping back to German. What files do I have to edit to remove the languages I dont need?
Thnx.

SD Tweakz - Run your scripts on SD at boot-time. (Plus few battery tweaks)

SD Tweakz v2
Only works on custom ROMs with init.d(aka busybox runparts) support
UPDATED 04/11/11(added a few battery tweaks)
Wondering around on XDA will sometimes lead you to threads with scripts/tweaks that may or may not help you improve your android device in one way or another. Now most of these scripts/tweaks are not boot resistant. Meaning, after rebooting the tweaks gets disabled and you need to enter/execute them once again.
Well here's another script that would help you initialize those scrips/tweaks every time you restart/reboot you phone and make your life a lot more easier.
Instructions / How does it work?
1. Download the initial script here (SD Tweakz v2)
2. Flash via recovery This will install/copy the initial script into a portion of your android system which initializes/runs every time the phone boots
3. Create a folder on SD called "scriptz" (/sdcard/scriptz)
4. Place your tweaks/scripts inside "scriptz" folder. Usefull scripts/tweaks with explanation below
5. Reboot and see your script run on boot time By this point, every time you boot, the initial script will check your sdcard(/sdcard/sctiptz) if any scripts/tweaks are present. Once found it will then run the scripts for you each and every time you boot
What is it good for
Well there are lots of tweaks out there just waiting to be discovered. Some can yield great performance and some can provide you with a better battery management that can extend your battery life for hours. Unfortunately, some tweaks can only give you one of the benefits above and a bad performance on the other. Meaning you just can't have 'em all. Here you can choose which tweaks/scripts to apply, modify the values as you want as well as debugging which script provides the benefits that you expect. Another reason for using this mod is compatibility as some tweaks/scripts can be ROM dependent. Most of the time it's a kernel issue but some libraries can get involved too.
The Scripts
Scripts are just plain linux compliant text document which has certain linux commands that can be issued using adb/terminal.
You can make one yourself using some android text editors(from es file explorer, dropbox, root explorer etc.). Don't forget to add a ".sh" file extension.
Here's a few example of the scripts I use:
Code:
#These scripts are from various sources from different sites including [URL="http://forum.samdroid.net/"]Samdroid.net[/URL]
#And of course in collaboration with FranciscoFranco
#
#My approach in the scripts/tweaks that I use is basically just to
#squeeze more juice out of my phone. So in contrast to the tweaks
#included in FranciscoFranco's thread, the tweaks/scripts I use are less
#aggressive in terms of performance and more inclined to save battery.
#
#non-rotational.sh
#this script tells android that you are not using spinning disks
DM=`ls -d /sys/block/dm*`;
MTD=`ls -d /sys/block/mtd*`;
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
for j in $DM $MTD $LOOP $RAM;
do
echo 0 > $j/queue/rotational;
done
#noatime.sh
#Remount all partitions with noatime, for more info visit [URL="http://forum.xda-developers.com/showpost.php?p=8708125&postcount=1"]http://forum.xda-developers.com/showpost.php?p=8708125&postcount=1[/URL]
for k in $(busybox mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime $k
done
#scheduler.sh
#Changes the scheduler used by the system, for more info visit [URL="http://forum.xda-developers.com/showpost.php?p=4806456&postcount=1"]http://forum.xda-developers.com/showpost.php?p=4806456&postcount=1[/URL]
for i in `busybox ls -1 /sys/block/mtdblock*`
do
echo "noop" > $i/queue/scheduler;
done
echo "noop" > /sys/block/mmcblk0/queue/scheduler;
echo "noop" > /sys/block/dm-0/queue/scheduler;
echo "noop" > /sys/block/dm-1/queue/scheduler;
#setprop.sh (currently testing)
#various build.prop settings
setprop wifi.supplicant_scan_interval 600
These are few of the tweaks that I have tested(and using right now), I will update it every time I test something out and will eventually add some of FranciscoFranco's tweaks for you to try out.
You can get some useful scripts from here - Performance and battery tweaks - by Franciscofranco (just read along)
Note: These scripts are no different from the scripts in FranciscoFranco's thread, I just categorized each individual tweaks and separated them for you to be able to apply each one separately. I will be more inclined to describe only battery saving tweaks as I am only interested with tweaks that could extend battery life(this includes performance tweaks that doesn't seem to affect the battery behavior at all)
Here's the my initial script again: SD Tweakz v2
Here's the downloadable version of each tweak mentioned above:
non-rotational.sh
scheduler.sh
noatime.sh
setprop.sh
If anything bad happens, just flash this Undo.zip(unsigned so just toggle signature verification) and everything should be back as it was before.
Huge thanks to NervGaz for providing a solution to the mount point conflict issue and of course Franciscofranco for those lively discussions and ideas we exchange.
Awesome job, I already linked this on my first page
@Ungaze
what is the difference from Tweakz V2?
bluviper said:
@Ungaze
what is the difference from Tweakz V2?
Click to expand...
Click to collapse
almost everything. Flashing this script alone won't do anything. You need to get your tweaks from here first and save it to /sdcard/tweakz folder. reboot and this way it will do exactly what Tweakz V2 did. Now if you notice any lag or performance drop, apply each tweak/script one by one to debug/troubleshoot which one is causing it.
Additionally if you found anything useful, you can make your own script.sh and place it on the /tweakz folder to run it on every boot.
ungaze said:
almost everything. Flashing this script alone won't do anything. You need to get your tweaks from here first and save it to /sdcard/tweakz folder. reboot and this way it will do exactly what Tweakz V2 did. Now if you notice any lag or performance drop, apply each tweak/script one by one to debug/troubleshoot which one is causing it.
Additionally if you found anything useful, you can make your own script.sh and place it on the /tweakz folder to run it on every boot.
Click to expand...
Click to collapse
Yes please, keep posting feedback either here or the other thread. Anything is useful since some users say they suffer some ocasional lag, others don't notice improvements, others say their phone became super fast...
ok now i get it... so the first batch of scripts on zip cannot be run on boot...
thats why you created this...
..ok i have finally applied everything! hehehe since i love smorgasbords...
and its very hard to tell that its there.... hehehe.. seems like fine to me.
no hiccups whatsoever..
but i feel its OK... thanks again man..
ok now i get it... so the first batch of scripts on zip cannot be run on boot...
thats why you created this...
Click to expand...
Click to collapse
the first batch of scripts had to be manually moved to init.d and had to be in a specific filename with a specific header and containing all the tweaks altogether in order to run on boot.
now what I did with the update.zips(Tweakz V1, Tweakz V2) was make moving it to init.d, renaming and fixing the header all easier for you guys but it still contain all the tweaks with no option for you guys to modify/add/remove lines that you want. This time it already runs on boot.
with this tweak, everything is easily manipulated through the sd card and a simple file explorer for more flexibility and easy troubleshooting. This should also work on most phones with init.d support.
Yes please, keep posting feedback either here or the other thread.
Click to expand...
Click to collapse
And to make things neater, just post stuff regarding only this script here and everything about tweaks on the other thread mentioned above.
You don't really need to move the scripts to the data partition, just invoke the with sh, ie. "sh /sdcard/scriptz/script.sh" it would make your for loop something like this:
for script in $list
do
sh /sdcard/scriptz/$script
done
Also I'd be careful with mounting SD ahead of vold, atleast on /sdcard or /mnt/sdcard make a tempfolder somewhere as a mount point instead and you shouldn't to worry about vold throwing up on you... Just a thought.
You don't really need to move the scripts to the data partition, just invoke the with sh, ie. "sh /sdcard/scriptz/script.sh" it would make your for loop something like this:
Click to expand...
Click to collapse
didn't work last time i tried running the scripts directly from sdcard but will try it with your script.
Also I'd be careful with mounting SD ahead of vold, atleast on /sdcard or /mnt/sdcard make a tempfolder somewhere as a mount point instead and you shouldn't to worry about vold throwing up on you... Just a thought.
Click to expand...
Click to collapse
I don't really have a choice right now but to use the same method as "VOID rom" is using when loading modules. Any ideas?
BTW thanks so much
A quick and simple solution would be to just add something along the lines of
mount -o rw,remount auto /
mkdir /tmp
<mount the sdcard>
<run the scripts>
<unmount the sdcard>
rmdir /tmp
mount -o ro,remount auto /
Not the cleanest solution of all time, but it should work and no risk of conflicting mount points. Another solution is to just have people install the scripts on the /data partition in a directory there as /data is mounted rw.
Sent from my LG-P500 using Tapatalk
NervGaz said:
A quick and simple solution would be to just add something along the lines of
mount -o rw,remount auto /
mkdir /tmp
<mount the sdcard>
<run the scripts>
<unmount the sdcard>
rmdir /tmp
mount -o ro,remount auto /
Not the cleanest solution of all time, but it should work and no risk of conflicting mount points. Another solution is to just have people install the scripts on the /data partition in a directory there as /data is mounted rw.
Sent from my LG-P500 using Tapatalk
Click to expand...
Click to collapse
I was worried about the mount point traffic as well, but I guess I will be implementing the second solution instead, with a very different approach, and a more complex script.
You seem to know your trade, too bad we didn't get to collaborate before I made this script(from scratch, with no knowledge at all with scripting and how they work). Was asking and trolling on different threads with no help at all. Good thing mr. google was always there for anyone who needs help .
I'll start working and hope to hear from you about my next release as well.
You might want to look at the userinit script in the CM based ROM's around if you're going down that route, it does what you want and there's no point reinventing the wheel if you know what I mean.
Sent from my LG-P500 using Tapatalk
Great! Nice tip, never done that before. Thanks alot man.
so all in all, is this script really running on boot or not?
It runs, only problem encountered is with CM7 roms. (mount point traffic or something like that in a sense) will edit 1st page till I finish the reworked script.
Hey ungaze,I have just flashed the script and everything. I'm on CM7. What is the problem? Do I have to wait for a fix and do everything over again? Because I'm currently not experiencing any problems
Nope, it worked once, it should also work every time. Dunno which beta version of CM7 some people are having problem with. I still think this method is easier and faster for testing scripts to run on boot, but the next script will just be more lets say "compatible to a wider variety of ROMs and even other devices".
The issue can occur on rom's that mount the sdcard on /mnt/sdcard and symlink that to /sdcard as your mountpoint doesn't exist. If memory serves me right this is the correct mount procedure since 2.2 and is more in line with FHS. Potentially you can see issues with this if it mounts before vold runs as well as vold with throw an error if the mountpoint is in use. This can occur on rom's that mount to /sdcard. Hope that clears it up a bit.
Sent from my LG-P500 using Tapatalk
How does this look?
Code:
mount -o rw,remount auto /
mkdir /tmp
mount sd
mount -t vfat /dev/block/mmcblk0p1 /tmp
if [ -e /tmp/scriptz ]
then
list=`ls /tmp/scriptz/*.sh`
for script in $list
do
sh $script
done
fi
umount sd
umount /tmp
rmdir /tmp
mount -o ro,remount auto /
Also "ls /tmp/scriptz/*.sh" would show the complete path including /tmp/scriptz/------ and so I just used sh $script on line 10. is this ok?
No need to mount the sdcard in the script, vold handles all that and its not used anyway. Apart from that it looks good to me.
Sent from my LG-P500 using Tapatalk

[DEV] Using -mm option works temporarily

I'm using the -mm (master-mount) option (or trying to) to be able to link folders from internal to external SD. Unfortunately it doesn't seem to work in a 'permanent' way. Any new app started after the mount does not receive the mounted folders, only apps already running will receive it!?
Furthermore, I tried various ways of using the -mm command, but only one seem to work:
su -mm -c 'mount command here' < /dev/null
Running su -mm and piping the commands fails, eg does not mount anything, but no failure message!?
Running su -mm -c <script_path> < /dev/null fails., eg does not mount anything, but no failure message!?
I also tried to run within different context, but it changes nothing. App started after the mount won't see it.
@Chainfire, can you help me make it work? Maybe detail a little more the How-to on this subject, because I fail to find a working method and I don't see how to make it work.
The only way to make it work seems to disable mount namespace separations.
Thanks.
@Chainfire, I understood you're likely not here for the rest of the summer, so you'll hopefully get this when you're back. Happy holiday until then.
I've made further investigations, on a stock-rooted LG G4, latest Lollipop 5.1.1.
For info, the mount commands are like this: 'mount -o bind,shared <source> <target>'... I run them using this syntax: su -mm -c 'mount... '.
EDIT:
All mounted folders are then accessible by any root shell started before or after they have been mounted. However other shells (be it started by the same app or another) do not see them if they are started after the folders have been mounted. If those standard shell are already running when the folders are mounted, they are all visible! Same behavior on a 4.4.2 device.
Then I tried disabling mount separation, but the result is exactly the same except for a very annoying side effect though, root shells actually loose access to /storage/emulated/0 !
EDIT2:
Found out that it only affects the emulated path (/storage/emulated/... and possibly /storage/extSdCard), if using /data/media and /mnt/media_rw paths, the mounts stick across processes, at least when the fuse filesystem is used.
Nevertheless is this a bug, is there something that can be done to make it work for emulated path (be it on fuse or sdcard filesystems) ? Or am I misunderstanding how all this works, or misusing the options? I'll appreciate any help you can provide on this. Let me know if you need any further information, I'll be happy to provide anything you need.
Thanks.

Categories

Resources