Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Теперь Вы можете запустить его в формате ./create_zone.sh <zone-name> <zone-ip-domain> <zone-ip-node> , например!:

./create_zone.sh zone02 192.168.0 3

...

Code Block
languagebash
cat > build_all.sh <<EOT
#!/bin/bash
# by Denis Kozadaev
COMPONENT=\$1;
WORKDIR=\$2
WORKSPACE=$2\${WORKDIR}/\$3;
JOBS=$3\$4;
umask 022

WORKDIR="/export/home/admin"
#export CCACHE_DIR="\${BUILD_RESULT}/.ccache"
#export CCACHE_SIZE="2G"
export CCACHE_DISABLE="true"
export WORKSPACE="\${WORKDIR}/du2"

set -x

echo '======================================='
env

echo '======================================='
test -L /etc/dpkg/origins/default || sudo ln -fs dilos /etc/dpkg/origins/dilos
test -f /usr/bin/gmake || sudo ln -fs make /usr/bin/gmake
git clone https://bitbucket.org/dilos/du2.git \${WORKSPACE}

echo '======================================='
cd \${WORKDIR}
export DEB_BUILD_OPTIONS="parallel= 2"
sudo -E apt-get update
#sudo apt-get install -y libssl1.0.2/du-unstable openssl/du-unstable tar/du-unstable --allow-downgrades
#sudo apt-get install -y libssl1.0.2/du-unstable openssl/du-unstable tar/du-unstable --allow-downgrades
#sudo apt-get install -y libbz2-1./du2-unstable --allow-downgrades
sudo apt-get install -y acl iputils-ping kbd ksh scheduler system-data-console-fonts traceroute gmake  build-essential
#sudo apt-get install -y acl iputils-ping kbd ksh scheduler system-data-console-fonts traceroute gmake  build-essential 
#sudo apt-get install -y libicu-dev/du-unstable libicu57/du-unstable icu-devtools/du-unstable --allow-downgrades

DEBIAN_FRONTEND=nkvmoninteractive sudo -E apt-get install -f -y
DEBIAN_FRONTEND=noninteractive sudo -E apt-get upgrade -y

if ! getent group shadow | grep -q '^shadow:[^:]*:42'
then
sudo -E groupadd -g 42 shadow 
fi

test -L /usr/lib/jvm/default-java || sudo -E /usr/bin/ln -fs oracle-default-jdk /usr/lib/jvm/default-java

sudo -E apt-get install -y libx11-6 libxi6 libxtst6
sudo -E /usr/bin/ln -fs libX11.so.6 /usr/lib/64/libX11.so.4
sudo -E /usr/bin/ln -fs libXi.so.6 /usr/lib/64/libXi.so.5
sudo -E /usr/bin/ln -fs libXtst.so.6 /usr/lib/64/libXtst.so.1

echo '======================================='
echo "\${COMPONENT}"
test -d \${WORKSPACE}/components/\${COMPONENT} || exit 1
#cd \${WORKSPACE}/components
#yes Y |sudo -E gmake setup

cd "\${WORKSPACE}/components/\${COMPONENT}"

#sudo -E gmake debclobber
#if (( \$? > 0 )); then
#exit 1
#fi

#export LD_DEBUG=files,libs
sudo -E mkdir -p /data/repo/\${COMPONENT}
BLD_COMPONENT = BLD_COMPONENT=\${COMPONENT}-\$(date '+%Y-%m-%d')
BUILD_RESULT=/data/repo/\${COMPONENT}
export COMPONENT_RESULT=\`echo \${BLD_COMPONENT} | sed -e 's;/;-;'\`
sudo -E /usr/bin/rm -rf \${BUILD_RESULT}/du/\${COMPONENT_RESULT}
mkdir -p \${BUILD_RESULT}/du/\${COMPONENT_RESULT} 2>/dev/null

#export SHELLOPTS= 

sudo -E gmake JOBS=\${JOBS} WS_DEBS=\${BUILD_RESULT}/du/\${COMPONENT_RESULT} deb
#fakeroot gmake JOBS=\${JOBS} WS_DEBS=\${BUILD_RESULT}/du/\${COMPONENT_RESULT} deb
#| tee \${WORKSPACE}/log.\${COMPONENT}.txt
RES=\$?
echo '======================================='
sudo -E gmake debclobber
echo '======================================='
sudo -E apt-get install -y oracle-jdk
if (( \$RES > 0 )); then
exit 1
fi
EOT
chmod 777 ./build_all.sh

...

Code Block
languagebash
./build_all.sh lynx /export/home/admin/ du2 4

После сборки компонент Вы можете проверить их установку в отдельной новой зоне.

...