mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 09:13:08 +00:00
fix some codeing style problems
This commit is contained in:
parent
8dea21b6c1
commit
4114a4f6a9
@ -369,7 +369,7 @@ sub process_request {
|
||||
|
||||
my $compress="gzip";
|
||||
#use "pigz" as the compress tool instead of gzip if "pigz" exist
|
||||
my $ispigz=system("bash -c 'type -p pigz'");
|
||||
my $ispigz=system("bash -c 'type -p pigz' >/dev/null 2>&1");
|
||||
if($ispigz == 0){
|
||||
$compress="pigz";
|
||||
}
|
||||
@ -385,7 +385,6 @@ sub process_request {
|
||||
if ($includestr) {
|
||||
system("$includestr >> $xcat_packimg_tmpfile");
|
||||
}
|
||||
#$excludestr =~ s!-a \z!|cpio -H newc -o | $compress -c - > ../rootimg.gz!;
|
||||
$excludestr = "cat $xcat_packimg_tmpfile|cpio -H newc -o | $compress -c - > ../rootimg.gz";
|
||||
}
|
||||
$oldmask = umask 0077;
|
||||
|
@ -523,10 +523,9 @@ sub process_request {
|
||||
$callback->({data=>["$verb contents of $rootimg_dir"]});
|
||||
unlink("$destdir/rootimg-statelite.gz");
|
||||
|
||||
|
||||
my $compress="gzip";
|
||||
#use "pigz" as the compress tool instead of gzip if "pigz" exist
|
||||
my $ispigz=system("bash -c 'type -p pigz'");
|
||||
my $ispigz=system("bash -c 'type -p pigz' >/dev/null 2>&1");
|
||||
if($ispigz == 0){
|
||||
$compress="pigz";
|
||||
}
|
||||
|
@ -949,14 +949,11 @@ sub mkinitrd_dracut {
|
||||
$additional_options= qq{--include /tmp/cmdline /etc/cmdline};
|
||||
}
|
||||
|
||||
|
||||
|
||||
# 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){
|
||||
@ -964,7 +961,8 @@ sub mkinitrd_dracut {
|
||||
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";
|
||||
|
||||
print "\nchroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver\n";
|
||||
!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";
|
||||
|
@ -1088,7 +1088,6 @@ sub mkinitrd_dracut {
|
||||
$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){
|
||||
@ -1096,8 +1095,8 @@ sub mkinitrd_dracut {
|
||||
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";
|
||||
|
||||
print "\nchroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver\n";
|
||||
!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";
|
||||
|
@ -1645,17 +1645,13 @@ EOMS
|
||||
symlink("bash", "/tmp/xcatinitrd.$$/bin/sh");
|
||||
symlink("bash", "/tmp/xcatinitrd.$$/sbin/sh");
|
||||
|
||||
|
||||
my $compress="gzip";
|
||||
#if pigz is available,use pigz instead of gzip
|
||||
my $ispigz=system("bash -c 'type -p pigz' >/dev/null 2>&1");
|
||||
if($ispigz == 0){
|
||||
$compress="pigz";
|
||||
}else{
|
||||
$compress="gzip";
|
||||
}
|
||||
|
||||
|
||||
#copy("$rootimg_dir/lib/modules/*d","/tmp/xcatinitrd.$$/$_");
|
||||
print "\ncd /tmp/xcatinitrd.$$;find .|cpio -H newc -o|$compress -9 -c - > $destdir/initrd-$mode.gz \n";
|
||||
system("cd /tmp/xcatinitrd.$$;find .|cpio -H newc -o|$compress -9 -c - > $destdir/initrd-$mode.gz");
|
||||
|
Loading…
x
Reference in New Issue
Block a user