From af74c75a0e05575958e8706fd33bd2d34b533c59 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 4 Jun 2016 14:24:51 +0200 Subject: document --- perl-install/bootloader.pm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'perl-install') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 7848af1a6..0d8a7c243 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1267,6 +1267,19 @@ sub method2text { }->{$method}; } + +=item method_choices_raw($b_prefix_mounted) + +Returns list of bootloaders. + +method_choices_raw(1) will return the list of installed boot loaders. + +method_choices_raw(0) will return the list of all boot loaders supported by drakboot. + +Returns: ("grub2", "grub2-graphic") + +=cut + sub method_choices_raw { my ($b_prefix_mounted) = @_; detect_devices::is_xbox() ? 'cromwell' : @@ -1280,6 +1293,15 @@ sub method_choices_raw { 'lilo-menu'), )); } + +=item method_choices($all_hds, $b_prefix_mounted) + +Returns list of supported bootloaders according to what is detected. + +Like method_choices_raw(), the $b_prefix_mounted parameter enables to return the list of either installed supported methods or the list of all supported boot loaders. + +=cut + sub method_choices { my ($all_hds, $b_prefix_mounted) = @_; my $fstab = [ fs::get::fstab($all_hds) ]; @@ -1293,6 +1315,15 @@ sub method_choices { && !(/grub2?-graphic/ && cat_("/proc/cmdline") =~ /console=ttyS/); } method_choices_raw($b_prefix_mounted); } + +=item main_method_choices($b_prefix_mounted) + +Returns list of supported bootloaders, not distinging text/gfx mode. + +Like method_choices_raw(), the $b_prefix_mounted parameter enables to return the list of either installed supported methods or the list of all supported boot loaders. + +=cut + sub main_method_choices { my ($b_prefix_mounted) = @_; uniq(map { main_method($_) } method_choices_raw($b_prefix_mounted)); -- cgit v1.2.1