summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-11-09 11:48:44 +0000
committerOlivier Blin <oblin@mandriva.com>2009-11-09 11:48:44 +0000
commite0246d7b70809b6f6567aaa62b4a4f61b5e09d8d (patch)
treeae554ad109d9e379bb7ff32fd054f74b40fab991 /lib
parent203dc993aa05736ed1b599729850e65de94e56fe (diff)
downloaddraklive-e0246d7b70809b6f6567aaa62b4a4f61b5e09d8d.tar
draklive-e0246d7b70809b6f6567aaa62b4a4f61b5e09d8d.tar.gz
draklive-e0246d7b70809b6f6567aaa62b4a4f61b5e09d8d.tar.bz2
draklive-e0246d7b70809b6f6567aaa62b4a4f61b5e09d8d.tar.xz
draklive-e0246d7b70809b6f6567aaa62b4a4f61b5e09d8d.zip
use bootloader module to build initrd and create kernel symlinks (gdium friendly)
Diffstat (limited to 'lib')
-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;