This commit is contained in:
aixiao 2017-08-23 20:12:44 +08:00
parent b594454bed
commit 949efb3146

58
aq.sh Normal file → Executable file
View File

@ -100,7 +100,7 @@ init() {
QEMU_CONFIGURE_GIT=$QEMU_CONFIGURE_2_10_0_RC2 QEMU_CONFIGURE_GIT=$QEMU_CONFIGURE_2_10_0_RC2
MAKE_J="$(grep -c ^processor /proc/cpuinfo | grep -E '^[1-9]+[0-9]*$' || echo 1)" ; test $MAKE_J != "1" && make_j=$((MAKE_J - 1)) || make_j=$MAKE_J MAKE_J="$(grep -c ^processor /proc/cpuinfo | grep -E '^[1-9]+[0-9]*$' || echo 1)" ; test $MAKE_J != "1" && make_j=$((MAKE_J - 1)) || make_j=$MAKE_J
MAKE_J="-j${make_j}" MAKE_J="-j${make_j}"
pkg_install debian pkg_install $OS
if test "$GIT_QEMU" = "0" ; then if test "$GIT_QEMU" = "0" ; then
git_clone git_clone
install qemu-git install qemu-git
@ -149,13 +149,26 @@ check_os() {
echo The system does not support echo The system does not support
exit 1 exit 1
fi fi
#! test "$OS" = "debian" && echo -ne The system does not support\\n && exit 1
case $OS in case $OS in
"debian") "debian")
: APT1=""
arch=`uname -m`
test "$arch" = "i686" && arch=x86
test "$arch" = "i386" && arch=x86
test "$arch" = "i486" && arch=x86
test "$arch" = "i586" && arch=x86
test "$arch" = "x86_64" && arch=x64
test "$arch" = "armel7" && arch=arm
;; ;;
"ubuntu") "ubuntu")
: APT1=""
arch=`uname -m`
test "$arch" = "i686" && arch=x86
test "$arch" = "i386" && arch=x86
test "$arch" = "i486" && arch=x86
test "$arch" = "i586" && arch=x86
test "$arch" = "x86_64" && arch=x64
test "$arch" = "armel7" && arch=arm
;; ;;
"*") "*")
echo -ne The system does not support\\n && exit 1 echo -ne The system does not support\\n && exit 1
@ -239,12 +252,45 @@ pkg_install() {
echo -ne done\\n echo -ne done\\n
fi fi
echo -n "Debian apt install " echo -n "Debian apt install "
DEBIAN_FRONTEND=noninteractive bg_wait apt-get -qqy --force-yes build-dep qemu-system build-essential DEBIAN_FRONTEND=noninteractive bg_wait apt-get -qqy --force-yes install build-essential git $APT1
if test $(cat $BGEXEC_EXIT_STATUS_FILE) != "0" ; then
echo -ne fail\\n-----------------------------\\n
exit 1
else
echo -ne done\\n
fi
echo -n "Debian apt build-dep "
DEBIAN_FRONTEND=noninteractive bg_wait apt-get -qqy --force-yes build-dep qemu-system $APT1
if test $(cat $BGEXEC_EXIT_STATUS_FILE) != "0" ; then if test $(cat $BGEXEC_EXIT_STATUS_FILE) != "0" ; then
echo -ne fail\\n-----------------------------\\n echo -ne fail\\n-----------------------------\\n
exit 1 exit 1
fi fi
echo -ne done\\n-----------------------------\\n echo -ne done\\n-----------------------------\\n
;;
ubuntu)
echo -n "Ubuntu apt update "
bg_wait apt-get update
if test $(cat $BGEXEC_EXIT_STATUS_FILE) != "0" ; then
echo -ne fail\\n
else
echo -ne done\\n
fi
echo -n "Ubuntu apt install "
DEBIAN_FRONTEND=noninteractive bg_wait apt-get -qqy --force-yes install build-essential git
if test $(cat $BGEXEC_EXIT_STATUS_FILE) != "0" ; then
echo -ne fail\\n-----------------------------\\n
exit 1
else
echo -ne done\\n
fi
echo -n "Ubuntu apt build-dep "
DEBIAN_FRONTEND=noninteractive bg_wait apt-get -qqy --force-yes build-dep qemu-system
if test $(cat $BGEXEC_EXIT_STATUS_FILE) != "0" ; then
echo -ne fail\\n-----------------------------\\n
exit 1
else
echo -ne done\\n-----------------------------\\n
fi
;; ;;
esac esac
} }
@ -460,7 +506,7 @@ HELP
esac esac
} }
path path
VER=1.04 VER=1.05
for((i=1;i<=$#;i++)); do for((i=1;i<=$#;i++)); do
ini_cfg=${!i} ini_cfg=${!i}
ini_cfg_a=`echo $ini_cfg | sed -r s/^-?-?.*=//` ini_cfg_a=`echo $ini_cfg | sed -r s/^-?-?.*=//`