From fecdc357167b1b31e9872c4b913cb052dd110e90 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 22 Apr 2013 19:18:53 +0000 Subject: [PATCH] If lzma is older than gzip genesis, prefer newer git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16034 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/destiny.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 278e019b1..65f08d20f 100644 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -385,13 +385,21 @@ sub setdestiny { $xcatdport = $port_entry; } if (-r "$tftpdir/xcat/genesis.kernel.$arch") { - if (-r "$tftpdir/xcat/genesis.fs.$arch.lzma") { + my $bestsuffix="lzma"; + my $othersuffix="gz"; + if (-r "$tftpdir/xcat/genesis.fs.$arch.lzma" and -r "$tftpdir/xcat/genesis.fs.$arch.gz") { + if (-C "$tftpdir/xcat/genesis.fs.$arch.lzma" > -C "$tftpdir/xcat/genesis.fs.$arch.gz") { #here, lzma is older for whatever reason + $bestsuffix="gz"; + $othersuffix="lzma"; + } + } + if (-r "$tftpdir/xcat/genesis.fs.$arch.$bestsuffix") { $bootparms->setNodeAttribs($_,{kernel => "xcat/genesis.kernel.$arch", - initrd => "xcat/genesis.fs.$arch.lzma", + initrd => "xcat/genesis.fs.$arch.$bestsuffix", kcmdline => $kcmdline."xcatd=$master:$xcatdport destiny=$state"}); } else { $bootparms->setNodeAttribs($_,{kernel => "xcat/genesis.kernel.$arch", - initrd => "xcat/genesis.fs.$arch.gz", + initrd => "xcat/genesis.fs.$arch.$othersuffix", kcmdline => $kcmdline."xcatd=$master:$xcatdport destiny=$state"}); } } else { #'legacy' environment