Browse Source

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.
master
freesource 22 years ago
parent
commit
b7d2a338d7
  1. 21
      BootRoot/BootRoot.pm
  2. 10
      BootRoot/Yard.pm
  3. 5
      gbootroot-nest1_pkg
  4. 3
      gbootroot_pkg
  5. 2
      pkg/dpkg/gbootroot-nest1/rules
  6. 2
      pkg/dpkg/gbootroot/rules

21
BootRoot/BootRoot.pm

@ -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>) {

10
BootRoot/Yard.pm

@ -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";

5
gbootroot-nest1_pkg

@ -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";

3
gbootroot_pkg

@ -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";

2
pkg/dpkg/gbootroot-nest1/rules

@ -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

2
pkg/dpkg/gbootroot/rules

@ -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

Loading…
Cancel
Save