[PATCH] isar-installer: Fixing supervised image deployment in isar-installer when target device is not empty

11 views
Skip to first unread message

alexander...@siemens.com

unread,
Nov 15, 2024, 8:58:47 AM11/15/24
to isar-...@googlegroups.com, Alexander Heinisch
From: Alexander Heinisch <alexander...@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...@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

Uladzimir Bely

unread,
Nov 21, 2024, 1:50:26 AM11/21/24
to alexander...@siemens.com, isar-...@googlegroups.com
On Fri, 2024-11-15 at 14:58 +0100, alexander.heinisch via isar-users
wrote:
Applied to next, thanks.

--
Best regards,
Uladzimir.
Reply all
Reply to author
Forward
0 new messages