2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-12 06:20:14 +00:00

Merge pull request #6677 from gurevichmark/squashfs

Fix squashfs flags for centos
This commit is contained in:
besawn
2020-04-22 18:10:34 -04:00
committed by GitHub
3 changed files with 51 additions and 17 deletions

View File

@@ -23,7 +23,7 @@ SYNOPSIS
\ **packimage [-v| -**\ **-version]**\
\ **packimage**\ [\ **-m | -**\ **-method**\ \ *cpio|tar*\ ] [\ **-c | -**\ **-compress**\ \ *gzip|pigz|xz*\ ] [\ **-**\ **-nosyncfiles**\ ] \ *imagename*\
\ **packimage**\ [\ **-m | -**\ **-method**\ \ **cpio|tar|squashfs**\ ] [\ **-c | -**\ **-compress**\ \ **gzip|pigz|xz**\ ] [\ **-**\ **-nosyncfiles**\ ] \ *imagename*\
***********
@@ -33,7 +33,7 @@ DESCRIPTION
Packs the stateless image from the chroot file system into a file to be sent to the node for a diskless boot.
Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while packimage is running.
Note: For an osimage that is deployed on a cluster, running \ **packimage**\ will overwrite the existing rootimage file and be unavailable to the compute nodes while \ **packimage**\ is running.
**********
@@ -49,15 +49,36 @@ OPTIONS
*******
\ **-h**\ Display usage message.
\ **-v**\ Command Version.
\ **-h**\
Display usage message.
\ **-m| -**\ **-method**\ Archive Method (cpio,tar,squashfs, default is cpio)
\ **-c| -**\ **-compress**\ Compress Method (pigz,gzip,xz, default is pigz/gzip)
\ **-v**\
Command Version.
\ **-m| -**\ **-method**\
Archive Method (cpio, tar, squashfs (requires overlayFS or aufs modules during provisioning), default is cpio)
\ **-c| -**\ **-compress**\
Compress Method (pigz, gzip, xz, default is pigz/gzip)
\ **-**\ **-nosyncfiles**\
Bypass of syncfiles requested, will not sync files to root image directory
\ **-**\ **-nosyncfiles**\ Bypass of syncfiles requested, will not sync files to root image directory
************

View File

@@ -8,13 +8,13 @@ B<packimage [-h| --help]>
B<packimage [-v| --version]>
B<packimage> [B<-m>|B<--method> I<cpio|tar>] [B<-c>|B<--compress> I<gzip|pigz|xz>] [B<--nosyncfiles>] I<imagename>
B<packimage> [B<-m>|B<--method> B<cpio|tar|squashfs>] [B<-c>|B<--compress> B<gzip|pigz|xz>] [B<--nosyncfiles>] I<imagename>
=head1 DESCRIPTION
Packs the stateless image from the chroot file system into a file to be sent to the node for a diskless boot.
Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while packimage is running.
Note: For an osimage that is deployed on a cluster, running B<packimage> will overwrite the existing rootimage file and be unavailable to the compute nodes while B<packimage> is running.
=head1 PARAMETERS
@@ -22,17 +22,29 @@ I<imagename> specifies the name of a OS image definition to be used. The specifi
=head1 OPTIONS
=over 10
B<-h> Display usage message.
=item B<-h>
B<-v> Command Version.
Display usage message.
B<-m| --method> Archive Method (cpio,tar,squashfs, default is cpio)
=item B<-v>
B<-c| --compress> Compress Method (pigz,gzip,xz, default is pigz/gzip)
Command Version.
B<--nosyncfiles> Bypass of syncfiles requested, will not sync files to root image directory
=item B<-m| --method>
Archive Method (cpio, tar, squashfs (requires overlayFS or aufs modules during provisioning), default is cpio)
=item B<-c| --compress>
Compress Method (pigz, gzip, xz, default is pigz/gzip)
=item B<--nosyncfiles>
Bypass of syncfiles requested, will not sync files to root image directory
=back
=head1 RETURN VALUE

View File

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