1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
# vim: filetype=sh
# bootloader management
# ---------------------
# configure the bootloader appropriately, given the variable $kernel_bootargs
# and any other target-specific requirements.
configure_bootloader()
{
# get existing conf in chroot environment if any...
# sample code:
# if [ -f /boot/cmdline.txt ]
# then
# existing_bootargs=$(cat /boot/cmdline.txt)
# fi
# our mandatory options
mandatory_bootargs="root=<some-device> rootfstype=ext4 rootwait"
# The user may specify more bootarg customization by giving
# them on the command line (option --config-kernel-bootargs).
# Specifying "<bootarg>[=<value>]" or "+<bootarg>[=<value>]"
# allows to add or overwrite any previous definition of <bootarg>.
# Specifying "-<bootarg>" allows to remove any definition of
# <bootarg> from the kernel cmdline.
explicit_bootargs=$kernel_bootargs
# order of precedence is:
# explicit_bootargs > mandatory_bootargs > existing_bootargs
applied_kernel_cmdline="$(aggregate_kernel_cmdline $existing_bootargs \
$mandatory_bootargs $explicit_bootargs)"
# write computed $applied_kernel_cmdline in appropriate configuration file...
}
# install the bootloader on $loop_device
install_bootloader()
{
my_bootloader_install $loop_device
}
|