diff mbox series

[1/1] diskpart: disable fdisk dialog driven partitioning

Message ID 20210513071311.84629-1-james.hilliard1@gmail.com
State Accepted
Headers show
Series [1/1] diskpart: disable fdisk dialog driven partitioning | expand

Commit Message

James Hilliard May 13, 2021, 7:13 a.m. UTC
Since we don't support dialog driven partitioning we should ensure
it is disabled as it can cause failures under some circumstances.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 handlers/diskpart_handler.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Stefano Babic May 13, 2021, 9:34 a.m. UTC | #1
On 13.05.21 09:13, James Hilliard wrote:
> Since we don't support dialog driven partitioning we should ensure
> it is disabled as it can cause failures under some circumstances.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>   handlers/diskpart_handler.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
> index 65010c1..641c6f9 100644
> --- a/handlers/diskpart_handler.c
> +++ b/handlers/diskpart_handler.c
> @@ -194,6 +194,16 @@ static int diskpart(struct img_type *img,
>   		return -ENOMEM;
>   	}
>   
> +	/*
> +	 * The library uses dialog driven partitioning by default.
> +	 * Disable as we don't support interactive dialogs.
> +	 */
> +	ret = fdisk_disable_dialogs(cxt, 1);
> +	if (ret) {
> +		ERROR("Failed to disable dialogs");
> +		goto handler_release;
> +	}
> +
>   	ret = fdisk_assign_device(cxt, img->device, 0);
>   	if (ret == -EACCES) {
>   		ERROR("no access to %s", img->device);
> 

Reviewed-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
index 65010c1..641c6f9 100644
--- a/handlers/diskpart_handler.c
+++ b/handlers/diskpart_handler.c
@@ -194,6 +194,16 @@  static int diskpart(struct img_type *img,
 		return -ENOMEM;
 	}
 
+	/*
+	 * The library uses dialog driven partitioning by default.
+	 * Disable as we don't support interactive dialogs.
+	 */
+	ret = fdisk_disable_dialogs(cxt, 1);
+	if (ret) {
+		ERROR("Failed to disable dialogs");
+		goto handler_release;
+	}
+
 	ret = fdisk_assign_device(cxt, img->device, 0);
 	if (ret == -EACCES) {
 		ERROR("no access to %s", img->device);