Skip to content

Commit

Permalink
Support for exfat added to kernel, now waiting for roms devs;)
Browse files Browse the repository at this point in the history
Reworked partition check and tuning
Removed autofix partitions and added warning after boot to let user fix manualy the
partitions
Fixed Stweaks Partition scan
Commit computoncio/Dorimanx-SG2-I9100-Kernel@36a4223 needed because binaries are in kernel zip and they are copied to /system/bin when flashing the kernel.
Then they are copied to /sbin when /sbin/init runs because /system is not mounted in tunning
and fixing partitions
  • Loading branch information
computoncio committed Apr 27, 2014
1 parent 31eb8a7 commit 26a33b6
Show file tree
Hide file tree
Showing 11 changed files with 364 additions and 313 deletions.
10 changes: 5 additions & 5 deletions res/customconfig/actions/push-actions/partitions_scan
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
$BB mount -o remount,rw /;

echo "DATA Partition" > /tmp/storage_check;
$BB sh -c "/sbin/tune2fs -l /res/dev/data | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs.static -l /res/dev/data | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
echo "SYSTEM Partition" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs -l /res/dev/system | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs.static -l /res/dev/system | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
echo "CACHE Partition" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs -l /res/dev/cache | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs.static -l /res/dev/cache | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
echo "EFS Partition" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs -l /dev/block/mmcblk0p1 | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs.static -l /dev/block/mmcblk0p1 | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
echo "Preloaded Partition" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs -l /dev/block/mmcblk0p12 | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
$BB sh -c "/sbin/tune2fs.static -l /dev/block/mmcblk0p12 | grep 'Filesystem state' | cut -c 27-44" >> /tmp/storage_check;
)&

sleep 2;
Expand Down
4 changes: 2 additions & 2 deletions res/misc/JellyB-CM-AOKP-10.1/init.smdk4210.rc.2
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ on init

on fs
# verify filesystem (UMS)
exec sformat /dev/block/mmcblk0p11 vfat
exec sformat /dev/block/mmcblk0p11 %TYPE%

# make sure sdcard is mounted because we may have our data and cache partitions on it
mount vfat /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8
mount %TYPE% /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8

# mount partitions.
mount ext4 loop@/res/dev/cache /cache nosuid nodev wait
Expand Down
2 changes: 1 addition & 1 deletion res/misc/JellyB-CM-AOKP-10.2/fstab.goldfish
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
/dev/block/mtdblock0 /system ext4 ro,barrier=1 wait
/dev/block/mtdblock1 /data ext4 noatime,nosuid,nodev,barrier=1,nomblk_io_submit wait,check
/dev/block/mtdblock2 /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
/devices/platform/goldfish_mmc.0 /storage/sdcard vfat defaults voldmanaged=sdcard:auto
/devices/platform/goldfish_mmc.0 /storage/sdcard auto defaults voldmanaged=sdcard:auto
4 changes: 2 additions & 2 deletions res/misc/JellyB-CM-AOKP-10.2/init.smdk4210.rc.2
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ on init

on fs
# verify filesystem (UMS)
exec sformat /dev/block/mmcblk0p11 vfat
exec sformat /dev/block/mmcblk0p11 %TYPE%

# make sure sdcard is mounted because we may have our data and cache partitions on it
mount vfat /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8
mount %TYPE% /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8

# mount partitions.
mount ext4 loop@/res/dev/cache /cache nosuid nodev wait
Expand Down
4 changes: 2 additions & 2 deletions res/misc/JellyB-Sammy/init.smdk4210.rc.2
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ on boot

on fs
# verify filesystem (UMS)
exec sformat /dev/block/mmcblk0p11 vfat
exec sformat /dev/block/mmcblk0p11 %TYPE%

# make sure sdcard is mounted because we may have our data and cache partitions on it
mount vfat /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8
mount %TYPE% /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8

# Mount all
mount ext4 loop@/res/dev/cache /cache nosuid nodev wait
Expand Down
10 changes: 5 additions & 5 deletions res/misc/KitKat-CM-AOKP-11/fstab.smdk4210.sec
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# data partition must be located at the bottom for supporting device encryption

