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
|
# 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
if [ -f /boot/cmdline.txt ]
then
existing_bootargs=$(cat /boot/cmdline.txt)
fi
# our mandatory options
mandatory_bootargs="root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
# and the user may specify more bootarg customization by giving
# them on the command line
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)"
echo $applied_kernel_cmdline > /boot/cmdline.txt
}
# install the bootloader on $loop_device
install_bootloader()
{
# nothing to do here, package raspberrypi-bootloader should have installed the
# appropriate files in /boot.
: # colon is no-op in shell
}
|