source: mainline/contrib/qemu/build-from-scratch.sh@ 27dd0e6

Last change on this file since 27dd0e6 was 089765f, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Update files with /bin/bash shebang and extra line

  • Property mode set to 100755
File size: 1.9 KB
Line 
1#!/bin/bash
2#
3# SPDX-FileCopyrightText: 2014 Jakub Jermar
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8VERSION=6.2.0
9BASENAME=qemu-${VERSION}
10BASENAME_MASTER=qemu-master
11TARBALL=${BASENAME}.tar.bz2
12SOURCEDIR=${BASENAME}
13URL=https://download.qemu.org/${TARBALL}
14REPO=git://git.qemu.org/qemu.git
15
16OPENSPARC_TARBALL="OpenSPARCT1_Arch.1.5.tar.bz2"
17OPENSPARC_URL="http://download.oracle.com/technetwork/systems/opensparc/${OPENSPARC_TARBALL}"
18
19ARCHIVE_PREFIX="./S10image"
20BINARIES="1up-hv.bin 1up-md.bin nvram1 openboot.bin q.bin reset.bin"
21
22echo "==== Downloading OpenSPARC archive ===="
23
24if [ ! -f ${OPENSPARC_TARBALL} ]
25then
26 wget ${OPENSPARC_URL}
27else
28 echo "===== OpenSPARC archive already exists, skipping. ====="
29fi
30
31echo "==== 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
54echo "==== Installing OpenSPARC binaries ===="
55
56sudo install -d /usr/local/opensparc/image
57sudo install -m 0444 binaries/* /usr/local/opensparc/image
58
59echo "==== Obtaining QEMU sources ===="
60
61if [ "$1" == "--master" ]; then
62 git clone ${REPO} ${BASENAME_MASTER}
63 cd ${BASENAME_MASTER}
64else
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}
81fi
82
83echo "==== 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
87echo "==== Building QEMU ===="
88
89make -j 4
90
91echo "==== Installing QEMU ===="
92
93sudo make install
94
Note: See TracBrowser for help on using the repository browser.