2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 10:18:20 +00:00

Support xz for genesis

lzma is a deprecated name.
This commit is contained in:
Jarrod Johnson
2018-07-27 08:53:06 -04:00
parent 9ac4f80b4c
commit b476fdfa76

View File

@@ -189,6 +189,18 @@ sub process_request {
$initrd_file = "$tftpdir/xcat/genesis.fs.$arch.lzma";
}
}
if (not $done and -x "/usr/bin/xz") { #let's reclaim some of that size...
$callback->({ data => ["Creating genesis.fs.$arch.lzma in $tftpdir/xcat"] });
system("cd $tempdir; find . | cpio -o -H newc | xz -C crc32 -9 > $tftpdir/xcat/genesis.fs.$arch.lzma");
$lzma_exit_value = $? >> 8;
if ($lzma_exit_value) {
$callback->({ data => ["Creating genesis.fs.$arch.lzma in $tftpdir/xcat failed, falling back to gzip"] });
unlink("$tftpdir/xcat/genesis.fs.$arch.lzma");
} else {
$done = 1;
$initrd_file = "$tftpdir/xcat/genesis.fs.$arch.lzma";
}
}
if (not $done) {
$callback->({ data => ["Creating genesis.fs.$arch.gz in $tftpdir/xcat"] });