From: <ar...@sy...> - 2008-02-21 08:43:06
|
Author: arighi Date: 2008-02-21 02:42:57 -0600 (Thu, 21 Feb 2008) New Revision: 4391 Modified: trunk/lib/SystemImager/UseYourOwnKernel.pm Log: - rewritten UYOK kernel detection routine This also allows to properly detect Xen kernels. Bug reported by: Tory M Blue <tm...@gm...>, David K Livingstone <Dav...@cn...> Modified: trunk/lib/SystemImager/UseYourOwnKernel.pm =================================================================== --- trunk/lib/SystemImager/UseYourOwnKernel.pm 2008-02-20 12:09:49 UTC (rev 4390) +++ trunk/lib/SystemImager/UseYourOwnKernel.pm 2008-02-21 08:42:57 UTC (rev 4391) @@ -345,18 +345,30 @@ # # and not a directory if( -d $file ) { return undef; } + # + # skip symlinks + if( -l $file ) { return undef; } + # + # skip .bak files + if( $file =~ /\.bak$/ ) { return undef; } + # + # eliminate vmlinux files on RH + if( $file =~ m/^vmlinux$/ ) { return undef; } + # + # eliminate ramdisks + if( $file =~ m/initrd/ ) { return undef; } + # + # eliminate memtest + if( $file =~ m/^memtest/ ) { return undef; } + # + # eliminate message + if( $file =~ m/^message/ ) { return undef; } # # Get output from "file" for elimination by identification tests - my $cmd = "file -b $file"; + my $cmd = "file -bz $file"; open(INPUT,"$cmd|") or die("Couldn't run $cmd to get INPUT"); my ($input) = (<INPUT>); - # - # eliminate vmlinux files on RH - if( $input =~ m/ELF (32|64)-bit LSB executable,/ ) { return undef; } - # - # eliminate compressed data (eg. ramdisk) - if( $input =~ m/gzip compressed data,/ ) { return undef; } # eliminate cpio archives (eg. ramdisk) if( $input =~ m/cpio archive/ ) { return undef; } # eliminate cramfs files (eg. ramdisk) |