From 9b3a7ffb0e9767d88849ba0ed59963c775a4d464 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 16 Jan 2012 14:34:32 +0000 Subject: [PATCH] Prefer lzma when available for Genesis compression git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11386 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/destiny.pm | 6 ++++++ xCAT-server/lib/xcat/plugins/mknb.pm | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index a8d896715..88f959c1b 100644 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -278,9 +278,15 @@ sub setdestiny { $xcatdport = $portent->{value}; } if (-r "$tftpdir/xcat/genesis.kernel.$arch") { + if (-r "$tftpdir/xcat/genesis.fs.$arch.lzma") { + $bootparms->setNodeAttribs($_,{kernel => "xcat/genesis.kernel.$arch", + initrd => "xcat/genesis.fs.$arch.lzma", + kcmdline => $kcmdline."xcatd=$master:$xcatdport destiny=$state"}); + } else { $bootparms->setNodeAttribs($_,{kernel => "xcat/genesis.kernel.$arch", initrd => "xcat/genesis.fs.$arch.gz", kcmdline => $kcmdline."xcatd=$master:$xcatdport destiny=$state"}); + } } else { #'legacy' environment $bootparms->setNodeAttribs($_,{kernel => "xcat/nbk.$arch", initrd => "xcat/nbfs.$arch.gz", diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index 1b7888f9a..875848cf0 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -109,8 +109,13 @@ sub process_request { system("ssh-keygen -t dsa -f $tempdir/etc/ssh_host_dsa_key -C '' -N ''"); } if ($invisibletouch) { + if (-x "/usr/bin/lzma") { #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 | lzma -C crc32 -9 > $tftpdir/xcat/genesis.fs.$arch.lzma"); + } else { $callback->({data=>["Creating genesis.fs.$arch.gz in $tftpdir/xcat"]}); system("cd $tempdir; find . | cpio -o -H newc | gzip -9 > $tftpdir/xcat/genesis.fs.$arch.gz"); + } } else { $callback->({data=>["Creating nbfs.$arch.gz in $tftpdir/xcat"]}); system("cd $tempdir; find . | cpio -o -H newc | gzip -9 > $tftpdir/xcat/nbfs.$arch.gz");