From b476fdfa7609f80bfc02571661661f6888b52c98 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 27 Jul 2018 08:53:06 -0400 Subject: [PATCH] Support xz for genesis lzma is a deprecated name. --- xCAT-server/lib/xcat/plugins/mknb.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index 894ccc650..8ee8cc68d 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -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"] });