Browse Source

This ensures that the mount point is umount between the Copy and Create

stages when root is using a loop device.
master
freesource 23 years ago
parent
commit
8180a0375f
  1. 114
      BootRoot/Yard.pm

114
BootRoot/Yard.pm

@ -1209,11 +1209,6 @@ sub create_filesystem {
if ( $fs_type ne "genext2fs" &&
$uml_exclusively == 0 ) {
# If it is mounted it should just be automatically unmounted here
# since the create stage has been broken up into the copy and
# create stage. This is cool because the loop device can be
# scooped, just like the sources directory by rooot.
return "ERROR" if errm(mount_device($device,$mount_point)) == 2;
##### lost+found on a ramdisk is pointless
sys("rm -rf $mount_point/lost+found");
@ -1370,110 +1365,12 @@ sub create_filesystem {
info(0,"Done with the Copy stage\n");
=pod
# This could be run as another stage, its only complicated
# when root is using a loop device, in figuring out the verbosity.
if (@Libs) {
info(0, "\nRe-generating /etc/ld.so.cache on root fs.\n");
info(1, "Ignore warnings about missing directories\n");
sys("ldconfig -v -r $mount_point");
}
if ( $uml_exclusively == 0 ) {
info(0, "\nFinished creating root filesystem.\n");
}
if ( $fs_type ne "genext2fs" && $uml_exclusively == 0 ) {
## Probably will want to umount here
return "ERROR" if errum(sys("umount $mount_point")) == 2;
}
# This is fun.
else {
# The -D option is unique to the newest unreleased version of
# genextfs modified by BusyBox maintainer Erick Andersen
# August 20, 2001.
my $device_table = "$mnt/device_table.txt";
if ( $uml_exclusively ) {
my $expect_program = "/usr/lib/bootroot/expect_uml";
my $version = "2.4";
my $ubd0 =
"ubd0=/usr/lib/bootroot/root_filesystem/root_fs_helper";
my $ubd1 = "ubd1=$device";
my $options = "root=/dev/ubd0"; # need to keep this 1
my $filesystem;
if ( $fs_type eq "genext2fs" ) {
$filesystem = "mke2fs -m0";
}
else {
$filesystem = $main::makefs;
}
my $x_count = 1;
my $command_line = "$expect_program $ubd0 $ubd1 $options " .
"$mount_point $preserve_ownership $filesystem";
info(0,"\nUsing helper root_fs to $fs_type the filesystem:\n\n");
info(0,"$command_line\n\n");
# add error correction
# I'll allow the GUI to lock-xup for big copies and fs creation.
open(EXPECT,"$command_line|");
while (<EXPECT>) {
info(1,"$x_count $_");
$x_count++;
while (Gtk->events_pending) { Gtk->main_iteration; }
}
if ( $fs_type eq "mkcramfs" || $fs_type eq "genromfs" ) {
# Will just keep appending _cramfs .. leaving it to the
# user to realize this is happening, that way the user
# has control over the dd file.
$fs_type eq "mkcramfs" ? ($device = $device . "_cramfs") :
($device = $device . "_romfs");
my $cramfs_name = basename($device);
# If somebody closes ARS, this won't get updated,
# but that is a minor matter.
$ear2->set_text($cramfs_name) if $ear2;
$mount_point = dirname($device);
}
}
elsif (
sys("/usr/lib/bootroot/$main::makefs -b $fs_size -d $mount_point -D $device_table $device") !~
/^0$/ ) {
$error = error("Cannot $fs_type filesystem.\n");
return "ERROR" if $error && $error eq "ERROR";
}
}
info(0, "\nDone making the root filesystem. $Warnings warnings.\n",
"$device is now umounted from $mount_point\n\n");
#info(0, "All done!\n");
#info(0, "You can run more tests with the UML kernel\n",
# "or construct a distribution by using this root\n",
# "filesystem with a boot method.");
=cut
} # end sub create_filesystem
@ -1487,6 +1384,17 @@ sub create_expect_uml {
my $error;
if ( $fs_type ne "genext2fs" &&
$uml_exclusively == 0 ) {
return "ERROR" if errm(mount_device($device,$mount_point)) == 2;
##### lost+found on a ramdisk is pointless
sys("rm -rf $mount_point/lost+found");
sync();
}
if (@Libs) {
info(0, "\nRe-generating /etc/ld.so.cache on root fs.\n");

Loading…
Cancel
Save