Add files

This commit is contained in:
Namhyeon Go 2015-08-28 19:13:54 +09:00
parent 5f8cf4da07
commit 7aba8b4129
9 changed files with 259 additions and 0 deletions

4
app2sd_mount.sh Normal file
View File

@ -0,0 +1,4 @@
#!/system/bin/sh
insmod /system/lib/modules/nilfs2.ko
mount -t nilfs2 /dev/block/mmcblk0p2 /system/sd
/system/xbin/nilfs_cleanerd /dev/block/mmcblk0p2

60
etc/nilfs_cleanerd.conf Normal file
View File

@ -0,0 +1,60 @@
# nilfs_cleanerd.conf - configuration file of NILFS cleaner daemon.
#
# This file contains GC parameters that are loaded when cleaner gets
# started. You can force them to be reloaded by sending a HUP signal
# to the cleaner process.
#
# Each parameter is declared with a keyword-value pair or a directive
# with no argument. Lines beginning with "#" are ignored. For
# details, see the man page of nilfs_cleanerd.conf(5).
# Protection period in second.
protection_period 60
# Minimum number of clean segments
# 0 = continuous cleaning
# > 0 = pause cleaning until less segments are available
min_clean_segments 30%
# Maximum number of clean segments
max_clean_segments 70%
# The argument of min_clean_segments and max_clean_segments can be
# followed by a percent sign (%) or one of the following
# multiplicative suffixes: K 1024, MB 1000*1000, M 1024*1024, GB
# 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E.
#
# If the argument is followed by "%", it represents a disk capacity
# ratio.
# Clean segment check interval in seconds
clean_check_interval 60
# Segment selection policy.
# In NILFS version 2.0.0, only the timestamp policy is supported.
selection_policy timestamp # timestamp in ascend order
# The maximum number of segments to be cleaned at a time.
nsegments_per_clean 2
# The maximum number of segments to be cleaned at a time
# if clean segments < min_clean_segments
mc_nsegments_per_clean 4
# Cleaning interval in seconds.
cleaning_interval 5
# Cleaning interval in seconds
# if clean segments < min_clean_segments
mc_cleaning_interval 1
# Retry interval in seconds.
retry_interval 60
# Use mmap when reading segments if supported.
use_mmap
# Log priority.
# Supported priorities are emerg, alert, crit, err, warning, notice, info, and
# debug.
log_priority info

113
install.sh Normal file
View File

