From 68cab49d96a3bc3636fbb9e7238b78f0b7ed1613 Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Wed, 12 Dec 2012 19:29:35 +0000 Subject: Add ignore blkid flag for Transformers Change-Id: I8f2b5b68a8c3ede74858d53002efab997174ee65 --- partition.cpp | 8 ++++++-- partitionmanager.cpp | 2 ++ partitions.hpp | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/partition.cpp b/partition.cpp index dd8d3b3aa..32376c1bc 100644 --- a/partition.cpp +++ b/partition.cpp @@ -82,6 +82,7 @@ TWPartition::TWPartition(void) { Current_File_System = ""; Fstab_File_System = ""; Format_Block_Size = 0; + Ignore_Blkid = false; } TWPartition::~TWPartition(void) { @@ -152,6 +153,7 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) { // Custom flags, save for later so that new values aren't overwritten by defaults ptr += 6; Flags = ptr; + Process_Flags(Flags, Display_Error); } else if (strlen(ptr) == 4 && (strncmp(ptr, "NULL", 4) == 0 || strncmp(ptr, "null", 4) == 0 || strncmp(ptr, "null", 4) == 0)) { // Do nothing } else { @@ -333,6 +335,8 @@ bool TWPartition::Process_Flags(string Flags, bool Display_Error) { ptr += 13; Is_SubPartition = true; SubPartition_Of = ptr; + } else if (strcmp(ptr, "ignoreblkid") == 0) { + Ignore_Blkid = true; } else if (strlen(ptr) > 8 && strncmp(ptr, "symlink=", 8) == 0) { ptr += 8; Symlink_Path = ptr; @@ -881,8 +885,8 @@ void TWPartition::Check_FS_Type() { char* arg; char* ptr; - if (Fstab_File_System == "yaffs2" || Fstab_File_System == "mtd" || Fstab_File_System == "bml") - return; // Running blkid on some mtd devices causes a massive crash + if (Fstab_File_System == "yaffs2" || Fstab_File_System == "mtd" || Fstab_File_System == "bml" || Ignore_Blkid) + return; // Running blkid on some mtd devices causes a massive crash or needs to be skipped Find_Actual_Block_Device(); if (!Is_Present) diff --git a/partitionmanager.cpp b/partitionmanager.cpp index d845f74e2..536e86780 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -160,6 +160,8 @@ void TWPartitionManager::Output_Partition(TWPartition* Part) { printf("Has_Android_Secure "); if (Part->Is_Storage) printf("Is_Storage "); + if (Part->Ignore_Blkid) + printf("Ignore_Blkid "); printf("\n"); if (!Part->SubPartition_Of.empty()) printf(" SubPartition_Of: %s\n", Part->SubPartition_Of.c_str()); diff --git a/partitions.hpp b/partitions.hpp index a74a5a459..2c3ad7180 100644 --- a/partitions.hpp +++ b/partitions.hpp @@ -106,6 +106,7 @@ protected: string Storage_Path; // Indicates the path to the storage -- root indicates mount point, media/ indicates e.g. /data/media string Fstab_File_System; // File system from the recovery.fstab int Format_Block_Size; // Block size for formatting + bool Ignore_Blkid; // Ignore blkid results due to superblocks lying to us on certain devices / partitions private: bool Process_Flags(string Flags, bool Display_Error); // Process custom fstab flags -- cgit v1.2.3