blob: 87e412ef54cbdf089fc192c5ede9ad63386c8572 [file] [log] [blame]
#!/bin/bash -e
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
sed -i 's/deb.debian.org/ftp.bme.hu/' /etc/apt/sources.list
debconf-set-selections <(cat << EOF
keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout
keyboard-configuration keyboard-configuration/unsupported_layout boolean true
keyboard-configuration keyboard-configuration/compose select No compose key
keyboard-configuration keyboard-configuration/unsupported_config_options boolean true
keyboard-configuration keyboard-configuration/model select Generic 105-key PC (intl.)
keyboard-configuration keyboard-configuration/toggle select No toggling
keyboard-configuration keyboard-configuration/xkb-keymap select
keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean false
keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true
keyboard-configuration keyboard-configuration/unsupported_config_layout boolean true
keyboard-configuration keyboard-configuration/layoutcode string us
keyboard-configuration keyboard-configuration/variant select English (US)
keyboard-configuration console-setup/detect detect-keyboard
keyboard-configuration keyboard-configuration/switch select No temporary switch
keyboard-configuration keyboard-configuration/layout select English (US)
keyboard-configuration console-setup/ask_detect boolean false
keyboard-configuration keyboard-configuration/variantcode string
keyboard-configuration keyboard-configuration/modelcode string pc105
keyboard-configuration keyboard-configuration/unsupported_options boolean true
keyboard-configuration keyboard-configuration/optionscode string
keyboard-configuration console-setup/detected note
EOF
)
apt-get update
apt-get install -y \
wget curl nano gnupg lsb-release sysvbanner git \
psmisc nano screen sysvbanner net-tools procps \
screen psmisc netcat psmisc nano screen sysvbanner \
make gcc g++ \
locales time git-review jq diffstat unzip zip docker.io \
graphviz \
postgresql-client kdiff3 \
default-mysql-client \
xbase-clients libgtk3.0 software-properties-common \
docker.io locales time git-review jq diffstat unzip zip graphviz \
postgresql-client kdiff3 golang bash-completion \
default-mysql-client python libxml2-utils rsync lnav xmlstarlet jq colordiff xclip sudo wget vim tree pastebinit patchutils \
dnsutils wmctrl firefox-esr proxychains4
#python-networkx
groupadd -f -g 1000 dev
useradd -m -o -u 1000 -g 1000 -d /home/dev -s /bin/bash dev
addgroup --gid 999 docker_access
adduser dev docker_access
echo 'root:root' | chpasswd
echo 'dev:dev' | chpasswd
# setup sudo
adduser dev sudo
cat >> /etc/sudoers << EOF
# dev can do anything
dev ALL=(ALL) NOPASSWD:ALL
EOF
echo "LC_ALL=en_US.UTF-8" >> /etc/environment
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen en_US.UTF-8
cd /tmp
wget -nv https://github.com/bitnami/wait-for-port/releases/download/v1.0/wait-for-port.zip
unzip wait-for-port.zip
mv wait-for-port /usr/bin
rm wait-for-port.zip
sed -i 's/32m/36m/' ~dev/.bashrc
cat >> ~dev/.bashrc << EOF
alias grep='grep --color=auto'
alias Grep=grep
alias diffstat='diffstat -p0'
export USER=dev
EOF
/tools/build_cleanup