Fix bug#4551 - [FVT] Command genimage print out information of succeed even if dracut was failed

This commit is contained in:
GONG Jie 2015-03-09 14:51:40 +08:00
parent d381d3e723
commit c1eeb2f1ed
3 changed files with 6 additions and 3 deletions

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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");
}