[Cc Ben as he gave feedback to the last iteration, Luca as he wanted something actionable]
Hi folks
As I abondened the last try and also learned some new things in the
meantime, I'd like to discuss another try at re-organizing how Debian
does boot loaders and initramfs. This mail mostly tries to get the
goals
and requirements straight.
Please provide feedback. Also for missing stuff.
Regards,
Bastian
## Goals
- Setup complete boot entries from packaged and generated files
- Support dumb file systems for /boot by default, so boot loaders can
 drop complex file system support.
- Re-create stuff in /boot from scratch
- Remove symlink handling from kernel package
- Single entry point for packages and admins, aka no tool specific
 "update-initramfs" anymore
## Requirements
- Read package files in /usr
- Uses observed state, not changes provided by maintainer scripts
- Dumb writes to /boot. No rename, no sym, hard links. Can use ref
 links if possible.
- Generate initramfs if needed, creates new entry if re-generated
- Keep older stuff (like previous kernel, initramfs) for a short
while
- Possible to support multiple targets, like grub, zipl, flash-kernel
- Multiple inputs, plain kernel, UKI, also in one version
- Combinations of inputs, Xen+Linux
- Completely outside of kernel package
- Backward compatible support for stuff packaged in /boot
- Use config for kernel command line
## Open questions
- How to select default entry if supported, just sort by version and
use
 newest? This also works somewhat in BLS.
- How to interface with boot loaders, just absorb all knowledge about
 config and only run install tools if necessary (like with zipl as
 block map based loader)? grub might get support for BLS, at least
 there exists a patch somewhere, that will make it easier, and we
can
 just iterate over config files defining one entry each.
## Prior works
- Current Debian: change based, overwrites by dpkg in /boot,
versioned
 by ABI
- systemd install-kernel: only BLS as target, which nothing used by
 default in Debian can read
More?
## File system layout
Some initial ideas about how stuff could look.
### Boot file system (/boot)
This file system might be shared, so everything is somewhat
referenced
to the machine id. This should be somewhat compatible with BLS (type
1).
* /boot/$machineid/
 * ./grub/: config snippets, so we can do "no overwrite"
### Distribution file system (/usr)
* /usr/lib/boot/$package(_$modifier)/
 * ./data: raw data for item
 * ./metadata: info about item in undetermined format
## Prior works
[..]
- systemd install-kernel: only BLS as target, which nothing used by
default in Debian can read
[..]
## File system layout
Some initial ideas about how stuff could look.
### Boot file system (/boot)
This file system might be shared, so everything is somewhat referenced
to the machine id. This should be somewhat compatible with BLS (type
1).
* /boot/$machineid/
* ./grub/: config snippets, so we can do "no overwrite"
On Tue, Nov 01, 2022 at 09:29:07PM +0100, Bastian Blank wrote:
## Prior works
[..]
- systemd install-kernel: only BLS as target, which nothing used by
default in Debian can read
[..]
To maybe clarify this a bit: While kernel-install does target BLS primarily, it
has support for differing layouts via the KERNEL_INSTALL_LAYOUT environment variable (set via layout= in {/usr/lib,/etc}/kernel/install.conf).
kernel-install scripts are also just that, executables with two CLI entry points
(add and remove) and a set of fixed environment variables that they
receive. Currently all of this is written in POSIX shell (compatible with dash) - they can be made to do everything.
kernel-install and BLS support a bit more than the machine ID here, The relevant
keyword to look for in the kernel-install manpage and BLS is "entry-token". This was added for golden master setups, because the machine ID will probably only generated on first boot, but the initrd would be generated beforehand.
On Tue, 2022-11-01 at 21:29 +0100, Bastian Blank wrote:
## Goals
- Setup complete boot entries from packaged and generated files
- Support dumb file systems for /boot by default, so boot loaders can
 drop complex file system support.
- Re-create stuff in /boot from scratch
- Remove symlink handling from kernel package
- Single entry point for packages and admins, aka no tool specific
 "update-initramfs" anymore
Could you clarify what you mean by "single entry point" here? It's the
only point I can't quite decode. A trigger?
I would like to suggestion this as an additional, explicit goal, rather
than implicit:
End result should be fully compatible with the BLS (for the readers: https://uapi-group.org/specifications/specs/boot_loader_specification/
)
## Open questions
- How to select default entry if supported, just sort by version and
use
 newest? This also works somewhat in BLS.
Yes, we should follow BLS on this, so that end result is predictable, well-defined and doesn't vary wildly from other distros.
In fact, if Grub can do UKIs, do we even need Type 1 entries (separate textual config files) for anything at that point?
### Distribution file system (/usr)
* /usr/lib/boot/$package(_$modifier)/
 * ./data: raw data for item
 * ./metadata: info about item in undetermined format
What would 'metadata' be in this context?
On Mon, Nov 07, 2022 at 11:40:46AM +0100, Jörg Behrmann wrote:
On Tue, Nov 01, 2022 at 09:29:07PM +0100, Bastian Blank wrote:
## Prior works
[..]
- systemd install-kernel: only BLS as target, which nothing used by
default in Debian can read
[..]
To maybe clarify this a bit: While kernel-install does target BLS primarily, it
has support for differing layouts via the KERNEL_INSTALL_LAYOUT environment variable (set via layout= in {/usr/lib,/etc}/kernel/install.conf).
Okay. However no multi-selection.
kernel-install scripts are also just that, executables with two CLI entry points
(add and remove) and a set of fixed environment variables that they receive. Currently all of this is written in POSIX shell (compatible with dash) - they can be made to do everything.
Add and remove are not enough for what I would like to have.
And I'm
really not in the mood to try that in POSIX shell.
Is it even able to
make sure stuff is actually written on the disk?
kernel-install and BLS support a bit more than the machine ID here, The relevant
keyword to look for in the kernel-install manpage and BLS is "entry-token". This was added for golden master setups, because the machine ID will probably
only generated on first boot, but the initrd would be generated beforehand.
And I assume it got no way to migrate from an pre-defined entry-token to
the machine ID later on, which would be kind of useful to convert a
golden image into a real system where you can add unrelated systems
later.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 24:27:23 |
Calls: | 9,729 |
Calls today: | 19 |
Files: | 13,741 |
Messages: | 6,182,417 |
Posted today: | 2 |