From 0d61c6c559469cf4df58b0f59a78172c72afe878 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 22 Nov 2017 14:00:42 +0000 Subject: Remove obsolete code for generating old draklive-style initrds. Move the remaining code in the Initrd module into draklive - it's just a call to bootloader::add_kernel() and only gets used in one place, so doesn't need wrapping. --- draklive | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'draklive') diff --git a/draklive b/draklive index 27bbbde..ad0ce5c 100755 --- a/draklive +++ b/draklive @@ -36,13 +36,9 @@ use MDV::Draklive::Utils; use MDV::Draklive::Live; use MDV::Draklive::Progress; use MDV::Draklive::Loopback; -use MDV::Draklive::Initrd; use MDV::Draklive::Config; use MDV::Draklive::Storage; -#- FIXME: remove completely code handling old draklive-style initrds -my $use_dracut = 1; - sub get_syslinux_path { my ($media, $opts) = @_; '/' . $media->{storage} . '/syslinux' . ($opts->{boot} && '-boot-' . $opts->{boot}) . '.cfg'; @@ -57,8 +53,7 @@ sub get_default_append { my ($live, $opts) = @_; my $append = $opts->{append} || $live->{system}{append}; join(' ', - if_($use_dracut || !need_media_specific_boot($live), - 'root=mgalive:' . $live->{media}->get_media_source_for_nash), + 'root=mgalive:' . $live->{media}->get_media_source_for_nash, if_($live->{system}{vga_mode} && $append !~ /\bvga=\b/, 'splash quiet noiswmd audit=0 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0', 'vga=' . $live->{system}{vga_mode}), @@ -510,10 +505,16 @@ sub create_initrd { mount_system_fs($live); - if (!$use_dracut && need_media_specific_boot($live)) { - MDV::Draklive::Initrd::create_media_initrd($live); - } else { - MDV::Draklive::Initrd::create_classical_initrd($live); + my $kernel = $live->find_kernel; + print "using kernel $kernel->{version}\n"; + + my $initrd_file = $root . '/boot/' . $live->get_initrd_name; + unlink($initrd_file); + + { + my $bootloader = {}; + local $::prefix = $root; + bootloader::add_kernel($bootloader, $kernel, { label => 'linux', vga => $live->{system}{vga_mode} }, '', $live->{system}{no_initrd}); } umount_system_fs($live); -- cgit v1.2.1