1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | # SPDX-FileCopyrightText: 2014 Jakub Jermar
|
---|
4 | #
|
---|
5 | # SPDX-License-Identifier: BSD-3-Clause
|
---|
6 | #
|
---|
7 |
|
---|
8 | VERSION=6.2.0
|
---|
9 | BASENAME=qemu-${VERSION}
|
---|
10 | BASENAME_MASTER=qemu-master
|
---|
11 | TARBALL=${BASENAME}.tar.bz2
|
---|
12 | SOURCEDIR=${BASENAME}
|
---|
13 | URL=https://download.qemu.org/${TARBALL}
|
---|
14 | REPO=git://git.qemu.org/qemu.git
|
---|
15 |
|
---|
16 | OPENSPARC_TARBALL="OpenSPARCT1_Arch.1.5.tar.bz2"
|
---|
17 | OPENSPARC_URL="http://download.oracle.com/technetwork/systems/opensparc/${OPENSPARC_TARBALL}"
|
---|
18 |
|
---|
19 | ARCHIVE_PREFIX="./S10image"
|
---|
20 | BINARIES="1up-hv.bin 1up-md.bin nvram1 openboot.bin q.bin reset.bin"
|
---|
21 |
|
---|
22 | echo "==== Downloading OpenSPARC archive ===="
|
---|
23 |
|
---|
24 | if [ ! -f ${OPENSPARC_TARBALL} ]
|
---|
25 | then
|
---|
26 | wget ${OPENSPARC_URL}
|
---|
27 | else
|
---|
28 | echo "===== OpenSPARC archive already exists, skipping. ====="
|
---|
29 | fi
|
---|
30 |
|
---|
31 | echo "==== Extracting OpenSPARC binaries ===="
|
---|
32 | (
|
---|
33 | mkdir -p binaries;
|
---|
34 |
|
---|
35 | BINLIST=""
|
---|
36 | for b in ${BINARIES};
|
---|
37 | do
|
---|
38 | if [ ! -f binaries/$b ];
|
---|
39 | then
|
---|
40 | BINLIST+=${ARCHIVE_PREFIX}/$b" "
|
---|
41 | else
|
---|
42 | echo "===== $b seems to be already extracted, skipping. ====="
|
---|
43 | fi
|
---|
44 | done
|
---|
45 |
|
---|
46 | cd binaries
|
---|
47 |
|
---|
48 | if [ "${BINLIST}x" != "x" ];
|
---|
49 | then
|
---|
50 | tar --strip-components=2 -xjf ../${OPENSPARC_TARBALL} ${BINLIST}
|
---|
51 | fi
|
---|
52 | )
|
---|
53 |
|
---|
54 | echo "==== Installing OpenSPARC binaries ===="
|
---|
55 |
|
---|
56 | sudo install -d /usr/local/opensparc/image
|
---|
57 | sudo install -m 0444 binaries/* /usr/local/opensparc/image
|
---|
58 |
|
---|
59 | echo "==== Obtaining QEMU sources ===="
|
---|
60 |
|
---|
61 | if [ "$1" == "--master" ]; then
|
---|
62 | git clone ${REPO} ${BASENAME_MASTER}
|
---|
63 | cd ${BASENAME_MASTER}
|
---|
64 | else
|
---|
65 | if [ ! -f ${TARBALL} ]; then
|
---|
66 | wget ${URL}
|
---|
67 | fi
|
---|
68 |
|
---|
69 | if [ ! -f ${TARBALL}.sig ]; then
|
---|
70 | wget ${URL}.sig
|
---|
71 | fi
|
---|
72 |
|
---|
73 | gpg --verify ${TARBALL}.sig ${TARBALL}
|
---|
74 | if [ $? -ne 0 ]; then
|
---|
75 | echo Unable to verify the signature
|
---|
76 | exit
|
---|
77 | fi
|
---|
78 |
|
---|
79 | tar xvfj ${TARBALL}
|
---|
80 | cd ${SOURCEDIR}
|
---|
81 | fi
|
---|
82 |
|
---|
83 | echo "==== Configuring QEMU ===="
|
---|
84 |
|
---|
85 | ./configure --target-list=i386-softmmu,x86_64-softmmu,arm-softmmu,aarch64-softmmu,ppc-softmmu,sparc64-softmmu,mips-softmmu,mipsel-softmmu --audio-drv-list=pa
|
---|
86 |
|
---|
87 | echo "==== Building QEMU ===="
|
---|
88 |
|
---|
89 | make -j 4
|
---|
90 |
|
---|
91 | echo "==== Installing QEMU ===="
|
---|
92 |
|
---|
93 | sudo make install
|
---|
94 |
|
---|