Skip to content

Commit b1c3740

Browse files
committed
ovmf
1 parent d3f524e commit b1c3740

4 files changed

+88
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
297297
1. [ubuntu-18.04.1.0-live-server-amd64.sh](ubuntu-18.04.1.0-live-server-amd64.sh)
298298
1. [ubuntu-18.04.1-server-arm64.sh](ubuntu-18.04.1-server-arm64.sh)
299299
1. [ubuntu-18.04.1-desktop-amd64.sh](ubuntu-18.04.1-desktop-amd64.sh)
300+
1. [ovmf.sh](ovmf.sh)
300301
1. [Xen](xen.md)
301302
1. [Vagrant](vagrant/)
302303
1. [Intel SDE](intel-sde.md)

ovmf.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
# Tested on: Ubuntu 18.10.
4+
#
5+
# Outcome: TianoCore logo shows, then after a while we go into an UEFI terminal.
6+
#
7+
# EDK helps implement UEFI, but it does not have the closed source low level parts
8+
# which are left as exercises for the readers.
9+
#
10+
# OVFM implements those blobs for emulators.
11+
#
12+
# Bibliography:
13+
#
14+
# - https://github.com/tianocore/tianocore.github.io/wiki/How-to-build-OVMF/e372aa54750838a7165b08bb02b105148e2c4190
15+
# - https://github.com/tianocore/tianocore.github.io/wiki/How-to-run-OVMF/aac4095ac9309c0746bd5a8fa2cee3bf79cc1436
16+
17+
git clone https://github.com/tianocore/edk2
18+
cd edk2
19+
https://github.com/tianocore/tianocore.github.io/wiki/How-to-build-OVMF
20+
git checkout edk2-stable201811
21+
sed -Ei \
22+
-e 's/^ACTIVE_PLATFORM .*/ACTIVE_PLATFORM = OvmfPkg\/OvmfPkgX64.dsc/' \
23+
-e 's/^TARGET_ARCH .*/TARGET_ARCH = X64/' \
24+
Conf/target.txt \
25+
;
26+
cd OvmfPkg
27+
./build.sh
28+
cd ..
29+
qemu-system-x86_64 -bios ./Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd -enable-kvm

ubuntu-18.04-server-cloudimg-amd64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Tested on: Ubuntu 18.10.
3+
# Tested on host: Ubuntu 18.10.
44

55
set -eux
66

ubuntu-18.04-server-cloudimg-arm64.sh

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
#!/usr/bin/env bash
22

3+
# TODO: fails to set password most times. Tested on host: Ubuntu 18.10.
4+
# But I am alomst 100% that I've had at least one success with this exact same command.
5+
# But the rate is so small that I sometimes doubt my memory.
6+
#
7+
# [FAILED] Failed to start Initial cloud-init job (pre-networking). always shows, including on working runs.
8+
# It did not show on Ubuntu 18.04 host.
9+
#
10+
# Usually there is no error message, but I once saw this:
11+
#
12+
# [ 113.002366] cloud-init[528]: Cloud-init v. 18.4-0ubuntu1~18.04.1 running 'init' at Thu, 17 Jan 2019 00:22:16 +0000. Up 105.40 seconds.
13+
# [ 113.020759] cloud-init[528]: ci-info: +++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++
14+
# [ 113.031208] cloud-init[528]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
15+
# [ 113.041449] cloud-init[528]: ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
16+
# [ 113.051615] cloud-init[528]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
17+
# [ 113.061778] cloud-init[528]: ci-info: | enp0s1 | False | . | . | . | 52:54:00:12:34:56 |
18+
# [ 113.071307] cloud-init[528]: ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . |
19+
# [ 113.088462] cloud-init[528]: ci-info: | lo | True | ::1/128 | . | host | . |
20+
# [ 113.097037] cloud-init[528]: ci-info: +--------+-------+-----------+-----------+-------+-------------------+
21+
# [ 113.100513] cloud-init[528]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
22+
# [ 113.103872] cloud-init[528]: ci-info: +-------+-------------+---------+-----------+-------+
23+
# [ 113.107605] cloud-init[528]: ci-info: | Route | Destination | Gateway | Interface | Flags |
24+
# [ 113.111566] cloud-init[528]: ci-info: +-------+-------------+---------+-----------+-------+
25+
# [ 113.115000] cloud-init[528]: ci-info: +-------+-------------+---------+-----------+-------+
26+
# [ 113.118441] cloud-init[528]: 2019-01-17 00:22:23,983 - util.py[WARNING]: failed stage init
27+
# [ 113.238277] cloud-init[528]: failed run of stage init
28+
# [ 113.252444] cloud-init[528]: ------------------------------------------------------------
29+
# [ 113.255576] cloud-init[528]: Traceback (most recent call last):
30+
# [ 113.268398] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 658, in status_wrapper
31+
# [ 113.272674] cloud-init[528]: ret = functor(name, args)
32+
# [ 113.285055] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 362, in main_init
33+
# [ 113.288945] cloud-init[528]: init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
34+
# [ 113.293122] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 671, in apply_network_config
35+
# [ 113.304953] cloud-init[528]: return self.distro.apply_network_config(netcfg, bring_up=bring_up)
36+
# [ 113.309150] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/distros/__init__.py", line 178, in apply_network_config
37+
# [ 113.322181] cloud-init[528]: dev_names = self._write_network_config(netconfig)
38+
# [ 113.327226] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/distros/debian.py", line 114, in _write_network_config
39+
# [ 113.341030] cloud-init[528]: return self._supported_write_network_config(netconfig)
40+
# [ 113.353698] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/distros/__init__.py", line 93, in _supported_write_network_config
41+
# [ 113.358591] cloud-init[528]: renderer.render_network_config(network_config)
42+
# [ 113.376713] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/net/renderer.py", line 56, in render_network_config
43+
# [ 113.381516] cloud-init[528]: templates=templates, target=target)
44+
# [ 113.385465] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/net/netplan.py", line 210, in render_network_state
45+
# [ 113.389682] cloud-init[528]: self._netplan_generate(run=self._postcmds)
46+
# [ 113.393637] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/net/netplan.py", line 217, in _netplan_generate
47+
# [ 113.397718] cloud-init[528]: util.subp(self.NETPLAN_GENERATE, capture=True)
48+
# [ 113.401648] cloud-init[528]: File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2067, in subp
49+
# [ 113.405796] cloud-init[528]: cmd=args)
50+
# [ 113.411233] cloud-init[528]: cloudinit.util.ProcessExecutionError: Unexpected error while running command.
51+
# [ 113.416694] cloud-init[528]: Command: ['netplan', 'generate']
52+
# [ 113.420785] cloud-init[528]: Exit code: -11
53+
# [ 113.424647] cloud-init[528]: Reason: -
54+
# [ 113.428686] cloud-init[528]: Stdout:
55+
# [ 113.431914] cloud-init[528]: Stderr:
56+
# [ 113.435345] cloud-init[528]: ------------------------------------------------------------
57+
358
set -eux
459

560
# Parameters.
@@ -61,10 +116,10 @@ qemu-system-aarch64 \
61116
-device virtio-blk-device,drive=hd0 \
62117
-drive "if=none,file=${img_snapshot},id=hd0" \
63118
-drive "file=${user_data_img},format=raw" \
64-
-m 2G \
119+
-m 4G \
65120
-netdev user,id=net0 \
66121
-nographic \
67122
-pflash "$flash0" \
68123
-pflash "$flash1" \
69-
-smp 2 \
124+
-smp 4 \
70125
;

0 commit comments

Comments
 (0)