Skip to content

Commit

Permalink
Merge commit 'refs/pull/182/head' of github.com:golemfactory/ya-runti…
Browse files Browse the repository at this point in the history
…me-vm into late-chroot-qemu

* github.com:golemfactory/ya-runtime-vm:
  Update to qemu-8.1.1
  • Loading branch information
marmarek committed Oct 17, 2023
2 parents ade43e8 + eb28dbf commit 5e72576
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 30 deletions.
97 changes: 68 additions & 29 deletions qemu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,84 @@
FROM ubuntu:18.04
FROM ubuntu:22.04

RUN apt update \
&& \
\
DEBIAN_FRONTEND=noninteractive \
apt install --assume-yes \
build-essential ca-certificates git make \
python3 wget pkg-config libglib2.0-dev libpixman-1-dev \
libmount-dev libffi-dev libselinux1-dev libcap-ng-dev libattr1-dev \
apt install --assume-yes \
build-essential \
ca-certificates \
git \
make \
python3 \
python3-pip \
wget \
pkg-config \
libglib2.0-dev \
libpixman-1-dev \
libmount-dev \
libffi-dev \
libselinux1-dev \
libcap-ng-dev \
libattr1-dev \
ninja-build \
&& \
\
rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/qemu/qemu.git -b v5.1.0 --recurse-submodules
RUN git clone https://github.com/qemu/qemu.git -b v8.1.1 --recurse-submodules

RUN echo CONFIG_VIRTIO=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_SERIAL=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_PCI=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_NET=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_RNG=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_MMIO=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_SCSI=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_BLK=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VIRTIO_9P=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_PARALLEL=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_FSDEV_9P=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VFIO=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VFIO_PCI=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_EDID=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VGA=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_VGA_PCI=y >> /qemu/configs/devices/i386-softmmu/default.mak
RUN echo CONFIG_PCIE_PORT=y >> /qemu/configs/devices/i386-softmmu/default.mak

# --without-default-devices
RUN mkdir build && \
cd build && \
/qemu/configure --target-list=x86_64-softmmu --static --audio-drv-list="" \
--disable-slirp --disable-tcg-interpreter --disable-containers --disable-gtk \
--disable-capstone --disable-avx2 --disable-avx512f --disable-replication \
--disable-parallels --disable-sheepdog --disable-vvfat --disable-qed --disable-vdi \
--disable-qcow1 --disable-dmg --disable-cloop --disable-bochs --disable-bzip2 \
--disable-guest-agent --disable-numa --disable-tcg --disable-vnc \
--disable-live-block-migration --enable-virtfs --enable-vhost-vsock \
--without-default-devices
RUN echo CONFIG_PARALLEL=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_SERIAL=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_PCI=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_NET=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_RNG=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_MMIO=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_SCSI=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_BLK=y >> build/config-host.mak
RUN echo CONFIG_VIRTIO_9P=y >> build/config-host.mak
RUN echo CONFIG_FSDEV_9P=y >> build/config-host.mak

RUN cd build && make x86_64-softmmu/all V=1 CFLAGS+="-Os -flto" -j4 LIBS+="-flto -lblkid -luuid -lpixman-1 -lutil"
#RUN cd build && make x86_64-softmmu/all V=1 LIBS+="-flto -lblkid -luuid -lpixman-1 -lutil" CONFIG_PARALLEL=y CONFIG_VIRTIO_SERIAL=y
/qemu/configure \
--target-list=x86_64-softmmu \
--static \
--audio-drv-list="" \
--disable-slirp \
--disable-tcg-interpreter \
--disable-containers \
--disable-gtk \
--disable-capstone \
--disable-avx2 \
--disable-avx512f \
--disable-replication \
--disable-parallels \
--disable-vvfat \
--disable-qed \
--disable-vdi \
--disable-qcow1 \
--disable-dmg \
--disable-cloop \
--disable-bochs \
--disable-bzip2 \
--disable-guest-agent \
--disable-numa \
--disable-tcg \
--disable-vnc \
--disable-live-block-migration \
--disable-gio \
--enable-vhost-kernel \
--enable-virtfs \
--without-default-devices

#RUN cd build/x86_64-softmmu && -lmount -lblkid -luuid
RUN cd build && make V=1 CFLAGS+="-Os -flto" -j4

RUN cp /build/x86_64-softmmu/qemu-system-x86_64 vmrt
2 changes: 1 addition & 1 deletion qemu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ all: vmrt
vmrt: Dockerfile
docker build -t build-qemu .
$(SHELL) copy_img build-qemu vmrt .
$(SHELL) copy_img build-qemu /qemu/pc-bios/vgabios-stdvga.bin .

.PHONY: all

1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ assets = [
["image/self-test.gvmi", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"],

["poc/runtime/vmrt", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "755"],
["poc/runtime/vgabios-stdvga.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"],
["poc/runtime/bios-256k.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"],
["poc/runtime/kvmvapic.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"],
["poc/runtime/linuxboot_dma.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"],
Expand Down

0 comments on commit 5e72576

Please sign in to comment.