Browse Source

This adds romfs capability.

master
freesource 23 years ago
parent
commit
79ceb15b1f
  1. 11
      BootRoot/Yard.pm
  2. 13
      expect_uml

11
BootRoot/Yard.pm

@ -1418,20 +1418,21 @@ sub create_filesystem {
while (Gtk->events_pending) { Gtk->main_iteration; } while (Gtk->events_pending) { Gtk->main_iteration; }
} }
if ( $fs_type eq "mkcramfs" ) { if ( $fs_type eq "mkcramfs" || $fs_type eq "genromfs" ) {
# Will just keep appending _cramfs .. leaving it to the # Will just keep appending _cramfs .. leaving it to the
# user to realize this is happening, that way the user # user to realize this is happening, that way the user
# has control over the dd file. # has control over the dd file.
$device = $device . "_cramfs"; $fs_type eq "mkcramfs" ? ($device = $device . "_cramfs") :
my $cramfs_name = basename($device); ($device = $device . "_romfs");
my $cramfs_name = basename($device);
# If somebody closes ARS, this won't get updated, # If somebody closes ARS, this won't get updated,
# but that is a minor matter. # but that is a minor matter.
$ear2->set_text($cramfs_name) if $ear2; $ear2->set_text($cramfs_name) if $ear2;
$mount_point = dirname($device); $mount_point = dirname($device);
} }
} }
elsif ( elsif (
sys("/usr/lib/bootroot/$main::makefs -b $fs_size -d $mount_point -D $device_table $device") !~ sys("/usr/lib/bootroot/$main::makefs -b $fs_size -d $mount_point -D $device_table $device") !~
/^0$/ ) { /^0$/ ) {

13
expect_uml

@ -47,9 +47,12 @@ my $uml =
$uml->boot(); $uml->boot();
# Make the GID/UID 0 FS # Make the GID/UID 0 FS
if ( $filesystem =~ /^mkcramfs/ ) { if ( $filesystem =~ /^mkcramfs/ || $filesystem =~ /^genromfs/ ) {
$uml->command("mke2fs -m0 /dev/ubd/1"); $uml->command("mke2fs -m0 /dev/ubd/1");
} }
elsif ( $filesysem =~ /^genromfs/ ) {
$uml->command("$filesystem");
}
else { else {
$uml->command("$filesystem /dev/ubd/1"); $uml->command("$filesystem /dev/ubd/1");
} }
@ -67,6 +70,14 @@ if ( $filesystem =~ /^mkcramfs/ ) {
$uml->command("mount -t hostfs none -o $cram_dir /mnt2"); $uml->command("mount -t hostfs none -o $cram_dir /mnt2");
$uml->command("mkcramfs /mnt1 /mnt2/$cramfs_name"); $uml->command("mkcramfs /mnt1 /mnt2/$cramfs_name");
} }
if ( $filesystem =~ /^genromfs/ ) {
my $romfs_dir = dirname($mount_point);
my $root_fs_name = basename($ARGV[1]);
my $romfs_name = "$root_fs_name" . "_romfs";
$uml->command("umount /mnt2");
$uml->command("mount -t hostfs none -o $romfs_dir /mnt2");
$uml->command("genromfs -d /mnt1 -f /mnt2/$romfs_name");
}
$uml->command("umount /mnt1; umount /mnt2"); $uml->command("umount /mnt1; umount /mnt2");
$uml->halt(); $uml->halt();

Loading…
Cancel
Save