summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_interactive.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-08-13 19:06:50 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-08-13 19:06:50 +0000
commit17b65ec06df7108085989f2e0398e1b834cd0358 (patch)
tree6c4a056dfeac594066fd7d41c621d390fedd3d17 /perl-install/install_steps_interactive.pm
parent0fc25337f6b7397a892d6724cb6dc3886d6f01f8 (diff)
downloaddrakx-17b65ec06df7108085989f2e0398e1b834cd0358.tar
drakx-17b65ec06df7108085989f2e0398e1b834cd0358.tar.gz
drakx-17b65ec06df7108085989f2e0398e1b834cd0358.tar.bz2
drakx-17b65ec06df7108085989f2e0398e1b834cd0358.tar.xz
drakx-17b65ec06df7108085989f2e0398e1b834cd0358.zip
initial revision for drakautoinst
- put %installSteps in a separate package (steps.pm) (for drakxtools) - use additional fields {auto} and {noauto}, by step, to ease interactive auto install and oem stuff - in install2.pm, perform each step either from the interactive class or from install_steps, according to the {auto} flag - id, tell each step to not try to be automatic if {noauto} - in the install, have auto install bootdisk created in install_any so we can always write a bootdisk (from install_steps) for further use from drakautoinst in standalone - interactive version of install_steps_auto_install is now inheriting from the interactive class, so we can click on a previous automatic step and have it interactively during an interactive auto install
Diffstat (limited to 'perl-install/install_steps_interactive.pm')
-rw-r--r--perl-install/install_steps_interactive.pm68
1 files changed, 3 insertions, 65 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 057f5e399..bc33ad6e8 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -1138,77 +1138,15 @@ sub generateAutoInstFloppy {
my ($o, $replay) = @_;
my $floppy = detect_devices::floppy();
-#+ $o->ask_yesorno('',
-#+_("Do you want to generate an auto install floppy for linux replication?"), $floppy) or return;
$o->ask_okcancel('', _("Insert a blank floppy in drive %s", $floppy), 1) or return;
my $dev = devices::make($floppy);
-
- my $image = cat_("/proc/cmdline") =~ /pcmcia/ ? "pcmcia" :
- ${{ hd => 'hd', cdrom => 'cdrom', ftp => 'network', nfs => 'network', http => 'network' }}{$o->{method}};
-
- if (arch() =~ /sparc/) {
- $image .= arch() =~ /sparc64/ && "64"; #- for sparc64 there are a specific set of image.
-
- my $imagefile = "$o->{prefix}/tmp/autoinst.img";
- my $mountdir = "$o->{prefix}/tmp/mount"; -d $mountdir or mkdir $mountdir, 0755;
- my $workdir = "$o->{prefix}/tmp/work"; -d $workdir or rmdir $workdir;
-
+ {
my $w = $o->wait_message('', _("Creating auto install floppy"));
- install_any::getAndSaveFile("images/$image.img", $imagefile) or log::l("failed to write $dev"), return;
- devices::make($_) foreach qw(/dev/loop6 /dev/ram);
-
- require commands;
- run_program::run("losetup", "/dev/loop6", $imagefile);
- fs::mount("/dev/loop6", $mountdir, "romfs", 'readonly');
- commands::cp("-f", $mountdir, $workdir);
- fs::umount($mountdir);
- run_program::run("losetup", "-d", "/dev/loop6");
-
- substInFile { s/timeout.*//; s/^(\s*append\s*=\s*\".*)\"/$1 kickstart=floppy\"/ } "$workdir/silo.conf"; #" for po
-#-TODO output "$workdir/ks.cfg", install_any::generate_ks_cfg($o);
- output "$workdir/boot.msg", "\n7m",
-"!! If you press enter, an auto-install is going to start.
- ALL data on this computer is going to be lost,
- including any Windows partitions !!
-", "7m\n";
-
- local $o->{partitioning}{clearall} = 1;
- output("$workdir/auto_inst.cfg", install_any::g_auto_install());
-
- run_program::run("genromfs", "-d", $workdir, "-f", "/dev/ram", "-A", "2048,/..", "-a", "512", "-V", "DrakX autoinst");
- fs::mount("/dev/ram", $mountdir, 'romfs', 0);
- run_program::run("silo", "-r", $mountdir, "-F", "-i", "/fd.b", "-b", "/second.b", "-C", "/silo.conf");
- fs::umount($mountdir);
- commands::dd("if=/dev/ram", "of=$dev", "bs=1440", "count=1024");
-
- commands::rm("-rf", $workdir, $mountdir, $imagefile);
- } else {
- my $param = 'kickstart=floppy ' . install_any::generate_automatic_stage1_params($o);
- {
- my $w = $o->wait_message('', _("Creating auto install floppy"));
- install_any::getAndSaveFile("images/$image.img", $dev) or log::l("failed to write $dev"), return;
- }
- fs::mount($dev, "/floppy", "vfat", 0);
- substInFile {
- s/timeout.*/$replay ? 'timeout 1' : ''/e;
- s/^(\s*append)/$1 $param/
- } "/floppy/syslinux.cfg";
-
- unlink "/floppy/help.msg";
- output "/floppy/boot.msg", "\n0c",
-"!! If you press enter, an auto-install is going to start.
- All data on this computer is going to be lost,
- including any Windows partitions !!
-", "07\n" if !$replay;
-
- local $o->{partitioning}{clearall} = !$replay;
- output("/floppy/auto_inst.cfg", install_any::g_auto_install($replay));
-
- fs::umount("/floppy");
- common::sync(); #- if you shall remove the floppy right after the LED switches off
+ install_any::getAndSaveAutoInstallFloppy($o, $replay, $dev) or return;
}
+ common::sync(); #- if you shall remove the floppy right after the LED switches off
}
#------------------------------------------------------------------------------