Hi Stefano,
Unfortunately, the patch has an other typo too. Please see below:
On Fri, 24 Mar 2017, Géza Gémes wrote:
fdisk from util-linux >= 2.27.1 returns units in a slightly different
structure than earlier versions
Signed-off-by: Géza Gémes <geza.ge...@gmail.com>
---
scripts/lopartsetup | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/scripts/lopartsetup b/scripts/lopartsetup
index 04ce3cc..b675e03 100755
--- a/scripts/lopartsetup
+++ b/scripts/lopartsetup
@@ -53,7 +53,23 @@ then
exit 1
fi
-unit="`fdisk -lu $filename 2>/dev/null | grep -e "^Units = " | cut -d " " -f 9`"
+unitstring=""
+column=0
+if [ `fdisk -lu $filename 2>/dev/null | grep -e "^Units = " | wc -l` -eq 1 ]
+then
+ unitstring="^Units = "
+ column=9
+else if [ `fdisk -lu $filename 2>/dev/null | grep -e "^Units:" | wc -l` -eq 1 ]
this should have been elif [ `fdisk -lu $filename 2>/dev/null | grep -e
"^Units:" | wc -l` -eq 1 ]
+then
+ unitstring="^Units:"
+ column=8
+else
+ exit 1
+fi
+fi
two fi?
Aside from that, the patch looks good, so I fixed it myself and
committed it.
+unit="`fdisk -lu $filename 2>/dev/null | grep -e "$unitstring" | cut -d " " -f
$column`"
+
index=0
for i in "`fdisk -lu $filename 2>/dev/null | grep -e "^$filename"`"
do
--
2.7.4
I'll send a patch fixing this in a couple of seconds.
Cheers,
Geza
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel