From e0246d7b70809b6f6567aaa62b4a4f61b5e09d8d Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 9 Nov 2009 11:48:44 +0000 Subject: use bootloader module to build initrd and create kernel symlinks (gdium friendly) --- lib/MDV/Draklive/Initrd.pm | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'lib') 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; -- cgit v1.2.1