@ -0,0 +1,113 @@
#!/system/bin/sh
#scripted by gnh1201 at gmail dot com (Nam Hyeon, Go)
echo "Install App2SD NILFS2 for XT720"
echo "Backup: /data/data1, app1, app-private1, dalvik-cache1"
echo "This script may damage your system. Continue? (y/n)"
read y
if [ $y != "y" ]
then
echo "Canceled."
exit 1
fi
echo "Please Wait..."
mount -t yaffs2 -o rw,remount /dev/block/mtdblock6 /system
if [ -b /dev/block/mmcblk0p2 ]
then
busybox umount /dev/block/mmcblk0p2
else
echo "Not Found! /dev/block/mmcblk0p2";
exit 1
fi
echo "Do you want to format to NILFS2? (y/n)"
read y
if [ $y = "y" ]
then
touch /etc/mtab
cp xbin/* /system/xbin
cp etc/nilfs_cleanerd.conf /system/etc
chmod 755 /system/xbin/mkfs.nilfs2 /system/xbin/nilfs_cleanerd
chmod 644 /system/etc/nilfs_cleanerd.conf
mkfs.nilfs2 /dev/block/mmcblk0p2
fi
echo "Please Wait..."
cp nilfs2.ko /system/lib/modules
busybox insmod /system/lib/modules/nilfs2.ko
mkdir /system/sd
busybox mount -t nilfs2 /dev/block/mmcblk0p2 /system/sd
if [ $? -eq 255 ]
then
echo "Mount Failed!"
exit 1
fi
echo "NILFS2 Mount OK! Install App2SD..."
if [ -f /system/bin/mot_boot_mode.bin ]
then
echo "mot_boot_mode.bin Exists."
if [ -d /system/bin/boot_script ]
then
cp app2sd_mount.sh /system/bin/boot_script
chmod 755 /system/bin/boot_script/app2sd_mount.sh
elif [ -f /system/bin/mot_boot_mode ]
then
echo "insmod /system/lib/modules/nilfs2.ko" >> /system/bin/mot_boot_mode
echo "mount -t nilfs2 /dev/block/mmcblk0p2 /system/sd" >> /system/bin/mot_boot_mode
echo "/system/xbin/nilfs_cleanerd /dev/block/mmcblk0p2" >> /system/bin/mot_boot_mode
fi
else
mv /system/bin/mot_boot_mode /system/bin/mot_boot_mode.bin
cp mot_boot_mode /system/bin
chmod 755 /system/bin/mot_boot_mode
fi
busybox cp -r /data/app /system/sd
busybox chmod 777 /system/sd/app
busybox cp -r /data/dalvik-cache /system/sd
busybox chmod 777 /system/sd/dalvik-cache
busybox cp -r /data/app-private /system/sd
busybox chmod 777 /system/sd/app-private
busybox mv /data/app /data/app1
busybox ln -s /system/sd/app /data/app
busybox mv /data/dalvik-cache /data/dalvik-cache1
busybox ln -s /system/sd/dalvik-cache /data/dalvik-cache
busybox mv /data/app-private /data/app-private1
busybox ln -s /system/sd/app-private /data/app-private
echo "App2SD OK! Do you want I/O patch? (y/n)"
read y
if [ $y = "y" ]
then
busybox cp -rp /data/data /system/sd/
busybox mv /data/data /data/data1
busybox ln -s /system/sd/data /data/data
echo "I/O patch OK!"
else
echo "I/O patch Canceled."
fi
echo "Reboot? (y/n)"
read y
if [ $y = "y" ]
then
echo "Rebooting... Please Wait..."
reboot
fi
exit 1

11
mot_boot_mode Normal file
View File

@ -0,0 +1,11 @@
#!/system/bin/sh
export PATH=/system/bin:$PATH
#run original script
mot_boot_mode.bin
#mount nilfs2
insmod /system/lib/modules/nilfs2.ko
mount -t nilfs2 /dev/block/mmcblk0p2 /system/sd
/system/xbin/nilfs_cleanerd /dev/block/mmcblk0p2

BIN
nilfs2.ko Normal file

Binary file not shown.

40
restore_app2sd.sh Normal file
View File

@ -0,0 +1,40 @@
#!/system/bin/sh
#scripted by gnh1201 at gmail dot com
echo "Restore App2SD NILFS2 for XT720"
echo "This script may damage your system. Continue? (y/n)"
read y
if [ $y != "y" ]
then
echo "Canceled."
exit 1
fi
echo "Please Wait..."
mount -t yaffs2 -o rw,remount /dev/block/mtdblock6 /system
busybox rm /data/app
busybox cp -r /system/sd/app /data
busybox chmod 777 /data/app
busybox rm /data/dalvik-cache
busybox cp -r /system/sd/dalvik-cache /data
busybox chmod 777 /data/dalvik-cache
busybox rm /data/app-private
busybox cp -r /system/sd/app-private /data
busybox chmod 777 /data/app-private
echo "OK. Reboot? (y/n)"
read y
if [ $y = "y" ]
then
echo "Rebooting... Please Wait..."
reboot
fi
exit 1

31
restore_io.sh Normal file
View File

@ -0,0 +1,31 @@
#!/system/bin/sh
#scripted by gnh1201 at gmail dot com
echo "Restore I/O App2SD NILFS2 for XT720"
echo "This script may damage your system. Continue? (y/n)"
read y
if [ $y != "y" ]
then
echo "Canceled."
exit 1
fi
echo "Please Wait..."
mount -t yaffs2 -o rw,remount /dev/block/mtdblock6 /system
busybox rm /data/data
busybox cp -rp /system/sd/data /data
echo "OK. Reboot? (y/n)"
read y
if [ $y = "y" ]
then
echo "Rebooting... Please Wait..."
reboot
fi
exit 1

BIN
xbin/mkfs.nilfs2 Normal file

Binary file not shown.

BIN
xbin/nilfs_cleanerd Normal file

Binary file not shown.