0

I want to place the odex files of data apps on the second partition on sd card(sdex2-FAT32 file system).But when I check for the existence of the folder on sdex2 with the script(posting only part of the script taken from other site), I always get the echo "Second partition on sd card does not exit." Please help Also how to make the mnt/asec partition writable? The script

#! /system/bin/sh
bb="busybox"
root() {
$bb echo "Checking For Root Permissions..."
if $bb [[ "`$bb id -u`" == "0" ]];
then
    $bb echo "Root Permissions Acquired!"
    $bb echo
else
    $bb echo "Could Not Acquire Root Permissions..."
    $bb echo
    $bb echo "Type 'su' And Try Again"
    $bb echo
    exit 1
fi;
}

preparing() { 
$bb echo "Mounting File System..."
$bb mount -o remount, rw /
$bb mount -o remount, rw /data
$bb mount -o remount, rw /data/sdext2
$bb mount -o remount, rw /system
$bb echo
$bb echo "Setting Variable and Constant..."
DIR=/
DIREXT=/data/sdext2 #(created by Link2SD)
DIREXTO=/data/sdext2/odex #(odex files for Link2SD data apps)

$bb echo "Checking for required Directories..."
if $bb [ ! -d $DIREXT ];
then
    if $bb [ ! -d $DIREXTO ];
    then
        $bb echo
        $bb echo "Creating ODEX Directory in SD Card..."
        $bb mkdir -p $DIREXTO
        $bb echo
    else
        $bb echo
        $bb echo "ODEX Directory in SD Card Exists"
        $bb echo
    fi;
else
    $bb echo
    $bb echo "Second Partition in SD Card Does not Exists"
    $bb echo
    fi;
    $bb echo
}
#Additional code
if $bb [[ "${1}" == "" ]];
then
    $bb clear
    root
    $bb echo
    preparing
    $bb echo
    exit 1
fi;

I am able to cd to /data/sdext2 directory and even copy files to sdext2 directory from other directories, but cannot check for the existence of sdext2 directory.The phone is rooted. Instead of using the path /data/sdext2 should I uses /dev/block/vold/179:1

Dario Dias
  • 817
  • 6
  • 19
  • 32

1 Answers1

0

I found my mistake.The code should have been

if $bb [ -d $DIREXT ];

instead of

if $bb [ ! -d $DIREXT ];

the "!" symbol means if not exist, and instead of I checking for the existence of the directory was checking for it not existing.Sorry for the trouble.

Dario Dias
  • 817
  • 6
  • 19
  • 32