[Q] dsifix.ko applied to stock milestome froyo rom - Motorola Droid and Milestone General

hello, basically my question is that, how to apply the fix to a stock froyo rom...i think that it must be done trougth open recovery but i wanted to be sure. thankss

it can be done through the console of open recovery, or through a terminal editor if you have root.
edit: simpler way for stock roms
copy the dsifix.ko to your sdcard
mount the /system partition as read/write
run these commands:
Code:
cp /sdcard/dsifix.ko /system/lib/modules/dsifix.ko
chmod 644 /system/lib/modules/dsifix.ko
echo "insmod /system/lib/modules/dsifix.ko" >> /system/etc/rootfs/init.mapphone_umts.rc

correct me if im wrong, but the second directory, system/rootfs/, isnt that only for cyano based roms?? because in stock roms it doesnt exist. thanks for the reply.

ah you're right, sorry
hmm you could try using the 'install mods autostarts - not needed in many roms' script thats in androidiani openrecovery, and then running these commands:
Code:
cp /sdcard/dsifix.ko /system/lib/modules/dsifix.ko
chmod 644 /system/lib/modules/dsifix.ko
cd /system/etc/init.d
touch 1dsifix
echo "insmod /system/lib/modules/dsifix.ko" > 1dsifix
chmod 750 1dsifix
I'm not entirely sure this will work, but try it and see.

Hi,
to sum it up:
To use additional kernel modules (e.g. dsifix.ko) you need to tweak the startup scripts (e.g. init.mapphone_umts.rc)
To use tweaked startup scritps like modified init.mapphone_umts.rc you'll need a ROM that makes use of 2nd init process.
Stock ROMs do not use 2nd init, because it's a hacked feature and stock ROMs are usually not hacked
On stock ROM there's also no /system/etc/init.d nor /system/etc/rootfs directory, because they are no used there.
Hope this helps
P.S.: Don't know about this androidiani stuff ...
EDIT: Search button is so nice... http://forum.xda-developers.com/showthread.php?t=1003338
Regards,
scholbert

great i will try this evening, thanks for the repliess.
Sent from my Milestone using XDA App

the androidiani mod enables 2nd-init, which means it checks for scripts in the init.d folder
that link is only for the display update fix, which causes tearing, not for the kernel module fix thats popped up recently. However, we can modify coldsphinx's instructions to suit our purposes.
as usual, you'll need to move the dsifix to /system/lib/modules
Code:
cp /sdcard/dsifix.ko /system/lib/modules/dsifix.ko
chmod 644 /system/lib/modules/dsifix.ko
then rename the mot_boot_mode file to mot_boot_mode.bin
Code:
mv /system/bin/mot_boot_mode /system/bin/mot_boot_mode.bin
then create the file /system/bin/mot_boot_mode
and add this to the file:
Code:
#!/system/bin/sh
export PATH=/system/bin:$PATH
mot_boot_mode.bin
insmod /system/lib/modules/dsifix.ko
and then finally set the permissions
Code:
chmod 755 /system/bin/mot_boot_mode
it will work.

GReat! thanks!

Related

[Q] Odex before compression

