From 72cf0e15d3cf9390677fe083ccf91bafa6d13604 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 21 Apr 2020 09:37:23 -0400 Subject: [PATCH] Fix flags for squashfs for centos --- xCAT-server/lib/xcat/plugins/packimage.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index c37c48bf7..2cf3f9e1f 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -580,7 +580,7 @@ sub process_request { $flags = "-be"; } - if ($osver =~ /rhels/ && $osver !~ /rhels5/) { + if (($osver =~ /rhels/ && $osver !~ /rhels5/) || ($osver =~ /centos/)) { $flags = ""; } @@ -588,9 +588,10 @@ sub process_request { $callback->({ error => ["mksquashfs not found, squashfs-tools rpm should be installed on the management node"], errorcode => [1] }); return 1; } - my $rc = system("mksquashfs $temppath ../rootimg.sfs $flags"); + my $mksquashfs_command = "mksquashfs $temppath ../rootimg.sfs $flags"; + my $rc = system("$mksquashfs_command"); if ($rc) { - $callback->({ error => ["mksquashfs could not be run successfully"], errorcode => [1] }); + $callback->({ error => ["Command \"$mksquashfs_command\" failed"], errorcode => [1] }); return 1; } $rc = system("rm -rf $temppath");