mirror of
https://github.com/cirruslabs/tart.git
synced 2026-10-05 21:51:14 +02:00
* Package.swift: add SwiftFormat Can be invoked with "swift package plugin swiftformat". * $ swift package plugin swiftformat * .cirrus.yml: run SwiftFormat * SwiftFormat: exclude Sources/tart/OCI/Reference/Generated
38 lines
848 B
Swift
38 lines
848 B
Swift
import Virtualization
|
|
|
|
@available(macOS 13, *)
|
|
struct Linux: Platform {
|
|
func os() -> OS {
|
|
.linux
|
|
}
|
|
|
|
func bootLoader(nvramURL: URL) throws -> VZBootLoader {
|
|
let result = VZEFIBootLoader()
|
|
|
|
result.variableStore = VZEFIVariableStore(url: nvramURL)
|
|
|
|
return result
|
|
}
|
|
|
|
func platform(nvramURL: URL) -> VZPlatformConfiguration {
|
|
VZGenericPlatformConfiguration()
|
|
}
|
|
|
|
func graphicsDevice(vmConfig: VMConfig) -> VZGraphicsDeviceConfiguration {
|
|
let result = VZVirtioGraphicsDeviceConfiguration()
|
|
|
|
result.scanouts = [
|
|
VZVirtioGraphicsScanoutConfiguration(
|
|
widthInPixels: vmConfig.display.width,
|
|
heightInPixels: vmConfig.display.height
|
|
)
|
|
]
|
|
|
|
return result
|
|
}
|
|
|
|
func pointingDevices() -> [VZPointingDeviceConfiguration] {
|
|
[VZUSBScreenCoordinatePointingDeviceConfiguration()]
|
|
}
|
|
}
|