[Q] [ROM DEV] Preventing errors with scripts in any ROM - Galaxy S I9000 Q&A, Help & Troubleshooting

Hi anyone,
Some things I want to discuss about.
1. DBDATA/databases
You should know that I include a update-script command to delete the /dbdata/databases folder in my ROM to prevent any App related problems.
But I think, since 2.2.1 this won't work anymore.
So does any ROM Dev has a workaround?
Or can someone confirm, that this works?
My update-script command:
Code:
delete_recursive DBDATA:databases
2. "rm" or "busybox rm" in a bash script?
When writing a script which gets executed from the update-script, do we need to use a simple "rm" or "busybox rm" for deleting files?
I'm not 100% sure, but I don't think that busybox is functional already?
My script:
Code:
#!/system/bin/sh
# Script written by darkyy // Joel Staub
# Script to prevent errors during the ROM installation
cd /sdcard
#/sdcard/Darky-Wallpaper
if [ -d "Darky-Wallpaper" ]; then
rm -r "Darky-Wallpaper"
fi
#/sdcard/Gingerbread_Keyboard
if [ -d "Gingerbread_Keyboard" ]; then
rm -r "Gingerbread_Keyboard"
fi
#/sdcard/launcherpro_backup
if [ -d "launcherpro_backup" ]; then
rm -r "launcherpro_backup"
fi
#/sdcard/Voodoo
if [ -d "Voodoo" ]; then
rm -r "Voodoo"
fi
#/sdcard/WindowsPhone7_Icons
if [ -d "WindowsPhone7_Icons" ]; then
rm -r "WindowsPhone7_Icons"
fi

"busybox rm" is the secure way when you need some functions of the busybox "rm" command, for example "rm -r".
If "rm" exists in /system/bin/ and a "rm" symlink to busybox in /system/xbin/, the shell chooses the one in /system/bin.
If the stock rm binary got removed it will work without busybox, but if not, "rm -r whatever" for example would fail.

Fr4gg0r said:
"busybox rm" is the secure way when you need some functions of the busybox "rm" command, for example "rm -r".
If "rm" exists in /system/bin/ and a "rm" symlink to busybox in /system/xbin/, the shell chooses the one in /system/bin.
If the stock rm binary got removed it will work without busybox, but if not, "rm -r whatever" for example would fail.
Click to expand...
Click to collapse
Thank you very much for this well-written answer.
So, does busybox work even when the ROM is installing?

*PUSH*
10char

Busybox works if the initramfs of the kernel used while installing has busybox. (Not the one included in the rom)

pawitp said:
Busybox works if the initramfs of the kernel used while installing has busybox. (Not the one included in the rom)
Click to expand...
Click to collapse
Thank you dude.
I finished with doing my "rm" commands with busybox.
Will be great for my ROM

Darkyy said:
Thank you dude.
I finished with doing my "rm" commands with busybox.
Will be great for my ROM
Click to expand...
Click to collapse
yes, busybox works even when installing rom
btw, to play safe, u need to chk if it is a symlink with -L, coz -d wont handle symlinks

ykk_five said:
yes, busybox works even when installing rom
btw, to play safe, u need to chk if it is a symlink with -L, coz -d wont handle symlinks
Click to expand...
Click to collapse
That's no problem
Thank you

Related

mkdir: no such tool

it is inside /system/xbin and link to busybox, busybox mkdir works...
now root explorer/ cifs manager cannot create directory, how to fix?
Sent from my Milestone using XDA App
my rom is CM7 RC4.1
sorry cannot post to dev
can someone give me some idea of wth is happening? discussion is okay.
Sent from my Milestone using XDA App
any guide to update/reinstall busybox?
Sent from my Milestone using XDA App
Busybox is available on the market: https://market.android.com/details?id=stericson.busybox&feature=search_result
I'm not sure if that's what you're looking for, but there it is if you need it
I have the same problem even after installing the most recent busybox.
$
$ mkdir
mkdir: no such tool
$
$ echo $PATH
/data/local/bin:/sbin:/system/sbin:/system/bin:/system/xbin
$
$ /system/xbin/mkdir
BusyBox v1.19.0.git.adrynalyne (2010-12-21 22:03:30 MST) multi-call binary.
Usage: mkdir [OPTIONS] DIRECTORY...
Create DIRECTORY
Options:
-m MODE Mode
-p No error if exists; make parent directories as needed
$
as a workaround use /system/xbin/mkdir
janosik47 said:
I have the same problem even after installing the most recent busybox.
$
$ mkdir
mkdir: no such tool
$
$ echo $PATH
/data/local/bin:/sbin:/system/sbin:/system/bin:/system/xbin
$
$ /system/xbin/mkdir
BusyBox v1.19.0.git.adrynalyne (2010-12-21 22:03:30 MST) multi-call binary.
Usage: mkdir [OPTIONS] DIRECTORY...
Create DIRECTORY
Options:
-m MODE Mode
-p No error if exists; make parent directories as needed
$
as a workaround use /system/xbin/mkdir
Click to expand...
Click to collapse
Can you please explain how you run the above command? I always get mkdir : no such tool and I'm not clear how you ran the above command.

