Browse Source

Added preserve_permissions.

master
freesource 23 years ago
parent
commit
82ced90590
  1. 7
      BootRoot/Yard.pm
  2. 11
      expect_uml

7
BootRoot/Yard.pm

@ -1397,10 +1397,13 @@ sub create_filesystem {
my $x_count = 1; my $x_count = 1;
info(1,"\n$expect_program $ubd0 $ubd1 $options $mount_point\n\n"); my $command_line = "$expect_program $ubd0 $ubd1 $options " .
"$mount_point $uml_expect->{preserve_permissions} $filesystem";
info(1,"\n$command_line\n\n");
# add error correction # add error correction
open(EXPECT,"$expect_program $ubd0 $ubd1 $options $mount_point $filesystem|"); open(EXPECT,"$command_line|");
while (<EXPECT>) { while (<EXPECT>) {
info(0,"$x_count $_"); info(0,"$x_count $_");
$x_count++; $x_count++;

11
expect_uml

@ -4,17 +4,18 @@ use BootRoot::UML;
if ( !$ARGV[0] ) { if ( !$ARGV[0] ) {
die "expect_uml ubd0 ubd1 other-options mount-point filesystem_command\n"; die "expect_uml ubd0 ubd1 other-options mount-point preserve_permissions filesystem_command\n";
} }
my $arguments = "$ARGV[0] $ARGV[1] $ARGV[2]"; my $arguments = "$ARGV[0] $ARGV[1] $ARGV[2]";
my $mount_point = "$ARGV[3]"; my $mount_point = "$ARGV[3]";
my $preserve_permissions = "$ARGV[4]";
my $end = 5; my $end = 6;
my $filesystem; my $filesystem;
for ( 4 .. $end ) { for ( 5 .. $end ) {
if ( $_ == 4 ) { if ( $_ == 4 ) {
$filesystem = "$ARGV[4]"; $filesystem = "$ARGV[4]";
# What to do with the rieserfs command # What to do with the rieserfs command
@ -49,7 +50,9 @@ $uml->command("$filesystem /dev/ubd/1");
$uml->command("mount /dev/ubd/1 /mnt1"); $uml->command("mount /dev/ubd/1 /mnt1");
$uml->command("mount -t hostfs none -o $mount_point /mnt2"); $uml->command("mount -t hostfs none -o $mount_point /mnt2");
$uml->command("cp -a /mnt2/* /mnt1"); $uml->command("cp -a /mnt2/* /mnt1");
$uml->command("chown -R 0:0 /mnt1"); if ( $preserve_permissions == 0 ) {
$uml->command("chown -R 0:0 /mnt1");
}
$uml->command("umount /mnt1; umount /mnt2"); $uml->command("umount /mnt1; umount /mnt2");
$uml->halt(); $uml->halt();

Loading…
Cancel
Save