Why is my ext2 conversion of /cache not working? - Android Software/Hacking General [Developers Only]

#!/sbin/ash
DEVICE="/dev/stl14"
DIR="/cache"
umount $DEVICE
true
if [ $? = 0 ];
then
mkfs.ext2 -q -b 4096 $DEVICE
mount -t ext2 -o rw,noatime,nodiratime,nodev,nosuid $DEVICE $DIR
echo "/cache converted successfuly!" > /sdcard/ext2_cache.log
else
echo "/cache conversion error: unable to umount /cache" > /sdcard/ext2_cache.log
fi;
Click to expand...
Click to collapse
This scripts is executed in adb shell while in CWM...
On a reboot, my /cache is not mounted :/ and when I force to mount it
with
mount -t ext2 /dev/stl14 /cache
Click to expand...
Click to collapse
I get strange artifacts on my screen...
But for app2sd the phone uses ext2 as well... So why is ext2 not working for /cache then?
The link to app2sd is here: http://forum.xda-developers.com/showpost.php?p=16979976&postcount=552
Am I missing something?

Related

Debian in Haykuro/Cupcake builds

Hello all,
I've been trying for some time now to get Debian to work on the Haykuro bulds, but I can't seem to get things to mount. Anybody have any ideas?
This is the script that is supposed to start it up:
=============SCRIPT START==============
clear
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
echo "Android Filesytem remounted as read/write"
export kit=/sdcard/debian
export bin=/system/xbin/bb
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox insmod ext2
mknod /dev/loop2 b 7 0
clear
mount -o loop,noatime $kit/debian.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
sleep 1
echo "Starting init process"
sleep 1
echo "INIT: Debian booting....."
sleep 1
echo "Running Linux Kernel"
sysctl -w net.ipv4.ip_forward=1
sleep 1
echo "AutoMounter started"
sleep 1
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean kill of Debian!"
echo " "
chroot $mnt /bin/bash
busybox umount -f /data/local/mnt/dev/pts /data/local/mnt/proc /data/local/mnt/sys /data/local/mnt
echo "Filesystems have unmounted"
sleep 3
busybox losetup -d /dev/block/loop2
===============END SCRIPT==================
This is the result I get when I run it:
===============RUN SCRIPT START=============
←[H←[JAndroid Filesytem remounted as read/write
insmod: /lib/modules/2.6.27-04102009-daproy: No such file or directory
insmod: /lib/modules: No such file or directory
insmod: ext2.ko: module not found
mknod: /dev/loop2: File exists
←[H←[J
mount: mounting /sdcard/debian/debian.img on /data/local/mnt failed: Block devic
e required
mount: mounting devpts on /data/local/mnt/dev/pts failed: No such file or direct
ory
mount: mounting proc on /data/local/mnt/proc failed: No such file or directory
mount: mounting sysfs on /data/local/mnt/sys failed: No such file or directory
Custom Linux Pseudo Bootstrapper V1.0 - by Mark Walker
WEB: http://www.androidfanatic.com
EML: [email protected]
Starting init process
INIT: Debian booting.....
Running Linux Kernel
net.ipv4.ip_forward = 1
AutoMounter started
Type EXIT to end session
Make sure you do a proper EXIT for a clean kill of Debian!
chroot: cannot execute /bin/bash: No such file or directory
umount: forced umount of /data/local/mnt/dev/pts failed!
umount: cannot umount /data/local/mnt/dev/pts: No such file or directory
umount: forced umount of /data/local/mnt/proc failed!
umount: cannot umount /data/local/mnt/proc: No such file or directory
umount: forced umount of /data/local/mnt/sys failed!
umount: cannot umount /data/local/mnt/sys: No such file or directory
umount: forced umount of /data/local/mnt failed!
umount: cannot umount /data/local/mnt: Invalid argument
Filesystems have unmounted
losetup: : No such file or directory
Loopback device shutdown - success
==============End===============
I was hoping someone could help me out with this. I would really appreciate it. I am running 5.0.1G (Haykuro's build). I have tried asking him, but neither of us have the knowledge of how to fix the problems.
Thanks.
Check the first lines in the script that begin with "export..." .
For example if your debian image is located like defined in "export kit..."
Or if the binary paths are all correct. I think the problem is that there is probably no /system/xbin within your image like in the JF image. So the script can't find the tools it needs.
EDIT//
You can probably ignore the above part....
The problem is that the script doesn't load the "ext2" filesystem kernelmodule which is needed to mount Debian.
But i don't know if the script only look at the wrong place or if the ext2.ko module isn't available within your image.
You can search for the module by typing the following into a terminal:
find / -name "ext2.ko"
check if /data/local/mnt exists, if not , mkdir /data/local/mnt.
xbin is there. There is no need for ext2.ko because it is built into the kernel already (asked haykuro himself). /data/local/mnt exists. The export statement is right, my debian image is in /sdcard/debian.img.
Any other ideas?
I am running haykuro's 4.5g build. The latest one.
damageless said:
..... is right, my debian image is in /sdcard/debian.img.
Click to expand...
Click to collapse
Mhm. But that would be wrong...
Has to be in /sdcard/debian/debian.img
So try to create debian subfolder.
Okay, my bad. It's in /sdcard/debian/debian.img.
Any ideas?
I will try to help with this in a few hours. I have the 5.0.2Hr2-appstosd-signed image on my phone, a 1.2 GB ext2 filesystem partition on my SD Card (only a Class-4, it's really dog slow for most apps!), and I am working on getting debian functional within /system/sd.
I don't like the idea of having 3 "different" filesystems on my SD card, so I wanted to utilize the ext2 partition I use for apps/cache for Debian also, this would ensure that I could leave it mounted all the time without worrying about Debian dying if I mount the FAT32 partition onto my computer.
Praeluceo said:
I will try to help with this in a few hours.
Click to expand...
Click to collapse
I would really appreciate that. I was thinking the same thing, but I don't know how to do it.
Well that got nowhere quick. Any other ideas?
modprobe ext2
ok i just tried that, that was the solution previously when running debian, yu had to load the ext2 module, but something must be missing in the new build as i get
cannot parse modules.dep
Got the same error
I receive the same error message. Found a solution at the bottom of the first post:
http://forum.xda-developers.com/showthread.php?t=507291&highlight=debian
download updated scripts
it seems to be ok for me
----------------------------------
In fact, i cannot achieve any apt-get.
Phone block before and i'm unable to do anything in terminal, neither shutingdown.
I've tried with "terminal emulator" on phone and with adb shell.
HTC Orange
1.5G
---------------------------------
new image from duke
-> ok

[CM7] Remove files on boot and change LCD Density using init.d

Talk in the CM7 threads has revealed that many people remove apps from CM7 before flashing/after flashing/using an update zip. This thread has a quick and easy method to remove apps (and other things) from CM7 on boot using an init.d script.
This method requires s-off (as the system is mounted as rw) and requires a little knowledge of android, however I will produce a 1 time only flash zip if people need it.
The following script is used and I will explain it below and what to modify;
If using Windows, don't use Notepad. I suggest Notepad++
/system/etc/init.d/50rm
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
#apps to delete
#send installed apps to /data/packages
pm list packages -f > /data/packages
for i in CarHomeLauncher LiveWallpapers LiveWallpapersPicker Protips;
do
if [ -e /system/app/$i.apk ];
then
rm -f /system/app/$i.apk;
grep $i.apk /data/packages > /data/pname;
pname2=$(sed 's/\(.*=\)\(.*\)/\2/' /data/pname);
pm uninstall $pname2;
fi;
done;
rm -f /data/packages
rm -f /data/pname
#delete camera_click sound
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
Save the script as /system/etc/init.d/50rm (adb push 50rm /system/etc/init.d/50rm) and change permissions to 750 (adb shell chmod 750 /system/etc/init.d/50rm).
Next, so that this script is kept through flashes of new CM7 versions, we add it to the custom_backup_list.txt found in /system/etc/ (if you don't have one, create one).
/system/etc/custom_backup_list.txt
Code:
etc/init.d/50rm
There are two situations to show how things can be deleted:
1)#apps to delete
The line to change here is the for i in ... line (10) where there is a list of app names to uninstall.
Change names to what you want to be deleted from /system/app. Do not include .apk in the name.
2)#delete camera click sound
This is an example of how to delete other files that are wanted to be deleted. As an example, I have put the camera click sound. The full directory of the file will be needed.
What the script does:
The script will check if these files are there and then delete them. With the system apps, I have put in a script that should uninstall the files using the package manager (which I think is working, but am currently testing it because I'm not sure package manager can be run whilst booting, but post-boot my pm list packages -f reveals none of the packages)
Requests:
If anyone has a better, more efficient way of using the pm to uninstall the apps, please mention it. I am a novice when it comes to shell scripting and can only go by what I have done so far.
Changelog:
25/04/2011 - initial release
26/04/2011 - changed some strings
Script - http://bit.ly/golKIb (right click - save link as - check there is no file extension) - adb push 50rm /system/etc/init.d/50rm; adb shell chmod 750 /system/etc/init.d/50rm
How to use the custom_backup_list.txt in more ways - (by freerunner @ CM Forums)
Any problems, post here or add me to gtalk
subscribed, thanks mate.
i'll look into this when i get the time
Could anyone write a procedure that checks /system/build.prop, finds the line "ro.sf.lcd_density=240" and swapps it for "ro.sf.lcd_density=210"?
JDima said:
Could anyone write a procedure that checks /system/build.prop, finds the line "ro.sf.lcd_density=240" and swapps it for "ro.sf.lcd_density=210"?
Click to expand...
Click to collapse
Already done that. Once again, its not the cleanest way of doing things, but its as much as I know.
Change LCD Density on Boot
Code:
#!/system/bin/sh
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=210/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
What the script does:
Checks the LCD Density and if it is 240, it will change it to 210 (or whatever value people want by changing ro.sf.lcd_density=210 to the denisty they want). It then reboots immediately (whilst still on splash screen) so that the new density is loaded when you boot the phone.
Why is this needed when there are apps on the market?:
Many of the apps on the market need to be re-run on new rom flashes or are not permanent. This can be made permanent by adding to the custom_backup_list.txt and will be done every new flash in CM7.
Is this way better than deleting apps/sounds before flashing, or is it just alternative?
Personally I find it more easy to delete apps and other stuff via adb when the rom is instaled.
expl0de said:
Is this way better than deleting apps/sounds before flashing, or is it just alternative?
Personally I find it more easy to delete apps and other stuff via adb when the rom is instaled.
Click to expand...
Click to collapse
Its an alternative way that does it for you. All you have to do is put the script on your phone, add it to the custom_backup_list.txt and let the script work for you.
iinga, thanks!
Why? Because https://market.android.com/details?id=lv.n3o.lcddensity (for example) doesn't seem to work after reboot, and it has slightly different behavior (check out the keyboard for instance). The build.prop method is the "cleanest" one.
JDima said:
iinga, thanks!
Why? Because https://market.android.com/details?id=lv.n3o.lcddensity (for example) doesn't seem to work after reboot, and it has slightly different behavior (check out the keyboard for instance). The build.prop method is the "cleanest" one.
Click to expand...
Click to collapse
Agreed, which is why I wrote that script in the first place
Problem. The script does exactly nothing.
Code:
--------- beginning of /dev/log/main
I/cm ( 79): Welcome to Android 2.3.3 / CyanogenMod-7.0.2.1-Desire
I/cm ( 80): _
I/cm ( 81): __ __ _ ___ _ _ __ ___ __ _ _ _ _ __ __))
I/cm ( 82): ((_ \(/'((_( ((\( ((_)((_( (('((\( ((`1( ((_)((_(
I/cm ( 83): )) _))
I/cm ( 84):
I/mountsd ( 98): Checking filesystems..
I//system/xbin/run-parts( 74): e2fsck 1.41.10 (10-Feb-2009)
I//system/xbin/run-parts( 74): /dev/block/mmcblk0p2: recovering journal
I//system/xbin/run-parts( 74): /dev/block/mmcblk0p2: clean, 133/438272 files, 260021/875449 blocks
I/logwrapper( 104): busybox terminated by exit(0)
I/logwrapper( 109): busybox terminated by exit(0)
I/logwrapper( 111): busybox terminated by exit(0)
I/mountsd ( 113): /sd-ext successfully mounted
I/busybox ( 127): S2E: Initialization...
I/busybox ( 127): S2E: /sd-ext/app mount as /data/app
I/busybox ( 127): S2E: /sd-ext/app-private mount as /data/app-private
I/busybox ( 127): S2E: /sd-ext/download mount as /cache/download
I/busybox ( 127): S2E: Done!
I/logwrapper( 127): busybox terminated by exit(0)
[B]I//system/xbin/run-parts( 74): run-parts: /system/etc/init.d/50rm exited with code 111[/B]
I/logwrapper( 74): /system/xbin/run-parts terminated by exit(1)
The permissions are correct.
Here's my 50rm:
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=210/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
JDima said:
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=210/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
Click to expand...
Click to collapse
Try removing the "mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;" in the lcd density if section (before reboot).
iinga said:
Try removing the "mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;" in the lcd density if section (before reboot).
Click to expand...
Click to collapse
Predictably, it didn't help.
No way would mounting /system as RO be performed twice - because the script terminates after any of them one way or another.
JDima said:
Predictably, it didn't help.
No way would mounting /system as RO be performed twice - because the script terminates after any of them one way or another.
Click to expand...
Click to collapse
I know it wouldn't perform twice, however I was wondering why it fails to run the script.
It has been working for me, but now trying to work out what is different is difficult.
iinga said:
It has been working for me, but now trying to work out what is different is difficult.
Click to expand...
Click to collapse
Could you post the whole script you're using yourself (if it includes changing density)?
JDima said:
Could you post the whole script you're using yourself (if it includes changing density)?
Click to expand...
Click to collapse
Code:
#!/system/bin/sh
#mount system rw
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system;
#change lcd_density and reboot if new install
density=$(grep ro.sf.lcd_density=240 /system/build.prop);
if [ $density = "ro.sf.lcd_density=240" ];
then
sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=220/g' /system/build.prop;
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
reboot;
fi;
#apps to delete
pm list packages -f > /system/packages
for i in CarHomeLauncher LiveWallpapers LiveWallpapersPicker Protips DSPManager GenieWidget FileManager;
do
if [ -e /system/app/$i.apk ];
then
rm -f /system/app/$i.apk;
grep $i.apk /system/packages > /system/pname;
pname2=$(sed 's/\(.*=\)\(.*\)/\2/' /system/pname);
pm uninstall $pname2;
fi;
done;
rm /system/packages;
rm /system/pname;
#delete camera_click sound
if [ -e /system/media/audio/ui/camera_click.ogg ];
then
rm -f /system/media/audio/ui/camera_click.ogg;
fi;
#mount system ro
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system;
http://www.iinga.net/desire/50rmlcd
Nope. Same thing with your script. I even tried granting the script maximum permissions - useless.
Can anyone else verify the script actually works?
JDima said:
Nope. Same thing with your script. I even tried granting the script maximum permissions - useless.
Can anyone else verify the script actually works?
Click to expand...
Click to collapse
Are you s-off?
iinga said:
Are you s-off?
Click to expand...
Click to collapse
Off course
A detailed reproduction of my steps:
1) Place 50rm into /system/etc/init.d via Root Explorer (shouldn't make any difference)
2) Change permissions on 50rm.
3) Doublecheck the permissions.
4) Create and configure custom_backup_list.txt
5) Reflash the same ROM (I'm using custom MTD - however, that also shouldn't change anything)
6) Verify visually that the script didn't work.
7) Verify that 50rm is in place with correct permissions.
8) Reboot and adb logcat...
JDima said:
Off course
A detailed reproduction of my steps:
1) Place 50rm into /system/etc/init.d via Root Explorer (shouldn't make any difference)
2) Change permissions on 50rm.
3) Doublecheck the permissions.
4) Create and configure custom_backup_list.txt
5) Reflash the same ROM (I'm using custom MTD - however, that also shouldn't change anything)
6) Verify visually that the script didn't work.
7) Verify that 50rm is in place with correct permissions.
8) Reboot and adb logcat...
Click to expand...
Click to collapse
I just did step 5 and my phone goes to splash screen, reboots from splash screen, fully boots in density 220.
Code:
adb shell grep ro.sf.lcd_density /system/build.prop
ro.sf.lcd_density=220
How did you create your script? When I just created it using notepad for windows, I get the Exit Code 111 and no LCD Density change.
Creating with notepad ++, script runs fine and LCD density gets changed correctly.
iinga said:
How did you create your script? When I just created it using notepad for windows, I get the Exit Code 111 and no LCD Density change.
Creating with notepad ++, script runs fine and LCD density gets changed correctly.
Click to expand...
Click to collapse
Dammit...
Thanks, mate, it worked

Backtrack issue HTC jetstream

Greetings.
Ive used following script , HTC jetsteam rooted unlocked bootloader.
Code:
if [ "$perm" != "0" ];then echo "This Script Needs Root! Type : su";exit;fi
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/bt
export bin=/system/bin
export mnt=/data/local/mnt
mkdir -p $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/loop2 ]; then
echo "Loop device exists"
else
busybox mknod /dev/loop2 b 7 0
fi
mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM For Xoom"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
but keep getting error message .
can't execute /bin/bash no such file or directory.
Hope to hear from you guys.
Regards
Net_Spy
May be u might not have busybox installed after rooting ur phone
Hit thanks rather than typing it
Well I do have busybox installed in my device.
Regards
Net_Spy

[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.

Mount external partition using rooted Z3 with locked bootloader

Hello.
I just started messing around with my Z3 and so far followed the tutorial here https://forum.xda-developers.com/z3-compact/general/recovery-root-mm-575-lb-t3418714 to install root and recovery without unlocking the bootloader. Also took the chance to make a backup of the ta partition.
My objective was being able to mount an external ext4 partition so I could move game data and free some internal space. I believe the official kernel doesn't support init.d so I searched and found a script that worked and added it to the bottom of init.qcom.post_boot.sh.
Code:
### Init.d support ###
busybox run-parts /system/etc/init.d/
It's a very simple script that creates /sd-ext folder if it's missing and mounts /dev/block/mmcblk1p2 there
Code:
#!/system/bin/sh
#
# mounts ext partition from sd card
if [ ! -d /sd-ext ];
then
mount -o rw,remount /
install -m 774 -o 1000 -g 1000 -d /sd-ext
mount -o ro,remount /
fi
if [ ! -d /sd-ext ];
then
echo sd-ext not created >> /data/Test.log
else
mount -o rw -t ext4 /dev/block/mmcblk1p2 /sd-ext
fi
It was something that I got on some forum plus some trial and error and some Linux knowledge I have.
It seemed to work. The directory was created and mounted and I was able to move the games there using Titanium Backup.
But after I rebooted, the folder was there and all the data, but the apps don't show up on the apps list. I have to reinstall them...
Am I missing something? How can I fix this?

Categories

Resources