#!/system/bin/sh
: '
 ============ Copyright (C) 2010 Jared Rummler (JRummy16) ============
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 =====================================================================
'

DIR=/data/PACLogs
LOG=$DIR/tweaks.log
cfg_file=/system/etc/init.d.cfg
script_helpers=/system/etc/helpers.sh

if [ ! -e $DIR ]; then
	mkdir $DIR;
fi;

if [ -e $LOG ]; then
	rm $LOG;
fi;

. $script_helpers

if busybox [ ! -e $cfg_file ]; then
	sysrw
	cat > $cfg_file << EOF
# ============ Copyright (C) 2010 Jared Rummler (JRummy16) ============
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# 
# =====================================================================

# libraries
script_helpers=/system/etc/helpers.sh

# booleans
zipalign_apks=false
fix_permissions=false
enable_sysctl=false
free_mem=false
clear_data_cache=false
enable_cron=false
sd_boost=false
file_system_speedups=false
battery=false
touch=false
minfree=false
gpurender=false
sleepers=false
journalism=false
sqlite3=false
wifisleep=false
iostats=false
sentrenice=false
tweaks=false
speedy_modified=false
loopy_smoothness_tweak=false

# files
sysctl_conf=/system/etc/sysctl.conf

# memory thresholds
foreground_app_mem=2048
visible_app_mem=3072
perceptible_app_mem=4096
heavy_weight_app_mem=4096
secondary_server_mem=6144
backup_app_mem=6144
home_app_mem=6144
hidden_app_mem=7168
empty_app_mem=8192

# sd boost value
read_ahead_kb=2048

EOF
	sysro
fi;

echo "PACman ROM Tweaks Starting At $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG;
