diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/virtualization')
8 files changed, 72 insertions, 77 deletions
diff --git a/nixpkgs/pkgs/applications/virtualization/8086tiny/builder.sh b/nixpkgs/pkgs/applications/virtualization/8086tiny/builder.sh index 7cff2589abe0..210f11e1328d 100644 --- a/nixpkgs/pkgs/applications/virtualization/8086tiny/builder.sh +++ b/nixpkgs/pkgs/applications/virtualization/8086tiny/builder.sh @@ -1,17 +1,19 @@ source $stdenv/setup -mkdir -p ./$name $out/bin $out/share/$name $out/share/doc/$name/images +unpackPhase +cd $sourceRoot -cd $name -tar xf $src make 8086tiny + if [ $bios ]; then cd bios_source nasm -f bin bios.asm -o bios cd .. fi +mkdir -p $out/bin $out/share/$name $out/share/doc/$name/images + install -m 755 8086tiny $out/bin install -m 644 fd.img $out/share/$name/8086tiny-floppy.img install -m 644 bios_source/bios.asm $out/share/$name/8086tiny-bios-src.asm diff --git a/nixpkgs/pkgs/applications/virtualization/8086tiny/default.nix b/nixpkgs/pkgs/applications/virtualization/8086tiny/default.nix index 464ea053cc4f..db76efb96e5f 100644 --- a/nixpkgs/pkgs/applications/virtualization/8086tiny/default.nix +++ b/nixpkgs/pkgs/applications/virtualization/8086tiny/default.nix @@ -1,17 +1,19 @@ -{ stdenv, fetchurl +{ stdenv, fetchFromGitHub , localBios ? true, nasm ? null , sdlSupport ? true, SDL ? null }: assert sdlSupport -> (SDL != null); -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "8086tiny"; version = "1.25"; - src = fetchurl { - url ="http://www.megalith.co.uk/8086tiny/downloads/8086tiny_125.tar.bz2"; - sha256 = "0kmq4iiwhi2grjwq43ljjk1b1f1v1x9gzrgrgq2fzfsj7m7s6ris"; + src = fetchFromGitHub { + owner = "adriancable"; + repo = pname; + rev = "c79ca2a34d96931d55ef724c815b289d0767ae3a"; + sha256 = "00aydg8f28sgy8l3rd2a7jvp56lx3b63hhak43p7g7vjdikv495w"; }; buildInputs = with stdenv.lib; @@ -22,18 +24,20 @@ stdenv.mkDerivation { builder = ./builder.sh; - meta = { - description = "An open-source 8086 emulator"; + meta = with stdenv.lib; { + description = "An open-source small 8086 emulator"; longDescription = '' - 8086tiny is a tiny, open-source (MIT), portable (little-endian hosts) Intel PC emulator, powerful enough to run DOS, Windows 3.0, Excel, MS Flight Simulator, AutoCAD, Lotus 1-2-3, and similar applications. 8086tiny emulates a "late 80's era" PC XT-type machine. + 8086tiny is a tiny, open-source (MIT), portable (little-endian hosts) + Intel PC emulator, powerful enough to run DOS, Windows 3.0, Excel, MS + Flight Simulator, AutoCAD, Lotus 1-2-3, and similar applications. 8086tiny + emulates a "late 80's era" PC XT-type machine. - 8086tiny is based on an IOCCC 2013 winning entry. In fact that is the "unobfuscated" version :) + 8086tiny is based on an IOCCC 2013 winning entry. In fact that is the + "unobfuscated" version :) ''; - homepage = "http://www.megalith.co.uk/8086tiny/index.html"; - license = stdenv.lib.licenses.mit; - maintainers = [ stdenv.lib.maintainers.AndersonTorres ]; - platforms = stdenv.lib.platforms.linux; + homepage = "https://github.com/adriancable/8086tiny"; + license = licenses.mit; + maintainers = [ maintainers.AndersonTorres ]; + platforms = platforms.linux; }; } - -# TODO: add support for a locally made BIOS diff --git a/nixpkgs/pkgs/applications/virtualization/conmon/default.nix b/nixpkgs/pkgs/applications/virtualization/conmon/default.nix index be6196855e2b..d5abb569e7b1 100644 --- a/nixpkgs/pkgs/applications/virtualization/conmon/default.nix +++ b/nixpkgs/pkgs/applications/virtualization/conmon/default.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "conmon"; - version = "2.0.17"; + version = "2.0.18"; src = fetchFromGitHub { owner = "containers"; repo = pname; rev = "v${version}"; - sha256 = "01bicv0qr4aiahkw9cp6igk3jv1fqkbxmsp80nfvq6rxx873v0q7"; + sha256 = "0f32g048jamfhrds68vzirx8iqizr45wf2d4bfvdsk176amrj4k0"; }; nativeBuildInputs = [ pkg-config ]; diff --git a/nixpkgs/pkgs/applications/virtualization/qboot/default.nix b/nixpkgs/pkgs/applications/virtualization/qboot/default.nix index 800d601c76e6..8d1f9dac2e51 100644 --- a/nixpkgs/pkgs/applications/virtualization/qboot/default.nix +++ b/nixpkgs/pkgs/applications/virtualization/qboot/default.nix @@ -1,4 +1,4 @@ -{ stdenv, meson, ninja, fetchFromGitHub }: +{ stdenv, meson, ninja, fetchFromGitHub, nixosTests }: stdenv.mkDerivation { name = "qboot-20200423"; @@ -19,6 +19,8 @@ stdenv.mkDerivation { hardeningDisable = [ "stackprotector" "pic" ]; + passthru.tests = { qboot = nixosTests.qboot; }; + meta = { description = "A simple x86 firmware for booting Linux"; homepage = "https://github.com/bonzini/qboot"; diff --git a/nixpkgs/pkgs/applications/virtualization/qemu/default.nix b/nixpkgs/pkgs/applications/virtualization/qemu/default.nix index d6611e20a9c1..c5dcc2fafc68 100644 --- a/nixpkgs/pkgs/applications/virtualization/qemu/default.nix +++ b/nixpkgs/pkgs/applications/virtualization/qemu/default.nix @@ -8,7 +8,7 @@ , seccompSupport ? stdenv.isLinux, libseccomp , pulseSupport ? !stdenv.isDarwin, libpulseaudio , sdlSupport ? !stdenv.isDarwin, SDL2 -, gtkSupport ? !stdenv.isDarwin && !xenSupport, gtk3, gettext, vte +, gtkSupport ? !stdenv.isDarwin && !xenSupport, gtk3, gettext, vte, wrapGAppsHook , vncSupport ? true, libjpeg, libpng , smartcardSupport ? true, libcacard , spiceSupport ? !stdenv.isDarwin, spice, spice-protocol @@ -35,18 +35,19 @@ let in stdenv.mkDerivation rec { - version = "4.2.0"; + version = "5.0.0"; pname = "qemu" + stdenv.lib.optionalString xenSupport "-xen" + stdenv.lib.optionalString hostCpuOnly "-host-cpu-only" + stdenv.lib.optionalString nixosTestRunner "-for-vm-tests"; src = fetchurl { - url = "https://wiki.qemu.org/download/qemu-${version}.tar.bz2"; - sha256 = "1gczv8hn3wqci86css3mhzrppp3z8vppxw25l08j589k6bvz7x1w"; + url= "https://download.qemu.org/qemu-${version}.tar.xz"; + sha256 = "1dlcwyshdp94fwd30pddxf9bn2q8dfw5jsvry2gvdj551wmaj4rg"; }; - nativeBuildInputs = [ python python.pkgs.sphinx pkgconfig flex bison ]; + nativeBuildInputs = [ python python.pkgs.sphinx pkgconfig flex bison ] + ++ optionals gtkSupport [ wrapGAppsHook ]; buildInputs = [ zlib glib ncurses perl pixman vde2 texinfo makeWrapper lzo snappy @@ -77,44 +78,6 @@ stdenv.mkDerivation rec { ./no-etc-install.patch ./fix-qemu-ga.patch ./9p-ignore-noatime.patch - (fetchpatch { - name = "CVE-2019-15890.patch"; - url = "https://git.qemu.org/?p=libslirp.git;a=patch;h=c59279437eda91841b9d26079c70b8a540d41204"; - sha256 = "1q2rc67mfdz034mk81z9bw105x9zad7n954sy3kq068b1svrf7iy"; - stripLen = 1; - extraPrefix = "slirp/"; - }) - # patches listed at: https://nvd.nist.gov/vuln/detail/CVE-2020-7039 - (fetchpatch { - name = "CVE-2020-7039-1.patch"; - url = "https://git.qemu.org/?p=libslirp.git;a=patch;h=2655fffed7a9e765bcb4701dd876e9dab975f289"; - sha256 = "1jh0k3lg3553c2x1kq1kl3967jabhba5gm584wjpmr5mjqk3lnz1"; - stripLen = 1; - extraPrefix = "slirp/"; - excludes = ["slirp/CHANGELOG.md"]; - }) - (fetchpatch { - name = "CVE-2020-7039-2.patch"; - url = "https://git.qemu.org/?p=libslirp.git;a=patch;h=82ebe9c370a0e2970fb5695aa19aa5214a6a1c80"; - sha256 = "08ccxcmrhzknnzd1a1q2brszv3a7h02n26r73kpli10b0hn12r2l"; - stripLen = 1; - extraPrefix = "slirp/"; - }) - (fetchpatch { - name = "CVE-2020-7039-3.patch"; - url = "https://git.qemu.org/?p=libslirp.git;a=patch;h=ce131029d6d4a405cb7d3ac6716d03e58fb4a5d9"; - sha256 = "18ypj9an2jmsmdn58853rbz42r10587h7cz5fdws2x4635778ibd"; - stripLen = 1; - extraPrefix = "slirp/"; - }) - # patches listed at: https://nvd.nist.gov/vuln/detail/CVE-2020-7211 - (fetchpatch { - name = "CVE-2020-7211.patch"; - url = "https://git.qemu.org/?p=libslirp.git;a=patch;h=14ec36e107a8c9af7d0a80c3571fe39b291ff1d4"; - sha256 = "1lc8zabqs580iqrsr5k7zwgkx6qjmja7apwfbc36lkvnrxwfzmrc"; - stripLen = 1; - extraPrefix = "slirp/"; - }) ] ++ optional nixosTestRunner ./force-uid0-on-9p.patch ++ optionals stdenv.hostPlatform.isMusl [ (fetchpatch { @@ -145,6 +108,8 @@ stdenv.mkDerivation rec { "--sysconfdir=/etc" "--localstatedir=/var" "--enable-docs" + "--enable-tools" + "--enable-guest-agent" ] # disable sysctl check on darwin. ++ optional stdenv.isDarwin "--cpu=x86_64" @@ -165,12 +130,17 @@ stdenv.mkDerivation rec { ++ optional smbdSupport "--smbd=${samba}/bin/smbd"; doCheck = false; # tries to access /dev + dontWrapGApps = true; - postFixup = - '' + postFixup = '' # copy qemu-ga (guest agent) to separate output mkdir -p $ga/bin cp $out/bin/qemu-ga $ga/bin/ + '' + optionalString gtkSupport '' + # wrap GTK Binaries + for f in $out/bin/qemu-system-*; do + wrapGApp $f + done ''; # Add a ‘qemu-kvm’ wrapper for compatibility/convenience. diff --git a/nixpkgs/pkgs/applications/virtualization/qemu/fix-qemu-ga.patch b/nixpkgs/pkgs/applications/virtualization/qemu/fix-qemu-ga.patch index c2f051e2b944..0b2dd0ee5ece 100644 --- a/nixpkgs/pkgs/applications/virtualization/qemu/fix-qemu-ga.patch +++ b/nixpkgs/pkgs/applications/virtualization/qemu/fix-qemu-ga.patch @@ -1,22 +1,36 @@ -diff --git a/qga/commands-posix.c b/qga/commands-posix.c -index 0dc219d..9d020d3 100644 +diff -Naur a/qga/commands-posix.c b/qga/commands-posix.c --- a/qga/commands-posix.c +++ b/qga/commands-posix.c -@@ -102,6 +102,8 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) +@@ -109,6 +109,8 @@ reopen_fd_to_null(1); reopen_fd_to_null(2); - + + execle("/run/current-system/sw/bin/shutdown", "shutdown", "-h", shutdown_flag, "+0", + "hypervisor initiated shutdown", (char*)NULL, environ); execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0", "hypervisor initiated shutdown", (char*)NULL, environ); _exit(EXIT_FAILURE); -@@ -189,6 +191,8 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp) - +@@ -157,11 +159,13 @@ + pid_t pid; + Error *local_err = NULL; + struct timeval tv; ++ static const char hwclock_path_nix[] = "/run/current-system/sw/bin/hwclock"; + static const char hwclock_path[] = "/sbin/hwclock"; + static int hwclock_available = -1; + + if (hwclock_available < 0) { +- hwclock_available = (access(hwclock_path, X_OK) == 0); ++ hwclock_available = (access(hwclock_path_nix, X_OK) == 0) || ++ (access(hwclock_path, X_OK) == 0); + } + + if (!hwclock_available) { +@@ -207,6 +211,8 @@ + /* Use '/sbin/hwclock -w' to set RTC from the system time, * or '/sbin/hwclock -s' to set the system time from RTC. */ -+ execle("/run/current-system/sw/bin/hwclock", "hwclock", has_time ? "-w" : "-s", ++ execle(hwclock_path_nix, "hwclock", has_time ? "-w" : "-s", + NULL, environ); - execle("/sbin/hwclock", "hwclock", has_time ? "-w" : "-s", + execle(hwclock_path, "hwclock", has_time ? "-w" : "-s", NULL, environ); _exit(EXIT_FAILURE); diff --git a/nixpkgs/pkgs/applications/virtualization/qemu/utils.nix b/nixpkgs/pkgs/applications/virtualization/qemu/utils.nix index 430d71221797..436716e0a8c3 100644 --- a/nixpkgs/pkgs/applications/virtualization/qemu/utils.nix +++ b/nixpkgs/pkgs/applications/virtualization/qemu/utils.nix @@ -13,4 +13,6 @@ stdenv.mkDerivation rec { cp "${qemu}/bin/qemu-io" "$out/bin/qemu-io" cp "${qemu}/bin/qemu-nbd" "$out/bin/qemu-nbd" ''; + + inherit (qemu) meta; } diff --git a/nixpkgs/pkgs/applications/virtualization/xhyve/default.nix b/nixpkgs/pkgs/applications/virtualization/xhyve/default.nix index 921a54b11a2e..db9a7ef82577 100644 --- a/nixpkgs/pkgs/applications/virtualization/xhyve/default.nix +++ b/nixpkgs/pkgs/applications/virtualization/xhyve/default.nix @@ -27,10 +27,11 @@ stdenv.mkDerivation rec { cp build/xhyve $out/bin ''; - meta = { + meta = with lib; { description = "Lightweight Virtualization on macOS Based on bhyve"; homepage = "https://github.com/mist64/xhyve"; - maintainers = [ lib.maintainers.lnl7 ]; - platforms = lib.platforms.darwin; + maintainers = [ maintainers.lnl7 ]; + license = licenses.bsd2; + platforms = platforms.darwin; }; } |