summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-22 00:15:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-22 00:15:50 +0000
commit1e438db0a3bba659e5c5e8aec5194ea3fc3233d9 (patch)
tree87831b0f55475469601a2b611d707d034dd3e600 /perl-install
parentce4ab206f27055fc7459d04a5173efa132e7f43c (diff)
downloaddrakx-backup-do-not-use-1e438db0a3bba659e5c5e8aec5194ea3fc3233d9.tar
drakx-backup-do-not-use-1e438db0a3bba659e5c5e8aec5194ea3fc3233d9.tar.gz
drakx-backup-do-not-use-1e438db0a3bba659e5c5e8aec5194ea3fc3233d9.tar.bz2
drakx-backup-do-not-use-1e438db0a3bba659e5c5e8aec5194ea3fc3233d9.tar.xz
drakx-backup-do-not-use-1e438db0a3bba659e5c5e8aec5194ea3fc3233d9.zip
- remove createBootdisk step
- add mkbootdisk option in setupBootloader__general() - move kernelVersion() from install_any to any
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/any.pm67
-rw-r--r--perl-install/install2.pm7
-rw-r--r--perl-install/install_any.pm7
-rw-r--r--perl-install/install_steps.pm17
-rw-r--r--perl-install/install_steps_interactive.pm61
-rw-r--r--perl-install/steps.pm3
6 files changed, 67 insertions, 95 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 5a9464c1f..4072ff5b7 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -74,6 +74,67 @@ sub enableShadow {
run_program::rooted($prefix, "grpconv") or log::l("grpconv failed");
}
+sub kernelVersion {
+ my $kernel = readlink "$::prefix/boot/vmlinuz" || first(all("$::prefix/boot"));
+ first($kernel =~ /vmlinuz-(.*)/);
+}
+
+sub mkbootdisk {
+ my ($in, $bootloader, $fstab) = @_;
+
+ $in->set_help('createBootdisk') if !$::isStandalone;
+
+ if (arch() =~ /sparc/) {
+ #- as probing floppies is a bit more different on sparc, assume always /dev/fd0.
+ #- [pixel] uh, but in that case it would be better to change detect_devices::floppies, no?
+ $in->ask_okcancel('',
+ N("A custom bootdisk provides a way of booting into your Linux system without
+depending on the normal bootloader. This is useful if you don't want to install
+SILO on your system, or another operating system removes SILO, or SILO doesn't
+work with your hardware configuration. A custom bootdisk can also be used with
+the Mandrake rescue image, making it much easier to recover from severe system
+failures.
+
+If you want to create a bootdisk for your system, insert a floppy in the first
+drive and press \"Ok\".")) or return;
+ } else {
+ $in->ask_yesorno('', formatAlaTeX(
+ N("A custom bootdisk provides a way of booting into your Linux system without
+depending on the normal bootloader. This is useful if you don't want to install
+LILO (or grub) on your system, or another operating system removes LILO, or LILO doesn't
+work with your hardware configuration. A custom bootdisk can also be used with
+the Mandrake rescue image, making it much easier to recover from severe system
+failures. Would you like to create a bootdisk for your system?
+%s", isThisFs('xfs', fsedit::get_root($fstab)) ? N("
+
+(WARNING! You're using XFS for your root partition,
+creating a bootdisk on a 1.44 Mb floppy will probably fail,
+because XFS needs a very large driver).") : ''))) or return;
+ }
+
+ my $floppy_dev;
+ my @l = detect_devices::floppies_dev() or die N("Sorry, no floppy drive available");
+ my %l = (
+ 'fd0' => N("First floppy drive"),
+ 'fd1' => N("Second floppy drive"),
+ 'Skip' => N("Skip"),
+ );
+ my $format = sub { $l{$_[0]} || $_[0] };
+
+ $in->ask_from_({
+ messages => N("Choose the floppy drive you want to use to make the bootdisk"),
+ }, [ { val => \$floppy_dev, list => \@l, format => $format } ]
+ ) or return;
+
+ $in->ask_warn('', N("Insert a floppy in %s", $format->($floppy_dev)));
+
+ my $_w = $in->wait_message('', N("Creating bootdisk..."));
+
+ require bootloader;
+ bootloader::mkbootdisk(kernelVersion(), $floppy_dev, $bootloader->{perImageAppend});
+ 1;
+}
+
sub setupBootloader {
my ($in, $b, $all_hds, $fstab, $security) = @_;
my $hds = $all_hds->{hds};
@@ -184,6 +245,7 @@ sub setupBootloader__general {
my $memsize = bootloader::get_append($b, 'mem');
my $prev_clean_tmp = my $clean_tmp = any { $_->{mntpoint} eq '/tmp' } @{$all_hds->{special} ||= []};
my $prev_boot = $b->{boot};
+ my $mkbootdisk;
$b->{password2} ||= $b->{password} ||= '';
$b->{vga} ||= 'normal';
@@ -203,6 +265,9 @@ sub setupBootloader__general {
{ label => N("Password (again)"), val => \$b->{password2}, hidden => 1 },
{ label => N("Restrict command line options"), val => \$b->{restricted}, type => "bool", text => N("restrict") },
),
+ if_(arch() !~ /alpha/ && arch() !~ /ppc/,
+ { label => N("Create a bootdisk"), val => \$mkbootdisk, type => 'bool', advanced => 1 },
+ ),
{ label => N("Clean /tmp at each boot"), val => \$clean_tmp, type => 'bool', advanced => 1 },
{ label => N("Precise RAM size if needed (found %d MB)", availableRamMB()), val => \$memsize, advanced => 1 },
if_(detect_devices::isLaptop(),
@@ -247,6 +312,8 @@ sub setupBootloader__general {
@{$all_hds->{special}} = grep { $_->{mntpoint} eq '/tmp' } @{$all_hds->{special}};
}
}
+ mkbootdisk($in, $b, $fstab) or return &setupBootloader__general if $mkbootdisk;
+
1;
}
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 851b9fe1b..601d59f01 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -271,13 +271,6 @@ sub addUser {
}
#------------------------------------------------------------------------------
-sub createBootdisk {
- my ($clicked, $ent_number, $auto) = @_;
- modules::write_conf($o->{prefix});
- installStepsCall($o, $auto, 'createBootdisk', $ent_number == 1, $clicked);
-}
-
-#------------------------------------------------------------------------------
sub setupBootloader {
my ($_clicked, $ent_number, $auto) = @_;
return if $::g_auto_install || $::uml_install;
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 52516eef1..af259f7dd 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -210,13 +210,6 @@ sub allowNVIDIA_rpms {
#-######################################################################################
#- Functions
#-######################################################################################
-sub kernelVersion {
- my ($o) = @_;
- my $kernel = readlink "$o->{prefix}/boot/vmlinuz" || first(all("$o->{prefix}/boot"));
- first($kernel =~ /vmlinuz-(.*)/);
-}
-
-
sub getNextStep {
my ($s) = $::o->{steps}{first};
$s = $::o->{steps}{$s}{next} while $::o->{steps}{$s}{done} || !$::o->{steps}{$s}{reachable};
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 2a4c2d23e..27c57376b 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -765,23 +765,6 @@ sub addUser {
}
#------------------------------------------------------------------------------
-sub createBootdisk($) {
- my ($o) = @_;
- my $dev = $o->{mkbootdisk} or return;
-
- my @l = detect_devices::floppies_dev();
-
- $dev = shift @l || die N("No floppy drive available")
- if $dev eq "1"; #- special case meaning autochoose
-
- return if $::testing;
-
- require bootloader;
- bootloader::mkbootdisk(install_any::kernelVersion($o), $dev, $o->{bootloader}{perImageAppend});
- $o->{mkbootdisk} = $dev;
-}
-
-#------------------------------------------------------------------------------
sub readBootloaderConfigBeforeInstall {
my ($o) = @_;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 6b287867c..00fc43133 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -1000,67 +1000,6 @@ sub addUser {
}
#------------------------------------------------------------------------------
-sub createBootdisk {
- my ($o, $first_time, $noauto) = @_;
-
- return if !$noauto && $first_time && !$::expert;
-
- if (arch() =~ /sparc/) {
- #- as probing floppies is a bit more different on sparc, assume always /dev/fd0.
- $o->ask_okcancel('',
- N("A custom bootdisk provides a way of booting into your Linux system without
-depending on the normal bootloader. This is useful if you don't want to install
-SILO on your system, or another operating system removes SILO, or SILO doesn't
-work with your hardware configuration. A custom bootdisk can also be used with
-the Mandrake rescue image, making it much easier to recover from severe system
-failures.
-
-If you want to create a bootdisk for your system, insert a floppy in the first
-drive and press \"Ok\"."),
- $o->{mkbootdisk}) or return $o->{mkbootdisk} = '';
- my @l = detect_devices::floppies_dev();
- $o->{mkbootdisk} = $l[0] if !$o->{mkbootdisk} || $o->{mkbootdisk} eq "1";
- $o->{mkbootdisk} or return;
- } else {
- my @l = detect_devices::floppies_dev();
- my %l = (
- 'fd0' => N("First floppy drive"),
- 'fd1' => N("Second floppy drive"),
- 'Skip' => N("Skip"),
- );
-
- if ($first_time || @l == 1) {
- $o->ask_yesorno('', formatAlaTeX(
- N("A custom bootdisk provides a way of booting into your Linux system without
-depending on the normal bootloader. This is useful if you don't want to install
-LILO (or grub) on your system, or another operating system removes LILO, or LILO doesn't
-work with your hardware configuration. A custom bootdisk can also be used with
-the Mandrake rescue image, making it much easier to recover from severe system
-failures. Would you like to create a bootdisk for your system?
-%s", isThisFs('xfs', fsedit::get_root($o->{fstab})) ? N("
-
-(WARNING! You're using XFS for your root partition,
-creating a bootdisk on a 1.44 Mb floppy will probably fail,
-because XFS needs a very large driver).") : '')),
- $o->{mkbootdisk}) or return $o->{mkbootdisk} = '';
- $o->{mkbootdisk} = $l[0] if !$o->{mkbootdisk} || $o->{mkbootdisk} eq "1";
- } else {
- @l or die N("Sorry, no floppy drive available");
-
- $o->ask_from_(
- {
- messages => N("Choose the floppy drive you want to use to make the bootdisk"),
- }, [ { val => \$o->{mkbootdisk}, list => \@l, format => sub { $l{$_[0]} || $_[0] } } ]
- ) or return;
- }
- $o->ask_warn('', N("Insert a floppy in %s", $l{$o->{mkbootdisk}} || $o->{mkbootdisk}));
- }
-
- my $_w = $o->wait_message('', N("Creating bootdisk..."));
- install_steps::createBootdisk($o);
-}
-
-#------------------------------------------------------------------------------
sub setupBootloaderBefore {
my ($o) = @_;
my $_w = $o->wait_message('', N("Preparing bootloader..."));
diff --git a/perl-install/steps.pm b/perl-install/steps.pm
index 4157c1394..87f937f21 100644
--- a/perl-install/steps.pm
+++ b/perl-install/steps.pm
@@ -29,9 +29,6 @@ use common;
configureX => [ N_("Configure X"), 1, 1, '1', ["formatPartitions", "setupBootloader"], 'X' ],
summary => [ N_("Summary"), 1, 0, '', "installPackages", 'summary' ],
configureServices => [ N_("Configure services"), 1, 1, '!$::expert', "installPackages", 'services' ],
-if_(arch() !~ /alpha/ && arch() !~ /ppc/,
- createBootdisk => [ N_("Create a bootdisk"), 1, 0, '', "installPackages", 'bootdisk' ],
-),
installUpdates => [ N_("Install system updates"), 1, 1, '', ["installPackages", "configureNetwork", "summary"], '' ],
exitInstall => [ N_("Exit install"), 0, 0, '', '', 'exit' ],
);