File: bootloader

package info (click to toggle)
debootstick 2.8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 296 kB
  • sloc: sh: 1,364; makefile: 34
file content (42 lines) | stat: -rw-r--r-- 1,339 bytes parent folder | download | duplicates (3)
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
}