-
Notifications
You must be signed in to change notification settings - Fork 82
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 1/2 #209
Conversation
Related (and must be merged at the same time): PR created for part 2/2 (vyos-build): vyos/vyos-build#427 |
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
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.
|
PR updated for part 2/2 (vyos-build): vyos/vyos-build#427 |
I think I have figured out why a fresh install works but not an update of existing install. That is because when you in the existing install run While when doing a fresh install you boot from the ISO which do contain the updated scripts. So any suggestions on how to resolve this "chicken or the egg" situation? One suggestion is to alter the op-mode for This updated op-mode could then be backported so users with lets say LTS 1.3.4 could first update to LTS 1.3.5 and then make the jump to LTS 1.4.0 or 1.5-rolling. For the PR's regarding T5593 this would mean that first a nightly with the updated op-mode must be available (along with some note in forum and blog) and then from there merge the PR's for T5593. |
Update commited to fix so VyOS now can do both fresh install and upgrade from previous install (if image where these commits are merged were used for the previous install). Note! Since VyOS prior to these PR's (involving T5593) cannot properly upgrade a fresh install is needed OR that the op-mode Updated files:
|
Created https://vyos.dev/T5622 which must first be resolved before T5593 can get successfully merged. |
@Apachez- the issue that you have encountered is similar to one we are acutely familiar with in the context of I think these investigations are worthwhile, however, a few important points: (1) seamless upgrades of VyOS images is a notable and fundamental feature of VyOS and any disturbance beyond the occasional workaround for a broken migration should be avoided. You'll recall how disruptive was the case of the change in coreutils (T5267, T5520) --- note that a breakage in the continuity of the upgrade path never goes away: at some point, a user with an iso of that period will try to upgrade and require the workarounds as outlined for users on the forum and phabricator (as you had helped with). (2) as mentioned in the task, the image-tools revision is being readied to move out of draft; fundamental changes to legacy tools (which we are all anxious to get rid of) will conflict with that. These investigations are useful and can be done in parallel or subsequent to that change. (3) introducing a workaround that may later need to be revisited or reverted will leave a lasting footprint as in (1), and needs to be carefully considered. Finally, asking a user to just do a fresh install OR download a special tool/script to update is a burden; again, something similar was considered for 1768 and rejected --- had that not been the case, we would have merged it with a notice of the breaking change. |
(edits above for clarity) |
I think this should be designed for future updates where the
A less distruptive workaround would be to provide an update script which could be runned prior to upgrading the image (basically overwriting the local editions of The pentalty for now will be that we are stuck with 33MB of redundant junk in the ISO as long as the upgrade script cant be fixed. |
I agree that we should keep that 33MB and your careful investigation in mind: at the moment, I will happily pay 33MB to avoid disgruntled users, our time providing workarounds, and the break in a strong feature of VyOS. One idea that has been discussed, similar to your suggestion, is the possibility of providing a tool that updates earlier images of a system, overwriting their file systems with newer image tools --- this would only be provided as an option, with severe warnings of router destruction, for use at the discretion of an expert. etc. etc. ... it should never be required or default to introduce a breaking change in upgrade continuity. This was tested out of curiosity a few months ago, but would only be introduced after guaranteeing a seamless non-interactive update path, if at all. |
I suppose you already considered the below but I got a suggestion on how to resolve this issue: TLDR: Before production users can upgrade into LTS 1.4.0 they first must (if on 1.2.x) upgrade to 1.2.10 or (if on 1.3.x) upgrade to 1.3.10. From the 1.x.10 version they can upgrade into LTS 1.4.0. Another option for production users is to do a fresh install using LTS 1.4.0. The above will be stated in the release notes for LTS 1.4.0. For 1.5-rolling users prior to 2023-09-30 they must first upgrade to 1.5-rolling 2023-10-01 before going to whatever 1.5-rolling version they prefer (which is 2023-10-01 or newer). Another option for the rolling usesr is to do a fresh install using 1.5-rolling 2023-10-01. The above will be stated on blog and forum. Longer edition:
|
So, maintaining a non-intrusive upgrade path is a high bar --- any requirement of the user for workarounds or extra steps would be considered a critical failing of that feature. Secondly, I can imagine that some of the changes planned for development in the near future could easily add or subtract several 10s of MB, so let us not worry about the difference now, and certainly not in the face of the high bar set by our requirement. Now, I very much appreciate interesting workarounds, but it is not worth jeopardizing any stability; better to focus on increasing stability under the design of evolving legacy -> modern --- that to me is the more challenging technical problem, and one of the many cool things about the VyOS project ... |
I would still consider it to be a flaw that the upgrade script is dependent on whats currently installed within the installation rather than whats provided through the ISO itself. Even if other improvements will shave off another 10's of MB then there will still exist ~33MB of junk which could have been shaved off aswell as long as the upgrade scripts wasnt locked in a position where they doesnt seem to be able to be upgraded without some additional step (either if that step is to run a specific script or to be forced to pass a specific version). That is I really hope that the new python-based upgrade script will have a capability to utilize whats provided by the ISO itself (to be upgraded into) in terms of scripting. |
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. |
Further shrink VyOS imagesize (ISO) by moving Linux kernel-files out of the filesystem.squashfs and into the live-directory of the ISO.
Note! There is a part 2/2 of this for vyos-build that must be merged at the same time.
For this to work following files have been modified:
scripts/install/install-image-new
So the Linux-kernel files are copied to the persistent boot-directory during install.
scripts/install/install-image-existing
So the Linux-kernel files are copied to the persistent boot-directory during upgrade.
Smoketest results:
For more information see task: