Get PNOR partition flags
Change-Id: Ie9a5606d64580390f1a024c36b986193ed3742d3
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/generate-squashfs b/generate-squashfs
index 3811378..e4c71ba 100755
--- a/generate-squashfs
+++ b/generate-squashfs
@@ -40,10 +40,19 @@
{
while read line; do
if [[ $line == "ID="* ]]; then
- # This line looks like "ID=05 MVPD 000d9000..00169000 (actual=00090000)"
+ # This line looks like
+ # "ID=05 MVPD 000d9000..00169000 (actual=00090000) [ECC]"
read -r -a fields <<< "$line"
- # Need the partition ID, name, start location, and end location
- echo "partition${fields[0]##*=}=${fields[1]},${fields[2]/../,}"
+
+ # Get any flags attached to end (e.g. [ECC])
+ flags=""
+ for flag in "${fields[@]:4}"
+ do
+ flags+=",${flag//[\[\]]/}"
+ done
+
+ # Need the partition ID, name, start location, end location, and flags
+ echo "partition${fields[0]##*=}=${fields[1]},${fields[2]/../,}${flags}"
# Save the partition name
partitions+=(${fields[1]})
fi