1
0
mirror of synced 2026-02-24 07:32:35 +00:00

xt-install-image: New helper function checkForCommonFilesInChroot

Don't fail on missing /bin/ls or /bin/cp, it could be on purpose
This commit is contained in:
Axel Beckert
2010-05-31 14:24:26 +02:00
parent d9a26c8c69
commit 3fd6e4c941

View File

@@ -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 <<EOT;
WARNING ($0): The $what at $chroot doesn\'t seem to be a full system.
WARNING ($0): The $what is missing the common file: $file.
EOT
}
}
}
=begin doc
A utility method to run a system command. We will capture the return
@@ -639,6 +656,12 @@ sub copyDebFiles
sub do_copy
{
#
# Check if the copy source has at least some "standard" files present.
#
checkForCommonFilesInChroot($CONFIG{ 'install-source' },
"installation source");
#
# Find the copy command to run from the configuration file.
#