From b5c4399a1cb9f7819c4601666ff3df0d7a61aea1 Mon Sep 17 00:00:00 2001 From: Bill Sanders Date: Tue, 21 May 2019 11:49:59 -0700 Subject: [PATCH] BUGFIX: Display an error message on the console and the message queue if we are unable to find any disks on the host. --- .../opt/stack/bin/output-partition.py | 5 +++++ .../usr/lib/YaST2/startup/First-Stage/F08-stacki | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sles/src/stack/images/common/sles-stacki.img-patches/opt/stack/bin/output-partition.py b/sles/src/stack/images/common/sles-stacki.img-patches/opt/stack/bin/output-partition.py index fe66d1852..7ae138537 100755 --- a/sles/src/stack/images/common/sles-stacki.img-patches/opt/stack/bin/output-partition.py +++ b/sles/src/stack/images/common/sles-stacki.img-patches/opt/stack/bin/output-partition.py @@ -494,6 +494,11 @@ def main(): else: break + # TODO: right now, this is the only place that exit()'s. + # F08-stacki looks specifically for '1' for the case of 'no disks found' + if not host_disks: + sys.exit(1) + # # if fstab is corrupted, get_host_fstab() will throw and exception. # catch it and just report an empty fstab diff --git a/sles/src/stack/images/common/sles-stacki.img-patches/usr/lib/YaST2/startup/First-Stage/F08-stacki b/sles/src/stack/images/common/sles-stacki.img-patches/usr/lib/YaST2/startup/First-Stage/F08-stacki index fe6c0dde1..d929b3a27 100755 --- a/sles/src/stack/images/common/sles-stacki.img-patches/usr/lib/YaST2/startup/First-Stage/F08-stacki +++ b/sles/src/stack/images/common/sles-stacki.img-patches/usr/lib/YaST2/startup/First-Stage/F08-stacki @@ -99,10 +99,13 @@ then '{"state": "nukedisk failed - check console or reinstall with halt_install_on_error=False"}' fi -# # then configure the partitions -# /opt/stack/bin/output-partition.py > /tmp/partition.xml +if [ $? -eq 1 ] +then + halt_install "Unable to find disks to create partitioning scheme on." \ + '{"state": "partition config failed - no disks found"}' +fi # Configure the bootloader /opt/stack/bin/output-bootloader.py > /tmp/bootloader.xml