From 86f767a446988d6e3fb5b5b033eea6c69f1b590c Mon Sep 17 00:00:00 2001 From: freesource Date: Sat, 9 Mar 2002 01:47:24 +0000 Subject: [PATCH] Yard won't attempt to make /dev on compressed fs and ro if /dev is a symbolic link, won't complain when there is an unitialized value in concatation in Boot, Ramdisk_size is always 4096 for mtdram, this setting isn't really necessary, but is left anyways. --- BootRoot/BootRoot.pm | 12 +++++++----- BootRoot/Yard.pm | 28 ++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/BootRoot/BootRoot.pm b/BootRoot/BootRoot.pm index abfe2e4..61f0dea 100644 --- a/BootRoot/BootRoot.pm +++ b/BootRoot/BootRoot.pm @@ -38,6 +38,10 @@ use File::Basename; use File::Find; use File::Path; +$SIG{__WARN__} = + sub { warn @_ unless $_[0] =~ /Subroutine [\w:]+ redefined/io + || $_[0] =~ /Use of uninitialized value in concatenation/}; + # If you want gBootRoot to do it's stuff somewhere else, change the # value for $tmp1. my $tmp1 = "/tmp"; # tmp should be default - Cristian @@ -1733,7 +1737,7 @@ sub uml_box { #_______________________________________ -# Submit Button + # Submit Button my $submit_b = button_advanced(0,1,7,8,"Submit",$table_uml); $tooltips->set_tip( $submit_b, "Start uml kernel processes.", @@ -1922,10 +1926,8 @@ sub uml_box { # ramdisk_size if ( !$ramdisk_size ) { - $ramdisk_size = "ramdisk_size=$total_size"; - if ( $ramdisk_size < 4096 ) { - $ramdisk_size = 4096; - } + #$ramdisk_size = "ramdisk_size=$total_size"; + $ramdisk_size = "ramdisk_size=4096"; } else { undef $ramdisk_size; diff --git a/BootRoot/Yard.pm b/BootRoot/Yard.pm index 7e3e684..fd5bbb5 100644 --- a/BootRoot/Yard.pm +++ b/BootRoot/Yard.pm @@ -1479,6 +1479,31 @@ sub create_expect_uml { if ( $uml_exclusively ) { + if ( $fs_type eq "mkcramfs" || $fs_type eq "genromfs" || + $fs_type eq "mkfs.jffs" || $fs_type eq "mkfs.jffs2") { + + my $mount_pt = dirname($device); + + # fail-safe /dev and /initrd directory check + if ( -f "$mount_pt/loopback/dev" || + -l "$mount_pt/loopback/dev" ) { + warning("$mount_pt/loopback/dev isn't a directory " . + "not a file\n"); + } + elsif ( !-d "$mount_pt/loopback/dev" ) { + errmk(sys("mkdir $mount_pt/loopback/dev")); + } + + if ( -f "$mount_pt/loopback/initrd" ) { + warning("$mount_pt/loopback/initrd should be a directory" . + " not a file\n"); + } + elsif ( !-d "$mount_pt/loopback/initrd" ) { + errmk(sys("mkdir $mount_pt/loopback/initrd")); + } + + } + my $expect_program = "/usr/lib/bootroot/expect_uml"; my $version = "2.4"; my $ubd0 = @@ -1517,8 +1542,7 @@ sub create_expect_uml { # 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"); + if ( $fs_type eq "mkcramfs" ) { $device = $device . "_cramfs";