-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add custom boot command that waits for text to appear #178
base: main
Are you sure you want to change the base?
Conversation
Missing docs for new wait command, will add after initial feature review |
This allows e.g: diff --git a/macos/macos.pkrtpl.yaml b/macos/macos.pkrtpl.yaml
index bed5e73..305532e 100644
--- a/macos/macos.pkrtpl.yaml
+++ b/macos/macos.pkrtpl.yaml
@@ -1,14 +1,8 @@
-wait_for_boot:
- # Wait for VM too boot
- # FIXME: Ideally there would be some way to wait for the first
- # non-black frame from the VNC server.
- - <wait60s>
-
install_macos:
- # Hello, Hola, Bonjour, etc.
+ - <wait "Get Started">
- <spacebar>
- - <wait5s>
+ - <wait "Language"> |
Is the builder not a macOS machine? |
Hi @torarnv 👋 This is a pretty cool use of Apple's Vision framework. Have you considered submitting this to packer or packer-plugin-sdk directly? This way:
|
Thanks @edigaryev! I did initially considered building this feature into packer-plugin-sdk's An upstream feature in packer-plugin-sdk would make sense, but one challenge there is that Using github.com/otiai10/gosseract would be an option, but would add more dependencies compared to the fairly straight forward use of the built in Vision.framework. One possible upstream improvement would be to teach I'm still testing this feature on my nightly builds, so we can hold on on merging for now. Let me know if you have other concerns though! |
The functionality builds on the built in Vision framework on macOS, and the existing VNC integration, which now has been taught a few new tricks, including ZLib encoded framebuffer updates and desktop resize. A custom VNC driver has been added, that picks up changes to the VNC framebuffer, and allows custom boot commands without changes to the packer-sdk bootcommand grammar, by using a simple regex replacement that uses two symbols from the Unicode Private Use Area (PUA) as markers. With the new driver we also have the ability to wait for the first frame, instead of users specifying an arbitrary boot wait timeout.
d033baf
to
ecebf0f
Compare
I guess we need to move the lint and build to a |
Done |
@edigaryev @fkorotkov thoughts? 🙂 |
Using
<wait "string">
or<wait "(some|regex|here)">
allows installing macOS without having to specify hard-coded timeout waits such as<wait10s>
.We now also wait for the first frame, if
boot_wait
is not specified.