summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Draklive/Initrd.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MDV/Draklive/Initrd.pm')
-rw-r--r--lib/MDV/Draklive/Initrd.pm23
1 files changed, 7 insertions, 16 deletions
diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm
index 489e1f1..c885c29 100644
--- a/lib/MDV/Draklive/Initrd.pm
+++ b/lib/MDV/Draklive/Initrd.pm
@@ -296,27 +296,18 @@ sub add_splash {
sub create_classical_initrd {
my ($live) = @_;
my $root = $live->get_system_root;
- my $kernel = $live->find_kernel->{version};
- #- FIXME: use bootloader-config and allow it not to require a bootloader?
- print "using kernel $kernel\n";
-
- my $vmlinuz_long = '/boot/vmlinuz-' . $kernel;
- my $vmlinuz_short = '/boot/vmlinuz';
- symlinkf(basename($vmlinuz_long), $root . $vmlinuz_short);
-
- $live->{system}{no_initrd} and return;
+ my $kernel = $live->find_kernel;
+ print "using kernel $kernel->{version}\n";
- my $initrd_long = '/boot/initrd-'. $kernel . '.img';
- my $initrd_short = '/boot/initrd.img';
run_('mount', '-t', 'proc', '/proc', $root . '/proc');
run_('mount', '-t', 'sysfs', '/sys', $root . '/sys');
- run_({ root => $root }, 'mkinitrd', '-v', '-f', $initrd_long, $kernel);
+ {
+ my $bootloader = {};
+ local $::prefix = $root;
+ bootloader::add_kernel($bootloader, $kernel, { label => 'linux' }, '', $live->{system}{no_initrd});
+ }
run_('umount', $root . '/sys');
run_('umount', $root . '/proc');
- if (-f $root . $initrd_long) {
- symlinkf(basename($initrd_long), $root . $initrd_short);
- add_splash($live, $initrd_long);
- }
}
1;