a2sd no block device - Android Software/Hacking General [Developers Only]

Hi when i install a2sd on my Galaxy Gio then get i the follow log from a2sd check
Code:
a2sd check
[ ] GREP: Using ROM Busybox.
[ ] REBOOT: Using ROM Busybox.
[ ] FDISK: Using ROM Busybox.
[ ] CAT: Using ROM Busybox.
[ ] MKDIR: Using ROM Busybox.
[ ] RMDIR: Using ROM Busybox.
[ ] CHMOD: Using ROM Busybox.
[ ] MOUNT: Using ROM Busybox.
[ ] UMOUNT: Using ROM Busybox.
[ ] CP: Using ROM Busybox.
[ ] RM: Using ROM Busybox.
[ ] MV: Using ROM Busybox.
[ ] LN: Using ROM Busybox.
[ ] MORE: Using ROM Busybox.
[ ] MKNOD: Using ROM Busybox.
[ ] AWK: Using ROM Busybox.
[ ] SLEEP: Using ROM Busybox.
[ ] SYNC: Using ROM Busybox.
[ ] TEE: Using ROM Busybox.
__ _____
| \ |
| | |
|__/ | Darktremor Apps2SD 2.7.5.3 Beta 4a (2011-01-30)
[-] Checkpoint 1: Check for SD Card Fix and Implement.
[-] Checkpoint 2: Run Dalvik Heap Program (if exists).
[-] Checkpoint 3: Run Set Low Memory Killer Program (if exists).
[-] Checkpoint 4: Determine Mount Point.
[-] Checkpoint 5: Set Parameter Variables.
[ ] GetProp Command = /system/bin/toolbox getprop
[ ] SetProp Command = /system/bin/toolbox setprop
[ ] Mount Point = /system/sd
[-] Checkpoint 6: Insert CyanogenMod patch.
[-] Checkpoint 7: Complete Dalvik Cache Move (if applicable).
[-] Checkpoint 8: Resetting Dalvik Cache Partition
[-] Checkpoint 9: Switching Davlik Cache to Cache Partition (if applicable)
[-] Checkpoint 10: Checking for existence of command parameter
[-] Checkpoint 11: Check for a2sd help command
[-] Checkpoint 12: Check for a2sd check command
[ ] Starting Apps2SD Check Program.
Darktremor 2.7.5.3 Beta 4a Apps2SD Status Report
================================================================================
===
Legend: [Ô£ö]=Setting is correct
[ÔÇ╝]=Setting is correct, but not optimal.
[Ô£û]=Setting is incorrect and needs to be fixed or option is not availa
ble.
================================================================================
===
[COLOR="Red"]Block Device - [Ô£ö][/COLOR]
Mount Point - [Ô£ö] /system/sd
Support EXT2? - [Ô£ö] Yes
Support EXT3? - [Ô£û] No
Support EXT4? - [Ô£û] No
Apps - [ ] Regular directory.
[ ] No Apps2SD Flag File not found.
[Ô£û] Programs runs from Int. Storage.
Setup issue. Run a2sd repair to fix.
Private Apps - [ ] Regular directory.
[ ] No Apps2SD Flag File not found.
[Ô£û] Private Programs runs from Int. Storage.
Setup issue. Run a2sd repair to fix.
Dalvik Cache - [ ] Regular directory.
[ ] Dalvik to /cache flag file not found.
[ ] Dalvik to SD flag file not found.
[Ô£ö] Dalvik runs from Int. Storage.
To run from SD card, type a2sd cachesd.
To run from /cache partition, type a2sd cachepart.
Data - [ ] Program Data on Internal Storage.
Swap - [ ] Partition not present or no swap support.
[Ô£ö] Swap does not start.
ZipAlign - [Ô£ö] Not running at boot.
To activate it, type a2sd zipalign
Dalvik Heap(MB) - [Ô£ö] 64m
Low Memory
Killer Settings - [Ô£ö] 1536,2048,6144,8192,12288,15360
Note: Values are in pages.
1 page = 4KB memory.
Values represent the following:
1st number = Foreground App
2nd number = Visible App
3rd number = Secondary Server
4th number = Hidden App
5th number = Content Provider
6th number = Empty App
[Ôüç] For a list of commands that you can use with Apps2SD
Type: a2sd help
#
who knows the problem ?

does your GIO support a2sd Darktremor? to use a2sd , your boot.img must support it

zico_newbie said:
does your GIO support a2sd Darktremor? to use a2sd , your boot.img must support it
Click to expand...
Click to collapse
He makes a tut.
http://forum.xda-developers.com/showpost.php?p=16359561&postcount=302
But i get that error

strunkie said:
He makes a tut.
http://forum.xda-developers.com/showpost.php?p=16359561&postcount=302
But i get that error
Click to expand...
Click to collapse
strunkie said:
He makes a tut.
http://forum.xda-developers.com/showpost.php?p=16359561&postcount=302
But i get that error
Click to expand...
Click to collapse
Ô£ö maybe = checklist, there are word "ran a2sd to repair on your terminal after a2sd check, isnt it? , so lets write a2sd on your terminal to repair, so maybe your a2sd work but cheklist code error, lets try to move cache to ext and enable zipalign, lets read a2sd help and to move cache to ext, write a2sd cachesd on terminal and to zipalign write on terminal: a2sd zipalign
Sent from my GT-S5570 using XDA App
Sent from my GT-S5570 using XDA App

Related

Camera Problem in Android on Pola 100

I have a HTC Polaris and I installed yesterday Android.
I used Incubus26Jc's Super FroYo RLS10.5 Themed with polaimg-panel3-320-froyo-15-07-10.
When I try to open the camera, after a few seconds I get the error in the picture.
Radio version is 1.59.46.12
I got the same problom
My model and radio are the same to you,
and the problom is the same....
I just tried the latest Radio for Polaris and the same problem occurs.
zeoos said:
I have a HTC Polaris and I installed yesterday Android.
I used Incubus26Jc's Super FroYo RLS10.5 Themed with polaimg-panel3-320-froyo-15-07-10.
When I try to open the camera, after a few seconds I get the error in the picture.
Radio version is 1.59.46.12
Click to expand...
Click to collapse
i have the same problem
but my radio version is 1.65.38.14, i'm using Super FroYo 2.2[RLS10] and panel1(24-05-10)
humm, you can help me to find polaimg-panel3-320-froyo-15-07-10?
thanks!
Another with the same problem, any solution?
I used Incubus26Jc's Super FroYo RLS11 Themed with polaimg-panel3-320-froyo-15-07-10.
rfsaidel, the link polaimg http://it029000.massey.ac.nz/vogue/files/?C=M;O=D
The camera works perfectly with the program layar, but keeps giving error when I want to take a picture. What is happening?
I use Android with Haret.
When is start my camera it says: Please insert an SD card before using the camera... but there is a SD card in the phone.
Reformat sdcard and try again
I have the same problem. Formatting (fat32) doesn't helped.
Device: pola100
Kernel: l1q1d (POLAIMG-PANEL1-320-FROYO.NBH)
Radio: 1.59.46.12 (Previous: 1.59.42.15 from Original HTC WWE 3.13.405.0)
OS: androidhtc.sourceforge.net (system-froyo-02-09-10_17.tgz)
System: NAND
Data: NAND
When i insert the sdcard dmesg gives me:
Code:
[ 535.350453] mmc1: Slot status change detected (0 -> 1)
[ 536.590495] set sdcc vdd to 17
[ 536.642967] clk_set_rate 21:144000
[ 536.645007] set sd clock - 0 20001
[ 536.753135] mmc1: Command timeout
[ 536.759012] mmc1: Command timeout
[ 536.760389] mmc1: Command timeout
[ 536.760389] mmc1: Command timeout
[ 536.760389] SD Init
[ 536.767470] set sdcc vdd to 15
[ 536.959049] mmc_sd_init_card: Delay 250 ms
[ 537.220389] clk_set_rate 21:32000000
[ 537.220389] set sd clock - 0 20001
[ 537.314612] mmc1: host does not support reading read-only switch. assuming write-enable.
[ 537.314687] SD Init Retry
[ 537.314730] mmc1: new high speed SDHC card at address b368
[ 537.318229] mmcblk1: mmc1:b368 USD 3931136KiB
[ 537.318765] mmcblk1: unknown partition table
Reformat the sd using a partition manager
Got rid of the sdcard error using:
adb shell
fdisk /dev/block/mmcblk1 (created one primary partition)
mkdosfs /dev/block/mmcblk1p1
umount /sdcard
<ejected and inserted sdcard>
But now there is another known error:
Starting WLAN, it immediately shows "Error".
I tried to use an hint from another thread:
running "Fix File Persmissions" from the bootmenu
without success.
Did you install the correlated wlan module for the choosen kernel/nbh?
You are going OT

