random: Fix behavior of kernel option "-rs".
[pintos-anon] / src / misc / bochs-2.6.11-build.sh
1 #!/bin/sh -xe
2
3 # Note: as of 2.6.9, you need to change line 566 of pintos.  Replace:
4 #     user_shortcut: keys=ctrlaltdel
5 # with
6 #     keyboard: user_shortcut=ctrl-alt-del
7 # to accommodate the new bochsrc.txt syntax
8
9 V=2.6.11
10
11 if test 1 != "$#"; then
12     echo "usage: $0 <install-prefix>" >&2
13     exit 2
14 fi
15 export PREFIX="$1"
16
17 SRCDIR=$(dirname $(readlink -f "$0"))
18 if test ! -d "$SRCDIR"; then
19     echo "cannot file src directory" >&2
20     exit 1
21 fi
22
23 if test ! -f "$SRCDIR/bochs-$V.tar.gz"; then
24     wget -O "$SRCDIR/bochs-$V.tar.gz" \
25          "https://sourceforge.net/projects/bochs/files/bochs/$V/bochs-$V.tar.gz/download"
26 fi
27
28 builddir=$(mktemp -d /tmp/bochsXXXXXXXXX)
29 trap "rm -rf \"$builddir\"" 0
30
31 cd "$builddir"
32 tar xzf "$SRCDIR/bochs-$V.tar.gz"
33 cd "bochs-$V"
34
35 for patchfile in "$SRCDIR/bochs-$V"-*.patch; do
36     patch -p1 -i "$patchfile"
37 done
38
39 CFGOPTS="--with-x --with-x11 --with-term --with-nogui"
40 mkdir plain
41 (cd plain &&
42         ../configure $CFGOPTS --prefix="$PREFIX" --enable-gdb-stub &&
43         make -j$(nproc) &&
44         make install)
45 mkdir with-dbg
46 (cd with-dbg &&
47         ../configure --enable-debugger --disable-debugger-gui $CFGOPTS --prefix="$PREFIX" &&
48         make -j$(nproc) &&
49         cp bochs "$PREFIX/bin/bochs-dbg")