initramfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
To: harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
Subject: [PATCH 4/8] mkinitrd-suse.sh: Bail out with exit 1 if initrd cannot be generated
Date: Fri, 26 Jun 2015 16:55:53 +0200	[thread overview]
Message-ID: <1435330557-17685-5-git-send-email-trenn@suse.de> (raw)
In-Reply-To: <1435330557-17685-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>

Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
 mkinitrd-suse.sh | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh
index af42cbe..c2b314f 100755
--- a/mkinitrd-suse.sh
+++ b/mkinitrd-suse.sh
@@ -280,7 +280,8 @@ done
 
 [[ $targets && $kernels ]] || default_kernel_images
 if [[ ! $targets || ! $kernels ]];then
-    error "No kernel found in $boot_dir"
+    error "No kernel found in $boot_dir or bad modules dir in /lib/modules"
+    exit 1
 fi
 
 # We can have several targets/kernels, transform the list to an array
@@ -301,6 +302,8 @@ fi
 [[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
 shopt -s extglob
 
+failed=""
+
 for ((i=0 ; $i<${#targets[@]} ; i++)); do
 
     if [[ $img_vers ]];then
@@ -329,14 +332,18 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
         # expansion magics
         if [ -n "${modules_all}" ];then
             $dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
+            [ $? -ne 0 ] && failed="$failed $target"
         else
             $dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
+            [ $? -ne 0 ] && failed="$failed $target"
         fi
     else
         if [ -n "${modules_all}" ];then
             $dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
+            [ $? -ne 0 ] && failed="$failed $target"
         else
             $dracut_cmd $dracut_args "$target" "$kernel"
+            [ $? -ne 0 ] && failed="$failed $target"
         fi
     fi
 done
@@ -345,4 +352,12 @@ if [ "$skip_update_bootloader" ] ; then
     echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually."
 else
     update-bootloader --refresh
+    [ $? -ne 0 ] && echo "Updating bootloader failed" && exit 1
+fi
+
+if [ "$failed" != "" ]; then
+    echo "Generating $failed targets failed"
+    exit 1
 fi
+
+exit 0
-- 
2.1.4

  parent reply	other threads:[~2015-06-26 14:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 14:55 Several SUSE bugfixes Thomas Renninger
     [not found] ` <1435330557-17685-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2015-06-26 14:55   ` [PATCH 1/8] /etc/multipath.conf is not mandatory Thomas Renninger
     [not found]     ` <1435330557-17685-2-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2015-07-01  8:56       ` Harald Hoyer
2015-06-26 14:55   ` [PATCH 2/8] Fix nfs parsing when IPv4 address is used in /etc/fstab Thomas Renninger
2015-06-26 14:55   ` [PATCH 3/8] Reset IFS variable Thomas Renninger
2015-06-26 14:55   ` Thomas Renninger [this message]
2015-06-26 14:55   ` [PATCH 5/8] Use the uncompressed kernel file on arm and aarch to detect kernel version Thomas Renninger
2015-06-26 14:55   ` [PATCH 6/8] Install /etc/sysconfig/console to see specific fonts Thomas Renninger
     [not found]     ` <1435330557-17685-7-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2015-06-27  5:29       ` Andrei Borzenkov
2015-06-26 14:55   ` [PATCH 7/8] ensure pre-mount (and resume) run before root fsck Thomas Renninger
     [not found]     ` <1435330557-17685-8-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2015-06-29 23:49       ` Alexander Tsoy
     [not found]         ` <20150630024933.3c41d601-gl4+DzqHFJJb4Dhfy2/fiQ@public.gmane.org>
2015-07-01 15:47           ` Harald Hoyer
2015-06-26 14:55   ` [PATCH 8/8] Use udev rules to create dmraid /dev/mapper/ devices Thomas Renninger
     [not found]     ` <1435330557-17685-9-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2015-06-27  5:41       ` Andrei Borzenkov
     [not found]         ` <20150627084153.1936a074-stAJ6ESoqRzYCGPCin2YbQ@public.gmane.org>
2015-06-29 11:17           ` Thomas Renninger
2015-06-29 17:36       ` [PATCH] " Thomas Renninger
     [not found]         ` <1435599415-10187-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2015-06-29 18:02           ` Dracut GitHub Import Bot
2015-07-07 11:41           ` Harald Hoyer
     [not found]             ` <559BBAF5.5000501-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-07 11:54               ` Hannes Reinecke
     [not found]                 ` <559BBE0F.1070903-IBi9RG/b67k@public.gmane.org>
2015-11-13 11:00                   ` Harald Hoyer
     [not found]                     ` <5645C2D6.2010702-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-13 15:04                       ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435330557-17685-5-git-send-email-trenn@suse.de \
    --to=trenn-l3a5bk7wagm@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).