Is it possible to odex a system before I compress it into a androidinstall and send it to my device to install?
If so how?
only way i have found to odex is through the phone
How do people release odex'ed builds then?
2 ways
1. if adb works push the odex script to /data run the scrpit (search odex donut or dzo's instructions on how to use it), then do an adb pull of /system then repack it into a .tar and go
2 adb doesnt work for me so here is how i do it, i load up my build and in the /data folder i have the odex script, i run the script using terminal emulator, then i restart after its finished and put in a blank sd card then i copy the app and framework folders from /system to the SD and replace those folders in the original .tar with the newly odex'd ones
I put the odex script into data and then added it to init
jholtom said:
Is it possible to odex a system before I compress it into a androidinstall and send it to my device to install?
If so how?
Click to expand...
Click to collapse
I asked dzo once and he answered me, in the Fresh Froyo thread. The search function isn't working right now, but when you read this it might be working. Another thread described things in more detail, but I long ago forgot where that thread is. I never got odexing to work outside the phone, but here is the script I have tried. Note that the dexpreopt.py python script has to be edited to mount system as read/write, or it completely fails. I run this after a complete build.
Code:
#! /bin/sh
. build/envsetup.sh
lunch us_vogue-userdebug
rm out/target/product/vogue/obj/PACKAGING/systemimage_unopt_intermediates/system.img
ONE_SHOT_MAKEFILE=/home/devel/android/build/tools/dexpreopt/Android.mk make -C /home/devel/android/ files
make
mkdir /tmp/system-odex
rm -rf /tmp/system-odex/system
cp -ra out/target/product/vogue/system /tmp/system-odex
dexpreopt.py --outsystemdir=/tmp/system-odex/system
for i in /tmp/system-odex/system/app/*.apk; do zipalign -f 4 $i /tmp/zip; mv /tmp/zip $i; done
tar -C /tmp/system-odex -czf odex.tgz system
n2rjt said:
I asked dzo once and he answered me, in the Fresh Froyo thread. The search function isn't working right now, but when you read this it might be working. Another thread described things in more detail, but I long ago forgot where that thread is. I never got odexing to work outside the phone, but here is the script I have tried. Note that the dexpreopt.py python script has to be edited to mount system as read/write, or it completely fails. I run this after a complete build.
Code:
#! /bin/sh
. build/envsetup.sh
lunch us_vogue-userdebug
rm out/target/product/vogue/obj/PACKAGING/systemimage_unopt_intermediates/system.img
ONE_SHOT_MAKEFILE=/home/devel/android/build/tools/dexpreopt/Android.mk make -C /home/devel/android/ files
make
mkdir /tmp/system-odex
rm -rf /tmp/system-odex/system
cp -ra out/target/product/vogue/system /tmp/system-odex
dexpreopt.py --outsystemdir=/tmp/system-odex/system
for i in /tmp/system-odex/system/app/*.apk; do zipalign -f 4 $i /tmp/zip; mv /tmp/zip $i; done
tar -C /tmp/system-odex -czf odex.tgz system
Click to expand...
Click to collapse
ok thanks
I'll work with it
Also there is a script I use to odex files as they are downloaded from the market or installed on the phone. It is inside of my barebones build and if you look inside my userinit from my build you will see the call to the file.
Edit: I do not take credit for it, I just claim to be a source of the file as I already have it.

[SCRIPT] Permissions Init Script

Hey guys,
I had a nasty issue with Bi-Winning a couple weeks ago where I pushed custom framework and totally forgot about permissions. Apparently when you don't set the proper permissions it can really slow things down.
So I figured this could easily be avoided. So because of that and our CWM "Fix Permissions" option doesn't really do anything, I wrote this script to fix it!
Upon every boot, it will scan /system/app, /system/framework/, and /data/app and set the proper permissions for all the files in there.
Users
note if you're on Trigger 2.9.1+ or Bi-Winning V1+ you do NOT have to do this. It's built into your ROM already.
Flash the attached zip named "CWM_Flash_Permissions_Script.zip"
Ironically, it may not have the correct permissions after you flash it, so then do either of the following
1) Do these commands in ADB to set the correct permissions
Code:
adb shell
mount -o rw,remount /dev/block/stl9 /system
busybox chmod 777 /system/etc/init.d/*
or
2) Open up Root Explorer (or something similar)
navigate to /system/etc/init.d/
in there find the new file S30edt_perms
long press, and set the permissions
make it look like this
Code:
x x x
x x x
x x x
Here's the init.d script, it's really simple, but also effective
Code:
#!/system/bin/sh
# Permission script
# Written by Einherjar Dev Team
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
mount -o rw,remount /dev/block/stl9 /system
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo " setting permissions (644) for $file" >> $logFile
chmod 644 $file
done
echo "chmodding init.d folder"
chmod 777 /system/etc/init.d
for file in /system/etc/init.d/*; do
echo " setting permissions (777) for $file" >> $logFile
chmod 777 $file
done
echo "Permissions set" >> $logFile
Very cool, thanks roman.
Very cool to post the code too... lets us linux newbs get our learn on!
Poser said:
Very cool, thanks roman.
Very cool to post the code too... lets us linux newbs get our learn on!
Click to expand...
Click to collapse
I'm a Linux noobie myself!
birgertime said:
I'm a Linux noobie myself!
Click to expand...
Click to collapse
[slight OT] Just getting wifi working on an old ideapad y510 in slackware was an epic struggle... (wicd my arse)
[back on topic] I wish more devs would post script contents (though we can easily download and look in vi or notepad)... it helps the learning curve immensely
grateful for all the work EDT and rest of dev community does. We all are.
Question: What does the fix permissions CWM do then?
Poser said:
[slight OT] Just getting wifi working on an old ideapad y510 in slackware was an epic struggle... (wicd my arse)
[back on topic] I wish more devs would post script contents (though we can easily download and look in vi or notepad)... it helps the learning curve immensely
grateful for all the work EDT and rest of dev community does. We all are.
Question: What does the fix permissions CWM do then?
Click to expand...
Click to collapse
I have no clue, lol. Never bothered looking at it
edit: I hate vi.
roman im gonna add S30edt_perms.zip to my rom ..ill add you to credits
birgertime said:
I have no clue, lol. Never bothered looking at it
edit: I hate vi.
Click to expand...
Click to collapse
lol.
Vi is about as stripped down as you can get when it comes to text based editors... (I know its blasphemous... but I dig notepad++, shhh... dont tell)
I get "Bad Mode"
gamefreakgcb said:
I get "Bad Mode"
Click to expand...
Click to collapse
Hmm, ok you might need super user permissions do this and let me knkow if it works:
1) type in "adb shell"
2) type in su (don't press enter yet)
3) turn your screen on & unlock it
4) press enter on the su prompt, then his yes on the screen
then try that chmod command again.
birgertime said:
Hmm, ok you might need super user permissions do this and let me knkow if it works:
1) type in "adb shell"
2) type in su (don't press enter yet)
3) turn your screen on & unlock it
4) press enter on the su prompt, then his yes on the screen
then try that chmod command again.
Click to expand...
Click to collapse
Gave permission, still "Bad Mode"
gamefreakgcb said:
Gave permission, still "Bad Mode"
Click to expand...
Click to collapse
bad mode in the command line? gotta give me something more here
if it' s when you run chmod +x try this one:
Code:
busybox chmod 777 /system/etc/init.d/*
birgertime said:
bad mode in the command line? gotta give me something more here
if it' s when you run chmod +x try this one:
Code:
busybox chmod 777 /system/etc/init.d/*
Click to expand...
Click to collapse
When I do that, I get
chmod: /system/etc/init.d/S01edt_systcl: Read-only file system
chmod: /system/etc/init.d/S20edt_gps: Read-only file system
chmod: /system/etc/init.d/S30edt_perms: Read-only file system
chmod: /system/etc/init.d/S50edt_zipalign: Read-only file system
chmod: /system/etc/init.d/S98edt_tweaks: Read-only file system
chmod: /system/etc/init.d/S99edt_complete: Read-only file system
gamefreakgcb said:
When I do that, I get
chmod: /system/etc/init.d/S01edt_systcl: Read-only file system
chmod: /system/etc/init.d/S20edt_gps: Read-only file system
chmod: /system/etc/init.d/S30edt_perms: Read-only file system
chmod: /system/etc/init.d/S50edt_zipalign: Read-only file system
chmod: /system/etc/init.d/S98edt_tweaks: Read-only file system
chmod: /system/etc/init.d/S99edt_complete: Read-only file system
Click to expand...
Click to collapse
Oh crap, thanks for pointing that out man. Easy fix
do this
Code:
mount -o rw,remount /dev/block/stl9 /system
busybox chmod 777 /system/etc/init.d/*
should work like a charm
by the way, next time you flash a newer edt rom, they already have this fix built in. since you overwrote the file, you'll need to run the above commands to set the correct permissions as they get messed up sometimes when modifying them.
That did the trick, thanks.
The script in the .zip says
Code:
# Permission script
# Written by Roman (birgertime)
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo "setting permissions for $file" >> $logFile
chmod 0644 $file
done
echo "Permissions set" >> $logFile
Which is different than the OP. I'm confused.
MikeyMike01 said:
The script in the .zip says
Code:
# Permission script
# Written by Roman (birgertime)
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo "setting permissions for $file" >> $logFile
chmod 0644 $file
done
echo "Permissions set" >> $logFile
Which is different than the OP. I'm confused.
Click to expand...
Click to collapse
I notice that before... but got side tracked and forgot to mention something... I just pulled the one from in Bi-Winning V2 and have been ADB Push'ing that.
EDIT: Also noticed that the one that's in Dan_Brutal "Metrik Part 1- Pepperkake" is the wrong one.
Does this works on hd2 android? i really need this..
haysnamrip said:
Does this works on hd2 android? i really need this..
Click to expand...
Click to collapse
Should work on any Android that can run scripts
i flashed and its working.. no more changing permission after run fix_permissins on terminal emulator..
Hey Roman, thanks for yet another improvement for this phone!
Simple question: can I just download and push the S30edt_perms.zip to etc/int.d? And is this any good for CM7 based ROMs? I just checked and that file isn't in my init.d folder on Trigger Redux.
Thanks!
Sent from my rough sketch of a Vibrant on a brick.

How to get root access from kernel, with no busybox and not building any sources

Hi folks,
On my way trying to get 10 usefull posts to access the developers forums, I have writen this easy tutorial. xD
THIS IS FOR S5830i DEVICES. init.rc used belongs to S5830i ramdisk
Whats all about? Well, in this tutorial I will so you how to get root access directly from Kernel only modifing init.rc and adding su to tmp folder.
THIS IS NOT UNSECURING THE BOOT.IMG TUTORIAL
Question: Axyllum why are you posting this, if there are so many tutorials on how to do this for other devices?
Answer: Simple, as you all ready imagine, partition for boot.img is just 5MB Oh my god.
Then, if my boot image is all ready 4.28MB, how can I use a busybox thats 836KB (I compiled a busybox with mount, cp, mkdir, chmod and chown that is the minimum to get root: image = 836MB). Cant use this beacuse I exceed total mounting point size.
Kernel + ramdisk = 4.28MB if you pull stock boot.img from your device.
Minimum busybox explained before = 836KB
SU image 25KB to 86KB depending on the su image you use.
This makes a total of: 5.2MB. Try to flash it. It fails? Yes, you exceeded the mounting point size.
And the solution? Follow my tutorial.
Abilites you will need to follow the turotrial:
Know how to: Un pack & repack boot.img
Know how to: Decompress Ramdisk and compress it back. (to get the famous newramdisk in many many tutorials) newramdisk is just a name, you can compress back to any name, for example axyllumramdisk or yourramdisk or how ever you want to call it.
Asuming you know how to do the explained above and after my wierd chat, lets gooooo:
1. Open init.rc in your favourite text editor.
2. Go to this line in init.rc:
mount rfs /dev/stl9 /system check=no
You should see this:
mount rfs /dev/stl9 /system check=no
mount rfs /dev/stl9 /system ro remount
Got it? lets go to step 3.
3. Overwrite both lines with this:
mount rfs /dev/stl9 /system check=no
mkdir /system/xbin
copy /tmp/su /system/xbin/su
chown root root /system/xbin/su
chmod 06755 /system/xbin/su
mount rfs /dev/stl9 /system ro remount
Make sure you are not overwriting other lines or your ramdisk could not work.
4. Paste SU image file to tmp folder. Make sure SU image has execute permissions.
5. Compress back ramdisk (the famous newramdisk).
6. Repack boot.img
7. Flash it.
8. Restart device.
9. Download superuser.apk and busybox form market and.... there you go you made your kernel with root access and no need of a busybox.
Ok, this was simple, but i imagine more than one will like to know what we did.
I'll explain:
As we cant add a busybox, how the hell am i going to mount system rw, mkdir xbin, cp su from tmp to xbin, chmod / chown permissions?
I started reading the init.rc file (i was bored and my wife wanted to go shopping --> no way i have an init.rc file to mess up with), and I saw many mkdir, copy, chmod etc... commands. (Opened a beer)
So i thought, great, there is all ready a busybox with the least i need to make this. Then why dont i use this preinstalled commands?
And i did this:
mount rfs /dev/stl9 /system check=no --> first I checked this, this instruction is where init.rc mounts system. At this point system is mounted RW.
mkdir /system/xbin --> Then as system is rw, I will create xbin folder. how? with mkdir comand.
copy /tmp/su /system/xbin/su --> Great I did not find a cp command, but found a "copy" command someware in init.rc. Search for it, you will see its used. Then why dont I use it to copy SU in tmp folder to the just created xbin folder? It worked.
chown root root /system/xbin/su --> Owner of su in xbin is: yes, root.
chmod 06755 /system/xbin/su --> Set the right permission to su. You need to chmod with 06755. --> 09364, 66666, 83823 will not work looooolll just a joke i imagine you all ready know what setting permissions is all about.
mount rfs /dev/stl9 /system ro remount --> Remount system with ro (this is the read only remount command).
I dont know if there are any other tutorials doing this, this way, i just did it my self. I Found tutorials on doing the same, but busybox, and .sh script and su were needed. To much for our small boot.img partition.
Enjoy.
Tip, dont mess your init.rc if you do not understand it.

[Q] Init.d under Cocore 6.2 dont working [SOLVED]

Hi
Im using Galaxy S Advance with:
JB 4.1.2 and stock ROM
rooted
kernel Cocore 6.2
I tried to use script on boot from init.d directory, unfortunately not working.
To see if it works fine, I created /etc/init.d folder
with permissions 777, owner root
Inside init.d folder, I created simple script: testinit.sh also testinit
Code:
#!/system/bin/sh
echo init.d script is working > /storage/sdcard0/init.txt
file permissions 777, owner root
But after restart, file init.txt on sdcard0 isnt created,
so I suppose that script isnt running.
I created also another script follow Cocore thread
Code:
#!/system/bin/sh
insmod /lib/modules/logger.ko
for start logger. Logger didnt start also.
Both scripts started in console or adb works fine.
Tnx in advance
darcik said:
Hi
Im using Galaxy S Advance with:
JB 4.1.2 and stock ROM
rooted
kernel Cocore 6.2
I tried to use script on boot from init.d directory, unfortunately not working.
To see if it works fine, I created /etc/init.d folder
with permissions 777, owner root
Inside init.d folder, I created simple script: testinit.sh also testinit
Code:
#!/system/bin/sh
echo init.d script is working > /storage/sdcard0/init.txt
file permissions 777, owner root
But after restart, file init.txt on sdcard0 isnt created,
so I suppose that script isnt running.
I created also another script follow Cocore thread
Code:
#!/system/bin/sh
insmod /lib/modules/logger.ko
for start logger. Logger didnt start also.
Both scripts started in console or adb works fine.
Tnx in advance
Click to expand...
Click to collapse
Try this way: LINK.
Tnx for answer, atm I abandoned testinit script, this isnt important
and focused on start of logger .
I changed it to
Code:
#!/system/bin/sh
busybox mount -o remount,rw -t auto /system;
busybox insmod /lib/modules/logger.ko
but logger didnt start.
Does the system log, what happens when boot, I mean errors?
I have a habit of "big" Linux system
darcik said:
Tnx for answer, atm I abandoned testinit script, this isnt important
and focused on start of logger .
I changed it to
Code:
#!/system/bin/sh
busybox mount -o remount,rw -t auto /system;
busybox insmod /lib/modules/logger.ko
but logger didnt start.
Does the system log, what happens when boot, I mean errors?
I have a habit of "big" Linux system
Click to expand...
Click to collapse
I think log starts after script is executed, and it can't be executed during pre-boot. So maybe it only works when you get in system (booted). And then there is not much to show, try doing some thing while logcat is triggered. Like change governor, IO etc.
I am just gessing this, maybe I am wrong about that, but seams logical to me. :fingers-crossed:
Lol
Incidentally, I found the answer to my problem in this topic.
Save the script without any extensions (Yes, not even .sh extension).
Click to expand...
Click to collapse
So I renamed my script to logcat without sh extension and all works.
Anyway tnx for help.
Cocore 8.0 init.d not working
I make this init.d file for cocore 8.0:
#!/system/bin/sh
busybox mount -o remount,rw -t auto /system;
echo 12 > /sys/module/mxt224e/parameters/threshold_batt
echo init.d script is working > /storage/sdcard0/init.txt
echo "pegasusq" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "sio" > /sys/block/mmcblk0/queue/scheduler
echo 100663296 > /sys/block/zram0/disksize
mkswap /dev/block/zram0
swapon /dev/block/zram0
echo 700 > /sys/kernel/abb-charger/max_ac_c
echo 0 > /sys/module/mali/parameters/mali_debug_level
Click to expand...
Click to collapse
placed in /system/etc/init.d with "logcat" name. This scirpt don't make the txt file. Why?
Permission 755 for script file. No .sh at the end - just filename.
That should help
Sent from my SGS Adv. using xda-developers app.
th3cr0w said:
Permission 755 for script file. No .sh at the end - just filename.
That should help
Sent from my SGS Adv. using xda-developers app.
Click to expand...
Click to collapse
The solution was i left some space after the command. Thank you!

need help if there is any hope

Hey there.
i have my old sgs, and it cant boot to recovery. just to the rom.
the problem i have is that the usb port of the phone is messed up and only charges, cant be fixed.
so i cant use Odin.
is there any way to restore recovery? ive tried flashify and Rom Manager, both fails
purpleraintoxicity said:
Hey there.
i have my old sgs, and it cant boot to recovery. just to the rom.
the problem i have is that the usb port of the phone is messed up and only charges, cant be fixed.
so i cant use Odin.
is there any way to restore recovery? ive tried flashify and Rom Manager, both fails
Click to expand...
Click to collapse
We have recovery united with boot kernel if i'm not wrong, so it's risky for you.
If it isn't problem with keys, then you can flash kernel from terminal (i don't know on which ROM you are). I'm not too familiar with 2.3.6 layout, but on MTD you should:
- get any MTD ROM .zip.
- extract those files: bml_over_mtd \ bml_over_mtd.sh \ erase_image \ flash_image
- Take files to /sdcard
- Go in terminal (some file managers don't like copying to /sbin):
Code:
cp /sdcard/flash_image /sbin/flash_image
cp /sdcard/erase_image /sbin/erase_image
cp /sdcard/bml_over_mtd.sh /sbin/bml_over_mtd.sh
mkdir /tmp
cp /sdcard/bml_over_mtd /tmp/bml_over_mtd
chmod 755 /sbin/flash_image
chmod 755 /sbin/erase_image
chmod 755 /tmp/bml_over_mtd
chmod 755 /sbin/bml_over_mtd.sh
- Those files (^^^) should be in given locations (except /sbin/bml_over_mtd.sh - it can be somewhere else).
- Take desired boot.img to /sdcard/boot.img
- And make this:
Code:
su
erase_image boot
sh /sbin/bml_over_mtd.sh boot 72 reservoir 2004 /sdcard/boot.img
- Check /sdcard/bml_over_mtd.log for errors (it should be successful).
- If failed, don't restart! You must try different method.
Maybe wait before i will test it on my own (i can roll back anyway, you can't).
PS: Why not in General?
EDIT: It worked on PAC-ROM @ 4.4.4, so all MTD can be ok. BUT didn't tested on 2.3.6 firmware, here you shouldn't use bml_over_mtd i think, so try:
Code:
/sbin/flash_image boot /sdcard/boot.img
Still didn't guaranteed!!!
Ill try it. Thanks
Im on PA 4.4.4
on the lines:
cp /sdcard/flash_image /sbin/flash_image
cp /sdcard/erase_image /sbin/erase_image
i get error in terminal that this location is read-only
edit:
all went well after remounting this dir
the log was successful, now rebooted, waiting on boot logo for 5 min now. hope itll work, even though i dont really mind, i have my daily G2
thank you!
One more thing :you can always use mobile Odin...

Categories

Resources