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 > prepare.sh <<EOT
#!/bin/bash
WORKSPACE=/export/home/admin/du2

apt-get clean
apt-get autoclean
apt-get remove libiconv-dev -y

APTLIST="/tmp/apt_sources.list"
APTLISTETC="/etc/apt/sources.list"

apt-get install -y acl iputils-ping kbd ksh scheduler system-data-console-fonts
apt-get install -y traceroute gmake build-essential man-db po-debconf po4a debhelper
apt-get install -y libx11-6 libxi6 libxtst6 liblua5.2-dev libnghttp2-dev libjansson-dev
apt-get install -y jdupes libaprutil1-dev libbrotli-dev liblua5.2-dev libxml2-dev 
apt-get install -y mawk doxygen graphviz libdb-dev libgdbm-dev libsqlite3-dev libpq-dev
apt-get install -y default-libmysqlclient-dev unixodbc-dev libssl-dev bison lsb-release
apt-get install -y libcurl4-openssl-dev libcurl4-gnutls-dev libcurl4-nss-dev dh-exec
apt-get install -y cmake docbook-xml docbook-xsl libgtest-dev liblz4-dev libbz2-dev
apt-get install -y xsltproc w3m gperf guile-2.0-dev texinfo texlive cm-super-minimal
apt-get install -y libgtk-3-dev libdaemon-dev libdbus-1-dev python-all-dev python-gdbm
apt-get install -y python-dbus python-gi-dev gobject-introspection libgirepository1.0-dev
apt-get install -y xmltoman intltool sgmltools-lite libdebconfclient0-dev texi2html
apt-get install -y sharutils man2html libkrb5-dev libssl1.0libgeoip-dev libgeoiplibpipeline-dev
/usr/bin/ln -fs libX11.so.6 /usr/lib/64/libX11.so.4
/usr/bin/ln -fs libXi.so.6 /usr/lib/64/libXi.so.5
/usr/bin/ln -fs libXtst.so.6 /usr/lib/64/libXtst.so.1

cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo "" > \$APTLIST
echo /etc/apt/sources.list
echo "deb [trusted=yes] http://192.168.0.2/dilos du2-prebuild main contrib non-free" >> \$APTLIST/etc/apt/sources.list
echo "deb-src [trusted=yes] http://192.168.0.2/dilos du2-prebuild main contrib non-free" 2>/dev/null >> \$APTLIST
mv \$APTLIST \$APTLISTETC/etc/apt/sources.list
cp /etc/apt/sources.list /etc/apt/sources.list.dev

apt-get update -y

test -f /var/lib/dpkg/lock && rm -f /var/lib/dpkg/lock
test -f /var/cache/apt/archives/lock && rm -f /var/cache/apt/archives/lock
dpkg --configure -a
rm -rf \${WORKSPACE} && mkdir -p \${WORKSPACE}

apt-get upgrade -y

env DEBIAN_FRONTEND=noninteractive apt-get install -y -f
env DEBIAN_FRONTEND=noninteractive apt-get install -y git openssh-server
EOT

...

Code Block
languagebash
cat > build_all.sh <<EOT
#!/bin/bash

BLD_PARALLEL="4"
WORKSPACE=/export/home/admin/du2

while read COMP; do
  if [[ "" == "\$COMP" ]]; then
    continue
  fi
  BLD_RESULT="/data/repo/du/\$COMP"
  test -z "\$COMP" && exit 1
  test -d \${BLD_RESULT} && rm -rf \${BLD_RESULT}

  if [[ "$COMP" == "bind9" ]]; then
    cp /etc/apt/sources.list.dev /etc/apt/sources.list
    apt-get update
    apt-get install -y libssl1.0-dev
    cp /etc/apt/sources.list.bak /etc/apt/sources.list
    apt-get update
  fi
#  apt-get update && apt-get upgrade -y || exit 1
#  apt-get install -y build-essential illumos-dev dpkg-dev gmake || exit 1

  DEB_BUILD_OPTIONS="nocheck notest parallel=\${BLD_PARALLEL}"
  export DEB_BUILD_OPTIONS

  test -d \${WORKSPACE}/\$COMP && rm -rf \${WORKSPACE}/\$COMP

  mkdir -p \${WORKSPACE}/\$COMP
  cd \${WORKSPACE}/\$COMP
  apt-get build-dep -y \$COMP || exit 1
  #DEB_BUILD_OPTIONS="nocheck notest parallel=4" apt-get source --compile \$COMP || exit 1
  apt-get source --compile \$COMP || exit 1

  mkdir -p \${BLD_RESULT}
  cp -ax *.deb \${BLD_RESULT}/ || exit 1
  cp -ax *.changes \${BLD_RESULT}/ || exit 1
  cp -ax *.buildinfo \${BLD_RESULT}/ || exit 1
done < /data/repo/pkg/list_component
EOT

...