I'm trying to make a script that will do a modification to the build.prop on boot.
Usually I flash the cm7 nightly and I pull the build.prop, modify it and push it back before the first boot. The idea is to make it easier for flashing roms on the go. Using custom_backup_list.txt seems to be a viable option but it will keep an old build.prop indefinitely.
Some of the properties that I want to change are
Code:
windowsmgr.max_events_per_sec=100
ro.sf.lcd_density=201
ro.config.ringtone=_Mosquito 16bit.mp3
ro.config.alarm_alert=Alarm_Beep_02.ogg
From what I read today CM7 looks for inituser.sh file at two different locations:
Code:
/sd-ext/userinit.sh
/data/local/userinit.sh
As of now I have tried without success doing the following
Make a userinit.sh script at /data/local with the following code
Code:
#!/system/bin/sh
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
setprop windowsmgr.max_events_per_sec 100
setprop ro.sf.lcd_density 201
setprop ro.config.ringtone "_Mosquito 16bit.mp3"
setprop ro.config.alarm_alert Alarm_Beep_02.ogg
I'm not sure if there's something wrong in the above code, or CM7 is not running the scripts on boot.
EDIT: after adb push the file I do
Code:
adb shell
chmod 755 /data/local/userinit.sh
I've been trying for several hours now. Still get issue with stuck at X.
This is my updated script. Not sure what is wrong...
Using CM7 nightly36
cavs intersectraven
ss4n1 script
dtapp2sd
this is my userinit.sh at /data/local
Code:
#!/system/bin/sh
file=/system/.bproped
if [ -f "$file" ]; then
echo "Done already"
else
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=202/g' /system/build.prop
sed -i '/ro.config.ringtone/d' /system/build.prop
sed -i '/ro.config.alarm_alert/d' /system/build.prop
echo "ro.telephony.call_ring.delay=1000" >> /system/build.prop
echo "ro.config.ringtone=_Mosquito 16bit.mp3" >> /system/build.prop
echo "ro.config.alarm_alert=Alarm_Beep_02.ogg" >> /system/build.prop
echo "windowsmgr.max_events_per_sec=100" >> /system/build.prop
echo > /system/.bproped
fi;
exit 0
I know where you're coming from. Takes a while to customize your phone manually after each nightly, so I actually have a custom script similar to what you're doing, which updates build.prop and other config files (hosts, gps.conf, etc). Only mine is run within the update.zip, using the recovery shell /sbin/sh.
For your method, you can try this ...
Code:
#!/system/bin/sh
MODIFIED=`cat /system/build.prop|grep "zeus_chingon"`
if [ "$MODIFIED" ];
then
echo "Done already"
else
mount -o remount,rw /system
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=202/g' /system/build.prop
RINGTONE=`cat /system/build.prop|grep "ro.config.ringtone"`
sed -i 's/$RINGTONE/ro.config.ringtone=_Mosquito_16bit.mp3/g' /system/build.prop
ALARM=`cat /system/build.prop|grep "ro.config.alarm_alert"`
sed -i 's/$ALARM/ro.config.alarm_alert=Alarm_Beep_02.ogg/g' /system/build.prop
echo "ro.telephony.call_ring.delay=1000" >> /system/build.prop
echo "windowsmgr.max_events_per_sec=100" >> /system/build.prop
echo "# Modified by zeus_chingon" >> /system/build.prop
mount -o remount,ro /system
fi
EDIT:
My own custom script is HERE. Feel free to modify for your own use.
ch33kybutt said:
I know where you're coming from. Takes a while to customize your phone manually after each nightly, so I actually have a custom script similar to what you're doing, which updates build.prop and other config files (hosts, gps.conf, etc). Only mine is run within the update.zip, using the recovery shell /sbin/sh.
For your method, you can try this ...
Code:
#!/system/bin/sh
MODIFIED=`cat /system/build.prop|grep "zeus_chingon"`
if [ "$MODIFIED" ];
then
echo "Done already"
else
mount -o remount,rw /system
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=202/g' /system/build.prop
RINGTONE=`cat /system/build.prop|grep "ro.config.ringtone"`
sed -i 's/$RINGTONE/ro.config.ringtone=_Mosquito_16bit.mp3/g' /system/build.prop
ALARM=`cat /system/build.prop|grep "ro.config.alarm_alert"`
sed -i 's/$ALARM/ro.config.alarm_alert=Alarm_Beep_02.ogg/g' /system/build.prop
echo "ro.telephony.call_ring.delay=1000" >> /system/build.prop
echo "windowsmgr.max_events_per_sec=100" >> /system/build.prop
echo "# Modified by zeus_chingon" >> /system/build.prop
mount -o remount,ro /system
fi
EDIT:
My own custom script is HERE. Feel free to modify for your own use.
Click to expand...
Click to collapse
Thanks for your help, I end up using your zip file with some modification. The problem that I keep encountering is that using the /data/local/userinit.sh method it get stuck on boot at X.
I saw in your buildprop.sh some settings like
Code:
ro.HOME_APP_ADJ=1
ro.HOME_APP_MEM=3072
what does each one do?
I use LauncherPro if that have anything to do with it.
ro.HOME_APP_ADJ determines oom_adj value and ro.HOME_APP_MEM determines memory threshold, for your chosen launcher app. In short, these settings help to keep the launcher resident in memory and thus reduce homescreen lag.
One thing you have know about the ro.* settings in build.prop, are that they are writeable one-time only, i.e. once any ro.* value has been set, it becomes read-only and you cannot use setprop to change it further.
So it seems that your orginal buildprop.sh script add to the first line of build prop by using the
Code:
sed -i '1i\Something' /system/build.prop;
to put it in "higher priority" so that it get run first and overlook the second occurence that might occur in the build.prop afterwards?
So if i want to add something to line number n it would be
sed -i 'ni\something' .......
zeus_chingon said:
So it seems that your orginal buildprop.sh script add to the first line of build prop by using the
Code:
sed -i '1i\Something' /system/build.prop;
to put it in "higher priority" so that it get run first and overlook the second occurence that might occur in the build.prop afterwards?
So if i want to add something to line number n it would be
sed -i 'ni\something' .......
Click to expand...
Click to collapse
That's correct.
Build.prop
Hi All,
By default my System folder didn't had the build.prop. i extracted it from the CM7 Rom made some changes and copied it to System folder and rebooted.
Changes ringtone(default) Playa.ogg to Rigel.ogg.
After reboot still Playa.ogg as my default ringtone.
What is figured was my Phone isnt including build.prop file
Any suggestions?
Thanx
Wildfire Rooted(CM7 Nightly 2.3.5)
Related
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.
So yea I've been working on a proper "app2sd" solution that doesn't involve just switching the MicroSD for the eMMC, but I like the stock rom so far, so I didn't feel like flashing a rom just to get init.d, and I didn't feel like modifying the ramdisk in the kernel either. So I cooked up this script that anyone can run from terminal to get init.d support. It should work for other devices too, as long as they run /system/etc/install-recovery.sh on boot.
There's only three requirements for it to work:
#1 You must be rooted
#2 Your device must run /system/etc/install-recovery.sh
#3 You must have busybox
I tested a few times on my own device (GT-N8013), but haven't had anyone else test it, so don't freak out if it doesn't work. Just let me know what went wrong and I'll figure something out.
Running it is very simple:
#1 Open any terminal app
#2 su
#3 navigate to the folder where you have the script
#4 sh ./enableinit.sh
Your device will be rebooted once the process is done, don't freak out. If everything went fine, you'll have a file in /sdcard called init.d.log created by the test init.d script that is made by the enabler.
You can either download the attachment (rename it to enableinit.sh if you get the attachment), or create the file with the contents betlow:
Code:
#!/system/bin/sh
# Adds init.d support to any device that automatically runs /system/etc/install-recovery.sh
# on startup.
#
# Made by TweakerL, make sure to visit us at and-host.com or chat with us on freenode #and-host
echo '##################################################'
echo '## ##'
echo '## Script by TweakerL ##'
echo '## Visit us at and-host.com ##'
echo '## Chat with us at freenode #and-host ##'
echo '## ##'
echo '##################################################'
echo ''
echo 'This script will enable init.d if your device'
echo 'executes /system/etc/install-recovery.sh'
echo ''
echo 'Your tablet will be rebooted once the process'
echo 'is done.'
echo ''
echo 'If the script successfully enabled init.d you will'
echo 'have a file in /sdcard called init.d.log after'
echo 'the device is done rebooting. Remember to always'
echo 'set the proper permissions in your scripts or they'
echo 'will not work.'
echo ''
read -p "Press ENTER to continue..."
if [ ! -f /system/xbin/busybox -a ! -f /system/bin/busybox ]
then
echo 'You do not have busybox. Exiting now...'
else
# Mount system as rw in order to execute the script
busybox mount -o remount,rw -t ext4 /dev/block/mmcblk0p9 /system
# Check if install-recovery.sh already exists, and if so
# add the necessary lines, otherwise create it
if [ -f /system/etc/install-recovery.sh ]
then
if cat /system/etc/install-recovery.sh | busybox egrep -i "sysinit"
then
echo sysinit already present in install-recovery.sh, skipping this step.
else
busybox cp -f /system/etc/install-recovery.sh /sdcard/qsxdrgbhuk.sh
echo '' >> /sdcard/qsxdrgbhuk.sh
echo '/system/bin/sysinit' >> /sdcard/qsxdrgbhuk.sh
busybox cp -f /sdcard/qsxdrgbhuk.sh /system/etc/install-recovery.sh
fi
else
echo '#!/system/bin/sh' >> /sdcard/qsxdrgbhuk.sh
echo '' >> /sdcard/qsxdrgbhuk.sh
echo '/system/bin/sysinit' >> /sdcard/qsxdrgbhuk.sh
busybox cp -f /sdcard/qsxdrgbhuk.sh /system/etc/install-recovery.sh
busybox chmod 755 /system/etc/install-recovery.sh
fi
# Check if sysinit already exists and if so skip step
# otherwise create it
if [ ! -f /system/bin/sysinit ]
then
echo '#!/system/bin/sh' >> /sdcard/kuhbgrdxsq
echo 'export PATH=/sbin:/system/sbin:/system/bin:/system/xbin' >> /sdcard/kuhbgrdxsq
echo '' >> /sdcard/kuhbgrdxsq
echo '/system/bin/logwrapper busybox run-parts /system/etc/init.d' >> /sdcard/kuhbgrdxsq
busybox cp -f /sdcard/kuhbgrdxsq /system/bin/sysinit
busybox chmod 755 /system/bin/sysinit
else
echo sysinit already exists in /system/bin. init.d should already be enabled.
fi
# Cleanup
busybox rm -f /sdcard/qsxdrgbhuk.sh
busybox rm -f /sdcard/kuhbgrdxsq
#Check that init.d folder exists and if not create it
# as well as set the right permissions
if [ -d '/system/etc/init.d' ]
then
chmod 755 /system/etc/init.d
else
mkdir /system/etc/init.d
chmod 755 /system/etc/init.d
fi
# Create a test init.d script that echoes a file to
# /sdcard on successful execution
echo '#!/system/bin/sh' > /sdcard/99testinit
echo '' >> /sdcard/99testinit
echo 'echo init.d works > /sdcard/init.d.log' >> /sdcard/99testinit
busybox cp -f /sdcard/99testinit /system/etc/init.d
chmod 755 /system/etc/init.d/99testinit
busybox rm -f /sdcard/99testinit
# Sync and remount system
sync
busybox mount -o remount,ro -t ext4 /dev/block/mmcblk0p9 /system
# Reboot system to enable init.d
if [ -f /system/bin/reboot ]
then
echo Your device will reboot in 3 seconds
sleep 3
reboot
else
echo "Your device doesn't appear to have a reboot command,"
echo "please reboot your device now to avoid problems."
fi
fi
reserved
TweakerL said:
reserved
Click to expand...
Click to collapse
it is good!
TweakerL said:
reserved
Click to expand...
Click to collapse
Thanks for sharing.
Im tested my ainol elf offical rom novo0706, and worked. Thank
Sent from my Ainol Novo 7 Elf using Tapatalk 2
Pretty awesome. Will edit once i try this out.
Edit: Everything worked. Tested on GT-N8013
Thanks alot.
Sent from my GT-N8013 using Tapatalk 2
Hi, Can you tell more clearly how to make this work.
Sent from my GT-N8000 using xda app-developers app
Can any one make .zip file to flash thru recovery..thanks
The point was not to have to go into recovery...
Anyway, it's really simple...
Download the attached file
open terminal
then do the following commands
Code:
su
cd /sdcard
sh ./Download/enableinit.sh.txt
assuming that your browser saves files to /sdcard/Download
Sorry, I am a computer idiot . I really donot how to do after I had downloaded the text file. Appreciated if you can explain more detail.
Sent from my GT-N8000 using xda app-developers app
So now with init.d support ready, is it going to be possible to run proper a2sd scripts? And which one specifically would you recommend? Excuse me if i'm asking the wrong questions.
andylam16 said:
Sorry, I am a computer idiot . I really donot how to do after I had downloaded the text file. Appreciated if you can explain more detail.
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
It has nothing to do with knowing anything about computers, as you don't need a computer to do this... just your device...
Download the file, on your device, if you're using stock browser it will go to /sdcard/Download
Make sure you have busybox, download a busybox installer from the market, install it, and run it, and tell it to install busybox
Download a terminal app from the play store for free, such as android terminal emulator, install it and open it
then type in these exact commands, just like they're in here, in the terminal:
Code:
su
sh /sdcard/Download/enableinit.sh
Assuming of course, that your stuff is getting download to /sdcard/Download.
If you can't do this... sell your android device and buy an iCrap one...
drnish83 said:
So now with init.d support ready, is it going to be possible to run proper a2sd scripts? And which one specifically would you recommend? Excuse me if i'm asking the wrong questions.
Click to expand...
Click to collapse
I'm working on my own app2sd script that should beat anything ever made. Here's what it does:
It uses a second partition in the MicroSD card for gaining extra storage, this partition has to be formatted to ext4
#1 It mounts the external ext4 partition to a new location
#2 It detects the location for /sdcard/Android; /data/data; /data/app no matter what device you have (suppose the directories aren't the same for a certain device)
#3 It has the option to mount /sdcard/Android to a folder in the external partition
#4 It has the option to mount /data/data to a folder in the external partition
#5 It has the option to mount /data/app to a folder in the external partition
#6 It has the option to automatically copy everything from any of those folders to the appropriate folder in the external partition
#7 It has the option to automatically wipe from the internal storage anything that it moves
#8 If you have all options enabled, apps will be automatically installed to the external partition and never take any space in the internal storage, while everything else (Download/recovery/backup/pictures/videos/etc...) all remain in the internal partition.
Wow... cant wait for this script
Sent from my GT-N8013 using Tapatalk 2
Thanks for explaining. Interesting indeed! Will definitely wait for it eagerly!
Here's a preview of the super app2sd script I'm working on. Much of it is already implemented, should have it all in a couple of days
confusing
I have tried your script and it has successful at first.. then i flashing my note again with stock rom and i try using ur script again but now there is nothing chance.. do you know why?? what must i do now??
You know, this is the damnedest thing, but your instructions call for Busybox installation, and I can't install Busybox on my N8013. And tips you can share?
NessLookAlike said:
You know, this is the damnedest thing, but your instructions call for Busybox installation, and I can't install Busybox on my N8013. And tips you can share?
Click to expand...
Click to collapse
Busy box installs on mine.
Sent from my GT-N8013 using Tapatalk 2
NessLookAlike said:
You know, this is the damnedest thing, but your instructions call for Busybox installation, and I can't install Busybox on my N8013. And tips you can share?
Click to expand...
Click to collapse
Only reason you wouldn't be able to install busybox is if you're not rooted.
Mr tweaker, i have done the process of init.d but there is nothing changed.. where is my false?
Sent from my GT-N8000 using XDA Premium HD app
Welly_11 said:
Mr tweaker, i have done the process of init.d but there is nothing changed.. where is my false?
Sent from my GT-N8000 using XDA Premium HD app
Click to expand...
Click to collapse
Look for these files and let me know if they're there:
/system/etc/install-recovery.sh
/system/bin/sysinit
/system/etc/init.d/99testinit
**************************************
If anybody needs help, look for me on irc - #and-host in freenode
Hi All,
Workaround http://forum.xda-developers.com/showpost.php?p=37246757&postcount=11
I've put together aroma installer for installing Google Apps to NATIVESD Jelly bean ROM's.
Theoretically it should work for all rom's, but I haven't tested it yet
You can download it from: gapps-jb-20121011_NativeSD_v1.zip - 90.33 MB
Changelog:
v1: 20.01.2012 attempt to add suport for PAC
Old version:gapps-jb-20121011_NativeSD.zip - 90.33 MB
IF you want to say thanks to anyone, say thanks to Securecrt, Xylograph for giving us NATIVESD
HypoTurtle for providing code for universal installer His work
Hi, has anyone tried it, is it working? I would appreciate to get feedback on which ROMs is it working or not.
Thanks
Sent from my HTC HD2 using xda premium
Does't work for me
Sent from my HTC HD2 using xda premium
samehfarahat said:
Does't work for me
Sent from my HTC HD2 using xda premium
Click to expand...
Click to collapse
What is your setup? ROM name, etc..?
PAC 1.2a
Sent from my HTC HD2 using xda premium
OK, I'll check it out during the weekend
GAPPS NativeSD installer Does not Work
Doesn't work for me either
I am using "16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD] "
Please help!
Thanks
Hi guys,
I think I found the issue at least for PAC rom. I was caused by slightly different way of mounting partitions. I'm uploading new zip right now, first post should be updated in few minutes.
Please let me know if it's working for you now.
If you do not want to wait, you can replace contents of mount_NativeSD.sh file with following script:
Code:
#!/sbin/sh
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
cp /ext4p/NativeSD/initrd.gz /tmp/initrd.gz
mkdir /tmp/ramd
cd /tmp/ramd
gzip -d -c ../initrd.gz | cpio -i -d
#!/bin/sh
if [ -a "init.android" ]
then
sed -n '/rom_name=/w romname.txt' /tmp/ramd/init
sed -i 's/rom_name=//' romname.txt
else
if [ -f "mountfs.sh" ]
then
sed -n '/rom_name=/w mount.txt' mountfs.sh
sed -n '1w romname.txt' mount.txt
sed -i 's/rom_name="//' romname.txt
sed -i 's/"//' romname.txt
else
sed -n '/--bind/,/system/w initrc.txt' init.rc
sed -n '1w romname.txt' initrc.txt
sed -i 's,exec /bin/busybox mount --bind /NativeSD/,,
s,/system /system,,
s/ *//g' romname.txt
sed -i 's/[[:blank:]]//g' romname.txt
fi
fi
export ROM_NAME=`cat romname.txt`
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
asisislam said:
Doesn't work for me either
I am using "16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD] "
Please help!
Thanks
Click to expand...
Click to collapse
If new version is still not working for you, please post initrd.gz from your NATIVESD folder.
I tried the gapps-jb-20121011_NativeSD_v1.zip
for 2 ROMs:
[Dec. 9, 2012][ROM][720p] NexusHD2-JellyBean-4.1.2-CM10 V1.3a [NativeSD]
and
[16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD]
Unsuccessfull in both cases, I got the following error message:
Applying to SD-EXT
Mounting EXT PArtition
file_getprop: failed to stat "/tmp/nfo.prop": No such file or directory
(Attached are the initrd.files)
Well it seems that just about every ROM has a bit different method of setting ROM name. It's going to be very hard to create automatic script.
In the meantime you can do the following.
1. download zip file
2. create new file called mount_NativeSD.sh anywhere with following contents
Code:
#!/sbin/sh
# Set the ROM name
ROM_NAME=[COLOR="Red"]ROM_NAME[/COLOR]
export ROM_NAME
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
# mkdir -p /sdcard/NativeSD/$ROM_NAME
# mkdir -p /boot /boot_dir
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
# mkdir -p /ext4p/$ROM_NAME/system /ext4p/$ROM_NAME/data
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
# mount --bind /sdcard/NativeSD/$ROM_NAME /boot
# mount --bind /sdcard/NativeSD /boot_dir
#delete the old system
# rm -rf /system/*
#clean the dalvik-cache
# rm -rf /data/dalvik-cache/*
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
3. Replace red text with desired ROM name (eg. JellyBelly, PA_LEO, PAC, etc...)
4. replace mount_NativeSD.sh file inside the zip with the file you just created (name should be mount_NativeSD.sh)
hi, I tried with JellyTime R32 but it doesn't work, I tried replacing the rom name with JellyTime and JellyTime_R32 but I got file_getprop: failed to stat "/tmp/nfo.prop": No such file or directory . Here is my init file..
dcos said:
Hi All,
Workaround http://forum.xda-developers.com/showpost.php?p=37246757&postcount=11
I've put together aroma installer for installing Google Apps to NATIVESD Jelly bean ROM's.
Theoretically it should work for all rom's, but I haven't tested it yet
You can download it from: gapps-jb-20121011_NativeSD_v1.zip - 90.33 MB
Changelog:
v1: 20.01.2012 attempt to add suport for PAC
Old version:gapps-jb-20121011_NativeSD.zip - 90.33 MB
IF you want to say thanks to anyone, say thanks to Securecrt, Xylograph for giving us NATIVESD
HypoTurtle for providing code for universal installer His work
Click to expand...
Click to collapse
You can choose the programs ?
I found a script that adds boot audio. In it there is a line calling stagefright, stagefright either doesn't exist on my ROM and I have no clue as to add it. Here is the script in question which I don't know the original author however lithid from http://forum.cyanogenmod.org did some work on it and was close to creating a updater-script. Please Help Me as I know some scripting but not a lot
PS I was advised to ask this question to the devs by a cyanogenmod.org mod named bassmadrigal
Code:
#!/system/bin/sh
#I just made this into a script this was from a post on XDA by spiicytuna
#http://forum.xda-developers.com/showpost.php?p=8274824&postcount=2
#Please give the credit to him not me.
echo "preparing system..."
#Setting up the system for read/write access
mount -o remount,rw /system
#linking busybox mkdir (broken in rc2)
rm /system/bin/mkdir
ln -s /system/xbin/mkdir /system/bin/mkdir
mkdir -p /data/local/boot
echo "checking for previous bootsound installation..."
if [ -e /system/bin/bootsound ];
then
echo "bootsound already enabled, exiting.."
mount -o remount,ro /system
exit
fi
if [ "`ls /sbin|grep -q recovery;echo $?`" = "0" ];
then
mount -a > /dev/null
recoverymode=y
else
mount -o rw,remount /system
recoverymode=n
fi
echo "preparing startup scripts..."
#This is to create the needed scripts in init.local.rc
echo '' >> /system/etc/init.local.rc
echo '' >> /system/etc/init.local.rc
echo '###Bootsound - Safe to Delete: Start ###' >> /system/etc/init.local.rc
echo "" >> /system/etc/init.local.rc
echo 'service bootsound /system/bin/bootsound' >> /system/etc/init.local.rc
echo ' user media' >> /system/etc/init.local.rc
echo ' group audio' >> /system/etc/init.local.rc
echo ' disabled' >> /system/etc/init.local.rc
echo ' oneshot' >> /system/etc/init.local.rc
echo '' >> /system/etc/init.local.rc
echo 'on property:init.svc.bootanim=running # to correct timin' >> /system/etc/init.local.rc
echo ' start bootsound' >> /system/etc/init.local.rc
echo '' >> /system/etc/init.local.rc
echo 'on property:dev.bootcomplete=1' >> /system/etc/init.local.rc
echo ' stop bootsound' >> /system/etc/init.local.rc
echo '### Bootsound - Safe to Delete: End ###' >> /system/etc/init.local.rc
echo "creating script for bootsound in /system/bin..."
echo '#Now creating the bootsound script'
touch /system/bin/bootsound
echo '#!/system/bin/sh' >> /system/bin/bootsound
echo '' >> /system/bin/bootsound
echo 'bprop=/system/build.prop' >> /system/bin/bootsound
echo '' >> /system/bin/bootsound
echo 'play=$(cat $bprop | egrep -c -i -o ro.config.play.bootsound=1)' >> /system/bin/bootsound
echo 'if [ "$play" = "1" ]; then' >> /system/bin/bootsound
echo ' stagefright -a -o /system/media/android_audio.mp3' >> /system/bin/bootsound #this is the line that breaks the code
echo 'fi' >> /system/bin/bootsound
echo 'exit 0' >> /system/bin/bootsound
#Changing some permissions
chmod 777 /system/bin/bootsound
chown root:shell /system/bin/bootsound
echo '' >> /system/build.pro
echo 'ro.config.play.bootsound=1' >> /system/build.prop
echo 'media.stagefright.enable-player=true' >> /system/build.prop
echo 'media.stagefright.enable-meta=true' >> /system/build.prop
echo 'media.stagefright.enable-scan=true' >> /system/build.prop
echo 'media.stagefright.enable-http=true' >> /system/build.prop
#removed self-destruct, script checks for previous install
sleep 1
mount -o ro,remount /system
echo "done."
exit
ethan_hines said:
I found a script that adds boot audio. In it there is a line calling stagefright, stagefright either doesn't exist on my ROM and I have no clue as to add it. Here is the script in question which I don't know the original author however lithid from http://forum.cyanogenmod.org did some work on it and was close to creating a updater-script. Please Help Me as I know some scripting but not a lot
PS I was advised to ask this question to the devs by a cyanogenmod.org mod named bassmadrigal
Click to expand...
Click to collapse
Not sure if this works , but I will eventually try it , but not now , on my free time.
stagefright indeed is not included , my phone too doesn't have stagefright , if you go to youtube and search for android developement tutorials by "thenewboston" . you'll find 200 videos series , just watch the first 20 ones and you'll learn to use Media which replaces stagefright...I didn't try it yet.
It includes
Our_Player and Media Player and the directory of the song....check it out and give us heads ups!
thethiny said:
Not sure if this works , but I will eventually try it , but not now , on my free time.
stagefright indeed is not included , my phone too doesn't have stagefright , if you go to youtube and search for android developement tutorials by "thenewboston" . you'll find 200 videos series , just watch the first 20 ones and you'll learn to use Media which replaces stagefright...I didn't try it yet.
It includes
Our_Player and Media Player and the directory of the song....check it out and give us heads ups!
Click to expand...
Click to collapse
I appreciate the info, I took a look at his tutorials esp the ones involving animation, he really knows his stuff. I am not a Java programmer by any means and to be honest I find it quite tedious, it's like trying to teach a baby (this case the Dalvik VM) to do basic stuff like draw a green ball took like 20 lines of code!
What I need to know essentially is, do I have to use JAVA to get this to work now? In the past ie ICS and lower, there wasn't a problem with Custom Boot Audio, now with JB it seems it has disappeared from the radar.
I know the binary /system/bin/bootanimation (is this written in JAVA?, is there a source code for this bin?) is called at boot time by init.rc in the following manner:
Code:
service bootanim /system/bin/bootanimation
class main
user graphics
group graphics
disabled
oneshot
/system/bin/bootanimation (at least from what I gather) looks in /system/media for bootanimation.zip (zipped in store mode) decompresses it , looks at desc.txt for the code and displays the animation png by png.
In some desc.txt there is an s line, example:
Code:
# mobility
p 1 0 SOUND
s transdroid.mp3
which is SUPPOSED TO call a custom boot audio from /system/media (.mp3?) at the same time. This appears not to work. So logicaly I think the binary needs some tweaking. Can you offer any suggestions?
As you can see I have spent ALLOT of time mulling over why this,one would think, simple task: display a series of images and play audio at boot time I mean how hard can that be?
I am not trying to be a pest I just need to know WHY this doesn't work in JB (CM10.1)
Hi,
I have a nextcloud server on raspberry pi on my local network. I need to dynamically switch hosts when I connect to my wifi so my phone knows to connect to local ip from my domain(lets call it mydomain.com) which is configured in every app that uses nextcloud. So on cellurar use DNS server and on wifi use hosts' file entry.
On my previous device that ran LOS 14 I had a Tasker configuration that looked with scripts like this:
wifi_in.sh
Code:
#!/bin/sh
mount -o rw,remount,rw /system
echo "192.168.1.21 mydomain.com" >> /etc/hosts
echo "192.168.1.21 sth.mydomain.com" >> /etc/hosts
echo " " >> /etc/hosts
mount -o ro,remount,ro /system
wifi_out.sh
Code:
#!/bin/sh
mount -o rw,remount,rw /system
sed -i '/mydomain.com/d' /etc/hosts
sed -i '/^[[:space:]]*$/d' /etc/hosts
echo " " >> /etc/hosts
mount -o ro,remount,ro /system
It worked perfectly. I made it that wifi_in.sh triggers on being connected to network and wifi_out.sh when it disconnects. By adding white space to hosts file it made it so whole system read hosts file again and it was fluid.
Now I'm using systemless hosts file with AdAway. They work fine and I modified the scripts to use correct file:
BTW I'm on official LineageOS 14 with Magisk 14(point releases caused boot problems so I kinda stopped on 14)
wifi_in.sh
Code:
#!/bin/sh
echo "192.168.1.21 mydomain.com" >> /magisk/.core/hosts
echo "192.168.1.21 sth.mydomain.com" >> /magisk/.core/hosts
echo " " >> /magisk/.core/hosts
wifi_out.sh
Code:
#!/bin/sh
sed -i '/mydomain.com/d' /magisk/.core/hosts
sed -i '/^[[:space:]]*$/d' /magisk/.core/hosts
echo " " >> /magisk/.core/hosts
Well the problem is that it kinda worked once when I added hosts, but it doesn't update hosts anymore. So it stays 192.168.1.21 mydomain.com even if I delete every mydomain.com entry from hosts file.
Do you guys have any idea how to fix this?
That's interesting...
I ran your scripts and see the same thing. It works once... The hosts file in /magisk/.core updates every time, but the mirrored one in /system/etc doesn't.
Putting this one down on the "investigate" list.
Thanks for reporting this issue. However, this issue is not a Magisk bug, rather it is caused by the fact that it is mounted, the file is not actually in /system/etc
For some reason, the sed -i command works by first read stuffs to memory, delete the file, then recreate one. However the "delete the file" step is actually what causes this issue.
A workaround would change all sed -i commands:
Code:
# Change this
sed -i '<pattern>' '<file>'
# To this
sed '<pattern>' '<file>' > /dev/.tmp
mv -f /dev/.tmp '<file>'
topjohnwu said:
Thanks for reporting this issue. However, this issue is not a Magisk bug, rather it is caused by the fact that it is mounted, the file is not actually in /system/etc
For some reason, the sed -i command works by first read stuffs to memory, delete the file, then recreate one. However the "delete the file" step is actually what causes this issue.
A workaround would change all sed -i commands:
Code:
# Change this
sed -i '<pattern>' '<file>'
# To this
sed '<pattern>' '<file>' > /dev/.tmp
mv -f /dev/.tmp '<file>'
Click to expand...
Click to collapse
I modified the script and rebooted. Everything works as it should. Thank you very much for your help.
I don't even have a /magisk folder. did this path change? I'm on beta 16.4