Hi All,
I’ve bene trying to fault find something on my machine and I wanted to get the communities opinion on what I had to do to get it to work and whether what I changed makes sense and/or whether I should submit it as a patch or not.
I had terrible trouble trying to modify the vyos-1x repository, build it into an ISO and run the built in tests. They kept failing weirdly just by adding an extra package to the debian/control file in the vyos-1x repository. After a lot of debugging I managed to chase it down to a timing problem with the way check-qemu-install boots a VM and runs the self tests. In the current script, as in the vyos-build repository it follows the following steps to boot the system
- Boot the VM with QEMU
- Wait for UEFI String “BdsDxe” to appear
- Wait for GRUB String “GNU GRUB” to appear
- Wait 5 seconds for GRUB to initialise
- Press the “Down Key” on the keyboard
- Wait 0.5 seconds
- Repeat steps 5 and 6
- Press “Return” on the Keyboard
This should select the “Serial Console” option in GRUB and boot it. This is what is needed to run the tests.
On my setup this was failing because it took about 4 seconds to initialise GRUB before adding the package and over 5 seconds after adding the package to debian/control. (as an aside, I have absolutely no idea why adding a package adds such time to the boot process, but it does for some reason. It doesn’t when I use –custom-package but it does using debian/control. Race Conditions are fickle!). I tried messing with the wait time in step 4 but that felt like a hack as it could go up and down and be unreliable. I ended up changing the logic to look more like the following
- Boot the VM with QEMU
- Wait for UEFI String “BdsDxe” to appear
- Wait for GRUB String “The highlighted entry will be executed automatically in” to appear
- Wait 2 seconds, just in case
- Press the “Down Key” on the keyboard
- Wait 0.5 seconds
- Repeat steps 5 and 6
- Press “Return” on the Keyboard
This logic means it waits for GRUB to have completely loaded no matter what and is counting down, then do the key presses.
So, in summary, my question is: Is this logic change useful to the community and I should create a PR for it in the vyos-build repo? Or, is it just a hack that’s necessary for my setup somehow and I should just keep it for me and not submit it.
Thanks
Chris