Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/install_bln.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ backup="/system/lib/hw/$filename-backup-"`date '+%Y-%m-%d_%H-%M-%S'`

install_condition()
{
test -d "/system/lib/hw/"
test -d "/system/lib/hw/" && test -d "/sys/class/misc/backlightnotification"
}

extension_install_bln()
Expand All @@ -42,5 +42,5 @@ if install_condition; then
log "$name already installed"
fi
else
log "$name cannot be installed"
log "$name cannot be installed or is not supported"
fi
53 changes: 53 additions & 0 deletions extensions/update_vold.fstab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Voodoo lagfix extension

name='updated vold configuration file'
dest='/system/etc/vold.fstab'

extension_update_old_froyo_voldfstab()
{
# downgrade vold.fstab conditionnaly
for z in /voodoo/extensions/vold_fstabs/*; do
if cmp /system/etc/vold.fstab "$z"/new_froyo_vold.fstab; then
cp "$z"/old_froyo_vold.fstab $dest
extension_post_install_voldfstab
fi
done
}

extension_update_new_froyo_voldfstab()
{
# upgrade vold.fstab conditionnaly
for z in /voodoo/extensions/vold_fstabs/*; do
if cmp /system/etc/vold.fstab "$z"/old_froyo_vold.fstab; then
cp "$z"/new_froyo_vold.fstab $dest
extension_post_install_voldfstab
fi
done
}

extension_post_install_voldfstab()
{
# make sure it's owned by root
chown 0.0 $dest
# sets the permissions
chmod 644 $dest
log "$name now installed"
}

install_condition()
{
test -f "/system/etc/vold.fstab"
}


if install_condition; then

# test for old Samsung 2.2 kernels
if test -f /sys/devices/platform/s3c-usbgadget/gadget/lun2/file; then
extension_update_old_froyo_voldfstab
elif test -f /sys/devices/platform/s3c-usbgadget/gadget/lun0/file; then
extension_update_new_froyo_voldfstab
fi
else
echo "not installing $name"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Vold 2.0 Generic fstab
## - San Mehat (san@android.com)
##

#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
## mount_point - Where the volume will be mounted
## part - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################

## Example of a standard sdcard mount for the emulator / Dream
# Mounts the first usable partition of the specified device
#dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1

## Example of a dual card setup
# dev_mount left_sdcard /sdcard1 auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
# dev_mount right_sdcard /sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/msm_sdcc.3/mmc_host/mmc1

## Example of specifying a specific partition for mounts
# dev_mount sdcard /sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1

# sdcard mount for the P1
# internal sdcard
{
mount_deep = 0
ums_path = /sys/devices/platform/s3c-usbgadget/gadget/lun0/file
asec = disable
mbr_policy = skip
}
dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0

# externel sdcard
{
mount_deep = 1
ums_path = /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
asec = enable
mbr_policy = overwrite
}
dev_mount sdcard1 /mnt/sdcard/external_sd auto /devices/platform/s3c-sdhci.2/mmc_host/mmc2
#keep this line.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Vold 2.0 Generic fstab
## - San Mehat (san@android.com)
##

#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
## mount_point - Where the volume will be mounted
## part - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################

## Example of a standard sdcard mount for the emulator / Dream
# Mounts the first usable partition of the specified device
#dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1

## Example of a dual card setup
# dev_mount left_sdcard /sdcard1 auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
# dev_mount right_sdcard /sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/msm_sdcc.3/mmc_host/mmc1

## Example of specifying a specific partition for mounts
# dev_mount sdcard /sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1

# sdcard mount for the P1
# internal sdcard
{
mount_deep = 0
ums_path = /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
asec = disable
mbr_policy = skip
}
dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0

# externel sdcard
{
mount_deep = 1
ums_path = /sys/devices/platform/s3c-usbgadget/gadget/lun2/file
asec = enable
mbr_policy = overwrite
}
dev_mount sdcard1 /mnt/sdcard/external_sd auto /devices/platform/s3c-sdhci.2/mmc_host/mmc2
2 changes: 1 addition & 1 deletion multiboot_injector/generate_multiboot_ramdisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ tar xf ../../../lagfix/stages_builder/stages/stage1.tar


# clean git stuff
find -name '.git*' -exec rm {} \;
find -name '.git*' -exec rm -rf {} \;

# write the autodetect init script

Expand Down
4 changes: 1 addition & 3 deletions voodoo_initramfs_parts/configs/partitions
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# declaration of partition common for every model
dbdata_partition='/dev/block/stl10'
cache_partition='/dev/block/stl11'
system_partition='/dev/block/stl9'
data_on_emmc=1
Binary file not shown.
Binary file not shown.
Binary file added voodoo_initramfs_parts/partition_tables/charge
Binary file not shown.
Binary file added voodoo_initramfs_parts/partition_tables/continuum
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions voodoo_initramfs_parts/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# o Verizon Fascinate #
# o USCC Mesmerize #
# o Cellular South Showcase #
# o Verizon Galaxy Tablet #
# #
# Copyright Francois Simond 2010 (supercurio @ xda-developers) #
# credits to gilsken for ideas and support #
Expand Down
95 changes: 76 additions & 19 deletions voodoo_initramfs_parts/scripts/init_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ get_partition_for()
data) partition=$data_partition ;;
system) partition=$system_partition ;;
esac

if test "$partition" = ""; then
# This device doesn't use $1 partition
return 1
fi
}


Expand Down Expand Up @@ -40,7 +45,7 @@ set_fs_for()

mount_()
{
get_partition_for $1
get_partition_for $1 || return 1
get_fs_for $1

if test "$fs" = "ext4"; then
Expand All @@ -51,7 +56,13 @@ mount_()
# MoviNAND hardware support barrier, it allows to activate
# the journal option data=ordered and stay free from corruption
# even in worst cases
data) ext4_data_options=',data=ordered,barrier=1' ;;
data)
if test "$data_on_emmc" = 1; then
ext4_data_options=',data=ordered,barrier=1'
else
ext4_data_options=',nodelalloc,data=ordered,barrier=0'
fi
;;
# dbdata device don't support barrier. Delayed allocations
# are unsafe and must be deactivated
dbdata) ext4_data_options=',data=ordered,nodelalloc' ;;
Expand Down Expand Up @@ -173,16 +184,49 @@ detect_supported_model_and_setup_partitions()
log "model detected: $model"

# fascinate/mesmerize/showcase are different here
if test "$model" = 'fascinate' || test "$model" = 'mesmerize-showcase'; then
if test "$model" = 'fascinate' || test "$model" = 'mesmerize-showcase' || test "$model" = 'continuum'; then
sdcard_device='/dev/block/mmcblk1p1'
data_partition='/dev/block/mmcblk0p1'
dbdata_partition='/dev/block/stl10'
cache_partition='/dev/block/stl11'
system_partition='/dev/block/stl9'
# vzw galaxytab is different here
elif test "$model" = 'galaxytab-vzw'; then
sdcard_device='/dev/block/mmcblk1p1'
data_partition='/dev/block/mmcblk0p2'
dbdata_partition='/dev/block/stl10'
cache_partition='/dev/block/mmcblk0p1'
system_partition='/dev/block/stl9'
# /data on OneNAND for GalaxyS4G is different here
# and also no dbdata
elif test "$model" = 'tmo-vibrant-galaxys4g'; then
data_on_emmc=0
sdcard_device='/dev/block/mmcblk0p1'
data_partition='/dev/block/stl10'
dbdata_partition=''
cache_partition='/dev/block/stl11'
system_partition='/dev/block/stl9'
# All partitions are different on the DROID Charge
# compared to all other SGS devices.
# (ie. Samsung Stealth, SCH-I510)
elif test "$model" = 'charge'; then
sdcard_device='/dev/block/mmcblk1p1'
data_partition='/dev/block/mmcblk0p1'
dbdata_partition='/dev/block/stl11'
cache_partition='/dev/block/mmcblk0p3'
system_partition='/dev/block/stl10'
else
# for every other model
data_partition='/dev/block/mmcblk0p2'
sdcard_device='/dev/block/mmcblk0p1'
data_partition='/dev/block/mmcblk0p2'
dbdata_partition='/dev/block/stl10'
cache_partition='/dev/block/stl11'
system_partition='/dev/block/stl9'
fi
echo "data_partition='$data_partition'" >> /voodoo/configs/partitions

echo "dbdata_partition='$dbdata_partition'" >> /voodoo/configs/partitions
echo "cache_partition='$cache_partition'" >> /voodoo/configs/partitions
echo "system_partition='$system_partition'" >> /voodoo/configs/partitions
else
return 1
fi
Expand All @@ -192,7 +236,7 @@ detect_supported_model_and_setup_partitions()
detect_fs_on()
{
resource=$1
get_partition_for $resource
get_partition_for $resource || return 1
log "filesystem detection on $resource:"
if tune2fs -l $partition 1>&2; then
# we found an ext2/3/4 partition. but is it real ?
Expand Down Expand Up @@ -370,7 +414,7 @@ check_available_space()
if test $dest_fs = ext4; then
log "check Ext4 additionnal disk usage for $resource" 1
case $resource in
system) overhead=2 ;;
system) overhead=1 ;;
data) overhead=40 ;;
dbdata) overhead=20 ;;
cache) overhead=0 ;; # cache? don't care
Expand Down Expand Up @@ -432,16 +476,17 @@ rfs_format()

ext4_format()
{
common_mkfs_ext4_options='^resize_inode,^ext_attr,^huge_file'
common_mkfs_ext4_options='^extent,^flex_bg,^uninit_bg,^has_journal'
case $resource in
system) mkfs_options="-O $common_mkfs_ext4_options,^has_journal" ;;
cache) mkfs_options="-O $common_mkfs_ext4_options -J size=4" ;;
data) mkfs_options="-O $common_mkfs_ext4_options -J size=32" ;;
dbdata) mkfs_options="-O $common_mkfs_ext4_options -J size=16" ;;
# tune system inode number to fit available space in RFS and Ext4
system) mkfs_options="-O $common_mkfs_ext4_options,^large_file -L SYSTEM -b 4096 -m 0 -F" ;;
cache) mkfs_options="-O $common_mkfs_ext4_options -L CACHE -b 4096 -m 0 -F" ;;
data) mkfs_options="-O $common_mkfs_ext4_options -L DATA -b 4096 -m 0 -F" ;;
dbdata) mkfs_options="-O $common_mkfs_ext4_options,^large_file -L DATADATA -b 4096 -m 0 -F" ;;
esac
mkfs.ext4 -F $mkfs_options -T default $partition
# force check the filesystem after 100 mounts or 100 days
tune2fs -c 100 -i 100d -m 0 $partition
tune2fs -c 100 -i 100d -m 0 -L $resource $partition
}


Expand Down Expand Up @@ -517,7 +562,7 @@ convert()
test tell_conversion_happened = '' && tell_conversion_happened=0

# use global getters
get_partition_for $resource
get_partition_for $resource || return 1
get_fs_for $resource

source_fs=$fs
Expand All @@ -534,7 +579,13 @@ convert()
fi

# read the battery level
battery_level=`cat /sys/devices/platform/jupiter-battery/power_supply/battery/capacity`
if test "$model" = 'fascinate' || test "$model" = 'mesmerize-showcase' || test "$model" = 'continuum' || test "$model" = 'charge'; then
battery_level=`cat /sys/devices/platform/sec-battery/power_supply/battery/capacity`
elif test "$model" = 'galaxytab-vzw'; then
battery_level=`cat /sys/devices/platform/p1-battery/power_supply/battery/capacity`
else
battery_level=`cat /sys/devices/platform/jupiter-battery/power_supply/battery/capacity`
fi
log "battery level: $battery_level%"

if test "$battery_level" -lt 10 && test $resource != cache && test $resource != dbdata; then
Expand Down Expand Up @@ -728,11 +779,17 @@ finalize_interrupted_rfs_conversion()
archive=/sdcard/voodoo_"$resource"_conversion.tar.lzo
archive_ignored=/sdcard/voodoo_"$resource"_conversion_ignored.tar.lzo

# check if the /system archive is there and is more than 20MB
# check if an archive is there and is more than min_size
if test -f $archive; then

# /system is already mounted but not other resources
test $resource != system && mount_ $resource
# make sure /system is always unmounted
umount /system 2>/dev/null

# make sure the partition contains a valid filesystem or
# format to RFS in case of problem with Ext4 modules
if ! mount_ $resource; then
rfs_format $resource
fi

# check if the resource partition is empty (or at contains less than $min_size of data)
if test `du -s /$resource | cut -d/ -f1` -lt $min_size; then
Expand Down Expand Up @@ -834,7 +891,7 @@ get_cwm_fstab_mount_option_for()
generate_cwm_fstab()
{
for x in cache datadata data system; do
get_partition_for $x
get_partition_for $x || continue
get_fs_for $x
get_cwm_fstab_mount_option_for $fs
echo "$partition /$x $fs $cwm_mount_options" >> /voodoo/run/cwm.fstab
Expand Down
5 changes: 3 additions & 2 deletions voodoo_initramfs_parts/scripts/init_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ insmod /lib/modules/rfs_fat.ko


# insmod Ext4 modules for injected initramfs without Ext4 driver builtin
test -f /lib/modules/crc16.ko && insmod /lib/modules/crc16.ko
test -f /lib/modules/jbd2.ko && insmod /lib/modules/jbd2.ko
test -f /lib/modules/ext4.ko && insmod /lib/modules/ext4.ko

Expand Down Expand Up @@ -68,8 +69,8 @@ mount_attemps=5
while test $sdcard_is_mounted = 0 && test $mount_attemps -gt 0; do
sleep $wait

if test "`cat /sys/block/mmcblk0/size`" = 3907584; then
sdcard_dev=/dev/block/mmcblk1p1 # we are on fascinate/mesmerize/showcase
if test "`cat /sys/block/mmcblk0/size`" = 3907584 || test "`cat /sys/block/mmcblk0/size`" = 3825664; then
sdcard_dev=/dev/block/mmcblk1p1 # we are on fascinate/mesmerize/showcase/vzw-galaxytab
else
sdcard_dev=/dev/block/mmcblk0p1 # every other Galaxy S
fi
Expand Down
2 changes: 1 addition & 1 deletion voodoo_initramfs_parts/scripts/mount_wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
echo "mount command: $0 $*" > /voodoo/logs/mount_wrapper_log.txt
if test "$2" = 'auto' || test "$2" = 'rfs'; then
/bin/mount -t ext4 -o noatime,barrier=0,data=ordered $4 $5 || /bin/mount $*
/bin/mount -t ext4 -o noatime,barrier=1,data=ordered,nodelalloc $4 $5 || /bin/mount $*
else
/bin/mount $*
fi
Loading