Skip to content
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

Specify description for boot commands #11287

Closed
jacob-carlborg opened this issue Sep 26, 2021 · 2 comments
Closed

Specify description for boot commands #11287

jacob-carlborg opened this issue Sep 26, 2021 · 2 comments
Labels
core Core components of Packer enhancement

Comments

@jacob-carlborg
Copy link

It would be useful if there was a way to specify a description for each boot command in some way. Perhaps each entry in the boot_command array could be an array where the first element is the command and the second is the description. When logging is enabled (PACKER_LOG=1) Packer would output the description each time it outputs a boot command.

The use case is if an installation requires many steps, resulting in many boot commands, it's difficult to determine at which boot command Packer currently is. It's easy that the boot commands and the actual installation get out of sync and it would be really useful to know at which boot command Packer and the installation got out of sync. Here's an extract from the boot commands I'm using to install NetBSD:

boot_command = [
  "a<enter><wait5>", // Installation messages in English
  "a<enter><wait5>", // Keyboard type: unchanged

  "a<enter><wait5>", // Install NetBSD to hard disk
  "b<enter><wait5>", // Yes

  "a<enter><wait5>", // Available disks: sd0
  "a<enter><wait5>", // Guid Partition Table
  "a<enter><wait5>", // This is the correct geometry

The corresponding output procude by Packer when logging is enabled is:

2021/09/26 19:57:48 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2021/09/26 19:57:48 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2021/09/26 19:57:49 packer-builder-qemu plugin: [INFO] Waiting 5s
2021/09/26 19:57:54 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2021/09/26 19:57:54 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2021/09/26 19:57:54 packer-builder-qemu plugin: [INFO] Waiting 5s
2021/09/26 19:57:59 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2021/09/26 19:57:59 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2021/09/26 19:58:00 packer-builder-qemu plugin: [INFO] Waiting 5s
2021/09/26 19:58:05 packer-builder-qemu plugin: Sending char 'b', code 0x62, shift false
2021/09/26 19:58:05 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2021/09/26 19:58:05 packer-builder-qemu plugin: [INFO] Waiting 5s
2021/09/26 19:58:10 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2021/09/26 19:58:10 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2021/09/26 19:58:10 packer-builder-qemu plugin: [INFO] Waiting 5s
2021/09/26 19:58:15 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2021/09/26 19:58:16 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2021/09/26 19:58:16 packer-builder-qemu plugin: [INFO] Waiting 5s
2021/09/26 19:58:21 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2021/09/26 19:58:21 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2021/09/26 19:58:21 packer-builder-qemu plugin: [INFO] Waiting 5s

I've already added comments in the source file to help make it easier to understand which command corresponds to which step in the installation process. But looking at the out put, there's no easy way to correlate a command in the output back to the command in the source code. In this case, 6 out of 7 commands are the same: Sending char 'a', code 0x61, shift false.

@nywilken nywilken added the core Core components of Packer label Sep 28, 2021
@jacob-carlborg
Copy link
Author

Duplicate of hashicorp/packer-plugin-sdk#216.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core Core components of Packer enhancement
Projects
None yet
Development

No branches or pull requests

2 participants