From 3fd6e4c941639144ebcd4c9477f40ff4c9d7dc11 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Mon, 31 May 2010 14:24:26 +0200 Subject: [PATCH] xt-install-image: New helper function checkForCommonFilesInChroot Don't fail on missing /bin/ls or /bin/cp, it could be on purpose --- bin/xt-install-image | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/bin/xt-install-image b/bin/xt-install-image index f05c674..843f453 100755 --- a/bin/xt-install-image +++ b/bin/xt-install-image @@ -255,16 +255,9 @@ if ( defined( $CONFIG{ 'install-method' } ) && # # Test that we have some "standard" files present. # - foreach my $file (qw( /bin/ls /bin/cp )) - { - if ( !-x $CONFIG{ 'location' } . $file ) - { - print "The installation of the new system has failed.\n"; - print "\n"; - print "The system is missing the common file: $file\n"; - exit 1; - } - } + + checkForCommonFilesInChroot($CONFIG{ 'location' }, + "installed system"); # # All done. @@ -532,6 +525,30 @@ EOF +=begin doc + + Check if there are some common files in some chroot + +=end doc + +=cut + +sub checkForCommonFilesInChroot { + my ($chroot, $what) = @_; + foreach my $file (qw( /bin/ls /bin/cp )) + { + if ( !-x $chroot.$file ) + { + print STDERR <