Skip to content

Instantly share code, notes, and snippets.

@jcvenegas
Created June 5, 2018 15:59
Show Gist options
  • Save jcvenegas/f88546859b40f99f7ba6ff23ca55cdde to your computer and use it in GitHub Desktop.
Save jcvenegas/f88546859b40f99f7ba6ff23ca55cdde to your computer and use it in GitHub Desktop.
Build static qemu for kata
from ubuntu:xenial
WORKDIR /root/qemu
RUN apt-get update
RUN apt-get install -y python pkg-config zlib1g-dev libglib2.0-dev git libcap-ng-dev libpixman-1-dev cpio libelf-dev rsync libdw-dev pkg-config flex bison libaudit-dev bc python-dev gawk autoconf automake libtool libltdl-dev libglib2.0-dev libglib2.0-0 libcap-dev
RUN cd .. && git clone https://github.com/qemu/qemu.git
RUN git checkout stable-2.11
RUN git clone https://github.com/qemu/capstone.git capstone
RUN git checkout stable-2.11 && git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb
RUN ./configure --disable-bluez --disable-brlapi --disable-docs --disable-curses --disable-gtk --disable-opengl --disable-sdl --disable-spice --disable-vte --disable-vnc --disable-vnc-jpeg --disable-vnc-png --disable-vnc-sasl --disable-fdt --disable-glusterfs --disable-libiscsi --disable-libnfs --disable-bzip2 --disable-lzo --disable-snappy --disable-seccomp --disable-tpm --disable-slirp --disable-libusb --disable-usb-redir --disable-tcg --disable-uuid --disable-debug-tcg --disable-qom-cast-debug --disable-tcg-interpreter --disable-tcmalloc --disable-curl --disable-rdma --disable-tools --disable-xen --disable-linux-aio --enable-kvm --enable-vhost-net --enable-virtfs --enable-attr --enable-cap-ng --target-list=x86_64-softmmu --extra-cflags=" -O3 -fno-semantic-interposition -falign-functions=32 -D_FORTIFY_SOURCE=2 -fPIE" --extra-ldflags=" -z noexecstack -z relro -z now" --static --prefix=/opt/kata
RUN make -j8
RUN make install DESTDIR=/tmp/qemu-static
# docker build . -t qemu-static
# docker run -ti -v ${PWD}:/share qemu-static mv /tmp/qemu-static /share/qemu-static
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment