mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
configure: make qemu and gem5 steps optional
This commit is contained in:
@@ -1501,12 +1501,14 @@ To get started, have a look at the "Hardware device drivers" secion under link:k
|
||||
|
||||
== gem5
|
||||
|
||||
=== gem5 getting started
|
||||
|
||||
gem5 is a system simulator, much <<gem5-vs-qemu,like QEMU>>: http://gem5.org/
|
||||
|
||||
For the most part, just add the `-g` option to the QEMU commands and everything should magically work:
|
||||
|
||||
....
|
||||
./configure && ./build -a arm -g
|
||||
./configure -gq && ./build -a arm -g
|
||||
./run -a arm -g
|
||||
....
|
||||
|
||||
@@ -1839,7 +1841,7 @@ We have ported the PARSEC benchmark http://parsec.cs.princeton.edu for cross com
|
||||
This repo makes it trivial to get started with it:
|
||||
|
||||
....
|
||||
configure -p && ./build -a arm -g -i buildroot_config_fragment_parsec
|
||||
configure -gpq && ./build -a arm -g -i buildroot_config_fragment_parsec
|
||||
./run -a arm -g
|
||||
....
|
||||
|
||||
|
||||
57
configure
vendored
57
configure
vendored
@@ -1,10 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
interactive_pkgs=libsdl2-dev
|
||||
submodules='buildroot linux qemu gem5/gem5'
|
||||
gem5=false
|
||||
qemu=true
|
||||
submodules='buildroot linux'
|
||||
y=''
|
||||
while getopts pt OPT; do
|
||||
while getopts gqpt OPT; do
|
||||
case "$OPT" in
|
||||
g)
|
||||
gem5=true
|
||||
;;
|
||||
q)
|
||||
qemu=false
|
||||
;;
|
||||
p)
|
||||
submodules="$submodules parsec-benchmark/parsec-benchmark"
|
||||
;;
|
||||
@@ -16,6 +24,14 @@ while getopts pt OPT; do
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
## Submodules
|
||||
|
||||
if "$qemu"; then
|
||||
submodules="$submodules qemu"
|
||||
fi
|
||||
if "$gem5"; then
|
||||
submodules="$submodules gem5/gem5"
|
||||
fi
|
||||
(
|
||||
set -e
|
||||
# Shallow cloning saves a considerable amount of time, specially because of the linux kernel.
|
||||
@@ -25,36 +41,39 @@ shift $(($OPTIND - 1))
|
||||
# - `shallow = true` on the submodule has no effect for the non default educational branches of our submodules
|
||||
# - QEMU's submodules point to commits that are neither under branches nor tags, and so `--shallow-submodules` fails
|
||||
git submodule update --depth 1 --jobs 4 --init -- $submodules
|
||||
cd qemu
|
||||
git submodule update --init
|
||||
if "$qemu"; then
|
||||
cd qemu
|
||||
git submodule update --init
|
||||
fi
|
||||
) &
|
||||
wait $! || git submodule update --init -- $submodules
|
||||
|
||||
## apt-get
|
||||
|
||||
pkgs="\
|
||||
automake \
|
||||
build-essential \
|
||||
coreutils \
|
||||
"
|
||||
|
||||
# GEM5
|
||||
pkgs="$pkgs \
|
||||
g++-6 \
|
||||
gcc-6 \
|
||||
gcc-aarch64-linux-gnu \
|
||||
gcc-arm-linux-gnueabi \
|
||||
libgoogle-perftools-dev \
|
||||
protobuf-compiler \
|
||||
"
|
||||
|
||||
if "$gem5"; then
|
||||
pkgs="$pkgs \
|
||||
g++-6 \
|
||||
gcc-6 \
|
||||
gcc-aarch64-linux-gnu \
|
||||
gcc-arm-linux-gnueabi \
|
||||
libgoogle-perftools-dev \
|
||||
protobuf-compiler \
|
||||
"
|
||||
fi
|
||||
command -v apt-get >/dev/null 2>&1 || {
|
||||
cat <<EOF
|
||||
cat <<EOF
|
||||
apt-get not found. You're on your own for installing dependencies.
|
||||
|
||||
On Ubuntu they are:
|
||||
|
||||
$pkgs
|
||||
EOF
|
||||
exit 0
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Without this started failing in kernel 4.15 with:
|
||||
@@ -71,4 +90,6 @@ sudo apt-get install $y \
|
||||
$pkgs \
|
||||
$interactive_pkgs \
|
||||
;
|
||||
sudo apt-get build-dep $y qemu
|
||||
if "$qemu"; then
|
||||
sudo apt-get build-dep $y qemu
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user