forked from luizinhosuraty/pciemu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·36 lines (28 loc) · 1.17 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# setup.sh : Setup qemu for building pciemu
#
# Should run this only once.
#
# SPDX-License-Identifier: GPL-2.0
#
printf "Initializing setup. After this, you may build QEMU.\n"
# Clone QEMU source
git submodule update --init
# Repository information
REPOSITORY_DIR=$(git rev-parse --show-toplevel)
REPOSITORY_NAME=$(basename $REPOSITORY_DIR)
# Edit original build files
echo "source $REPOSITORY_NAME/Kconfig" >> qemu/hw/misc/Kconfig
echo "subdir('$REPOSITORY_NAME')" >> qemu/hw/misc/meson.build
# Create symbolic links to device files
ln -s $REPOSITORY_DIR/src/hw/$REPOSITORY_NAME/ $REPOSITORY_DIR/qemu/hw/misc/
# Create symbolic link to the pciemu_hw.h include file
# This will avoid changing the meson files to be able to find this include
ln -s $REPOSITORY_DIR/include/hw/pciemu_hw.h $REPOSITORY_DIR/src/hw/$REPOSITORY_NAME/pciemu_hw.h
# Configure QEMU
cd qemu
./configure \
--disable-bsd-user --disable-guest-agent --disable-werror \
--enable-curses --enable-slirp --enable-libssh --enable-vde --enable-virtfs \
--target-list=x86_64-softmmu,riscv64-softmmu,riscv32-softmmu
printf "\nSetup finished. You may now build QEMU:\n\tcd qemu && make \$(nproc --ignore 2)\n"