From 766ff497673a11fbdc2b91d7ffdd0bf1f0257d67 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Wed, 18 May 2022 14:05:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E5=A2=9E=E5=8A=A0PP?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E8=87=B3=E6=AD=A4=E6=95=B4=E4=B8=AA?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E9=81=B5=E5=BE=AA=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E5=AE=9A=E4=B9=89=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 56 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/build.sh b/build.sh index 6e3e4af..1a85b84 100755 --- a/build.sh +++ b/build.sh @@ -1,24 +1,46 @@ # Main and minor version definition mainverstr="s/ver_1/4/g" -minverstr="s/ver_2/0/g" +minver="01" +minverstr="s/ver_2/" oem="${1}" +cpu=`arch` -#if [ "${1}" -gt 0 ] 2>/dev/null ; then -# echo "${1}" -#else -# echo "usage: build.sh
[minver 0] [hw | lsc]" -# exit -#fi -#mainverstr="s/ver_1/""${1}""/g" -#minverstr="s/ver_2/" -#oem="${2}" -#if [ "$oem" == "minver" ]; then -# minverstr=${minverstr}"${3}" -# oem="${4}" -#else -# minverstr=${minverstr}"0" -#fi -#minverstr=${minverstr}"/g" +if cat /etc/*release | grep ^NAME | grep uos ; then + # uos ... + if [ "$cpu" == "x86_64" ]; then + minver="20"${minver} + elif [ "$cpu" == "aarch64" ]; then + minver="21"${minver} + elif [ "$cpu" == "mips64" ]; then + minver="22"${minver} + else + minver="29"${minver} + fi +elif cat /etc/*release | grep ^NAME | grep Kylin ; then + # kylin ... + if [ "$cpu" == "x86_64" ]; then + minver="30"${minver} + elif [ "$cpu" == "aarch64" ]; then + minver="31"${minver} + elif [ "$cpu" == "mips64" ]; then + minver="32"${minver} + else + minver="39"${minver} + fi +else + # unknown OS + if [ "$cpu" == "x86_64" ]; then + minver="90"${minver} + elif [ "$cpu" == "aarch64" ]; then + minver="91"${minver} + elif [ "$cpu" == "mips64" ]; then + minver="92"${minver} + else + minver="99"${minver} + fi +fi +minverstr=${minverstr}${minver}"/g" +echo "minor version replacing pattern: "${minverstr} sysarch=$(arch) sys=$(cat /etc/issue)