1
0
mirror of https://github.com/fspc/gbootroot.git synced 2025-02-23 09:03:23 -05:00

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 18:56:48 +00:00
parent e09780d219
commit b7d2a338d7
6 changed files with 28 additions and 15 deletions

View File

@ -377,7 +377,7 @@ if ( !( $option{home} || $option{help} || $option{h} ) ) {
# I removed mem=16M to make sure the optimal mem size was being # I removed mem=16M to make sure the optimal mem size was being
# chosen for the MTD Emulator # chosen for the MTD Emulator
# in case the user didn't know any better. # in case the user didn't know any better.
print OPTIONS "umid=bootroot root=/dev/ubd0 mode=tt\n"; print OPTIONS "umid=bootroot root=/dev/ubd0\n";
close(OPTIONS); close(OPTIONS);
} }
@ -2201,8 +2201,7 @@ sub uml_box {
# Order does matter because it's used by linuxrc # Order does matter because it's used by linuxrc
$entry_advanced[9] = $entry_advanced[9] =
"mtd=mtdram,$fs_type,$total_size,$erasure_size,$init, " . "mtd=mtdram,$fs_type,$total_size,$erasure_size,$init, " .
"$mem $ramdisk_size $initrd " . "mode=" . skas_or_tt() . " " . "$mem $ramdisk_size $initrd " . $entry_advanced[9];
$entry_advanced[9];
} }
@ -2216,8 +2215,7 @@ sub uml_box {
# Order does matter because it's used by linuxrc # Order does matter because it's used by linuxrc
$entry_advanced[9] = $entry_advanced[9] =
"mtd=blkmtd,$fs_type,$total_size,$erasure_size,$init, " . "mtd=blkmtd,$fs_type,$total_size,$erasure_size,$init, " .
"$mem $initrd " . "mode=" . skas_or_tt() . " " . "$mem $initrd " . $entry_advanced[9];
$entry_advanced[9];
} }
@ -2226,6 +2224,9 @@ sub uml_box {
} # mtd preparations } # mtd preparations
############# #############
if ( $entry_advanced[9] !~ m,mode=, ) {
$entry_advanced[9] = "mode=" . skas_or_tt() . " " . $entry_advanced[9];
}
unless ($pid = fork) { unless ($pid = fork) {
unless (fork) { unless (fork) {
@ -5309,17 +5310,19 @@ HELP
sub skas_or_tt { sub skas_or_tt {
my $ret; my ($ret, $error);
# CLI is never appended, but it could be. # CLI is never appended, but it could be.
if ( !$option{gui_mode} ) { if ( !$option{gui_mode} ) {
open(SKAS_OR_TT,"/usr/lib/bootroot/skas-or-tt|") or open(SKAS_OR_TT,"/usr/lib/bootroot/skas-or-tt|") or
die "Couldn't open /usr/lib/bootroot/skas-or-tt\n"; ($error = error("/usr/lib/bootroot/skas-or-tt: $!"));
return "ERROR"if $error && $error eq "ERROR";
} }
else { else {
my $skas_or_tt = $option{home} . "/skas-or-tt/skas-or-tt"; my $skas_or_tt = $option{home} . "/skas-or-tt/skas-or-tt";
open(SKAS_OR_TT,"$skas_or_tt|") or open(SKAS_OR_TT,"$skas_or_tt|") or
die "Couldn't open $skas_or_tt\n"; ($error = error("/usr/lib/bootroot/skas-or-tt: $!"));
return "ERROR"if $error && $error eq "ERROR";
} }
while (<SKAS_OR_TT>) { while (<SKAS_OR_TT>) {

View File

@ -1539,11 +1539,15 @@ sub create_expect_uml {
my $ubd1 = "ubd1=$device"; my $ubd1 = "ubd1=$device";
# This works for both forms of gui, but avoids cli. # This works for both forms of gui, but avoids cli.
my $options;
if ( !$option{template} ) { if ( !$option{template} ) {
$option{"uml-options"} = $option{"uml-options"} . $options = "root=/dev/ubd0 " . "mode=" .
" mode=" . skas_or_tt(); BootRoot::BootRoot::skas_or_tt() . " " .
$option{"uml-options"};
}
else {
$options = "root=/dev/ubd0 " . $option{"uml-options"};
} }
my $options = "root=/dev/ubd0 " . $option{"uml-options"};
my $filesystem; my $filesystem;
if ( $fs_type eq "genext2fs" ) { if ( $fs_type eq "genext2fs" ) {
$filesystem = "mke2fs -m0"; $filesystem = "mke2fs -m0";

View File

@ -133,11 +133,14 @@ system "cp -a $packaging_place/user-mode-linux/usr/lib/uml/port-helper $gbootroo
system "cp -a $packaging_place/user-mode-linux/usr/bin/* $gbootroot_cvs/user-mode-linux/usr/bin/"; system "cp -a $packaging_place/user-mode-linux/usr/bin/* $gbootroot_cvs/user-mode-linux/usr/bin/";
# kernel config # kernel config
system "cp -a $packaging_place/user-mode-linux/usr/lib/uml/config $gbootroot_cvs/user-mode-linux/usr/lib/uml/"; system "cp -a $packaging_place/user-mode-linux/usr/lib/uml/config $gbootroot_cvs/user-mode-linux/usr/lib/uml/config-nest1";
# genext2fs # genext2fs
system "cp -a $packaging_place/genext2fs/genext2fs $gbootroot_cvs/genext2fs/genext2fs"; system "cp -a $packaging_place/genext2fs/genext2fs $gbootroot_cvs/genext2fs/genext2fs";
# skas-or-tt
system "cp -a $packaging_place/skas-or-tt/skas-or-tt $gbootroot_cvs/skas-or-tt/skas-or-tt";
# root_fs_helper & Initrd.gz # root_fs_helper & Initrd.gz
system "cp -a $packaging_place/root_filesystem/root_fs_helper $gbootroot_cvs/root_filesystem/root_fs_helper"; system "cp -a $packaging_place/root_filesystem/root_fs_helper $gbootroot_cvs/root_filesystem/root_fs_helper";
system "cp -a $packaging_place/root_filesystem/Initrd.gz $gbootroot_cvs/root_filesystem/Initrd.gz"; system "cp -a $packaging_place/root_filesystem/Initrd.gz $gbootroot_cvs/root_filesystem/Initrd.gz";

View File

@ -138,6 +138,9 @@ system "cp -a $packaging_place/user-mode-linux/usr/bin/* $gbootroot_cvs/user-mod
# genext2fs # genext2fs
system "cp -a $packaging_place/genext2fs/genext2fs $gbootroot_cvs/genext2fs/genext2fs"; system "cp -a $packaging_place/genext2fs/genext2fs $gbootroot_cvs/genext2fs/genext2fs";
# skas-or-tt
system "cp -a $packaging_place/skas-or-tt/skas-or-tt $gbootroot_cvs/skas-or-tt/skas-or-tt";
# root_fs_helper & Initrd.gz # root_fs_helper & Initrd.gz
system "cp -a $packaging_place/root_filesystem/root_fs_helper $gbootroot_cvs/root_filesystem/root_fs_helper"; system "cp -a $packaging_place/root_filesystem/root_fs_helper $gbootroot_cvs/root_filesystem/root_fs_helper";
system "cp -a $packaging_place/root_filesystem/Initrd.gz $gbootroot_cvs/root_filesystem/Initrd.gz"; system "cp -a $packaging_place/root_filesystem/Initrd.gz $gbootroot_cvs/root_filesystem/Initrd.gz";

View File

@ -31,7 +31,7 @@ clean:
rm -f build-stamp configure-stamp rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process. # Add here commands to clean up after the build process.
-$(MAKE) clean #-$(MAKE) clean
#-$(MAKE) clean-sources #-$(MAKE) clean-sources
dh_clean dh_clean

View File

@ -31,7 +31,7 @@ clean:
rm -f build-stamp configure-stamp rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process. # Add here commands to clean up after the build process.
-$(MAKE) clean #-$(MAKE) clean
#-$(MAKE) clean-sources #-$(MAKE) clean-sources
dh_clean dh_clean