This adds a new c program skas-or-tt mostly from uml code which

automates the recognition of whether or not the host kernel has the
skas patch applied.  Makefile edits itself, and all gui is automated.
This commit is contained in:
freesource
2003-01-03 16:34:21 +00:00
parent 1578dff32e
commit 62ac34672a
7 changed files with 218 additions and 9 deletions
+27 -3
View File
@@ -27,7 +27,7 @@ package BootRoot::BootRoot;
use vars qw(@ISA @EXPORT %EXPORT_TAGS);
use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(start);
@EXPORT = qw(start skas_or_tt);
use strict;
use POSIX;
@@ -2201,7 +2201,7 @@ sub uml_box {
# Order does matter because it's used by linuxrc
$entry_advanced[9] =
"mtd=mtdram,$fs_type,$total_size,$erasure_size,$init, " .
"$mem $ramdisk_size $initrd " .
"$mem $ramdisk_size $initrd " . "mode=" . skas_or_tt() . " " .
$entry_advanced[9];
}
@@ -2216,7 +2216,7 @@ sub uml_box {
# Order does matter because it's used by linuxrc
$entry_advanced[9] =
"mtd=blkmtd,$fs_type,$total_size,$erasure_size,$init, " .
"$mem $initrd " .
"$mem $initrd " . "mode=" . skas_or_tt() . " " .
$entry_advanced[9];
}
@@ -5307,4 +5307,28 @@ HELP
}
sub skas_or_tt {
my $ret;
# CLI is never appended, but it could be.
if ( !$option{gui_mode} ) {
open(SKAS_OR_TT,"/usr/lib/bootroot/skas-or-tt|") or
die "Couldn't open /usr/lib/bootroot/skas-or-tt\n";
}
else {
my $skas_or_tt = $option{home} . "/skas-or-tt/skas-or-tt";
open(SKAS_OR_TT,"$skas_or_tt|") or
die "Couldn't open $skas_or_tt\n";
}
while (<SKAS_OR_TT>) {
!m,not found$, ? ($ret = "skas") : ($ret = "tt");
}
close(SKAS_OR_TT);
return $ret;
}
1;
+6 -1
View File
@@ -1538,10 +1538,15 @@ sub create_expect_uml {
}
my $ubd1 = "ubd1=$device";
# This works for both forms of gui, but avoids cli.
if ( !$option{template} ) {
$option{"uml-options"} = $option{"uml-options"} .
" mode=" . skas_or_tt();
}
my $options = "root=/dev/ubd0 " . $option{"uml-options"};
my $filesystem;
if ( $fs_type eq "genext2fs" ) {
$filesystem = "mke2fs -m0";
$filesystem = "mke2fs -m0";
}
else {
$filesystem = $main::makefs;