extlinux: Support a firmware-visible boot directory
When a separate boot partition is used, firmware such as U-Boot sees
this as a separate filesystem on a different device, since there is no
concept of a mount point in firmware.
This means that files must be loaded from the root directory of the boot
partition, rather than from '/boot'.
However a common case, which we need to support, is using a unified
filesystem. In this case the firmware must load files from the /boot
directory.
Provide a configuration option for extlinux which sets this boot
directory. This allows the correct path to be used in extlinux.conf when
loading the kernel and related files.
This feature mirrors the _BOOT_DIRECTORY and _BOOT_PATH logic used by
the u-boot-menu package (in /usr/share/u-boot-menu/read-config).
For now, curthooks itself does not support providing this config.
extlinux: Split out processing into setup_extlinux()
The grub implementation uses a setup_grub() function which takes just
the boot configuration. Do the same for extlinux so we can add more
logic there, with access to the full config.
The test_install_extlinux() test actually calls install_extlinux() with
the wrong config. Fix that and tidy up some comments while we are here.
When running tests with tox this warning appears:
curtin/commands/curthooks.py:417: DeprecationWarning:
The 'warn' method is deprecated, use 'warning' instead
LOG.warn("Couldn't detect kernel package to install for %s."
When running tox on a vanilla Ubuntu 24.04 I get this error:
In file included from python/acquire-item.cc:24:
python/apt_pkgmodule.h:14:10: fatal error: apt-pkg/hashes.h:
No such file or directory
14 | #include <apt-pkg/hashes.h>
| ^~~~~~~~~~~~~~~~~~
Add a note in the hacking instructions to help with this.