mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-22 03:00:26 +00:00
Merge pull request #6227 from neo954/dracut-compress
Only pass "--compress" argument to dracut when ($dracutver > "033")
This commit is contained in:
@@ -20,7 +20,7 @@ The parallel compression tool ``pigz`` can be enabled by installing ``pigz`` pac
|
||||
|
||||
Refer to the http://fedoraproject.org/wiki/EPEL for more details on EPEL
|
||||
|
||||
1) Enabling the ``pigz`` in ``genimage`` (only supported in RHELS6 or above)
|
||||
1) Enabling the ``pigz`` in ``genimage`` (only supported in RHEL 7 or above)
|
||||
|
||||
``pigz`` should be installed in the diskless rootimg. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then customize the diskless osimage to install ``pigz`` as the additional packages, see :doc:`Install Additional Other Packages</guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/additional_pkg>` for more details.
|
||||
|
||||
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user