diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-12-18 10:54:01 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-12-18 10:54:01 +0000 |
commit | 296dc5bb53c430c8842ab7327d8a76b5750c64b4 (patch) | |
tree | 5670e983d5d459466dac2b7a49b7ce14827c7e9d /lib/MDV/Draklive/Live.pm | |
parent | 7e53518a7d8709998482eef1e9da21ee1a1886a9 (diff) | |
download | drakiso-296dc5bb53c430c8842ab7327d8a76b5750c64b4.tar drakiso-296dc5bb53c430c8842ab7327d8a76b5750c64b4.tar.gz drakiso-296dc5bb53c430c8842ab7327d8a76b5750c64b4.tar.bz2 drakiso-296dc5bb53c430c8842ab7327d8a76b5750c64b4.tar.xz drakiso-296dc5bb53c430c8842ab7327d8a76b5750c64b4.zip |
Start creating a new set of tools for generating Mageia ISO images.
The aim is to share as much code as possible between the tool used
to generate the Live ISOs and the tool used to generate the classic
installer ISOs.
This is derived from the user/martinw/use-grub2 branch of draklive.
Diffstat (limited to 'lib/MDV/Draklive/Live.pm')
-rw-r--r-- | lib/MDV/Draklive/Live.pm | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/lib/MDV/Draklive/Live.pm b/lib/MDV/Draklive/Live.pm deleted file mode 100644 index d2adb1f..0000000 --- a/lib/MDV/Draklive/Live.pm +++ /dev/null @@ -1,70 +0,0 @@ -package MDV::Draklive::Live; - -use MDK::Common; - -sub new { - my ($class) = @_; - bless {}, $class; -} - -sub default_name_fields { - my ($live) = @_; - [ qw(name version product desktop), - if_($live->{settings}{region} ne 'all', region), - qw(arch media) - ]; -} - -sub get_name { - my ($live) = @_; - my $fields = $live->{name_fields} || default_name_fields($live); - join('-', grep { $_ } @{$live->{settings}}{@$fields}); -} - -sub get_set_suffix { - my ($live) = @_; - $live->{settings}{set} ? "-$live->{settings}{set}" : ""; -} - -sub get_builddir { - my ($live) = @_; - $live->{settings}{builddir} . '/' . $live->get_name . $live->get_set_suffix; -} - -sub get_system_root { - my ($live) = @_; - $live->{settings}{chroot} . '/' . $live->get_name . $live->get_set_suffix; -} - -sub get_media_prefix { - my ($live, $setting, $o_boot) = @_; - my $hidden = $live->{system}{hide_media_dirs} && $live->{media}->get_boot_setting('can_hide', { boot => $o_boot }); - $live->{prefix}{media}{$hidden ? "hidden_$setting" : $setting}; -} - -sub find_kernel { - my ($live) = @_; - require bootloader; - local $::prefix = $live->get_system_root; - my @kernels = bootloader::get_kernels_and_labels(); - my $kernel; - if ($live->{system}{kernel}) { - $kernel = find { $_->{version} eq $live->{system}{kernel} } @kernels; - $kernel or die "kernel $live->{system}{kernel} can not be found\n"; - } - $kernel ||= first(@kernels) or die "no kernel can be found\n"; -} - -sub get_initrd_name { - my ($live) = @_; - 'initrd-' . $live->find_kernel->{version} . '.img'; -} - -sub get_lib_prefix { - my ($live) = @_; - my $lib_prefix = find { glob($live->get_system_root . $_ . '/libc.so.*') } qw(/lib64 /lib); - $lib_prefix or die 'unable to find system libraries in /lib or /lib64'; - $lib_prefix; -} - -1; |