-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T5593: Further shrink VyOS imagesize, part 2/2 #427
Conversation
Related (and must be merged at the same time): PR created for part 1/2 (vyatta-cfg-system): vyos/vyatta-cfg-system#209 |
This shrinks the ISO by 33MB which is a significant gain
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An iso built from this and the companion PR will not boot in KVM or serial console; running make test shows:
DEBUG - error: no suitable video mode found.
DEBUG - error: no suitable video mode found.
DEBUG - Booting in blind modeBooting in blind mode
That's actually a false positive - we had that one for years, its a Kernel message. On the other hand, the resulting ISOs boot in QEMU using |
This exists already in the regular nightly builds: |
Using VirtualBox 7.0.10 at host Ubuntu 23.04 (Ubuntu Linux kernel 6.2.0-33-generic #33-Ubuntu SMP PREEMPT_DYNAMIC Tue Sep 5 14:49:19 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux). Booting installation with VyOS 1.5-rolling-202309240023 works without problems. Upgrading above to the build including the 2 commits (part 1 and 2) aka the same as smoketests were runned at when creating the PR's works without problem but fails during boot:
After reboot:
and then thrown back to the grub selector. Doing a fresh install using vyos-1337-230927-2-amd64.iso fails to boot aswell (from the ISO). Conclusion: Something odd is going on... Comparing the directories for when upgrade was runned:
Vs a clean installation: Stuck at boot menu (no errors just thrown back to the boot menu with VyOS logo). Mounting the ISO manually and looking at /boot/grub/grub.cfg:
However when in the boot menu pressing TAB to alter the bootstring the "vmlinuz-6.1.55-amd64-vyos" is nowhere to be seen? Anyone who want to explain that to me? :-) That the boot fails from ISO could of course be due to that symlinks are supported by the Rock Ridge ISO format while the bios of VirtualBox and others perhaps only uses Joliet which doesnt support symlinks? That would explain why the smoketests and booting through QEMU works. However even if the symlinks are removed (as in real files are placed in /live-directory of the ISO instead of the symlinks) there is still an issue with the copy script thats supposed to copy the Linux kernel files from the ISO to the persistent boot directory. That is the copy script for a new installation obviously works (otherwise the smoketests would have failed to start) while the one for an upgrade is the one that for whatever reason fails. Lets pause these PR's for now and Ill return when I have explored this some more... |
Hmm, enabling EFI in VirtualBox makes the clean install to be successful including booting afterwards (as in |
Regarding the differences in boot: It seems like when EFI is used then /boot/grub/grub.cfg defines the boot menu.
But when classic BIOS is used then /isolinux/live.cfg defines the boot menu.
|
Update commited to fix so VyOS now boots on both EFI (where /boot/grub/grub.cfg is used) and classic BIOS (where /isolinux/live.cfg is used). Updated file |
PR updated for part 1/2 (vyatta-cfg-system): vyos/vyatta-cfg-system#209 |
Created https://vyos.dev/T5622 which must first be resolved before T5593 can get successfully merged. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Thanks for the effort, but due to the issues outlined by @jestabro et al., I believe we have to put up with missing opportunities to shrink the image rather than risk regressions. |
Perhaps this can be reopened for VyOS 2.0 whenever that happens? The point of T5593 is to remove redudant information from the ISO itself and by that shrink it with a great amount. |
Change Summary
Further shrink VyOS imagesize (ISO) by moving Linux kernel-files out of the filesystem.squashfs and into the live-directory of the ISO.
This will save (according to tests) approx 31MB (the resulting nightly build should shrink from 391MB down to approx 360MB).
Note! There is a part 1/2 of this for vyatta-cfg-system that must be merged at the same time.
Types of changes
Related Task(s)
Component(s) name
build
Proposed changes
In order to further shrink the VyOS imagesize (ISO) the Linux kernel-files have moved out of the filesystem.squashfs and into the live-directory of the ISO.
For this to properly work the Linux kernel-files have to be copied to the persistent boot-directory during install/upgrade.
Note! There is a part 1/2 of this for vyatta-cfg-system that must be merged at the same time.
For this to work following files have been modified:
data/live-build-config/rootfs/excludes
Excludes all files in chroot/boot except the symlinks for initrd.img and vmlinuz from the filesystem.squashfs.
data/live-build-config/hooks/live/99-copy-linux-kernel.binary
New file that makes sure to copy Linux-kernel files from chroot/boot to binary/live during the binary phase (creating ISO) when building VyOS.
How to test
Build 1.5-rolling where both part 1 and 2 are included and verify that all smoketests are successful like so:
Checklist: