diff options
-rw-r--r-- | pnor_partition_table.cpp | 18 | ||||
-rw-r--r-- | test/vpnor/Makefile.am.include | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/pnor_partition_table.cpp b/pnor_partition_table.cpp index 19bee87..67b32f1 100644 --- a/pnor_partition_table.cpp +++ b/pnor_partition_table.cpp @@ -222,17 +222,26 @@ static inline void writeUserdata(pnor_partition& part, uint32_t version, std::istringstream stream(data); std::string flag{}; auto perms = 0; + auto state = 0; + MSG_DBG("Parsing ToC flags '%s'\n", data.c_str()); while (std::getline(stream, flag, ',')) { + if (flag == "") + continue; + if (flag == "ECC") { - part.data.user.data[0] = PARTITION_ECC_PROTECTED; + state |= PARTITION_ECC_PROTECTED; } else if (flag == "READONLY") { perms |= PARTITION_READONLY; } + else if (flag == "READWRITE") + { + perms &= ~PARTITION_READONLY; + } else if (flag == "PRESERVED") { perms |= PARTITION_PRESERVED; @@ -249,10 +258,15 @@ static inline void writeUserdata(pnor_partition& part, uint32_t version, { perms |= PARTITION_CLEARECC; } + else + { + MSG_INFO("Found unimplemented partition property: %s\n", + flag.c_str()); + } } + part.data.user.data[0] = state; part.data.user.data[1] = perms; - part.data.user.data[1] |= version; } diff --git a/test/vpnor/Makefile.am.include b/test/vpnor/Makefile.am.include index 4defe01..2a39ae1 100644 --- a/test/vpnor/Makefile.am.include +++ b/test/vpnor/Makefile.am.include @@ -121,6 +121,4 @@ check_PROGRAMS += \ %reldir%/toc_no_end \ %reldir%/toc_no_version \ %reldir%/toc_flags - -XFAIL_TESTS += %reldir%/toc_flags endif |