Repository navigation
[14.5-stable] netboot: stop transferring the installer ISO twice - #6878
Closed
milan-zededa wants to merge 2 commits into
Closed
milan-zededa wants to merge 2 commits into
milan-zededa wants to merge 2 commits into
Conversation
The netboot grub.cfg loopback mounts installer.iso over the network so that grub can read the kernel, initrd and configs out of it, and grub_installer.cfg then named ($install_part)/installer.iso as the initrd source. That is a second URL, so the whole ~500MB image crossed the network again just to end up in the initramfs. Read the payload out of the ISO grub already has open instead: the installer rootfs image, plus the top-level config.img when the ISO carries one. The kernel now gets root=/rootfs_installer.img and mounts it directly, which also drops the nested iso9660 loop mount. config.img has to be conditional because the two ISO builders disagree. tools/makeiso.sh builds from installer.tar and leaves only EFI/, boot/, etc/ and rootfs_installer.img at the ISO root, while create_installer_iso in runme.sh copies /bits/config.img there so that config overrides passed as "docker run -v ...:/in lfedge/eve" reach the installer. The unconditional rootaddmount=/config.img was silently skipped on the former. initrd.sh gains an add_mounts helper so both layouts can resolve rootaddmount sources: under root= when rootimg= is set, in the initramfs otherwise. It also skips the blkid device hunt when root= names a file, which has nothing to find there and relied on blkid printing at least one line to finish early. A source taken from the initramfs cannot be bind mounted straight from there. switch_root unlinks the whole initramfs, and while the bind mount keeps working for reads afterwards, its source dentry is deleted and the kernel refuses a deleted dentry as the source of a further bind mount. The onboot containers do exactly that with /config.img, so they failed with "move_mount() failed: No such file or directory". Such sources are therefore moved onto a tmpfs first, which switch_root skips, keeping them linked. The installer.net tarball itself is unchanged, files and layout alike. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit 7116d64)
Update the PXE boot sequence in BOOT-INSTALLER.md for the payload being read out of the loop mounted ISO, and explain why naming the ISO as a second URL is what makes the image cross the network twice. Note that the netboot directory is far better served over HTTP than over TFTP. Grub's HTTP transport implements seek with a Range request, so it only transfers the ISO extents it actually reads, while its TFTP transport has no seek at all and restarts from byte 0 on every backward seek. Document how to get that: overriding $cmddevice in the EFI/BOOT/grub.cfg of the served directory, that its path is resolved from the root of that device rather than relative to where grub was loaded from, and that no explicit export is needed because grub exports cmddevice itself at startup. Also document rootimg= and rootaddmount= in the mkimage-iso-efi README. The rootaddmount source is resolved under root= when rootimg= is set and in the initramfs otherwise, which was not written down anywhere. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit fc25cab)
4 of 7 tasks
Contributor
Author
|
Closing: the original PR (#6380) was not backported to 16.0-stable or 17.0-stable either, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #6380 to
14.5-stable.Both commits of the PR are cherry-picked with
-xfrom7116d64533andfc25cab6af. The cherry-picks are clean, no conflicts.Without this fix
TestBootstrapWithNetworkBootfails: the installer image is transferred twice over TFTP and the installer does not finish.PR dependencies
None.
How to test and validate this PR
Covered by the evetest test
TestBootstrapWithNetworkBoot(added to14.5-stableby #6873):Changelog notes
Network boot of the installer no longer transfers the installer ISO twice.
Checklist
For backport PRs (remove it if it's not a backport):
And the last but not least:
check them.