[GT-P3XXX] busybox + install-script [+cyanogen edition][2012-08-15]

Hi folks,
here's an easy-to-install busybox for your Galaxy Tab 2. NOW with Cyanogen Mod support.
ChangeLog:
BusyBox 1.21.0-git Nano1 (2012-07-28): initial release
BusyBox 1.21.0-git Nano2 (2012-07-29): applied various patches:
BUGFIX: flush all open files after listing them (ls)
BUGFIX: when setting hostname from file p**** whole name
COMPAT: ps now accepts (= ignores) all options a POSIX ps should
allow passing -mthumb to make
ash applet now exports HOME
silently ignore processes from inittab with terminal names without matching device file
default behaviour of 'showkey' applet changed from displaying interpreted keycode to decimals
do not show a message when testing an uninitialized variable
changed some terms in top applet output (rss vs. vsz)
BusyBox 1.21.0-git Nano3 (2012-08-05): major fix
NEW: rfkill applet¹
several minor modifications to applet
BUGFIX fixed a bug in busyinstall that left system without 'sh' upon uninstall²
provide busybox-patches to the world
BusyBox 1.21.0-git Nano4 (2012-08-15): minor fix / cm 10 edition
updated to latest git (some bugfixes)
BUGFIX: reading profile now works
BUGFIX: adjusted shell paths
BUGFIX: history now works
BUGFIX: no longer replace reboot on stock rom³
NEW: Cyanogen Mod edition (tested on cm10)
¹ Either redo 'busyinstall install', or do 'ln -sf /system/bin/busybox /system/bin/rfkill'
² You can find the original sh in you CWM backup, or here: http://www.nanolx.org/downloads/P3110/original-sh
If you didn't get /system/bin/sh.orig after 'busyinstall install', use this file as /system/bin/sh.orig
³ push new busyinstall into tablet to ensure future install/uninstall is fine. then do 'mv /system/bin/reboot.orig /system/bin/reboot'
from within 'adb shell' as root to get original reboot back.
Prerequisites:
* root access on your Tablet
Download:
busybox (normal): http://www.nanolx.org/downloads/P3110/busybox-nano4
busybox (debug): http://www.nanolx.org/downloads/P3110/busybox_unstripped-nano4
busyinstall (installer/stock): http://www.nanolx.org/downloads/P3110/busyinstall
busyinstall (installer/cm10): http://www.nanolx.org/downloads/P3110/busyinstall-cm
profile (optional): http://www.nanolx.org/downloads/P3110/profile¹
busybox (patches): http://www.nanolx.org/downloads/index.php?dir=P3110/busybox-patches/
¹ profile is a generic file, read on each startup of busybox. Mine sets HOME to /,
and puts /system/xbin/ in front of /system/bin/ in PATH. You can also adjust the
prompt (PS1) or whatever here, it's valid for all users. You could check for
'$(id -u) == 0' to adjust prompt for root, if not 0, for ordinary user.
Ordinary user should get 'busybox (normal)', rather than 'busybox (debug)'.
NEW INSTALLATION (STOCK ROM):
Putting busybox on internal sd-storage:
Code:
adb push busybox /mnt/extSdCard/
adb push busyinstall /mnt/extSdCard/
replace "extSdCard" if you saved busybox somewhere else
Code:
adb shell
su
chmod 0777 /mnt/extSdCard/busybox
chmod 0777 /mnt/extSdCard/busyinstall
/mnt/extSdCard/busybox remount -o rw,remount /system
/mnt/extSdCard/busybox mv -f /mnt/extSdCard/busybox /system/bin/
/system/bin/busybox mv -f /mnt/extSdCard/busyinstall /system/bin
busyinstall install
NEW INSTALLATION (CYANOGEN ROM):
Putting busybox on device:
in Settings > Development > set 'root access' to 'apps + adb'
Code:
adb root
adb shell
busybox mount -o rw,remount /system
exit
adb push busybox /system/xbin/busybox.nano
adb push busyinstall /system/bin/busyinstall
adb push profile /system/etc/profile # optional, if downloaded profile
adb shell
chmod 0777 /system/bin/busyinstall
busyinstall install
UPDATE:
Just download busybox, busyinstall and replace the ones in /system/bin/ - it will instantly work:
Code:
adb push busybox /system/bin/
adb push busyinstall /system/bin/
adb shell
su
toolbox chmod 0777 /system/bin/busybox # if you use windows, the executable bit might be missing in the uploaded file
chmod 0777 /system/bin/busyinstall
UNINSTALLATION:
Code:
ab shell
su
busyinstall --
That's it!
I tested everything and it does work perfect, either way a backup (CWM) is always recommened, when working around with stuff down the stack.
Suggestions welcome.
Out of curiosity, what is the difference between what this does and what BusyBox (by Stericson) from the Play Store does?
Sent from my MB855 using Tapatalk 2
Jleeblanch said:
Out of curiosity, what is the difference between what this does and what BusyBox (by Stericson) from the Play Store does?
Sent from my MB855 using Tapatalk 2
Click to expand...
Click to collapse
mine is a newer version
has all features of busybox (stericsons free version does not have all applets in busybox enabled, eg. 'sh' applet is missing)
installation 100% GT-P3XXX optimized
As of now, mostly personal preference I'd say.
Edit: But I'm currently applying stuff from busybox-power (maemo) which adds serveral bugfixes and stuff to busybox.
OK, improved version of busybox available in post 1 (+ changelog)
OK, thanks for letting me know!
I actually haven't done much with my Tablet lately as I've been busy with my phone as that now has CM10 too
But once I get my phone all set I'll use your BusyBox and give it a go!
Also, you said your busybox version is newer...but busybox via my phone is version 1.20.2. Just letting you know!
Thanks for this btw, I'd rather have a modified version optimized for my tablet versus a more universal version so to speak. Plus, with your updated applets! Thanks!
Sent from my MB855 using Tapatalk 2
Jleeblanch said:
Also, you said your busybox version is newer...but busybox via my phone is version 1.20.2. Just letting you know!
Sent from my MB855 using Tapatalk 2
Click to expand...
Click to collapse
Oh, ... mine is 1.21.0-git - fixed the typo
First,thank you for your work,second I've a question: I've an p3100 (wifi+gsm) ,it rooted on stock 4.0.4 ,and no busybox installed.It has 16gb onboard ,and I don't have at the moment any external microsd in slot,I've ordered an 32gb,but it hasn't come yet.Can you please tell me if it's safe puting your files in /sdcad (not ExtSdCard like you wrote) and give the commands using ''sdcard'' word ?
For e.g:
db shell
su
/mnt/sdcard/busybox remount -o rw,remount /system
I need busybox to backup my /efs folder ,but I don't want to screw something,so please tell me if it is safe to use internal memory (sdcard) for busybox install?Also ,when I'll receive the microsd ,I will need to install again busybox with your original commands from this topic ?
Thanks a lot!!
Best Regards!
viasat said:
First,thank you for your work,second I've a question: I've an p3100 (wifi+gsm) ,it rooted on stock 4.0.4 ,and no busybox installed.It has 16gb onboard ,and I don't have at the moment any external microsd in slot,I've ordered an 32gb,but it hasn't come yet.Can you please tell me if it's safe puting your files in /sdcad (not ExtSdCard like you wrote) and give the commands using ''sdcard'' word ?
For e.g:
db shell
su
/mnt/sdcard/busybox remount -o rw,remount /system
I need busybox to backup my /efs folder ,but I don't want to screw something,so please tell me if it is safe to use internal memory (sdcard) for busybox install?Also ,when I'll receive the microsd ,I will need to install again busybox with your original commands from this topic ?
Thanks a lot!!
Best Regards!
Click to expand...
Click to collapse
Of course you can. It does not matter where you put busybox. All that matters is, that you adjust the commands to your path.
In your you would push the files using ADB, like
Code:
adb push busybox /mnt/sdcard
adb push busyinstall /mnt/sdcard
also you don't need to re-do this when you got your sd-card, because during the steps you move busybox/busyinstall into /system/bin/.
Edit: updated instructions to clarify this.
Ok,thank you for your time,everything it's clear now.I'll try later,when I'm going home.
Cheers!
---------- Post added at 07:04 PM ---------- Previous post was at 06:11 PM ----------
OK,first problem:when I try to execute the first comand,it gives me ''permission denied'',so after a little reading,because my kernel it's stock,I've installed Chainfire's ''adbd Insecure v1.0 '' http://forum.xda-developers.com/showthread.php?t=1687590 to give me rights.After that I've no more errors,but,when I execute first command in adb,it says nothing,just hanging,and adb doesn't come back to # symbol ,and because of that I can't execute the next command.Any ideea what I'm doing wrong?Thanks!
What command failed?
Gesendet von meinem GT-P3110 mit Tapatalk 2
I don't know how to explain,it not really failed, but when I type
/mnt/sdcard/busybox remount -o rw,remount /system the adb doesn't return anything back,and doesn't come back to # symbol ,it just staying,nothing more,no response.I was waiting 2 minutes,and nothing ,doesn't return to # .I can type the next command
/mnt/sdcard/busybox mv /mnt/sdcard/busybox /mnt/sdcard/busyinstall /system/bin/
it's the same,no output,nothing.
Can you please tell me what I'm doing wrong?
Thanks again!
Now I'm stuck,even with adbd insecure activate I cannot execute commands:
C:\Documents and Settings\X\Desktop\ADB>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
[email protected]:/ # /mnt/sdcard/busybox remount -o rw,remount /system
/mnt/sdcard/busybox remount -o rw,remount /system
/system/bin/sh: /mnt/sdcard/busybox: cannot execute - Permission denied
126|[email protected]:/ # /mnt/sdcard/busybox mv /mnt/sdcard/busybox /mnt/sdcard/busy
install /system/bin/
dcard/busybox /mnt/sdcard/busyinstall /system/bin/ <
/system/bin/sh: /mnt/sdcard/busybox: cannot execute - Permission denied
126|[email protected]:/ #
Maybe I need first to install Stericsson's busybox from Market?At the moment,as I said before I don't have busybox installed at all,only su.
One more thing,every time when I save from your link busyinstall,no matter what browser,the file is saved as busyinstall.txt
It is normal ,or I need to rename it?
Thanks a lot!
Hmm... seems I forgot a little thing.
do this after you put busybox on tablet, before anything else:
Code:
adb shell
su
chmod 0777 /mnt/sdcard/busybox
then follow the rest of the instructions.
/goingtofixfirstpost
Same story,take a look:
[email protected]:/ # chmod 0777 /mnt/sdcard/busybox
chmod 0777 /mnt/sdcard/busybox
[email protected]:/ # chmod 0777 /mnt/sdcard/busyinstall
chmod 0777 /mnt/sdcard/busyinstall
[email protected]:/ # /mnt/sdcard/busybox remount -o rw,remount /system
/mnt/sdcard/busybox remount -o rw,remount /system
/system/bin/sh: /mnt/sdcard/busybox: cannot execute - Permission denied
126|[email protected]:/ #
Hmmm... > could you provide me the details of 'adb logcat'? Ensure to run those commands while logging.
Gesendet von meinem GT-P3110 mit Tapatalk 2
I don't know if this is what you want,but here we go:
I'm going to check your logs soon and report back.
Meanwhile I updated to Nano3 - see first post.
I got no clue why it does not work for you, but me.
What boot image and ROM are you using? Default boot/ROM, rooted boot/ROM, cyanogen?
I only tested default ROM with my boot. Currently testing cyanogenmod 10, but except some adjustments to busyinstall it will work there, too.
Sorry for the late reply,I'm on vacation until Sunday,and my acces to internet it's very limited here.Now,regarding my problem,first when I got the tablet it was on stock 4.0.3 ,wich I rooted manually to keep the counter to 0 (for warranity) ,and after that I updated to stock 4.0.4 using Mobile Odin Pro,with Everoot option ( it's rooting the rom on the fly) .So now I'm rooted on stock 4.0.4 ,stock recovery, and no busybox installed.I fell more secure and want to install your busybox version,because it's specialy designed for tab2,and it's has features from Maemo (I'm a big fan,I owned an N800,and I've also an N900 ).Maybe,if you have the time and the skills,you can pack it on an .apk version,if it's possible,of course.I will try more Sunday,when I'll be back home.Thanks again for your patience and help.Best Regards!
It will be great if we have a kernel (even stock) with CWM and this busybox...
I am also rooted with flash counter 0 and stock recovery.
Sent from my GT-P3110 using Tapatalk 2
Maybe some contributor creates a flashable zip (for CWM).
So... uploaded 1.20.1-Nano4. See first post for changes.
This time an addtional install-script for cyanogen mod was added, along some fixes.
ah... and: 100th post

[STOCK]INIT.D support. No need to flash anything or even reboot into recovery

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

[Q] android.policy.jar is unmodified,but device stay at frame

1.use kitchen extract rom from N7000ZSLO2_N7000OZSLO2_N7000XXLSO_HOME.tar.md5, then deodex rom.
2.copy android.policy.jar to sdcard.(android.policy.jar is unmodified.)
3.use dexopt-wrapper reodex ,get android.policy.odex.
4.copy android.policy.odex to /system/framework/android.policy.odex and set 644 permissions
5.reboot device and stay at samsung logo frame
now,How to deal with this problem? help,thx.
process
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
attach file is logcat information.The log file alway display "DexOpt: Some deps went away"
What Rom are you using?
But more important: Why do you want to do this?
If you using a deodexed rom, you don't need an odexed jar
ThaiDai said:
What Rom are you using?
But more important: Why do you want to do this?
Click to expand...
Click to collapse
offical rom:N7000ZSLO2_N7000OZSLO2_N7000XXLSO_HOME.tar
i want to add a recovery menu item.
now after update file,device status:
framework-res.apk OK
android.policy.jar fail
nokiamodeln91 said:
If you using a deodexed rom, you don't need an odexed jar
Click to expand...
Click to collapse
in framework folder,all is odex.so if i want to modify a jar, must need an odex file.i want to update file as little as possible.
update.
quywz said:
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of=[COLOR="Red"][B]/data/local/tmp/odex/android.policy.odex[/B][/COLOR] bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
Click to expand...
Click to collapse
Is there a reason you're copying the .odex signature to /data/local/tmp/odex/android.policy.odex instead of /system/framework/android.policy.odex ? With your script, /system/framework/android.policy.odex remains unsigned.
Einril said:
Is there a reason you're copying the .odex signature to /data/local/tmp/odex/android.policy.odex instead of /system/framework/android.policy.odex ? With your script, /system/framework/android.policy.odex remains unsigned.
Click to expand...
Click to collapse
sorry,In this thread,I write wrong.
The actual operation is "busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc".but the result is same.
if=/system/framework/android.policy.odex.bak is input file.
of = /system/framework/android.policy.odex is output file.
copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.
quywz said:
sorry,In this thread,I forgot to copy "busybox cp -f /data/local/tmp/odex/android.policy.odex /system/framework/android.policy.odex".
The actual operation don't forgot.but the result is same.
Click to expand...
Click to collapse
So what you're doing is :
1. optimize /system/framework/android.policy.jar to create /system/framework/android.policy.odex
2. copy the signature from /system/framework/android.policy.odex.bak to /data/local/tmp/odex/android.policy.odex
3. copy /data/local/tmp/odex/android.policy.odex to /system/framework/android.policy.odex
Am I right ? If I am, you're deleting the .odex file created from android.policy.jar, and replacing it with another one.
Einril said:
So what you're doing is :
1. optimize /system/framework/android.policy.jar to create /system/framework/android.policy.odex
2. copy the signature from /system/framework/android.policy.odex.bak to /data/local/tmp/odex/android.policy.odex
3. copy /data/local/tmp/odex/android.policy.odex to /system/framework/android.policy.odex
Am I right ? If I am, you're deleting the .odex file created from android.policy.jar, and replacing it with another one.
Click to expand...
Click to collapse
sorry,In this thread,I write wrong.
The actual operation is "busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc".but the result is same.
if=/system/framework/android.policy.odex.bak is input file.
of = /system/framework/android.policy.odex is output file.
copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.
1.right
2.copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.above is my copy wrong.
3.used new signed /system/framework/android.policy.odex.
4.reboot,device stay at logo frame
edit.invalid context
quywz said:
1.right
2.copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.above is my copy wrong.
3.used new signed /system/framework/android.policy.odex.
4.reboot,device stay at logo frame
Click to expand...
Click to collapse
Is the attached script the entire script ?
If it is, why are you only copying the .odex files from /data/local/tmp/odex/ to /system/framework/, and not android.policy.jar and framework.jar ?
Einril said:
Is the attached script the entire script ?
If it is, why are you only copying the .odex files from /data/local/tmp/odex/ to /system/framework/, and not android.policy.jar and framework.jar ?
Click to expand...
Click to collapse
yes,entire script.
somebody tell me "Pls use original jar".I tried to use new jar.but the result is same.:crying:
quywz said:
yes,entire script.
somebody tell me "Pls use original jar".I tried to use new jar.but the result is same.:crying:
Click to expand...
Click to collapse
You don't set the permissions for the files any longer. Is there a reason for that ? Permissions should be 644 I guess.
Einril said:
You don't set the permissions for the files any longer. Is there a reason for that ? Permissions should be 644 I guess.
Click to expand...
Click to collapse
I tried you said,isnt reason.I had set Permissions 755 and 777,all invalid :crying:
I dont understand why fail.I am finding reason....
quywz said:
I tried you said,isnt reason.I had set Permissions 755 and 777,all invalid :crying:
I dont understand why fail.I am finding reason....
Click to expand...
Click to collapse
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Einril said:
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Click to expand...
Click to collapse
thx.
I tried to update files one by one.after update framework-res.apk is ok.android.policy.jar is fail.so I dont modfiy android.policy.ja.then optimized it. updating android.policy.odex refer to attached script(not including framework part).but device is NG.
I dont find a NG reason.
Einril said:
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Click to expand...
Click to collapse
today ,I found a problem.dexopt-wrapper android.policy.jar and get android.policy.odex.Compare origial android.policy.odex,we fond dex's magic is different.origial android.policy.odex is "dex035", new origial android.policy.odex is "dex036".if i manually modify different,device is still stay.I guss if i manually modify different,odex's checknum is wrong.what do lead to new odex's magic change?is API Level ?
quywz said:
today ,I found a problem.dexopt-wrapper android.policy.jar and get android.policy.odex.Compare origial android.policy.odex,we fond dex's magic is different.origial android.policy.odex is "dex035", new origial android.policy.odex is "dex036".if i manually modify different,device is still stay.I guss if i manually modify different,odex's checknum is wrong.what do lead to new odex's magic change?is API Level ?
Click to expand...
Click to collapse
In dexFile.h :
Code:
/* current version, encoded in 4 bytes of ASCII */
#define DEX_MAGIC_VERS "036\0"
/*
* older but still-recognized version (corresponding to Android API
* levels 13 and earlier
*/
#define DEX_MAGIC_VERS_API_13 "035\0"
So yes, your dexopt-wrapper uses an API level >= 14 (ICS and JB), whereas your original ROM file must be older.
Einril said:
In dexFile.h :
Code:
/* current version, encoded in 4 bytes of ASCII */
#define DEX_MAGIC_VERS "036\0"
/*
* older but still-recognized version (corresponding to Android API
* levels 13 and earlier
*/
#define DEX_MAGIC_VERS_API_13 "035\0"
So yes, your dexopt-wrapper uses an API level >= 14 (ICS and JB), whereas your original ROM file must be older.
Click to expand...
Click to collapse
offical rom version is 4.1.2.so API level should is 16.but extract odex from device is 035.

Kali Nethunter.

Is anyone here familiar with Kali Nethunter? They released version 3.0 that now supports Marshmallow, however, Kali is installed on top of stock Marshmallow from what I understand. Can anyone elaborate on how this is possible seeing as Marshmallow on the shamu is packed tightly to the brim on the system partition? I freed up about 200 to 300 MB of space deleting system apps I don't need, but this Kali build is over 600MB! Probably uncompresses to be even bigger. Thanks for any insight ant of you can provide! Cheers!
H4X0R46 said:
Is anyone here familiar with Kali Nethunter? They released version 3.0 that now supports Marshmallow, however, Kali is installed on top of stock Marshmallow from what I understand. Can anyone elaborate on how this is possible seeing as Marshmallow on the shamu is packed tightly to the brim on the system partition? I freed up about 200 to 300 MB of space deleting system apps I don't need, but this Kali build is over 600MB! Probably uncompresses to be even bigger. Thanks for any insight ant of you can provide! Cheers!
Click to expand...
Click to collapse
When flashing it most likely removes enough to fit what it needs. It Could also over write stock files. I use Kali so am DL it now to have a look.
zelendel said:
When flashing it most likely removes enough to fit what it needs. It Could also over write stock files. I use Kali so am DL it now to have a look.
Click to expand...
Click to collapse
You were right, I went ahead and flashed it, and the aroma installer had a line that said "clearing up space in /system" and it did. Thanks!
Sent from my Nexus 6
H4X0R46 said:
You were right, I went ahead and flashed it, and the aroma installer had a line that said "clearing up space in /system" and it did. Thanks!
Sent from my Nexus 6
Click to expand...
Click to collapse
Yeah I have the zip and am gonna rip it apart and see just what it is doing.
zelendel said:
Yeah I have the zip and am gonna rip it apart and see just what it is doing.
Click to expand...
Click to collapse
Yea it makes me wonder what it's really removing. I had about 200 - 300 MB free on my system because I removed some Google bloatware, and after the Kali install, I had like, 500 ish MB free. It deletes something big from the system. Wonder what is actually removed.
Sent from my Nexus 6
H4X0R46 said:
Yea it makes me wonder what it's really removing. I had about 200 - 300 MB free on my system because I removed some Google bloatware, and after the Kali install, I had like, 500 ish MB free. It deletes something big from the system. Wonder what is actually removed.
Sent from my Nexus 6
Click to expand...
Click to collapse
Here is what their script removes.
# clean the system from extra/uneeded apps
#
SA=/system/app
# Apks were located in /system/app folder previously
rm -f $SA/PrintSpooler.*
rm -f $SA/QuickOffice.apk
rm -f $SA/CloudPrint2.apk
rm -f $SA/HPPrintPlugin.apk
rm -f $SA/KoreanIME.apk
rm -f $SA/PlusOne.apk
rm -f $SA/PlayGames.apk
rm -f $SA/Drive.apk
rm -f $SA/Maps.apk
rm -f $SA/Magazines.apk
rm -f $SA/GooglePinyinIME.apk
rm -f $SA/Books.apk
rm -f $SA/Magazines.apk
rm -f $SA/Currents.apk
rm -f $SA/GoogleEars.apk
rm -f $SA/Keep.apk
rm -f $SA/FaceLock.apk
# Apks are located in folders now...can we move to /data?
rm -rf $SA/HoloSpiralWallpaper
rm -rf $SA/BasicDreams
rm -rf $SA/Drive
rm -rf $SA/Maps
rm -rf $SA/FaceLock
rm -rf $SA/Books
rm -rf $SA/Newsstand
rm -rf $SA/Street
rm -rf $SA/CloudPrint2
rm -rf $SA/PlayGames
rm -rf $SA/YouTube
rm -rf $SA/PlusOne
rm -rf $SA/PrintSpooler
rm -rf $SA/GoogleHindiIME
rm -rf $SA/GooglePinyinIME
rm -rf $SA/KoreanIME
#rm -rf $SA/LatinImeGoogle
rm -rf $SA/Music2
rm -rf $SA/iWnnIME
rm -rf $SA/Photos
rm -rf $SA/LiveWallpapersPicker
rm -rf $SA/PhaseBeam
rm -rf /system/priv-app/Hangouts
rm -rf /system/priv-app/Wallet
zelendel said:
Here is what their script removes.
# clean the system from extra/uneeded apps
#
SA=/system/app
# Apks were located in /system/app folder previously
rm -f $SA/PrintSpooler.*
rm -f $SA/QuickOffice.apk
rm -f $SA/CloudPrint2.apk
rm -f $SA/HPPrintPlugin.apk
rm -f $SA/KoreanIME.apk
rm -f $SA/PlusOne.apk
rm -f $SA/PlayGames.apk
rm -f $SA/Drive.apk
rm -f $SA/Maps.apk
rm -f $SA/Magazines.apk
rm -f $SA/GooglePinyinIME.apk
rm -f $SA/Books.apk
rm -f $SA/Magazines.apk
rm -f $SA/Currents.apk
rm -f $SA/GoogleEars.apk
rm -f $SA/Keep.apk
rm -f $SA/FaceLock.apk
# Apks are located in folders now...can we move to /data?
rm -rf $SA/HoloSpiralWallpaper
rm -rf $SA/BasicDreams
rm -rf $SA/Drive
rm -rf $SA/Maps
rm -rf $SA/FaceLock
rm -rf $SA/Books
rm -rf $SA/Newsstand
rm -rf $SA/Street
rm -rf $SA/CloudPrint2
rm -rf $SA/PlayGames
rm -rf $SA/YouTube
rm -rf $SA/PlusOne
rm -rf $SA/PrintSpooler
rm -rf $SA/GoogleHindiIME
rm -rf $SA/GooglePinyinIME
rm -rf $SA/KoreanIME
#rm -rf $SA/LatinImeGoogle
rm -rf $SA/Music2
rm -rf $SA/iWnnIME
rm -rf $SA/Photos
rm -rf $SA/LiveWallpapersPicker
rm -rf $SA/PhaseBeam
rm -rf /system/priv-app/Hangouts
rm -rf /system/priv-app/Wallet
Click to expand...
Click to collapse
Alright! That's good to know! I was wondering how it removes so much from system, this answers my question perfectly!
H4X0R46 said:
Alright! That's good to know! I was wondering how it removes so much from system, this answers my question perfectly!
Click to expand...
Click to collapse
If you are ever wondering what it is doing, just unzip the file on the pc and use notepad++ to check out the scripts. Even if you dont understand everything somethings will start to make sense the more you look at it.
zelendel said:
If you are ever wondering what it is doing, just unzip the file on the pc and use notepad++ to check out the scripts. Even if you dont understand everything somethings will start to make sense the more you look at it.
Click to expand...
Click to collapse
I've done this more or less, where should I look? The update script? I've done this a couple of time to see which Android version a ROM was when the post I found it on was not specific enough.
Sent from my Nexus 6
H4X0R46 said:
I've done this more or less, where should I look? The update script? I've done this a couple of time to see which Android version a ROM was when the post I found it on was not specific enough.
Sent from my Nexus 6
Click to expand...
Click to collapse
What I did was look to see what the update script was running and then went and looked at those scripts. It's a bit of tracking but it works
zelendel said:
What I did was look to see what the update script was running and then went and looked at those scripts. It's a bit of tracking but it works
Click to expand...
Click to collapse
Thanks man! Appreciate it! Also, an unrelated side question. If you remove the SuperSU zip from a rom, will it still flash right and just skip SuperSU? Or does the script have to be also changed? Thanks! You may be able to answer this one, if not, that's cool!
Yeah it should. I would imagine to pull off alot of what its pc counter part does it will need root
zelendel said:
Yeah it should. I would imagine to pull off alot of what its pc counter part does it will need root
Click to expand...
Click to collapse
Mostly for multirom use, some roms include systemless root and as of right now, that doesn't flash correctly with multirom. So in theory, removing the super su folder from the rom and then installing normal system root should work?
Sent from my Nexus 6
H4X0R46 said:
Mostly for multirom use, some roms include systemless root and as of right now, that doesn't flash correctly with multirom. So in theory, removing the super su folder from the rom and then installing normal system root should work?
Sent from my Nexus 6
Click to expand...
Click to collapse
To be honest I have never messed with multirom. It has never really worked properly and most roms I run will not support it. So that I can't answer.
zelendel said:
To be honest I have never messed with multirom. It has never really worked properly and most roms I run will not support it. So that I can't answer.
Click to expand...
Click to collapse
Alright. Well cool thanks for all your help man! Appreciate it!
can i flash kali nethunter 3 on top of aosip slim gapps hcb13 ?
i installed their 3.0 the day they announced it but the terminal doesnt work with the error "1.) no title".
other people have the same issue and they cannot seem to reproduce the issue and fix it. had to dirty flash my system image.
even though they say its stable there are many issues hovering over this mod BUT its hell of a mod if it works, makes you proud to own an android; specially a Nexus!

Categories

Resources