From b48d22b43b7911ddf747a3904a3ef5a1deaa7172 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 13 Jun 2019 14:29:25 +0200 Subject: [PATCH] qemu: document FloppyConfig from struct --- common/floppy_config.go | 23 ++++++++++++++- website/source/docs/builders/qemu.html.md.erb | 29 +++++-------------- .../common/_FloppyConfig-not-required.html.md | 15 ++++++++++ .../partials/common/_FloppyConfig.html.md | 9 ++++++ 4 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 website/source/partials/common/_FloppyConfig-not-required.html.md create mode 100644 website/source/partials/common/_FloppyConfig.html.md diff --git a/common/floppy_config.go b/common/floppy_config.go index b1338cbcb..43e1ed414 100644 --- a/common/floppy_config.go +++ b/common/floppy_config.go @@ -1,3 +1,5 @@ +//go:generate struct-markdown + package common import ( @@ -9,8 +11,27 @@ import ( "github.com/hashicorp/packer/template/interpolate" ) +// A floppy can be made available for your build. This is most useful for +// unattended Windows installs, which look for an Autounattend.xml file on +// removable media. By default, no floppy will be attached. All files listed in +// this setting get placed into the root directory of the floppy and the floppy +// is attached as the first floppy device. The summary size of the listed files +// must not exceed 1.44 MB. The supported ways to move large files into the OS +// are using `http_directory` or [the file +// provisioner](https://www.packer.io/docs/provisioners/file.html). type FloppyConfig struct { - FloppyFiles []string `mapstructure:"floppy_files"` + // A list of files to place onto a floppy disk that is attached when the VM + // is booted. Currently, no support exists for creating sub-directories on + // the floppy. Wildcard characters (\*, ?, and \[\]) are allowed. Directory + // names are also allowed, which will add all the files found in the + // directory to the floppy. + FloppyFiles []string `mapstructure:"floppy_files"` + // A list of directories to place onto the floppy disk recursively. This is + // similar to the `floppy_files` option except that the directory structure + // is preserved. This is useful for when your floppy disk includes drivers + // or if you just want to organize it's contents as a hierarchy. Wildcard + // characters (\*, ?, and \[\]) are allowed. The maximum summary size of + // all files in the listed directories are the same as in `floppy_files`. FloppyDirectories []string `mapstructure:"floppy_dirs"` } diff --git a/website/source/docs/builders/qemu.html.md.erb b/website/source/docs/builders/qemu.html.md.erb index 422965dde..f5c7d6f99 100644 --- a/website/source/docs/builders/qemu.html.md.erb +++ b/website/source/docs/builders/qemu.html.md.erb @@ -97,6 +97,14 @@ Linux server and have not enabled X11 forwarding (`ssh -X`). <%= partial "partials/common/HTTPConfig-not-required" %> +## Floppy configuration reference + +<%= partial "partials/common/FloppyConfig" %> + +### Optional: + +<%= partial "partials/common/FloppyConfig-not-required" %> + ## Qemu Configuration Reference ### Optional: @@ -116,27 +124,6 @@ DADA five seconds and one minute 30 seconds, respectively. If this isn't specified, the default is `10s` or 10 seconds. -- `floppy_dirs` (array of strings) - A list of directories to place onto - the floppy disk recursively. This is similar to the `floppy_files` option - except that the directory structure is preserved. This is useful for when - your floppy disk includes drivers or if you just want to organize it's - contents as a hierarchy. Wildcard characters (\*, ?, and \[\]) are allowed. - The maximum summary size of all files in the listed directories are the - same as in `floppy_files`. - -- `floppy_files` (array of strings) - A list of files to place onto a floppy - disk that is attached when the VM is booted. This is most useful for - unattended Windows installs, which look for an `Autounattend.xml` file on - removable media. By default, no floppy will be attached. All files listed in - this setting get placed into the root directory of the floppy and the floppy - is attached as the first floppy device. Currently, no support exists for - creating sub-directories on the floppy. Wildcard characters (\*, ?, - and \[\]) are allowed. Directory names are also allowed, which will add all - the files found in the directory to the floppy. The summary size of the - listed files must not exceed 1.44 MB. The supported ways to move large - files into the OS are using `http_directory` or [the file provisioner](https://www.packer.io/docs/provisioners/file.html). - - ## Boot Command The `boot_command` configuration is very important: it specifies the keys to diff --git a/website/source/partials/common/_FloppyConfig-not-required.html.md b/website/source/partials/common/_FloppyConfig-not-required.html.md new file mode 100644 index 000000000..ec91a3356 --- /dev/null +++ b/website/source/partials/common/_FloppyConfig-not-required.html.md @@ -0,0 +1,15 @@ + + +- `floppy_files` ([]string) - A list of files to place onto a floppy disk that is attached when the VM + is booted. Currently, no support exists for creating sub-directories on + the floppy. Wildcard characters (\*, ?, and \[\]) are allowed. Directory + names are also allowed, which will add all the files found in the + directory to the floppy. + +- `floppy_dirs` ([]string) - A list of directories to place onto the floppy disk recursively. This is + similar to the `floppy_files` option except that the directory structure + is preserved. This is useful for when your floppy disk includes drivers + or if you just want to organize it's contents as a hierarchy. Wildcard + characters (\*, ?, and \[\]) are allowed. The maximum summary size of + all files in the listed directories are the same as in `floppy_files`. + \ No newline at end of file diff --git a/website/source/partials/common/_FloppyConfig.html.md b/website/source/partials/common/_FloppyConfig.html.md new file mode 100644 index 000000000..d302ba7d2 --- /dev/null +++ b/website/source/partials/common/_FloppyConfig.html.md @@ -0,0 +1,9 @@ + +A floppy can be made available for your build. This is most useful for +unattended Windows installs, which look for an Autounattend.xml file on +removable media. By default, no floppy will be attached. All files listed in +this setting get placed into the root directory of the floppy and the floppy +is attached as the first floppy device. The summary size of the listed files +must not exceed 1.44 MB. The supported ways to move large files into the OS +are using `http_directory` or [the file +provisioner](https://www.packer.io/docs/provisioners/file.html).