Skip to content

Commit 0083086

Browse files
jschintagSNiemann15
authored andcommitted
s390x: Add documentation for buildextend-secex
Document both possible paths for buildextend-secex. Add secex to buildextend-metal artifacts. Signed-off-by: Jan Schintag <[email protected]> Co-authored-by: Silke Niemann <[email protected]>
1 parent 9e6b8a6 commit 0083086

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

cmd/remote-session.go

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ func runCreate(c *cobra.Command, args []string) error {
138138
"--pull=always", "--privileged", "--security-opt=label=disable",
139139
"--volume", remoteSessionOpts.CreateWorkdir,
140140
"--workdir", remoteSessionOpts.CreateWorkdir,
141+
// Mount required volume for buildextend-secex, it will be empty on
142+
// non-s390x builders.
143+
// See: https://github.com/coreos/coreos-assembler/blob/main/docs/cosa/buildextend-secex.md
141144
"--volume=secex-data:/data.secex:ro",
142145
"--uidmap=1000:0:1", "--uidmap=0:1:1000", "--uidmap=1001:1001:64536",
143146
"--device=/dev/kvm", "--device=/dev/fuse", "--tmpfs=/tmp",

docs/cosa.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ other platforms or cloud providers:
4242
| Name | Description |
4343
| ---- | ----------- |
4444
| [buildextend-live](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-buildextend-live) | Generate the Live ISO
45-
| [buildextend-{dasd,metal,metal4k,qemu}](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-buildextend-metal) | Generate artifacts for the given platforms
45+
| [buildextend-{dasd,metal,metal4k,qemu,secex}](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-buildextend-metal) | Generate artifacts for the given platforms
4646
| [buildextend-{aliyun,aws,azure,digitalocean,exoscale,gcp,vultr}](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-ore-wrapper) | Generate artifacts for the given platforms
4747
| [buildextend-{azurestack,ibmcloud,openstack,vmware}](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-artifact-disk) | Generate artifacts for the given platforms
4848
| [{aliyun,aws}-replicate](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-ore-wrapper) | Replicate images on the platforms (AMIs for AWS)

docs/cosa/buildextend-secex.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
parent: CoreOS Assembler Command Line Reference
3+
nav_order: 1
4+
---
5+
6+
# cosa buildextend-secex
7+
8+
This buildextend command is used to build QEMU images that are enabled for IBM Secure Execution on IBM Z.
9+
In order to build a QEMU image protected by IBM Secure Execution, you need to provide a host key to encrypt it.
10+
11+
For more information on IBM Secure Execution on IBM Z, refer to the [IBM Documentation](https://www.ibm.com/docs/en/linux-on-systems?topic=ibmz-secure-execution).
12+
13+
The command is intended to be used in the RHCOS CI together with the universal host key, such that the image can be booted on any IBM Z machine that supports IBM Secure Execution.
14+
This results in a few specifics to note:
15+
- The resulting image will only be encrypted with a single host key, to enable firstboot.
16+
- The host key will not be written to the image.
17+
- The host key(s) need to be provided later during firstboot through Ignition.
18+
- The firstboot service will fail when no host key is provided, as the sdboot-image can not be recreated.
19+
- Write the host key(s) to: `/etc/se-hostkeys/ibm-z-hostkey-<hostkey-name>.crt`
20+
21+
To facilitate this, `buildextend-secex` can take 2 mutually exclusive additional arguments: `--genprotimgvm <path>` and `--hostkey <path>`.
22+
If none is provided, `--genprotimgvm` is used with default values.
23+
24+
## `--genprotimgvm <path>` (default)
25+
26+
Default Value: `/data.secex/genprotimgvm.qcow2`
27+
28+
This path is the default behavior. It assumes that the host key is not directly available, but is supplied through an IBM Secure Execution protected VM only.
29+
30+
The QEMU image will be built normally. However, it will not run `genprotimg` or `zipl`, but instead save the required input for the command to a temporary location.
31+
After the build, the provided VM will run. The VM is used to isolate and protect the `genprotimg` command, so that the universal host key is not exposed.
32+
A provided bash script is called before and after the `genprotimg` command, to fullfil the following steps:
33+
1. Copy the required kernel, initramfs, and parmfile to the VM
34+
2. Move the sdboot-image to the disk
35+
3. Call `zipl`to make the image bootable.
36+
This enables us to copy the required kernel, initramfs and parmfile to the VM and afterwards move the sdboot-image to the disk, as well as calling `zipl` to make the image bootable.
37+
38+
## `--hostkey <path>`
39+
40+
This path is intended for local development, but can be used for custom builds. The path takes a singe host key file, which is used to build the image.
41+
42+
Instead of running `genprotimg` and `zipl` in a separate VM, they run during the build process. Otherwise, the build is identical to the `--genprotimgvm`.
43+
Note: It is still assumed that the host key is provided via Ignition during firstboot.

0 commit comments

Comments
 (0)