mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +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
|
||||||
|
|
||||||
|
=== gem5 getting started
|
||||||
|
|
||||||
gem5 is a system simulator, much <<gem5-vs-qemu,like QEMU>>: http://gem5.org/
|
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:
|
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
|
./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:
|
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
|
./run -a arm -g
|
||||||
....
|
....
|
||||||
|
|
||||||
|
|||||||
57
configure
vendored
57
configure
vendored
@@ -1,10 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
interactive_pkgs=libsdl2-dev
|
interactive_pkgs=libsdl2-dev
|
||||||
submodules='buildroot linux qemu gem5/gem5'
|
gem5=false
|
||||||
|
qemu=true
|
||||||
|
submodules='buildroot linux'
|
||||||
y=''
|
y=''
|
||||||
while getopts pt OPT; do
|
while getopts gqpt OPT; do
|
||||||
case "$OPT" in
|
case "$OPT" in
|
||||||
|
g)
|
||||||
|
gem5=true
|
||||||
|
;;
|
||||||
|
q)
|
||||||
|
qemu=false
|
||||||
|
;;
|
||||||
p)
|
p)
|
||||||
submodules="$submodules parsec-benchmark/parsec-benchmark"
|
submodules="$submodules parsec-benchmark/parsec-benchmark"
|
||||||
;;
|
;;
|
||||||
@@ -16,6 +24,14 @@ while getopts pt OPT; do
|
|||||||
done
|
done
|
||||||
shift $(($OPTIND - 1))
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
|
## Submodules
|
||||||
|
|
||||||
|
if "$qemu"; then
|
||||||
|
submodules="$submodules qemu"
|
||||||
|
fi
|
||||||
|
if "$gem5"; then
|
||||||
|
submodules="$submodules gem5/gem5"
|
||||||
|
fi
|
||||||
(
|
(
|
||||||
set -e
|
set -e
|
||||||
# Shallow cloning saves a considerable amount of time, specially because of the linux kernel.
|
# 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
|
# - `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
|
# - 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
|
git submodule update --depth 1 --jobs 4 --init -- $submodules
|
||||||
cd qemu
|
if "$qemu"; then
|
||||||
git submodule update --init
|
cd qemu
|
||||||
|
git submodule update --init
|
||||||
|
fi
|
||||||
) &
|
) &
|
||||||
wait $! || git submodule update --init -- $submodules
|
wait $! || git submodule update --init -- $submodules
|
||||||
|
|
||||||
|
## apt-get
|
||||||
|
|
||||||
pkgs="\
|
pkgs="\
|
||||||
automake \
|
automake \
|
||||||
build-essential \
|
build-essential \
|
||||||
coreutils \
|
coreutils \
|
||||||
"
|
"
|
||||||
|
if "$gem5"; then
|
||||||
# GEM5
|
pkgs="$pkgs \
|
||||||
pkgs="$pkgs \
|
g++-6 \
|
||||||
g++-6 \
|
gcc-6 \
|
||||||
gcc-6 \
|
gcc-aarch64-linux-gnu \
|
||||||
gcc-aarch64-linux-gnu \
|
gcc-arm-linux-gnueabi \
|
||||||
gcc-arm-linux-gnueabi \
|
libgoogle-perftools-dev \
|
||||||
libgoogle-perftools-dev \
|
protobuf-compiler \
|
||||||
protobuf-compiler \
|
"
|
||||||
"
|
fi
|
||||||
|
|
||||||
command -v apt-get >/dev/null 2>&1 || {
|
command -v apt-get >/dev/null 2>&1 || {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
apt-get not found. You're on your own for installing dependencies.
|
apt-get not found. You're on your own for installing dependencies.
|
||||||
|
|
||||||
On Ubuntu they are:
|
On Ubuntu they are:
|
||||||
|
|
||||||
$pkgs
|
$pkgs
|
||||||
EOF
|
EOF
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Without this started failing in kernel 4.15 with:
|
# Without this started failing in kernel 4.15 with:
|
||||||
@@ -71,4 +90,6 @@ sudo apt-get install $y \
|
|||||||
$pkgs \
|
$pkgs \
|
||||||
$interactive_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