From: Géza Gémes Date: Sun, 19 Mar 2017 15:23:55 +0000 (+0100) Subject: Fix lopartsetup parsing of fdisk output X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=be736211f047c9a70e0fc9aafb8827add9612a1d;p=raisin.git Fix lopartsetup parsing of fdisk output Change lopartsetup in order to handle partitions, which have the boot flag enabled. Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini --- diff --git a/scripts/lopartsetup b/scripts/lopartsetup index bf33a28..04ce3cc 100755 --- a/scripts/lopartsetup +++ b/scripts/lopartsetup @@ -58,7 +58,11 @@ index=0 for i in "`fdisk -lu $filename 2>/dev/null | grep -e "^$filename"`" do index=$((index+1)) - offset=`echo $i | tr -s " " | cut -d " " -f 2` + offset=`echo "$i" | tr -s " " | cut -d " " -f 2` + if [[ "$offset" == "*" ]] + then + offset=`echo "$i" | tr -s " " | cut -d " " -f 3` + fi offset=$((unit*offset)) _create_loop_device "$filename" "$index" "$offset"