public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] isar-installer: Fixing supervised image deployment in isar-installer when target device is not empty
@ 2024-11-15 13:58 alexander.heinisch via isar-users
  2024-11-21  6:50 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: alexander.heinisch via isar-users @ 2024-11-15 13:58 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Heinisch

From: Alexander Heinisch <alexander.heinisch@siemens.com>

In supervised mode (!unattended) the check to override non empty
targets was combined with the check for unattended mode. Thus,
resulting in the wrong condition branch when the user  accepted
an override (closed dialog with 'Yes')
In such case the script was assuming similar behaviour like in
unattended mode, thus evaluating the installer_target_overwrite check,
which in that case is neither set via kernel cmdline nor via
auto.install file.

Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
---
 .../deploy-image/files/usr/bin/deploy-image-wic.sh       | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh b/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh
index 91c0518b..7f552eee 100755
--- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh
@@ -125,10 +125,11 @@ if ! $installer_unattended; then
 fi
 
 if ! cmp /dev/zero "$installer_target_dev" -n 1M; then
-    if ! $installer_unattended && \
-       ! dialog --defaultno \
-                --yesno "WARNING: Target device is not empty! Continue anyway?" 5 60; then
-        exit 0
+    if ! $installer_unattended; then
+        if ! dialog --defaultno \
+                    --yesno "WARNING: Target device is not empty! Continue anyway?" 5 60; then
+            exit 0
+        fi
     else
         if [ "$installer_target_overwrite" != "OVERWRITE" ]; then
             echo "Target device is not empty! -> Abort"
-- 
2.43.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20241115135809.599705-1-alexander.heinisch%40siemens.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] isar-installer: Fixing supervised image deployment in isar-installer when target device is not empty
  2024-11-15 13:58 [PATCH] isar-installer: Fixing supervised image deployment in isar-installer when target device is not empty alexander.heinisch via isar-users
@ 2024-11-21  6:50 ` Uladzimir Bely
  0 siblings, 0 replies; 2+ messages in thread
From: Uladzimir Bely @ 2024-11-21  6:50 UTC (permalink / raw)
  To: alexander.heinisch, isar-users

On Fri, 2024-11-15 at 14:58 +0100, alexander.heinisch via isar-users
wrote:
> From: Alexander Heinisch <alexander.heinisch@siemens.com>
> 
> In supervised mode (!unattended) the check to override non empty
> targets was combined with the check for unattended mode. Thus,
> resulting in the wrong condition branch when the user  accepted
> an override (closed dialog with 'Yes')
> In such case the script was assuming similar behaviour like in
> unattended mode, thus evaluating the installer_target_overwrite
> check,
> which in that case is neither set via kernel cmdline nor via
> auto.install file.
> 
> Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
> ---
>  .../deploy-image/files/usr/bin/deploy-image-wic.sh       | 9 +++++--
> --
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/meta-isar/recipes-installer/deploy-
> image/files/usr/bin/deploy-image-wic.sh b/meta-isar/recipes-
> installer/deploy-image/files/usr/bin/deploy-image-wic.sh
> index 91c0518b..7f552eee 100755
> --- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-
> image-wic.sh
> +++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-
> image-wic.sh
> @@ -125,10 +125,11 @@ if ! $installer_unattended; then
>  fi
>  
>  if ! cmp /dev/zero "$installer_target_dev" -n 1M; then
> -    if ! $installer_unattended && \
> -       ! dialog --defaultno \
> -                --yesno "WARNING: Target device is not empty!
> Continue anyway?" 5 60; then
> -        exit 0
> +    if ! $installer_unattended; then
> +        if ! dialog --defaultno \
> +                    --yesno "WARNING: Target device is not empty!
> Continue anyway?" 5 60; then
> +            exit 0
> +        fi
>      else
>          if [ "$installer_target_overwrite" != "OVERWRITE" ]; then
>              echo "Target device is not empty! -> Abort"
> -- 
> 2.43.0
> 

Applied to next, thanks.

-- 
Best regards,
Uladzimir.

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/09cf697b726d18420efbc67ad667e7ae84ec0aaf.camel%40ilbers.de.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-21  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-15 13:58 [PATCH] isar-installer: Fixing supervised image deployment in isar-installer when target device is not empty alexander.heinisch via isar-users
2024-11-21  6:50 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox