Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pkg-scripts/qemu-4.2.1-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rationale: - updating system qemu might be dangerous for production environments like github/labfolder - having more recent versions at hand allows testing, and for easier use by regular users. Difference to qemu installed in the system is the lack of the virtfs-feature, since it would require to run qemu as root (same would apply for the virtfs-proxy-helper).
executable file
54 lines (39 sloc)
1.42 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 1; exec bash /dev/shm/runme-$COOKIE.sh | |
# TESTING=1 | |
PKG=qemu | |
VERSION=4.2.1 | |
BUILD=0 | |
URL=https://download.qemu.org/qemu-$VERSION.tar.xz | |
PREFIX=/pkg/$PKG-$VERSION-$BUILD | |
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi | |
set -xe | |
umask 022 | |
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | |
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) | |
mkdir -p $BUILD_TMPDIR/home | |
export TMPDIR=$BUILD_TMPDIR | |
export HOME=$BUILD_TMPDIR/home | |
exec </dev/null | |
mkdir -p $PREFIX | |
cat >$PREFIX/profile <<-EOF | |
PATH=$PREFIX/bin:\$PATH | |
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi | |
EOF | |
. $PREFIX/profile | |
BUILDDIR=$PREFIX/build | |
mkdir -p $BUILDDIR | |
cd $BUILDDIR | |
AUDIODRIVERS=${AUDIODRIVERS:-alsa,oss,pa} | |
targets="--target-list=aarch64-linux-user,aarch64-softmmu,arm-linux-user,arm-softmmu,armeb-linux-user,i386-linux-user,i386-softmmu,ppc-linux-user,ppc-softmmu,ppc64-linux-user,ppc64-softmmu,x86_64-linux-user,x86_64-softmmu" | |
test -e qemu-${VERSION}.tar.xz || wget --no-verbose $URL | |
test -d qemu-$VERSION || tar -xf qemu-${VERSION}.tar.xz | |
cd qemu-$VERSION | |
./configure --prefix=${PREFIX} \ | |
$targets \ | |
--enable-system \ | |
--enable-jemalloc \ | |
--audio-drv-list=${AUDIODRIVERS} | |
make -j $(($(nproc)*4/5+1)) | |
make install | |
exit | |