[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 02/11] Fix lopartsetup parsing of fdisk output



On Sun, 19 Mar 2017, Géza Gémes wrote:
> Change lopartsetup in order to handle partitions, which have the
> boot flag enabled.
> 
> Signed-off-by: Géza Gémes <geza.gemes@xxxxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


> ---
>  scripts/lopartsetup | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> 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"
> -- 
> 2.7.4
> 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.