summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-05-15 07:49:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-05-15 07:49:22 +0000
commitfeb100ee749fb38296f05ba97217d16be0655f7b (patch)
treed9fafe9dbcb5c2513058259727ed58c553a6886f
parentd6fd604feea333d91e077da3f50de05d8dd6732f (diff)
downloaddrakx-feb100ee749fb38296f05ba97217d16be0655f7b.tar
drakx-feb100ee749fb38296f05ba97217d16be0655f7b.tar.gz
drakx-feb100ee749fb38296f05ba97217d16be0655f7b.tar.bz2
drakx-feb100ee749fb38296f05ba97217d16be0655f7b.tar.xz
drakx-feb100ee749fb38296f05ba97217d16be0655f7b.zip
- bootloader-config:
o do create /boot/initrd-xxx.img when there is no bootloader (#30771 comment #21)
-rw-r--r--perl-install/NEWS3
-rwxr-xr-xperl-install/standalone/bootloader-config26
2 files changed, 27 insertions, 2 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index e06bb744e..a62372653 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,6 @@
+- bootloader-config:
+ o do create /boot/initrd-xxx.img when there is no bootloader
+ (#30771 comment #21)
- create udev nodes configuration file in /etc/udev/devices.d/ instead
of conf.d (used for modem and mouse)
- diskdrake:
diff --git a/perl-install/standalone/bootloader-config b/perl-install/standalone/bootloader-config
index 60afecd16..4010b1c73 100755
--- a/perl-install/standalone/bootloader-config
+++ b/perl-install/standalone/bootloader-config
@@ -61,8 +61,14 @@ if ($image) {
my $all_hds = fsedit::get_hds();
fs::get_info_from_fstab($all_hds);
-my $bootloader = bootloader::read($all_hds) or die "Cannot find a boot loader installed\n";
-
+my $bootloader = bootloader::read($all_hds);
+if (!$bootloader) {
+ if (member($action, 'add-kernel', 'remove-kernel')) {
+ warn "Cannot find a boot loader installed. Only taking care of initrd\n";
+ } else {
+ die "Cannot find a boot loader installed\n";
+ }
+}
$action =~ s/-/_/g;
$::{$action}->();
@@ -81,6 +87,13 @@ sub remove_kernel() {
unlink "/lib/modules/$kernel_version/source";
remove_now_broken_boot_symlinks();
+ if (!$bootloader) {
+ #- removing the initrd for weird configs where no mdv bootloader is configured
+ my $kernel_str = bootloader::vmlinuz2kernel_str($image) or die "bad kernel name $image\n";
+ unlink bootloader::kernel_str2initrd_long($kernel_str);
+ return;
+ }
+
my %proposed_labels;
my @new_entries;
@@ -124,6 +137,15 @@ sub add_kernel() {
my $kernel_str = bootloader::vmlinuz2kernel_str($image) or die "bad kernel name $image\n";
+ if (!$bootloader) {
+ #- building the initrd for weird configs where no mdv bootloader is configured
+ my $fake_bootloader = { vga => undef };
+ my %opts = (initrd_options => $initrd_options);
+ my $initrd_long = bootloader::kernel_str2initrd_long($kernel_str);
+ bootloader::mkinitrd($kernel_str->{version}, $fake_bootloader, { %opts }, "/boot/$initrd_long");
+ return;
+ }
+
my $root_part = fs::get::root([ fs::get::fstab($all_hds) ]) or die "can not find root partition\n";
my %opts = (
root => fs::wild_device::from_part('', $root_part),