@@ -285,3 +285,52 @@ And point to it and the `core.0` binary:
285
285
```
286
286
$ cosa run -c --netboot-dir tmp/grub-netboot --netboot boot/grub2/i386-pc/core.0 -m 4096
287
287
```
288
+
289
+ ### GRUB (Secure Boot)
290
+
291
+ 1 . Create a temporary folder
292
+ 2 . Download a kernel, initramfs, rootfs, shim and GRUB binary
293
+ 3 . Create an empty disk image (bug in kola): ` touch disk.img `
294
+ 4 . Setup ` grub.cfg `
295
+ 5 . Place your Ignition config
296
+ 6 . Start a local HTTP server using ` cosa kola http-server `
297
+ 7 . Find and join the existing COSA container
298
+ 8 . Use ` cosa run ` to netboot the system
299
+
300
+ ```
301
+ $ tree pxe
302
+ pxe
303
+ ├── config.ign
304
+ ├── disk.img
305
+ ├── grub.cfg
306
+ ├── grubx64.efi
307
+ ├── rhcos-4.14.0-x86_64-live-initramfs.x86_64.img
308
+ ├── rhcos-4.14.0-x86_64-live-kernel-x86_64
309
+ ├── rhcos-4.14.0-x86_64-live-rootfs.x86_64.img
310
+ └── shim.efi
311
+
312
+ $ cat pxe/grub.cfg
313
+ default=0
314
+ timeout=1
315
+ menuentry "CoreOS (UEFI Secure Boot)" {
316
+ echo "Loading kernel"
317
+ linux /rhcos-4.14.0-x86_64-live-kernel-x86_64 ignition.firstboot ignition.platform.id=metal console=ttyS0 coreos.live.rootfs_url=http://10.0.2.2:8000/pxe/rhcos-4.14.0-x86_64-live-rootfs.x86_64.img ignition.config.url=http://10.0.2.2:8000/pxe/config.ign
318
+ echo "Loading initrd"
319
+ initrd rhcos-4.14.0-x86_64-live-initramfs.x86_64.img rhcos-4.14.0-x86_64-live-rootfs.x86_64.img
320
+ }
321
+
322
+ $ cosa kola http-server
323
+ ...
324
+ Serving HTTP on port: 8000
325
+
326
+ # In another shell
327
+ $ podman exec -it cosa bash
328
+
329
+ # Or if you removed `--name cosa` from the cosa alias command to be able to run
330
+ # multiple instances of cosa (see https://coreos.github.io/coreos-assembler/building-fcos/#running-multiple-instances)
331
+ $ podman ps | grep quay.io/coreos-assembler/coreos-assembler
332
+ 7fedc84484a6 quay.io/coreos-assembler/coreos-assembler:latest kola http-server 5 minutes ago Up 5 minutes hopeful_haibt
333
+ $ podman exec -ti 7fedc84484a6 bash
334
+
335
+ $ cosa run -c --netboot pxe/shim.efi -m 4096 --qemu-firmware uefi-secure --qemu-image pxe/disk.img
336
+ ```
0 commit comments