summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-07-26 15:45:54 +0000
committerFrancois Pons <fpons@mandriva.com>2001-07-26 15:45:54 +0000
commit9d6759fc9fd11598ecfb00a4652419731deeb35a (patch)
tree56d7e63b7cc5b96c0b6026374df11b4faf372094 /perl-install/install_steps.pm
parent43377d2b8a3bbead12699b2984ca96e4c7e5d900 (diff)
downloaddrakx-backup-do-not-use-9d6759fc9fd11598ecfb00a4652419731deeb35a.tar
drakx-backup-do-not-use-9d6759fc9fd11598ecfb00a4652419731deeb35a.tar.gz
drakx-backup-do-not-use-9d6759fc9fd11598ecfb00a4652419731deeb35a.tar.bz2
drakx-backup-do-not-use-9d6759fc9fd11598ecfb00a4652419731deeb35a.tar.xz
drakx-backup-do-not-use-9d6759fc9fd11598ecfb00a4652419731deeb35a.zip
add support for modified blank.img floppy and Update Modules floppy.
In first case copy kernel to /boot/vmlinuz-default to be taken into account by bootloader suggestion method. In second case, check installed kernel and update any modules listed in the Update Modules floppy.
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm63
1 files changed, 62 insertions, 1 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index f8c368279..45810de73 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -420,7 +420,6 @@ Consoles 1,3,4,7 may also contain interesting information";
touch "$o->{prefix}/var/lock/TMP_1ST";
any::writeandclean_ldsoconf($o->{prefix});
- log::l("before install packages, after writing ld.so.conf");
#- make sure some services have been enabled (or a catastrophic restart will occur).
#- these are normally base package post install scripts or important services to start.
@@ -495,6 +494,68 @@ GridHeight=70
if -e "$o->{prefix}$_.mdkgisave";
}
}
+
+ if ($o->{blank} || $o->{updatemodules}) {
+ my @l = detect_devices::floppies();
+
+ foreach (qw(blank updatemodules)) {
+ $o->{$_} eq "1" and $o->{$_} = $l[0] || die _("No floppy drive available");
+ }
+
+ $o->{blank} and $o->copyKernelFromDiskette();
+ $o->{updatemodules} and $o->updateModulesFromDiskette();
+ }
+}
+
+sub copyKernelFromDiskette {
+ my ($o) = @_;
+ return if $::testing || !$o->{blank};
+
+ fs::mount($o->{blank}, "/floppy", "vfat", 0);
+ eval { commands::cp("-f", "/floppy/vmlinuz", "$o->{prefix}/boot/vmlinuz-default") };
+ if ($@) {
+ log::l("copying of /floppy/vmlinuz from blank modified disk failed: $@");
+ }
+ fs::umount("/floppy");
+}
+
+sub updateModulesFromDiskette {
+ my ($o) = @_;
+ return if $::testing || !$o->{updatemodules};
+
+ fs::mount($o->{updatemdoules}, "/floppy", "ext2", 0);
+ foreach (glob_("$o->{prefix}/lib/modules/*")) {
+ my ($kernelVersion) = m,lib/modules/(\S*),;
+ if (-d "/floppy/$kernelVersion") {
+ my @src_files = glob_("/floppy/$kernelVersion/*");
+ my @dest_files = split "\n", `find "$o->{prefix}/lib/modules`;
+ foreach my $s (@src_files) {
+ my ($sfile, $sext) = $s =~ /([^\/\.]*\.o)(?:\.gz|\.bz2)?$/;
+ my $qsfile = quotemeta $sfile;
+ my $qsext = quotemeta $sext;
+ foreach my $target (@dest_files) {
+ $target =~ /$qsfile/ or next;
+ eval { commands::cp("-f", $s, $target) };
+ if ($@) {
+ log::l("updating module $target by $s failed: $@");
+ } else {
+ log::l("updating module $target by $s");
+ }
+ if ($target !~ /$qsfile$qsext$/) {
+ #- extension differ, first rename target file correctly,
+ #- then uncompress source file, then compress it as expected.
+ my ($basetarget, $text) = $target =~ /(.*?)(\.gz|\.bz2)$/;
+ rename $target, "$basetarget$sext";
+ $sext eq '.gz' and run_program::run("gzip", "-d", "$basetarget$sext");
+ $sext eq '.bz2' and run_program::run("bzip2", "-d", "$basetarget$sext");
+ $text eq '.gz' and run_program::run("gzip", $basetarget);
+ $text eq '.bz2' and run_program::run("bzip2", $basetarget);
+ }
+ }
+ }
+ }
+ }
+ fs::umount("/floppy");
}
#------------------------------------------------------------------------------