FS#66804 - [linux] pmem support for webboot
Attached to Project:
Arch Linux
Opened by Daniel Maslowski (cyrevolt) - Wednesday, 27 May 2020, 22:32 GMT
Last edited by Andreas Radke (AndyRTR) - Wednesday, 27 January 2021, 15:49 GMT
Opened by Daniel Maslowski (cyrevolt) - Wednesday, 27 May 2020, 22:32 GMT
Last edited by Andreas Radke (AndyRTR) - Wednesday, 27 January 2021, 15:49 GMT
|
Details
With LinuxBoot and u-root, there is a new, more auditable
approach to bootloaders in firmware. One of these is
webboot, which allows for booting live ISO images, given
that the kernel to boot is configured with pmem support. It
can be used for recovery, installation, or a stateless
system, just like a live USB stick.
The webboot bootloader works roughly as follows: - connect to a network, download an ISO image - copy the ISO to RAM, loopback mount it - kexec the ISO's kernel, append `memmap=$SIZE!$SIZE root=/dev/pmem0` For the config for Arch, see https://github.com/u-root/webboot/blob/master/webboot/webboot.go#L94 As a PoC, we have successfully taken TinyCore, rebuilt the kernel with pmem support, remastered the ISO, and could just boot into it. We could also fetch the live ISO images of various distros and boot into them; however, we needed to use a different kernel, because none of the distro kernels so far supports pmem by default. Research notes are here: https://github.com/u-root/webboot/blob/master/distros.md#distributions-of-linux-based-systems To add pmem support, only a little change is necessary: ``` CONFIG_X86_PMEM_LEGACY_DEVICE=y CONFIG_X86_PMEM_LEGACY=y CONFIG_BLK_DEV_PMEM=y CONFIG_ARCH_HAS_PMEM_API=y ``` Note that these cannot be modules, because the modules wouldn't be available before the ISO. See also: https://github.com/u-root/webboot/#solutions |
This task depends upon
Closed by Andreas Radke (AndyRTR)
Wednesday, 27 January 2021, 15:49 GMT
Reason for closing: Implemented
Additional comments about closing: 29-1. NVDIMM modules are included in the initramfs by the block hook.
Wednesday, 27 January 2021, 15:49 GMT
Reason for closing: Implemented
Additional comments about closing: 29-1. NVDIMM modules are included in the initramfs by the block hook.
I've remastered an ISO by just adding the three files via `mkinitcpio.conf`, based on https://git.archlinux.org/archiso.git/tree/configs/releng/mkinitcpio.conf.
Here is a recording of the PoC in action: https://mastodon.social/@CyReVolt/104255555469684347
That allowed me to successfully remaster a SystemRescueCd ISO and boot it.
Just adding the hook to https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/configs/releng/mkinitcpio.conf at the end suffices.
Demo: https://mastodon.social/@CyReVolt/104257269439262783