Commit Graph
22 Commits
Author SHA1 Message Date
Joachim Wiberg d01617a79e board/amd64: enable RTC subsystem
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-16 06:37:56 +01:00
Tobias Waldekranz e7112ca0c9 qemu: Support mounting host filesystem inside guest
This is mounted at /mnt/host in the guest. By default the images
directory is mounted.
2023-03-13 13:53:12 +01:00
Tobias Waldekranz f3304a6539 common: Unify disk image generation across aarch64 and amd64
On amd64, we use grub instead of U-Boot, because yours truly can't
figure out how to handle ACPI handover to the kernel.

The resulting image is now called disk.img instead of the old mmc.img,
since we can use it over any interface (e.g. virtio or SCSI).
2023-03-13 09:57:03 +01:00
Tobias Waldekranz 96af542d40 qemu: Consolidate DTB extension handling in qemu.sh 2023-03-13 09:55:16 +01:00
Tobias Waldekranz e9adde4100 qemu: Add option to start with UEFI instead of BIOS 2023-03-13 09:55:16 +01:00
Tobias Waldekranz 81f0276a31 qemu: Remove redundant enabling of KVM 2023-03-13 09:55:16 +01:00
Tobias Waldekranz 7ba2e0a0b1 qemu: Always use disk images when using U-Boot
The U-Boot scripts won't accept a raw squash.
2023-03-13 09:55:16 +01:00
Joachim Wiberg 281183755b qemu: replace -nic with -netdev to get >8 NICs, fix MAC calculation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00
Joachim Wiberg 04e646ab40 qemu: default to 256M RAM for both targets
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-28 14:47:56 +01:00
Tobias Waldekranz 98b59ac20b qemu: Optionally start from U-Boot using MMC disk
This is very useful for testing things like image signature
verification, system upgrades, etc.
2023-02-20 09:57:31 +01:00
Tobias Waldekranz fbd68c4a65 qemu: Let user supply extra append options 2023-02-09 10:26:10 +01:00
Tobias Waldekranz ca1467736f common: Refactor persistent storage setup
In the new model, we have three sources of storage:

- /mnt/var: Mountpoint for a disk with the label "var"
- /mnt/cfg: Mountpoint for a disk with the label "cfg"
- /mnt/tmp: Mountpoint for a ramdisk

These sources are used for the following overlays:

- **/cfg, /home, /root**: /mnt/cfg if available, else /mnt/tmp

- **/etc**: /mnt/cfg if available and the boot/etc finit condition is
            set, else /mnt/tmp

- **/var**: /mnt/var if available, else /mnt/tmp

- **/var/lib**: /mnt/var if available, else /mnt/cfg if available,
                else /mnt/tmp

See board/common/rootfs/lib/infix/mnt for more information.
2023-02-07 15:42:35 +01:00
Joachim Wiberg ccba72b083 Add factory default, all switch ports in group VLAN 1 on br0
This change checks¹ if the system does not have a br0 interface, creates
a default one consisting of all switch ports in VLAN 1 of br0.

On top of br0 a vlan1 management interface is created with DHCP address.

For emulation and test purposes, a way to supply tap interfaces from
Qemu, and pass off as if they were regular switch ports, is added.
____
¹ obviously a better way to detect a factory-reset device is needed,
  not all systems running infix will need or want a br0 interface.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-01-03 18:25:18 +01:00
Joachim Wiberg ef86cd23f4 configs: enable rngd to improve entropy with /dev/hwrng
Also, enable virtio-rng-pci in Qemu for testing.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-21 10:35:37 +01:00
Joachim Wiberg 63b0849ca7 qemu: prefer squashfs as initrd if enabled in .config
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-13 17:34:19 +01:00
Tobias Waldekranz d56937f9dc qemu: Support passing custom options to setup user mode networking
This can be used to specify things like port forwards, TFTP server,
etc.
2022-12-12 16:07:25 +01:00
Joachim Wiberg 073f2fb043 qemu: move quick-help text to right before starting qemu
The qemu.sh script can fail, due to misconfiguration or other problems,
before it actually starts qemu.  Therefore, move the help text to right
before starting the emulator.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-05 21:12:04 +01:00
Joachim Wiberg c5ffeb2d06 qemu: add default options to enable i6300 WDT and host RTC
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-23 14:41:23 +01:00
Joachim WibergandTobias Waldekranz d8d05b5278 qemu: silence dd and mkfs outputs, otherwise used by qemu
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim WibergandTobias Waldekranz 7badb97d06 qemu: add support for x86_64 with ext2 rootfs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 12:05:51 +01:00
Joachim Wiberg e3c4bffb99 qemu: drop debug message from stdout
Fixes first-start error: "Qemu: cannot find 'Creating'"

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-18 07:59:54 +01:00
Tobias Waldekranz 4232b22b76 qemu: Add virtualization support
The virtualized system is configured through kconfig under "External
Options"->"QEMU Virtualization".

To launch the system, simply run "make run". This works both from
output directories, and from the infix root with O= set.
2022-11-17 00:19:23 +01:00