package bootloader;
use diagnostics;
use strict;
#-######################################################################################
#- misc imports
#-######################################################################################
use common;
use fs::type;
use fs::get;
use fs::loopback;
use fs::proc_partitions;
use log;
use any;
use devices;
use detect_devices;
use partition_table::raw;
use run_program;
use modules;
=head1 SYNOPSYS
B<bootloader> enables to configure various boot loaders (LILO, GRUB Legacy, GRUB2, ...)
Example of usage:
$all_hds = fsedit::get_hds();
fs::get_raw_hds('', $all_hds);
fs::get_info_from_fstab($all_hds);
$fstab = [ fs::get::fstab($all_hds) ];
$bootloader = bootloader::read($all_hds);
(...)
bootloader::action($bootloader, 'write', $all_hds);
A particular bootloader is handled in separate typical functions that can be called by action() by /sbin/bootloader-config:
=head1 VFS aka how to support a bootloader
Most of the code is generic.
A particular bootloader implementation/support is done through a couple functions:
=over 4
=item * read_FOOBAR()
read the config file(s) of the FOOBAR bootloader, returning a $bootloader object
=item * install_FOOBAR($bootloader, $all_hds)
usually call write_FOOBAR() & install_raw_FOOBAR() if existing, aka:
=over 4
=item * updating config files
=item * then reinstalling the bootloader
=back
=item * install_raw_FOOBAR()
Optionnal: Low level installation of the stage1 of the bootloader, usually embedding it in MBR or on ESP, ... (eg: running lilo or /boot/grub*/install.sh)
=item * write_FOOBAR($bootloader, $all_hds)
update the config files, ie when a kernel was installed or removed.
when_config_changed_FOOBAR() is called right after in case something is needed when config is done (eg: lilo needs to be reinstalled)
=item * when_config_changed_FOOBAR()
|