[Q][void.][SOLVED] a2sd error. Mounting ext partition failed.

Hello,
I would like to post this in void. rom but I don't have enough post count.
I install void. delta as per instruction, and create directory on the following order: kernel, a2sd, gingerbread, gapps, one reboot for one directory. Then after installing Launcher Pro I realize I only have 138MB left on internal memory. I tried installing all my previous application and now got only 62MB left.
I partitioned the sd card as instructed, 0 for swap, 512 for ext, convert to ext3 then ext4, wipe everything, and after flashing it is all the same: apps still resided in internal memory.
I wonder what's wrong. Here the output for command a2sd check:
Code:
# a2sd check
[ ] Launching Darktremor A2SD
Starting Darktremor A2SD version 2.7 Update 3r1
[ ] Mounting /system as read-write
[ ] Starting A2SD in check mode
[ ] Running A2SD Check Program.
[ ] Searching for Mount Point...
[*] Mount point /system/sd located.
[ ] Checking for ext partition
[X] Ext partition found, but not mounted.
Your rom may not be setup to run A2SD.
Check with your rom developer if the boot image
is programmed to run A2SD.
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
Here the output for command a2sd remove:
Code:
# a2sd remove
[ ] Launching Darktremor A2SD
Starting Darktremor A2SD version 2.7 Update 3r1
[ ] Mounting /system as read-write
[ ] Starting A2SD in remove mode
[ ] Running A2SD Setup Program.
[ ] Searching for Mount Point...
[!] Mount point found..no further action required.
[ ] Remounting /system to read-write
[ ] Checking for ext partition
[!] Ext partition found, but not mounted.
[ ] Mounting ext partitions
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Invalid argument
[X] Mounting ext partition failed.
[X] Can't continue script...aborting.
[ ] Remounting /system to read-only.
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
Here the output for command a2sd install:
Code:
# a2sd install
[ ] Launching Darktremor A2SD
Starting Darktremor A2SD version 2.7 Update 3r1
[ ] Mounting /system as read-write
[ ] Starting A2SD in install mode
[ ] Running A2SD Setup Program.
[ ] Searching for Mount Point...
[!] Mount point found..no further action required.
[ ] Remounting /system to read-write
[ ] Checking for ext partition
[!] Ext partition found, but not mounted.
[ ] Mounting ext partitions
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Invalid argument
[X] Mounting ext partition failed.
[X] Can't continue script...aborting.
[ ] Remounting /system to read-only.
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
And the last command a2sd repair show (perhaps) some info:
Code:
# a2sd repair
[ ] Launching Darktremor A2SD
Starting Darktremor A2SD version 2.7 Update 3r1
[ ] Mounting /system as read-write
[ ] Starting A2SD in repair mode
[ ] Running A2SD Repair Program.
[ ] Searching for Mount Point...
[!] Mount point found..no further action required.
[ ] Remounting /system to read-write
[ ] Checking for ext partition
[!] Ext partition found, but not mounted.
[ ] Checking Ext partition...
e2fsck 1.40.8 (13-Mar-2008)
/dev/block/mmcblk0p2 has unsupported feature(s): extents gdt_checksum
e2fsck: Get a newer version of e2fsck!
[ ] Mounting ext partitions
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Invalid argument
[X] Mounting ext partition failed.
[X] Can't continue script...aborting.
[ ] Remounting /system as read-only.
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
I tried searching the forum but cannot find the suitable solution.
Thank you very much for your time.
UPDATE:
After several re-flash I got app2sd working. Here is what I did:
- reboot into recovery
- wipe everything
- partition micro sd: swap => 0, ext => 1024
- convert ext2 to ext3
- convert ext3 to ext4
- enable usb storage
- copy rom file
- and while the storage is connected, format the ext partition (/dev/sdb2 if on Linux) as ext4 using GNOME's Disk Utility
- disable usb storage
- flash zip
- reboot
- first boot, check free space: 165 MB
- create directory kernel
- reboot
- check free space: 165 MB
- create directory a2sd
- reboot
- check free space: 178 MB
- dont' do anything, just reboot
- check free space: 193 MB
And a2sd check command give me these:
Code:
# a2sd check
[ ] Launching Darktremor A2SD
Starting Darktremor A2SD version 2.7 Update 3r1
[ ] Mounting /system as read-write
[ ] Starting A2SD in check mode
[ ] Running A2SD Check Program.
[ ] Searching for Mount Point...
[*] Mount point /system/sd located.
[ ] Checking for ext partition
/dev/block/mmcblk0p2 /system/sd ext4 rw,noatime,nodiratime,barrier=1,data=ordered 0 0
[*] Ext partition is mounted.
[ ] Checking A2SD links.
A2SD Status Report
===============================================================
Apps - [-] Linked to SD Card.
[-] File .noa2sd not found.
[*] Programs run from SD card
To run from internal storage, type a2sd remove
Private Apps - [-] Linked to SD Card.
[-] File .noa2sd not found.
[*] Private Programs run from SD card
To run from internal storage, type a2sd remove
Dalvik Cache - [-] Symbolically Linked.
[-] File .dalvikcache found.
[*] Dalvik runs from SD card
To run from internal storage, type a2sd nocache
To run from /cache partition, type a2sd cachepart
Swap - [!] Partition not present.
[!] Swap does not start.
ZipAlign - [!] Not running at boot.
Property Patch - [-] File System Ready property
found.
[*] Boot image init.rc patched.
[ ] Setting File System Ready property to 1.
[ ] Remounting /system to read-only.
Thank you guys for your time. Have a nice weekend.
Try to convert ext2 to ext 3,then ext3 to ext4.I worked for me!
Had the same problem. I did as TheError said; i just wiped everything then repartitioned sd and it worked after reflashing
rosuvladut said:
Try to convert ext2 to ext 3,then ext3 to ext4.I worked for me!
Click to expand...
Click to collapse
Have done that too, but still not working.
kite86 said:
Had the same problem. I did as TheError said; i just wiped everything then repartitioned sd and it worked after reflashing
Click to expand...
Click to collapse
I notice you do wiping before partitioning. Will try that for next time flashing, might work for me.
UPDATE:
Done that too and still not working, but I can get it working now, will update the first post.
Hey one question.I'm using megatron and as the ROM said,it has apps to sd and dalvik to sd. But I feel I'm actually running out of space still.I would like to try out all this ext 3 ext 4 thing but I'm kinda stuck! Any suggestions???
AsherChua said:
Hey one question.I'm using megatron and as the ROM said,it has apps to sd and dalvik to sd. But I feel I'm actually running out of space still.I would like to try out all this ext 3 ext 4 thing but I'm kinda stuck! Any suggestions???
Click to expand...
Click to collapse
To check whether your a2sd working or not run this command on terminal emulator or adb shell:
Code:
a2sd check
If it working it should be output similar to mine in the first post.
export PATH=/data/local/bin:$PATH
sh-3.2$ export PATH=/data/local/bin:$PATH
sh-3.2$ a2sd check
rm: cannot remove '/data/dta2sd.lg2': Permission denied
cp: cannot create '/data/dta2sd.lg2': File exists
rm: cannot remove '/data/dta2sd.lg1': Permission denied
cp: cannot create '/data/dta2sd.lg1': File exists
rm: cannot remove '/data/dta2sd.log': Permission denied
[ ] Apps2SD is launching...
/system/bin/a2sd: line 22: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 23: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 24: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 31: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 35: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 36: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 37: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 38: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 39: /data/dta2sd.log: Permission denied
grep: /init.rc: Permission denied
tee: /data/dta2sd.log: Permission denied
__ _____
tee: /data/dta2sd.log: Permission denied
| \ |
tee: /data/dta2sd.log: Permission denied
| | |
tee: /data/dta2sd.log: Permission denied
|__/ | Darktremor Apps2SD 2.7.5.2 (2010-09-30)
tee: /data/dta2sd.log: Permission denied
/system/bin/launcha2sd: line 117: /data/dta2sd.log: Permission denied
[ ] GetProp Command = /system/bin/toolbox getprop
[ ] SetProp Command = /system/bin/toolbox setprop
[ ] Mount Point = /system/sd
tee: /data/dta2sd.log: Permission denied
[ ] Creating /cache/dc
tee: /data/dta2sd.log: Permission denied
mkdir: can't create directory '/cache/dc': Permission denied
tee: /data/dta2sd.log: Permission denied
chmod: /cache/dc: Permission denied
[ ] Symlinking /cache/dalvik-cache to /data/dalvik-cache
tee: /data/dta2sd.log: Permission denied
rm: can't stat '/cache/dalvik-cache': Permission denied
ln: /cache/dalvik-cache: Permission denied
tee: /data/dta2sd.log: Permission denied
/system/bin/launcha2sd: line 273: /data/dta2sd.log: Permission denied
[ ] Starting Apps2SD Check Program.
/system/bin/chka2sd: line 7: /data/dta2sd.log: Permission denied
grep: /init.rc: Permission denied
grep: /init.rc: Permission denied
tee: /data/dta2sd.log: Permission denied
[ ] Checking for ext partition
tee: /data/dta2sd.log: Permission denied
[X] Ext partition found, but not mounted.
tee: /data/dta2sd.log: Permission denied
Your rom may not be setup to run Apps2SD.
tee: /data/dta2sd.log: Permission denied
Check with your rom developer if the boot image
tee: /data/dta2sd.log: Permission denied
is programmed to run Apps2SD.
tee: /data/dta2sd.log: Permission denied
tee: /data/dta2sd.log: Permission denied
Your partition may be using an EXT4 partition,
tee: /data/dta2sd.log: Permission denied
but your rom may not support EXT4. Repartition
tee: /data/dta2sd.log: Permission denied
your SD card to use EXT2 or EXT3.
tee: /data/dta2sd.log: Permission denied
/system/bin/chka2sd: line 96: /data/dta2sd.log: Permission denied
/system/bin/launcha2sd: line 276: /data/dta2sd.log: Permission denied
/system/bin/launcha2sd: line 277: /data/dta2sd.log: Permission denied
/system/bin/a2sd: line 41: /data/dta2sd.log: Permission denied
sh-3.2$
This is what I got.So is it working? The permission denied shows me something is not right.
Try running the command as superuser. Enter su first, allow permission if requested, then execute a2sd check.
export PATH=/data/local/bin:$PATH
sh-3.2$ export PATH=/data/local/bin:$PATH
sh-3.2$ su
sh-3.2# a2sd check
[ ] Apps2SD is launching...
__ _____
| \ |
| | |
|__/ | Darktremor Apps2SD 2.7.5.2 (2010-09-30)
[ ] GetProp Command = /system/bin/toolbox getprop
[ ] SetProp Command = /system/bin/toolbox setprop
[ ] Mount Point = /system/sd
[ ] Creating /cache/dc
[ ] Symlinking /cache/dalvik-cache to /data/dalvik-cache
[ ] Starting Apps2SD Check Program.
[ ] Checking for ext partition
[X] Ext partition found, but not mounted.
Your rom may not be setup to run Apps2SD.
Check with your rom developer if the boot image
is programmed to run Apps2SD.
Your partition may be using an EXT4 partition,
but your rom may not support EXT4. Repartition
your SD card to use EXT2 or EXT3.
sh-3.2#
Now I got this.Looks to me like I have the apps2sd?
Yes, you got a2sd installed, but it has problem mounting ext partition. This problem was similar to mine.
You may want to try formatting ext partition using computer. No need to re-flash, just format the (supposedly) ext partition with ext4 using computer, reboot your phone and the a2sd should have no problem anymore.
You can also check the first post for how I do it.
Alright! I'm not very good with the 'computer and phone' way! Is there a way to do this just by using the phone? And after doing that,will I lose all my data on phone or sd card?
AsherChua said:
Alright! I'm not very good with the 'computer and phone' way! Is there a way to do this just by using the phone? And after doing that,will I lose all my data on phone or sd card?
Click to expand...
Click to collapse
You can try formatting using recovery mode, see if it's working for the second time.
I tried re-wiping, re-partitioning and re-flashing about three time until I finally decide to format manually using computer.
Yes on sd card, if you decide to re-partitioning again. Yes on the phone, if you decide to flashing again.
But always do backup before any attempt.
Alright! I'll try to figure this out. What good will it do me once I finish this?
fixed
I had the same exact problem but managed to figure out a way to fix it
The problem was that the ext was ext4 and not ext3 so a2sd could not detect it, which didnt make sense because I had backed up my entire phone using clockwork mod touch and it was restoring as ext4
So I booted into parted magic and put the microsd card in a usb reader, it would not detect it properly with the phone
Then I backed up all the files on the ext4 partition (right click mount), then look for disk under file manager
Next I reformatted the ext4 as ext3
Lastly I copied all the files I had backed up to the ext3 partition.
When I booted back into my phone, all my apps were there and it was working fine.
For some reason when I use the restore sd-ext in clockworkmod it changes the partition to ext4
That was giving me the issues with the lost apps and the mounting ext partition error.

