summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_interactive.pm
diff options
context:
space:
mode:
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
}
#------------------------------------------------------------------------------