diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-08-04 03:03:15 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-08-04 03:03:15 +0000 |
commit | 2cfecdf41dcddc3a47ee5ff14142cc10dd85bc0e (patch) | |
tree | 5186c61b1ea4ff66ed5fa0d8ac67ee8409f011b6 | |
parent | 846f775826f1f8ccd04f69909043f94a3b51b837 (diff) | |
download | drakx-2cfecdf41dcddc3a47ee5ff14142cc10dd85bc0e.tar drakx-2cfecdf41dcddc3a47ee5ff14142cc10dd85bc0e.tar.gz drakx-2cfecdf41dcddc3a47ee5ff14142cc10dd85bc0e.tar.bz2 drakx-2cfecdf41dcddc3a47ee5ff14142cc10dd85bc0e.tar.xz drakx-2cfecdf41dcddc3a47ee5ff14142cc10dd85bc0e.zip |
handle win4lin kernels
-rw-r--r-- | perl-install/bootloader.pm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 2bcd76798..22df2c805 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -24,7 +24,7 @@ use modules; #-##################################################################################### #- Functions #-##################################################################################### -my $vmlinuz_regexp = 'vmlinuz'; +my $vmlinuz_regexp = 'vmlinuz|win4lin'; my $decompose_vmlinuz_name = qr/((?:$vmlinuz_regexp).*)-(\d+\.\d+.*)/; sub expand_vmlinuz_symlink { @@ -86,9 +86,10 @@ sub vmlinuz2kernel_str { } sub kernel_str2label { my ($kernel, $o_use_long_name) = @_; + my $base = $kernel->{basename} eq 'vmlinuz' ? 'linux' : $kernel->{basename}; $o_use_long_name || $kernel->{use_long_name} ? - sanitize_ver("linux-$kernel->{version}") : - $kernel->{ext} ? "linux$kernel->{ext}" : 'linux'; + sanitize_ver("$base-$kernel->{version}") : + $kernel->{ext} ? "$base$kernel->{ext}" : $base; } sub get { @@ -558,14 +559,15 @@ sub get_kernels_and_labels { sub sanitize_ver { my ($string) = @_; - my ($main_version, undef, $extraversion, $rest) = - $string =~ m!(\d+\.\d+\.\d+)(-((?:pre|rc)\d+))?(.*)!; + my ($name, $main_version, undef, $extraversion, $rest) = + $string =~ m!(.*)(\d+\.\d+\.\d+)(-((?:pre|rc)\d+))?(.*)!; if (my ($mdkver, $cpu, $nproc, $mem) = $rest =~ m|-(.+)-(.+)-(.+)-(.+)|) { $rest = "$cpu$nproc$mem-$mdkver"; } + $name = '' if $name eq 'linux-'; - my $return = "$main_version$extraversion$rest"; + my $return = "$name$main_version$extraversion$rest"; $return =~ s|\.||g; $return =~ s|mdk||; |