diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 6a1ee4d50..da8e4117e 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -1150,15 +1150,15 @@ sub mkinitrd_dracut { # force the dracut run in non-hostonly mode for dracut higher than version 033 if ($dracutver > "033") { $additional_options .= " -N"; - } - #if "pigz" is available in the rootimg, use "pigz" instead of "gzip" - my $compress = qx(chroot $rootimg_dir bash -c "type -p pigz"|tr -d "\n"); - if ($compress) { + #if "pigz" is available in the rootimg, use "pigz" instead of "gzip" + my $compress = qx(chroot $rootimg_dir bash -c "type -p pigz"|tr -d "\n"); + if ($compress) { - #take the online cpu numerber as the pigz processes number - my $processnum = qx(lscpu -p=cpu --online|grep -v '#'|wc -l|tr -d "\n"); - $additional_options .= " --compress \"$compress -p $processnum \""; + #take the online cpu numerber as the pigz processes number + my $processnum = qx(lscpu -p=cpu --online|grep -v '#'|wc -l|tr -d "\n"); + $additional_options .= " --compress \"$compress -p $processnum \""; + } } print "\nchroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver\n";