# vold-managed volumes ("block device" is actually a sysfs devpath)
/devices/platform/dw_mmc/mmc_host/mmc0/mmc0 auto vfat defaults voldmanaged=sdcard0:11,nonremovable
/devices/platform/s3c-sdhci.2/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
/devices/platform/s3c_otghcd/usb auto auto defaults voldmanaged=usbdisk0:auto
/devices/platform/dw_mmc/mmc_host/mmc0/mmc0 auto auto defaults voldmanaged=sdcard0:11,nonremovable
/devices/platform/s3c-sdhci.2/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
/devices/platform/s3c_otghcd/usb auto auto defaults voldmanaged=usbdisk0:auto

# kernel mount path
/dev/block/mmcblk0p5 /boot emmc defaults recoveryonly
/dev/block/mmcblk0p6 /recovery emmc defaults recoveryonly
/dev/block/mmcblk0p5 /boot emmc defaults recoveryonly
/dev/block/mmcblk0p6 /recovery emmc defaults recoveryonly
6 changes: 3 additions & 3 deletions res/misc/KitKat-CM-AOKP-11/init.smdk4210.rc.2
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ on init

on fs
# verify filesystem (UMS)
exec sformat /dev/block/mmcblk0p11 vfat

exec sformat /dev/block/mmcblk0p11 %TYPE%
# make sure sdcard is mounted because we need apps2sd to work and we may have our data and cache partitions on it
mount vfat /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8
mount %TYPE% /dev/block/mmcblk0p11 /mnt/.secondrom wait utf8
mkdir /mnt/.secondrom/.android_secure 0700 root root
mkdir /mnt/.secondrom/.secondrom 0700 root root

Expand Down
14 changes: 7 additions & 7 deletions res/recovery.fstab
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# mount point fstype device device2
/cache ext4 /dev/block/mmcblk0p7
/system ext4 /dev/block/mmcblk0p9
/data ext4 /dev/block/mmcblk0p10 length=-16384
/preload ext4 /dev/block/mmcblk0p12
/sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
/sdcard1 vfat /dev/block/mmcblk0p11
# mount point fstype device device2
/cache ext4 /dev/block/mmcblk0p7
/system ext4 /dev/block/mmcblk0p9
/data ext4 /dev/block/mmcblk0p10 length=-16384
/preload ext4 /dev/block/mmcblk0p12
/sdcard auto /dev/block/mmcblk1p1 /dev/block/mmcblk1
/sdcard1 auto /dev/block/mmcblk0p11
35 changes: 0 additions & 35 deletions sbin/ext/system_tune_on_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,6 @@ $BB chmod 0744 /proc/cmdline;
$BB chmod -R 0770 /data/property/;
$BB chmod -R 0400 /data/tombstones;

LOG_SDCARDS=/log-sdcards
FIX_BINARY=/sbin/fsck_msdos

SDCARD_FIX()
{
# fixing sdcards
$BB date > $LOG_SDCARDS;
$BB echo "FIXING STORAGE" >> $LOG_SDCARDS;

if [ -e /dev/block/mmcblk1p1 ]; then
$BB echo "EXTERNAL SDCARD CHECK" >> $LOG_SDCARDS;
$BB cp /sbin/libexfat_utils.so /system/lib/;
$BB mount -t exfat /dev/block/mmcblk1p1 /mnt/tmp;
EXFAT_CHECK=$(cat /proc/self/mounts | grep "/dev/block/mmcblk1p1" | wc -l);
if [ "$EXFAT_CHECK" -eq "1" ]; then
$BB sh -c "/sbin/fsck.exfat -R /dev/block/mmcblk1p1" >> $LOG_SDCARDS;
$BB umount /mnt/tmp;
else
$BB sh -c "$FIX_BINARY -p -f /dev/block/mmcblk1p1" >> $LOG_SDCARDS;
fi;
else
$BB echo "EXTERNAL SDCARD NOT EXIST" >> $LOG_SDCARDS;
fi;

$BB echo "INTERNAL SDCARD CHECK" >> $LOG_SDCARDS;
$BB sh -c "$FIX_BINARY -p -f /dev/block/mmcblk0p11" >> $LOG_SDCARDS;
$BB echo "DONE" >> $LOG_SDCARDS;
}

BOOT_ROM()
{
Expand All @@ -88,12 +60,5 @@ if [ -e /tmp/wrong_kernel ]; then
sync;
reboot;
else
if [ -e /system/bin/fsck_msdos ]; then
FIX_BINARY=/system/bin/fsck_msdos
BOOT_ROM;
SDCARD_FIX;
else
BOOT_ROM;
SDCARD_FIX;
fi;
fi;

0 comments on commit 26a33b6

Please sign in to comment.