[SCRIPT][v1.4]Bug Reporter (ultimate debugging) -- The MUST debugging AIO tool!

Greetings
Hello everyone, I made a script to help developers solve problems and you become a more helpful user.
What does it do?
It exports to sdcard :
dmesg
last_kmsg
wakelocks
kernel version
logcat (normal and long)
radio (aka modem log)
getprop (aka build.prop)
running processes
partition info
mount info
RAM info
interrupts
boot logs from kernels like : nAa, lupus
Total maximum possible logs are 14 files.
What should I do? :cyclops:
Send files from the folder with the time-stamp you have just created or send the tar.gz'ed file to the corresponding developer to help him. Each time you run the script it creates a different folder with a unique time-stamp of the time and date you dumped the logs.
Send whatever is needed, everything is in bug_reporter folder.
Ok, how do we install this thing?
Make sure you download the latest version [ v1.4 is the latest ] which is attached below and put it in your sdcard...and that your device is rooted.
Go to CWM recovery and flash it! It does no harm, it just copies a small 6kb file in your /system/xbin. So there is no need to uninstall it later. It will accompany you until you flash a new ROM.
If you are coming from another version, just flash it over.
If you are having any problems, first attach the debug.txt from bug_reporter folder and tell me your device, kernel and ROM. The problem might be your busybox installation though.
Ok, how do we use this thing?
Make sure you have a terminal app, I use this : https://play.google.com/store/apps/details?id=jackpal.androidterm
Open a terminal app and just type :
Code:
su
bug
IT WON'T WORK PROPERLY IF NOT EXECUTED FROM /system/xbin/, SO IT MAY FAIL WITH SCRIPT MANAGER. TRY AND REPORT BACK TO ME.
That's it?
Yes. :good:
If you have any questions, feel free to ask anything. :highfive:
Any screenshots? :angel:
Yep.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I want to contribute/redistribute
Oh, please do! :victory: Spread it, mod it, rewrite it, make your own version, inform developers, tell ROM cookers to include it, do whatever you want with it, but please don't forget me...
Post any improvements or modifications for me here. :fingers-crossed:
Here is the "source code" of it:
Code:
#!/system/bin/sh
DIRECTORY="/sdcard/bug_reporter"
clear
#ROOT CHECK, FOR SCRIPT TO WORK ON ALL su VERSIONS
clear
echo "Checking root permissions..."
if [ "$(id)" != "uid=0(root) gid=0(root)" ];
then
echo " - Denied?"
echo " * Please accept superuser permission..."
echo " /!\ FIRST TYPE: su"
echo
exit
elif [ "$(id)" == "uid=0(root) gid=0(root)" ];
then
echo " - Granted! SU binary version : $(su -V)"
else
echo
echo " /!\ Some errors occured... Obviously..."
echo " * Run the script again."
echo " - Asking superuser permissions..."
echo " ( i ) If you see somewhere "root", we are OK,"
echo " else, we are NOT."
su
echo " Look at it :"
id
exit
fi
{
#CREATING THE NEST DIRECTORY
#
if [ ! -d "$DIRECTORY" ];
then
echo " - Directory not found.
echo " - Creating...
mkdir $DIRECTORY
echo " - Done!
else
echo " - Fatal error! Exiting...
exit
fi
#FOR DEBUGGING REASONS
#
echo " - SU binary version : $(su -V)"
#VACUUM
#
clear
##SETTING MAX MB
if [ ! -f $DIRECTORY/max_mb.txt ];
then
echo Logs can easily exceed over the size you can imagine.
echo So, I will ask you if you want me to delete them
echo in the future.
echo
echo "How many MB of logs do you want to keep?"
echo "(5 MB recommended)"
read keep
KEEP_KB=$(echo $(($keep*1024)) )
echo $KEEP_KB > $DIRECTORY/max_mb.txt
clear
fi
SIZE=$(du -s $DIRECTORY | cut -f1)
MAX_MB=$(cat $DIRECTORY/max_mb.txt)
MB=$(echo $(($SIZE/1024)) )
##CHECKING IF MAX MB ARE REACHED AND PROMPT
if [ "$SIZE" -ge "$MAX_MB" ];
then
echo Log files have reached the maximum size you have set.
echo Their size is around $MB MB.
echo
echo Do you want to clean all logs?
echo "(y = Yes, clean. n = No, reset max MB value)"
read clean
echo
if [ "$clean" == "y" ] || [ "$clean" == "Y" ] || [ "$clean" == "yes" ] || [ "$clean" == "YES" ];
then
rm -r $DIRECTORY
echo - Cleaned!
echo - Re-run the script to set again the max MB value.
echo - Bye!
exit
elif [ "$clean" == "n" ] || [ "$clean" == "N" ] || [ "$clean" == "no" ] || [ "$clean" == "NO" ];
then
rm $DIRECTORY/max_mb.txt
echo - Value reseted!
echo - Re-run the script to set again the max MB value.
echo - Continuing...
sleep 2
else
echo "/!\ Illegal character. Try again...";
sleep 1
exec bug
fi
fi
#PRECALCULATIONS FOR LOGCATING
#
ls dev/log > $DIRECTORY/devlog
MAIN=$(grep main $DIRECTORY/devlog)
RADIO=$(grep radio $DIRECTORY/devlog)
clear
DATETIME=$(date +%Y%m%d%H%M%S)
export DATETIME
echo " ,-------------, Everything is saved on sdcard"
echo " / [email protected] / under bug_reporter folder."
echo "/_____________/__,------,"
echo "| Bug reporter v1.4 / Remember the timestamp!"
echo "|_______________,-----' Format : yyyymmddhhmmss"
echo
echo "It exports and compresses as tarball the following :"
echo "* dmesg"
echo "* last_kmsg"
echo "* wakelocks"
echo "* kernel version"
echo "* logcat (normal and long)"
echo "* radio (aka modem log)"
echo "* getprop (aka build.prop)"
echo "* running processes"
echo "* partition info"
echo "* mount info"
echo "* RAM info"
echo "* interrupts"
echo "* boot logs from kernels like : nAa, lupus"
echo
cd $DIRECTORY
#TIMESTAMP WHICH IS THE FOLDER'S NAME WHERE THE FILES ARE SAVED ON EACH RUN
echo - report timestamp : $DATETIME
mkdir "$DATETIME"
echo - exporting...
#FOR DMESG
echo - dmesg
dmesg > $DIRECTORY/"$DATETIME"/dmesg.txt
echo - OK!
#FOR LAST_KSMG
#
echo - last_kmsg
if [ -f /proc/last_kmsg ];
then
cat /proc/last_kmsg > $DIRECTORY/"$DATETIME"/last_kmsg.txt
echo - OK!
else
echo " /!\ last_kmsg not found!";
fi
#FOR WAKELOCKS
#
echo - wakelocks
if [ -f /proc/wakelocks ];
then
cat /proc/wakelocks > $DIRECTORY/"$DATETIME"/wakelocks.txt
echo - OK!
else
echo " /!\ wakelocks not found!";
fi
#FOR KERNEL VERSION
#
echo - kernel version
if [ -f /proc/version ];
then
cat /proc/version > $DIRECTORY/"$DATETIME"/kernel.txt
uname -a >> $DIRECTORY/"$DATETIME"/kernel.txt
echo - OK!
else
echo " /!\ version not found!";
fi
#FOR LOLCATS
#
if [ "$MAIN" != "main" ] || [ "$RADIO" != "radio" ];
then
echo " /!\ main and radio logging aborted!";
echo "* I can't logcat properly, loggers may be disabled."
echo "- Your ROM's dev must have disabled it via a script."
echo " OR"
echo "- Loggers are disabled from kernel."
else
##MAIN
echo - logcat
logcat -d > $DIRECTORY/"$DATETIME"/logcat.txt
echo - OK!
echo - long logcat
logcat -v long -d > $DIRECTORY/"$DATETIME"/long_logcat.txt
echo - OK!
##RADIO
echo - radio
logcat -b radio -v time -d > $DIRECTORY/"$DATETIME"/radio.txt
echo - OK!
fi
#FOR GETPROP
#
echo - getprop
getprop > $DIRECTORY/"$DATETIME"/getprop.txt
echo - OK!
#FOR RUNNING PROCESSES
#
echo - processes
ps > $DIRECTORY/"$DATETIME"/processes.txt
echo - OK!
#FOR PARTITION INFO
#
echo - partition info
df > $DIRECTORY/"$DATETIME"/partitions.txt
echo - OK!
#FOR MOUNTS
#
echo - mount info
mount > $DIRECTORY/"$DATETIME"/mounts.txt
echo - OK!
#FOR RAM
#
echo - RAM info
free > $DIRECTORY/"$DATETIME"/ram.txt
echo - OK!
#FOR INTERRUPTS
#
echo - interrupts
cat /proc/interrupts > $DIRECTORY/"$DATETIME"/interrupts.txt
echo - OK!
##----DEVIDER FOR SPECIAL LOGS----##
#BOOT LOG FOR nAa KERNELS AND DERIVATIVES
#
if [ -f "/boot.txt" ];
then
echo " ( i ) Oh, I found a boot log too!"
echo "- That's found on some nAa kernels, backing it up."
cat /boot.txt > $DIRECTORY/"$DATETIME"/boot.txt
echo - OK!
fi
#BOOT LOG FOR lupus KERNELS AND DERIVATIVES
#
if [ -f "/tmp/lupus.log" ];
then
echo " ( i ) Oh, I found a boot log too!"
echo "- That's found on some lupus kernels, backing it up."
cat /tmp/lupus.log > $DIRECTORY/"$DATETIME"/boot.txt
echo - OK!
fi
##----###----##
#CLEANING UP UNEEDED FILES FOR USER
#
echo - Cleaning up...
##CLEANING LAST TARBALL
rm *.tar.gz 2>&1 | >$DIRECTORY/devlog
##devlog IS A FILE OF PRECALCULATIONS FOR LOGCAT
if [ -f "$DIRECTORY/devlog" ];
then
rm $DIRECTORY/devlog
fi
#COMPRESSING FOR EASY SENDING
#
echo - Compressing logs...
echo - Done!
echo " ( i ) Send "$DATETIME".tar.gz to developer(s)!"
tar -zcf "$DATETIME".tar.gz "$DATETIME"
echo - Exiting...
#ADVERTISING THE SCRIPT
#
echo "http://forum.xda-developers.com/showthread.php?p=41107818" > $DIRECTORY/"$DATETIME"/"I used bug_reporter script.txt"
#DEBUGING MY SCRIPT
#
} 2>&1 | tee $DIRECTORY/debug.txt
exit
CHANGELOG
Code:
[B]v1.4[/B] [B][COLOR="Red"]MORE FEATURES[/COLOR][/B]-[COLOR="SeaGreen"]WORKS ON ALL SUPERUSER APPS[/COLOR]
- alternative root check
- now it's [B]not[/B] necessary to have SuperSU, you can use whatever you want, but you have to type [B]su[/B] first
- added additional logging of : [B]running processes[/B], [B]partition info[/B], [B]mount info[/B], [B]RAM info[/B], [B]interrupts[/B], [B]boot logs[/B] from [B]lupus[/B] kernel
- avoided potential bug with radio logging
- added some more info about kernel version logging (with [B]uname -a[/B] command)
- code clean up and more easier to follow
- faster? (it takes 1 second for me)
[B]v1.3[/B] [B][COLOR="Red"]ROCK STABLE[/COLOR][/B]-[COLOR="SeaGreen"]THE BEST[/COLOR]
- corrected root check
- added compatibility with CM10.1, it uses an older version of su and the script will ask you to install SuperSU to update it
- corrected and re-ordered some text
- optimized script speed by removing unnecessary su requests (it just takes 3 secs to finish)
- added build.prop backup with getprop command, it will help devs understand more info about your situation
- added some sort of advertisement of the script, so that it'll become popular
- added compression of the last logging folder, so that you can easily send it to dev(s)
- added more info on the script, made more presentable and explanatory for those who are willing to modify it
[B]v1.2[/B] [B][COLOR="Red"]STABLE[/COLOR][/B]-[COLOR="SeaGreen"]FULLY TESTED[/COLOR]
- finally fixed logcat exporting, now it will work for sure, fully tested
- cleaned up the script a lot and made it simplier for reading
- added radio (aka modem log), wakelocks and kernel version logging
- fixed terminal output logging for debugging better
[B]v1.1[/B] [I][COLOR="Gray"]it won't logcat, but everything else works[/COLOR][/I]
- fixed wrong logcat exporting, now when it's disabled, you'll know it
- added an auto-check for vaccuming logs after reaching above the MB size you set (logs can easily reach 10 MB)
- small bugfixes
- root check, in order to be sure we collect logs as root
- terminal output logging for debugging reasons
[B]v1.0 beta[/B] [I][COLOR="Gray"]works, but has many errors, it may even fail to flash.[/COLOR][/I]
- initial release
Thank you very much, this script will help a lot of people, including me
Sent from my R800i using xda premium
Is it possible to move this bug file to system/xbin instead of flashing it (gives error). And if yes, what should be the permissions?
zadrozny91 said:
Is it possible to move this bug file to system/xbin instead of flashing it (gives error). And if yes, what should be the permissions?
Click to expand...
Click to collapse
It's fixed. Just flash bug_reporter[v1.0]-nAa.zip, the permissions are 755. If you are unsure about permissions, see this : http://www.draac.com/chmodchart.html
But I am telling you to flash the fixed zip, it'll work.
leajian said:
It's fixed. Just flash bug_reporter[v1.0]-nAa.zip, the permissions are 755. If you are unsure about permissions, see this : http://www.draac.com/chmodchart.html
But I am telling you to flash the fixed zip, it'll work.
Click to expand...
Click to collapse
nice concept ,,but there are some problems
after taking log
both lastkmsg and logcat file show nothing(empty files)
long logcat shows this: 9 com.android.settings
only dmesg is correctly extracted
UPDATE!
Code:
[B]v1.1[/B]
- fixed wrong logcat exporting, now when it's disabled, you'll know it
- added an auto-check for vaccuming logs after reaching above the MB size you set (logs can easily reach 10 MB)
- small bugfixes
- root check, in order to be sure we collect logs as root
- terminal output logging for debugging reasons
Thanks man, I was going to write something similar until I found this.
I cannot attest to the zip's functionality as I use it with script manager, but I can say version 1.0 worked perfectly (producing the three possible proper log files) for me. Version 1.1 not so much it tells me 'I can't logcat' when I clearly can; gl with your 'main not found' problem.
Also a suggestion maybe include in your zip a copy of the script that goes to /sdcard/ so the user can easily access it in order to facilitate using it as a widget.
defiant07 said:
Thanks man, I was going to write something similar until I found this.
I cannot attest to the zip's functionality as I use it with script manager, but I can say version 1.0 worked perfectly (producing the three possible proper log files) for me. Version 1.1 not so much it tells me 'I can't logcat' when I clearly can; gl with your 'main not found' problem.
Also a suggestion maybe include in your zip a copy of the script that goes to /sdcard/ so the user can easily access it in order to facilitate using it as a widget.
Click to expand...
Click to collapse
Indeed, logcating won't work no matter what. It's a bug. I am aware of it. I'll fix it today I guess along with some code cleanup and considering your suggestion.
Sent from my MT11i using xda premium
Code:
[B]v1.2[/B] [B][COLOR="Red"]STABLE[/COLOR][/B]-[COLOR="SeaGreen"]FULLY TESTED[/COLOR]
- finally fixed logcat exporting, now it will work for sure, fully tested
- cleaned up the script a lot and made it simplier for reading
- added radio (aka modem log), wakelocks and kernel version logging
- fixed terminal output logging for debugging better
Also v1.0 beta re-added in case you want it.
Might convert this to external scripts for windows and unix as well. Btw, why the root checker? If it needs to be in system/xbin then you already have root
Sent from my Nexus 7 using Tapatalk HD
cybojenix said:
Might convert this to external scripts for windows and unix as well. Btw, why the root checker? If it needs to be in system/xbin then you already have root
Sent from my Nexus 7 using Tapatalk HD
Click to expand...
Click to collapse
:victory: Yeah, do whatever you want with it!
About the root check... Have you ever thought of "just in case" case? Well sometimes sh!t happens... Like the 7+7=16 embarrassing situation on final exams for example.
Anyway, probably won't need this check on other unix systems... You'll need to start the script with
Code:
sudo -i
and remove any
Code:
su -c
in the script. Also some logging files are available only for android, like logcat and logcat radio. If you need any help with converting I can help you both for windows and unix, just PM me.
EDIT : Opss, root check is buggy, I've discovered it thanks to you! I'll upload a fixed minor revision later.
leajian said:
:victory: Yeah, do whatever you want with it!
About the root check... Have you ever thought of "just in case" case? Well sometimes sh!t happens... Like the 7+7=16 embarrassing situation on final exams for example.
Anyway, probably won't need this check on other unix systems... You'll need to start the script with
Code:
sudo -i
and remove any
Code:
su -c
in the script. Also some logging files are available only for android, like logcat and logcat radio. If you need any help with converting I can help you both for windows and unix, just PM me.
EDIT : Opss, root check is buggy, I've discovered it thanks to you! I'll upload a fixed minor revision later.
Click to expand...
Click to collapse
I mean set up a script to run from a pc to debug android. Let's you run it on non rooted devices (parts of it anyway)
It's quicker than getting a user to push and run via the android terminal (which not everyone has)
Easier to run via an adb interface which can be supplied, and implement an update script everyone is running the same version
Btw won't need help check my signature for the root scripts
Sent from my Nexus 7 using Tapatalk HD
UPDATE! The tool is now in a super stable state of development.
Code:
[B]v1.3[/B] [B][COLOR="Red"]ROCK STABLE[/COLOR][/B]-[COLOR="SeaGreen"]THE BEST[/COLOR]
- corrected root check
- added compatibility with CM10.1, it uses an older version of su and the script will ask you to install SuperSU to update it
- corrected and re-ordered some text
- optimized script speed by removing unnecessary su requests (it just takes 3 secs to finish)
- added build.prop backup with getprop command, it will help devs understand more info about your situation
- added some sort of advertisement of the script, so that it'll become popular
- added compression of the last logging folder, so that you can easily send it to dev(s)
- added more info on the script, made more presentable and explanatory for those who are willing to modify it
can i get permission for adding your script in my cm-10.1 for LG-P350 ?
PecanCM said:
can i get permission for adding your script in my cm-10.1 for LG-P350 ?
Click to expand...
Click to collapse
Says in the post you can. Just credit
Sent from my Nexus 7 using Tapatalk HD
Just sharing. I use this:
bugreport > /sdcard/bug_report_`date +"%Y%m%d-%H%M"`
You may want to incorporate it in some way.
Sent from my GT-I9100 using xda premium
RovG said:
Just sharing. I use this:
bugreport > /sdcard/bug_report_`date +"%Y%m%d-%H%M"`
You may want to incorporate it in some way.
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Thanks, I'll have it in mind, the reason why I didn't do this before is that I wanted it to be simple and not so informative.
In next update I might add some colors too!
Anyway here is an update... :fingers-crossed:
Code:
[B]v1.4[/B] [B][COLOR="Red"]MORE FEATURES[/COLOR][/B]-[COLOR="SeaGreen"]WORKS ON ALL SUPERUSER APPS[/COLOR]
- alternative root check
- now it's [B]not[/B] necessary to have SuperSU, you can use whatever you want, but you have to type [B]su[/B] first
- added additional logging of : [B]running processes[/B], [B]partition info[/B], [B]mount info[/B], [B]RAM info[/B], [B]interrupts[/B], [B]boot logs[/B] from [B]lupus[/B] kernel
- avoided potential bug with radio logging
- added some more info about kernel version logging (with [B]uname -a[/B] command)
- code clean up and more easier to follow
- faster? (it takes 1 second for me)

