diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 81ded62ec..56be0a5f5 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -934,7 +934,8 @@ sub mkinitrd_dracut { if ($dracutver > "033") { $additional_options .= " -N"; } - system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver"); + !system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver") + or die("Error: failed to generate the initial ramdisk for $mode.\n"); print "the initial ramdisk for $mode is generated successfully.\n"; move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz"); } diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index ae903cc3a..861a6f548 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -1072,7 +1072,8 @@ sub mkinitrd_dracut { $additional_options .= " -N"; } - system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver"); + !system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver") + and die("Error: failed to generate the initial ramdisk for $mode.\n"); print "the initial ramdisk for $mode is generated successfully.\n"; move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz"); } diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 478715df4..7dc708701 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -910,7 +910,8 @@ sub mkinitrd_dracut { xdie "the mode: $mode is not supported by genimage"; } - system("chroot $rootimg_dir dracut -f /tmp/initrd.$$.gz $kernelver"); + !system("chroot $rootimg_dir dracut -f /tmp/initrd.$$.gz $kernelver") + or die("Error: failed to generate the initial ramdisk for $mode.\n"); print "the initial ramdisk for $mode is generated successfully.\n"; move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz"); }