[Q] SD-EXT script for Android 4.2.2?

Hi is there a script that increases internal storage via sd-ext for Cyanogenmod 10.1 (android 4.2.2)?
If so could someone link it to me?
gymfreak7855 said:
Hi is there a script that increases internal storage via sd-ext for Cyanogenmod 10.1 (android 4.2.2)?
If so could someone link it to me?
Click to expand...
Click to collapse
Mounts2SD worked really well for me on 4.2.2; it's my a2sd script of choice. Here's the XDA thread about it.
Syd_M said:
Mounts2SD worked really well for me on 4.2.2; it's my a2sd script of choice. Here's the XDA thread about it.
Click to expand...
Click to collapse
That worked for me too!
gymfreak7855 said:
Hi is there a script that increases internal storage via sd-ext for Cyanogenmod 10.1 (android 4.2.2)?
If so could someone link it to me?
Click to expand...
Click to collapse
cronmod's int2ext
engr_exxi said:
cronmod's int2ext
Click to expand...
Click to collapse
That isnt working for me -_-
rhar**** said:
That isnt working for me -_-
Click to expand...
Click to collapse
you must use int2extv2.
scroll my signature for link.
gymfreak7855 said:
Hi is there a script that increases internal storage via sd-ext for Cyanogenmod 10.1 (android 4.2.2)?
If so could someone link it to me?
Click to expand...
Click to collapse
I was using link2sd with King Evo ROM but not if I'm so result. Nor well but if I use function works.
If someone recommended I would appreciate any Script
Create a file name 40int2ext then paste this.
Open notepad or notepad++.
Save file as 40int2ext
delete .txt extension at filename. (note you should set your pc to show extension file names)
You must have an ext partition at your sd card. I use ext4. You could choose among ext2/3/4 though.
As cronmod suggest the maximum size for partition must be 1GB/100mb of internal storage. I used about 512mb
From cronmod's int2ext
Code:
#!/system/bin/sh
#####################################
## CronMod INT2EXT+ - 02/21/2013 ##
## Written by CronicCorey [user=243864]@xda[/user] ##
## 40int2ext ##
#####################################
## Thanks to Mastermind1024 [user=3964321]@Xda F[/user]or helping to solve the IMEI and Baseband issues on some devices
## Thanks to vvFICKvv, DK75, and Dark Passenger [user=3964321]@Xda F[/user]or help to fix compatibility issues with Android 4.2.x
## Thanks to Mortaromarcello [user=4166799]@github[/user] for code to check if mmcblk0p2 exists
## Only continue if mmcblk0p2 exists
if [ ! -e /dev/block/mmcblk0p2 ]
then
exit
fi;
## Set SD cache size
SD_CACHE=/sys/devices/virtual/bdi/179:0/read_ahead_kb
if [ -e $SD_CACHE ]
then
busybox echo "1024" > $SD_CACHE;
fi;
## Make /sd-ext directory if needed and unmount /sd-ext if it already mounted
if [ ! -e /sd-ext ]
then
busybox mount -o remount,rw /;
busybox mkdir /sd-ext;
busybox mount -o remount,ro /;
else
busybox umount /sd-ext;
fi;
## Move /data mount point to /sd-ext
INT_DATA=$(busybox mountpoint -n /data | cut -d ' ' -f1)
busybox umount /data;
busybox mount $INT_DATA /sd-ext;
## Mount mmcblk0p2 to /data
busybox mount -o noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /data;
busybox chown 1000:1000 /data;
busybox chmod 771 /data;
## Move existing files
if [ ! -e /data/app ]
then
busybox mv /sd-ext/* /data;
fi;
## Move /data, /misc, /nvram, /property, and /radio back to /sd-ext
for i in data misc nvram property radio;
do
if [ ! -e /sd-ext/$i ] && [ -e /data/$i ]
then
busybox mv /data/$i /sd-ext;
busybox mkdir /data/$i;
fi;
## Make Binds
if [ -e /data/$i ]
then
busybox mount -o bind /sd-ext/$i /data/$i;
fi;
done;
## Unmount /sd-ext
busybox umount /sd-ext;
sync;
############################################################################################################################################################
########################################################
## Bind Cache by CyanogenMod ##
## bind mount /data/local/download to /cache/download ##
## if cache partition is too small ##
########################################################
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
DATAONLY=$(getprop dalvik.vm.dexopt-data-only)
if [ "$DATAONLY" = "1" ]
then
NEEDED=60000
else
NEEDED=105000
fi;
if [ $CACHESIZE -lt $NEEDED ]
then
mount -o bind /data/local/download /cache/download;
fi;
rm /cache/download/downloadfile*.apk >/dev/null 2>&1;
sync;
############################################################################################################################################################
######################################################################
## Automatic ZipAlign by Wes Garner ##
## ZipAlign files in /data that have not been previously ZipAligned ##
## Thanks to oknowton for the changes ##
######################################################################
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
echo "Starting Automatic ZipAlign" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
fi;
else
echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished" | tee -a $LOG_FILE;
I used it and it works
engr_exxi said:
cronmod's int2ext
Click to expand...
Click to collapse
Yeah cronmod's didn't work for me.
PROBLEM!
I wanted to extend my EXT partition size. So for that, I used Mini Partition Tool Home Edition to unallocate everything and create the full partition as primary sd card. Then i rebooted into recovery (CWM) and partitioned my sd card and created ext partition of 512 mb. But now, I am unable to use that ext partition. I cant mount it, even in recovery! SD card is working fine but problem is EXT. I have tried it with TWRP too and tried to create a SWAP too. But no luck!
What to do now?
pls dont tell to buy a new SD card.
rhar**** said:
I wanted to extend my EXT partition size. So for that, I used Mini Partition Tool Home Edition to unallocate everything and create the full partition as primary sd card. Then i rebooted into recovery (CWM) and partitioned my sd card and created ext partition of 512 mb. But now, I am unable to use that ext partition. I cant mount it, even in recovery! SD card is working fine but problem is EXT. I have tried it with TWRP too and tried to create a SWAP too. But no luck!
What to do now?
pls dont tell to buy a new SD card.
Click to expand...
Click to collapse
You can't use the ext partition like the primary partition. It's either a script use it like link2sd,data2sd,ext2sd or anythingyoucanimagine2sd.
Try this method. After you partition your sdcard. and installed cronmod's int2ext. Try to reaplce the 40int2ext file with the one I provide. I also suggest to remove other scripts currently at the /system/etc/init.d folder but retain the two 00banner and 90userinit. You can use any root file browsers. Then restart your phone
engr_exxi said:
You can't use the ext partition like the primary partition. It's either a script use it like link2sd,data2sd,ext2sd or anythingyoucanimagine2sd.
Try this method. After you partition your sdcard. and installed cronmod's int2ext. Try to reaplce the 40int2ext file with the one I provide. I also suggest to remove other scripts currently at the /system/etc/init.d folder but retain the two 00banner and 90userinit. You can use any root file browsers. Then restart your phone
Click to expand...
Click to collapse
Thats fine. I have been using it before too.
But now i am unable to mount sd-ext, even through recovery! No use of scripts. They wont work and some of them may even make my phone go to bootloop.
I wanna know how do i partition it now. Some other method than CWM or TWRP.

[MOD][SCRIPTS] Boot Script Utilities

About this thread
In this thread i will post my work on a init.d like support for stock rom which i call "Boot Script Utilities".
This work was developed for personal use and for my personal purposes.
If you do not like to use it please do not.
Click to expand...
Click to collapse
Just to be clear
I am not responsible for whatever happens to your phone.
Some Info
What is init.d?
Init.d is a folder located in "/system/etc/init.d/", but not all roms have his folder (stock rom don't have the folder).
What is special with this folder is that any script inside this folder will run on phone boot.
Why to run scripts on boot?
On boot many system variables are initiated before any application run, so you can make automatic tweaks on every boot.
ex. Swap external storage to internal.
Click to expand...
Click to collapse
Boot Script Utilities on stock Samsung Galaxy Core
This was developed for personal use. This is not the original init.d support.
I developed a similar support in order to implement some more features.
This do not means that this is a better way to roon scripts on boot.
What do i need?
A rooted Samsung Galaxy Core (I used I8260, for how to root search the forum)
A good root explorer (well Root Explorer worked)
A recovery with backup/restore support (to backup your rom in case you soft brick your phone)
What we will do?
We will edit a system file to run a script i wrote. This script will run all scripts (or not all read more below) inside /system/etc/init.d/ folder.
Step 0 - Backup your rom
Boot into your recovery and make a backup.
Step 1 - init.d folder
Create a directory on "/system/etc/" and name it "init.d".
So now directory "/system/etc/init.d/" exist.
Step 2 - Boot Script Utilities main script
Copy "init.bsu.boot.sh" file (link on the end of the post) in "/system/etc/".
So now file "/system/etc/init.bsu.boot.sh" exist.
Step 3 - Edit system file, run Boot Script Utilities
The system file we will edit is "/system/etc/init.qcom.post_boot.sh"
Insert this code on the bottom of the script
Code:
# Run Boot Script Utilities
# For galaxy core stock rom
# by DarkThanos
/system/bin/sh /system/etc/init.bsu.boot.sh > /data/tmp/init.bsu.log 2>&1 &
Step 4 - Ready
Insert your scripts inside "/system/etc/init.d/" and whey will run on boot.
Click to expand...
Click to collapse
Boot Script Utilities features
Disable all scripts
If file "/system/etc/init.d/disabled" exist no script will run.
Disable scripts
Any script named like "*.disabled" or "*.disabled.sh" will not run.
ex. "/system/etc/init.d/testscript.disabled.sh" will not run.
Run scripts asynchronous
Any script named like "*.async" or "*.async.sh" will run asynchronous.
ex. "/system/etc/init.d/testscript.async.sh" will run asynchronous.
Scripts run order
Scripts run in name order.
Log on every boot
All scripts results-errors output (stdout/stderr) will be printed on "/data/tmp/init.bsu.log"
Click to expand...
Click to collapse
[Change log]
1.0 Version
Script Public for first time.
init.d like support
Click to expand...
Click to collapse
[Dev Doc]
It does not really matters from where the script is called.
The script first checks if boot is completed, if not it sleeps for 2 seconds.
(so you need to call the script after boot, or before but asynchronous)
Code:
# Get boot complete state
isBootCompleted=`getprop dev.bootcomplete`
# Wait For boot complete event
# Probably useless unless script called from other file
while [ "$isBootCompleted" -ne '1' ]
do
# Wait and check again
sleep 2
# Check if boot completed
isBootCompleted=`getprop dev.bootcomplete`
done
The next step is to check if "/system/etc/init.d/disabled" file exist.
If it do not exist, it will run all not disabled scripts inside "/system/etc/init.d/".
It will check every file inside and analyze its name so it knows if the script is disabled or asynchronous.
Code:
# Create a init.d Support
# Implement /system/etc/init.d/ folder
# Check if init.d is disabled
# If /system/etc/init.d/disabled file exist, then init.d is disabled
if [[ ! -f /system/etc/init.d/disabled ]]
then
echo "[$manager_name] Initiating init.d scripts"
# Run every script on init.d folder
for scriptfile in /system/etc/init.d/*
do
if test -f "$scriptfile"
then
# Get script name
scriptname=$(basename $scriptfile)
# Check if script is disabled
# ex1 : 'testscript.sh.disabled' is disabled
# ex1 : 'testscript.disabled.sh' is disabled
echo "$scriptname" | grep -q -E '\.(disabled|disable\.sh)$'
if [ $? -eq 0 ]
then
echo "[$manager_name] Script $scriptname is disabled"
else
# check if script is asynchronous
# ex1 : 'testscript.sh.async' is asynchronous
# ex2 : 'testscript.async.sh' is asynchronous
echo "$scriptname" | grep -q -E '\.(async|async\.sh)$'
if [ $? -eq 0 ]
then
echo "[$manager_name] Run Script $scriptname asynchronous"
/system/bin/sh "$scriptfile" | script_log &
else
echo "[$manager_name] Run Script $scriptname"
/system/bin/sh "$scriptfile" | script_log
fi
fi
fi
done
else
echo '[$manager_name] init.d is disabled'
fi
That's all.
Please suggest any fixes or any improvements by messaging me.
Thanks for your time.
Click to expand...
Click to collapse
All Scripts
Links to all scripts posts
Optimize apks using ZipAlign
Optimize SQlite databases of apps
Swap External SD with Internal SD
Click to expand...
Click to collapse
[Script][Swap External SD with Internal SD][v1.0]
Name : Swap External SD with Internal SD
Version : v1.0
Author : DarkThanos
Thanks to: codlab
Click to expand...
Click to collapse
This script wait for your external sd card to be mounted and swap it with internal if it is bigger.
One minute after boot it will stop waiting.
(Fastest swap method I found)
I am not responsible for whatever happens to your phone.
Tested on my Samsung Galaxy Core (I8260)
[Change log]
1.0 Version
Script Public for first time.
Swap internal sd with external (if external>internal)
Click to expand...
Click to collapse
[Dev Doc]
The script first creates 2 directories to mount external sd and internal sd,
so that it can distinguish them from each other ("/data/sd_cards/internal/", "/data/sd_cards/external/").
Code:
# Mount root rw
mount -o remount,rw /
# Create directory to mount sd cards
# Make directory to save cards
mkdir -p /data/sd_cards
# Make directory to save internal
mkdir -p /data/sd_cards/internal
# Make directory to save external
mkdir -p /data/sd_cards/external
In the next step, the script waits for an external sd to be mounted.
This wait time is the reason why the script is better to be asynchronous.
The script checks every 5 seconds for an external sd, but after 1 minute (12 tries) it stops.
Code:
# Wait for external sd card to be mounted
# Max wait time is 1 minute
maxWaitTime=60
# While external Sd Card has 0 Capacity
while [[ $(du -s /storage/extSdCard | awk '{print $1}') == "0" && $maxWaitTime>0 ]]
do
# Check again in 5 seconds
sleep 5
# Count down max wait time
maxWaitTime=maxWaitTime-5
done
As soon as an external sd is mounted, the script mounts the external sd on "/data/sd_cards/external/"
and the internal on "/data/sd_cards/internal/".
Code:
# Save mount points on folders
# Mount bind internal SD in folder /data/sd_cards/internal
mount -o bind /storage/sdcard0 /data/sd_cards/internal
# Mount bind external SD in folder /data/sd_cards/external
mount -t vfat -o rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other /dev/block/vold/179:33 /data/sd_cards/external
So now the real internal sd can be found in the directory "/data/sd_cards/internal/"
and the real external sd can be found in the directory "/data/sd_cards/external/".
The reason we do this is to be able to make a script swap them again.
Then it checks the size of each, so that it knows if it ia worthing of swapping them.
Code:
# Get sd cards sizes
internalSdSize=$(du -s /storage/sdcard0 | awk '{print $1}')
externalSdSize=$(du -s /storage/extSdCard | awk '{print $1}')
If external sd is bigger, then on "/storage/sdcard0/" we mount "/data/sd_cards/external/"
and on "/storage/extSdCard/" we mount "/data/sd_cards/internal/".
Code:
# Swap sd cards
# If external sd card is bigger than internal swap
if [ $externalSdSize -gt $internalSdSize ]
then
# Swap
mount -o bind /data/sd_cards/internal /storage/extSdCard
mount -o bind /data/sd_cards/external /storage/sdcard0
fi
Click to expand...
Click to collapse
[Script][Optimize SQlite databases of apps][v1.0]
Name : Optimize SQlite databases of apps
Version : v1.0
Rewritten by : DarkThanos
Based on work of: pikachu01
Click to expand...
Click to collapse
This script optimize applications' database using sqlite3 (Vacuum/Reindex) every 5 boots or 5 days.
On any other boot it optimize only databases of phone, contacts, mms and settings .
Before use make a folder "libs" inside "/system/etc/init.d/",
insert the "sqlite3" file inside and give it execute permissions (the file is given with the script)
Bugs: (Its safe for use, its a warning not an error)
Contacts database is always locked, so can't be optimized.
I am not responsible for whatever happens to your phone.
Tested on my Samsung Galaxy Core (I8260)
[Change log]
1.0 Version
Script Public for first time.
SQlite databases on "/data/" optimize every 5 boots or 5 days.
SQlite databases of phone, contacts, mms and settings optimize on every boot.
Click to expand...
Click to collapse
[Dev Doc]
Script first initiate some variables
(path to Sqlite lib, path to a folder to save scripts data, minimum time between optimizes)
Code:
# Some variables
# SQLite path
sql_lib="/system/etc/init.d/libs/sqlite3";
# Data folder path
data_folder="/data/boot_scripts_data/";
# Data counter file name
data_file_counter="sql_optimize_counter";
# Data last run file name
data_file_lastrun="sql_optimize_lastrun";
# Max time between optimizes (in sec)
# 5 days = $(expr 5 \* 24 \* 60 \* 60 )
max_time_dif=432000
Check how many boots passed since last optimize
and when the last optimize was by reading scripts data.
Code:
# Create data folder if not exist
mkdir -p "$data_folder"
# Get data from files
# Run Counter
if [[ ! -f "$data_folder$data_file_counter" ]]
then
# File do not exist
touch "$data_folder$data_file_counter"
echo "0" > "$data_folder$data_file_counter"
runCount="0"
else
runCount=$(cat $data_folder$data_file_counter)
fi
# Last run date
if [[ ! -f "$data_folder$data_file_lastrun" ]]
then
# File do not exist
touch "$data_folder$data_file_lastrun"
echo "0" > "$data_folder$data_file_lastrun"
lastRun=0
else
lastRun=$(cat $data_folder$data_file_lastrun)
fi
If boots passed since last optimize equals with 5 or last optimized more than 5 days before,
then make a full database optimization.
Code:
# Check if its time for optimize
if [ $(( $(date +%s) - $lastRun )) -ge $max_time_dif -o $runCount -ge 5 ]; then
echo "Full mode optimize"
# Save data
echo "0" > "$data_folder$data_file_counter"
echo $(date +%s) > "$data_folder$data_file_lastrun"
# Optimize /data/
optimize_folder "/data/"
echo "All applications' databases were optimized"
Else make a light optimize.
(only phone, contacts, mms and settings)
Code:
else
echo "Light mode optimize"
# Save data
echo $((runCount+1)) > "$data_folder$data_file_counter"
# Only for Galaxy Core
# Count databases optimized
count=0
# phone optimize
optimize_folder "/data/data/com.android.phone/databases/"
# contacts optimize
optimize_folder "/data/data/com.android.providers.contacts/databases/"
# mms optimize
optimize_folder "/data/data/com.android.mms/databases/"
# email optimize
optimize_folder "/data/data/com.android.mms/databases/"
# settings optimize
optimize_folder "/data/data/com.android.settings/databases/"
echo "Important databases were optimized"
fi;
Optimize functions
Code:
# Some functions
# Optimize db
optimize_db(){
# Vacuum and then reindex
$sql_lib $1 'VACUUM;';
$sql_lib $1 'REINDEX;';
#echo $(basename $1)" was optimized."
}
# Optimize every db on folder
optimize_folder(){
local path=$1
count_result=0;
find $path -type f -iname "*.db" -print0 | while IFS= read -r -d $'\0' database; do
optimize_db $database
done
#echo "Databases inside $path were optimized."
}
Use the sqlite binary to VACUUM and REINDEX the given database.
Click to expand...
Click to collapse
[Script][Optimize apks using ZipAlign][v1.0]
Name : Optimize apks using ZipAlign
Version : v1.0
Author : Wes Garner
Suggestions : oknowton
Edited by : DarkThanos
Click to expand...
Click to collapse
This script zipalign applications' apk (only the apks that are not already zipaligned) on every boot.
First boot may take a while.
Before use make a folder "libs" inside "/system/etc/init.d/",
insert the "zipalign" file inside and give it execute permissions (the file is given with the script)
Bugs:(Not for use, more testing needed)
Some apps return an error after zipaligned, and need to be reinstalled.
(Found fix. Zipaligned apk do not holds read rights after copy. Command "cp -p" do not hold permissions. Temp fix "chmod 644". [I need help with that])
A download will be posted when it is stable.
I am not responsible for whatever happens to your phone.
Tested on my Samsung Galaxy Core (I8260)
Need to be tested for stable use.
[Change log]
1.0 Version
Script Public for first time.
Optimize apks using ZipAlign (on every boot check apps).
Click to expand...
Click to collapse
[Dev Doc]
Script code
Code:
#!/system/bin/sh
# Optimize apks using ZipAlign
#
# Work of:
# Wes Garner (Script code)
# oknowton (Suggestions)
#
# Modifications by:
# DarkThanos
#
# For the xda Galaxy Core users
#
# Some variables
# SQLite path
zipalign_lib="/system/etc/init.d/libs/zipalign";
# Data folder path
data_folder="/data/boot_scripts_data/";
# Data database file name
apk_cache="zipalign_apk_cache";
# Counters
count_apps=0
count_zipaligned_apps=0
count_zipalign_failed=0
# Report ZipAlign start
echo "ZipAlign Optimization Start";
# For every apk in /data/app/
for apk in /data/app/*.apk ; do
# Check if this apk is zipaligned
$zipalign_lib -c 4 $apk;
# Get results
not_zipaligned=$?;
# Count app
count_apps=$((count_apps+1))
# If not, align it
if [ $not_zipaligned -eq 1 ]; then
# ZipAlign app
result=`$zipalign_lib -f 4 $apk $data_folder$apk_cache`
if [ -e $data_folder$apk_cache -a ${#result} -eq 0 ]; then
# Successful zipalign
/system/xbin/busybox cp -p $data_folder$apk_cache $apk;
chmod 644 $apk;
rm $data_folder$apk_cache;
count_zipaligned_apps=$((count_zipaligned_apps+1))
else
echo "[ERROR] $result"
# Failed zipalign
count_zipalign_failed=$((count_zipalign_failed+1))
#echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
fi;
fi;
done;
# Report results
echo "Apks ZipAligned $count_zipaligned_apps/$count_apps ($count_zipalign_failed failed)";
# Exit
exit 0
I need help with the code:
Code:
/system/xbin/busybox cp -p $data_folder$apk_cache $apk;
chmod 644 $apk;
rm $data_folder$apk_cache;
I try to make all my script work with no busybox. "cp" command do not exist in android (without busybox).
Is "cat" a good alternative?
Also, should I use "chmod 644 $apk;"? "cp -p" do not work and I am pretty sure the script has root rights.
Thanks for your time.
Click to expand...
Click to collapse
I need betatester
Sent from my GT-I8262 using XDA Premium 4 mobile app
NieeLz said:
I need betatester
Click to expand...
Click to collapse
Download the "init.bsu.boot" script (from first post). Create the "/system/etc/init.d/" folder. And run the script (from your download folder) using Script Manager (do not forget to enable "su"). Then check "/data/tmp/init.bsu.log" (open as text) and see the log.
This is an easy safe test.
You can also make a test script, like:
Code:
#!/system/bin/sh
# Test Script
echo "This will be on log."
(You can read the script codes too, I have many comments.)

Categories

Resources