Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Ubuntu base build |
| 3 | |
| 4 | # vim: ts=4 sw=4 sts=4 et tw=72 : |
| 5 | |
| 6 | # force any errors to cause the script and job to end in failure |
| 7 | set -xeu -o pipefail |
| 8 | |
| 9 | rh_systems() { |
| 10 | echo 'No changes to apply' |
| 11 | } |
| 12 | |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 13 | ubuntu_install_java_setup() { |
| 14 | |
| 15 | echo "debconf shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections |
| 16 | |
| 17 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 |
| 18 | |
| 19 | DISTRO=$(lsb_release -cs) |
| 20 | |
| 21 | apt-add-repository \ |
| 22 | "deb http://ppa.launchpad.net/webupd8team/java/ubuntu $DISTRO main" |
| 23 | } |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 24 | |
| 25 | ubuntu_systems() { |
| 26 | apt-get clean |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 27 | |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 28 | # get prereqs for PPA and apt-over-HTTPS support |
| 29 | apt-get update |
| 30 | apt-get install -y apt-transport-https software-properties-common |
| 31 | |
| 32 | # install java (not needed as SonarQube includes this) |
| 33 | # ubuntu_install_java_setup |
| 34 | # apt-get update |
| 35 | # apt-get install -y oracle-java8-installer |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 36 | # rm -rf /var/cache/oracle-jdk8-installer |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 37 | |
| 38 | # set up ansible repo |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 39 | apt-add-repository -y ppa:ansible/ansible |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 40 | |
| 41 | # set up docker repo |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 42 | apt-key adv --keyserver keyserver.ubuntu.com --recv 0EBFCD88 |
| 43 | add-apt-repository \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 44 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |
| 45 | $(lsb_release -cs) \ |
| 46 | stable" |
| 47 | |
Zack Williams | 6ecb83c | 2018-08-29 13:22:21 -0700 | [diff] [blame] | 48 | # set up golang repo |
| 49 | add-apt-repository ppa:gophers/archive |
| 50 | |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 51 | # set up kubernetes repo |
| 52 | cat << EOF | base64 -d > /tmp/k8s-apt-key.gpg |
| 53 | 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 |
| 78 | EOF |
| 79 | |
| 80 | sudo apt-key add /tmp/k8s-apt-key.gpg |
| 81 | echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list |
| 82 | |
| 83 | # update after adding apt repos to sources |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 84 | apt-get update |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 85 | |
| 86 | # install basic sofware requirements |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 87 | apt-get install -y \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 88 | "docker-ce=17.06*" \ |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 89 | apt-transport-https \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 90 | ansible \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 91 | build-essential \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 92 | bzip2 \ |
| 93 | curl \ |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 94 | ebtables \ |
| 95 | ethtool \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 96 | git \ |
Zack Williams | 6ecb83c | 2018-08-29 13:22:21 -0700 | [diff] [blame] | 97 | golang-1.10-go \ |
Kailash Khalasi | 4b42e6c | 2018-10-18 13:43:52 -0700 | [diff] [blame] | 98 | httpie \ |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 99 | jq \ |
| 100 | "kubeadm=1.12.4-*" \ |
| 101 | "kubelet=1.12.4-*" \ |
| 102 | "kubectl=1.12.4-*" \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 103 | less \ |
Zack Williams | 9d661a4 | 2018-10-01 15:43:21 -0700 | [diff] [blame] | 104 | libmysqlclient-dev \ |
Zack Williams | 68f4310 | 2018-07-07 12:57:13 -0700 | [diff] [blame] | 105 | libpcap-dev \ |
Zack Williams | cfe0b94 | 2018-04-12 11:47:57 -0700 | [diff] [blame] | 106 | libxml2-utils \ |
Kailash Khalasi | 1ddc7c6 | 2018-04-20 08:47:56 -0700 | [diff] [blame] | 107 | maven \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 108 | nodejs \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 109 | npm \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 110 | python \ |
Zack Williams | 9754a83 | 2018-04-13 11:01:59 -0700 | [diff] [blame] | 111 | python-certifi \ |
| 112 | python-cryptography \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 113 | python-dev \ |
Zack Williams | 9754a83 | 2018-04-13 11:01:59 -0700 | [diff] [blame] | 114 | python-idna \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 115 | python-netaddr \ |
Zack Williams | 9754a83 | 2018-04-13 11:01:59 -0700 | [diff] [blame] | 116 | python-openssl \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 117 | python-pip \ |
Zack Williams | 9754a83 | 2018-04-13 11:01:59 -0700 | [diff] [blame] | 118 | python-urllib3 \ |
Zack Williams | 40c06f0 | 2018-04-15 20:31:34 -0700 | [diff] [blame] | 119 | ruby \ |
Zack Williams | eb842ae | 2018-05-15 17:07:32 -0700 | [diff] [blame] | 120 | socat \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 121 | ssh \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 122 | sshpass \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 123 | zip |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 124 | # end of apt-get install list |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 125 | |
| 126 | # install python modules |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 127 | pip install \ |
| 128 | Jinja2 \ |
| 129 | ansible-lint \ |
Zack Williams | ac92296 | 2018-07-24 13:02:26 -0700 | [diff] [blame] | 130 | astroid==1.* \ |
Zack Williams | 958bc4e | 2018-10-18 21:08:25 -0700 | [diff] [blame] | 131 | coverage \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 132 | docker-compose==1.20.1 \ |
| 133 | docker==3.2.1 \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 134 | gitpython \ |
Luca Prete | 90bfa5e | 2018-03-06 20:41:56 -0800 | [diff] [blame] | 135 | graphviz \ |
Kailash Khalasi | e15b27a | 2018-06-26 13:28:20 -0700 | [diff] [blame] | 136 | grpcio-tools \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 137 | isort \ |
Zack Williams | 6828f82 | 2018-04-12 16:13:33 -0700 | [diff] [blame] | 138 | linkchecker \ |
Zack Williams | 958bc4e | 2018-10-18 21:08:25 -0700 | [diff] [blame] | 139 | mock \ |
| 140 | nose2 \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 141 | pexpect \ |
Zack Williams | e9af4c4 | 2018-07-24 14:29:02 -0700 | [diff] [blame] | 142 | pylint==1.* \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 143 | pyyaml \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 144 | robotframework \ |
Kailash Khalasi | cb327c6 | 2018-04-03 10:41:38 -0700 | [diff] [blame] | 145 | robotframework-httplibrary \ |
Kailash Khalasi | a191768 | 2018-08-20 10:34:39 -0700 | [diff] [blame] | 146 | robotframework-kafkalibrary \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 147 | robotframework-requests \ |
Zack Williams | fd8a004 | 2018-04-12 14:34:17 -0700 | [diff] [blame] | 148 | robotframework-sshlibrary \ |
Zack Williams | a31016a | 2018-10-22 13:00:04 -0700 | [diff] [blame] | 149 | tox \ |
Zack Williams | fd8a004 | 2018-04-12 14:34:17 -0700 | [diff] [blame] | 150 | virtualenv |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 151 | # end of pip install list |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 152 | |
Zack Williams | 40c06f0 | 2018-04-15 20:31:34 -0700 | [diff] [blame] | 153 | # install ruby gems |
| 154 | gem install \ |
| 155 | mdl |
| 156 | # end of gem install list |
| 157 | |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 158 | # install npm modules |
| 159 | npm install -g \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 160 | gitbook-cli \ |
| 161 | markdownlint \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 162 | typings |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 163 | # end of npm install list |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 164 | |
Zack Williams | 6ecb83c | 2018-08-29 13:22:21 -0700 | [diff] [blame] | 165 | # install golang packages in /usr/local/go |
| 166 | # Set PATH=$PATH:/usr/local/go/bin` to use these |
| 167 | export GOPATH=/usr/local/go |
| 168 | mkdir -p $GOPATH |
| 169 | export PATH=$PATH:/usr/lib/go-1.10/bin:$GOPATH/bin |
| 170 | # converters for unit/coverage test |
| 171 | go get -v github.com/t-yuki/gocover-cobertura |
| 172 | go get -v github.com/jstemmer/go-junit-report |
| 173 | |
Zack Williams | 142ba6b | 2018-11-20 15:23:39 -0700 | [diff] [blame] | 174 | # dep for go package dependencies w/versioning, version v0.5.0, adapted from: |
| 175 | # https://golang.github.io/dep/docs/installation.html#install-from-source |
| 176 | go get -d -u github.com/golang/dep |
| 177 | pushd $(go env GOPATH)/src/github.com/golang/dep |
| 178 | git checkout "v0.5.0" |
| 179 | go install -ldflags="-X main.version=v0.5.0" ./cmd/dep |
| 180 | popd |
| 181 | |
Zack Williams | 6828f82 | 2018-04-12 16:13:33 -0700 | [diff] [blame] | 182 | # ubuntu 16.04 installs the node binary as /usr/bin/nodejs, which breaks |
| 183 | # tools that expect it to be named just `node`. Symlink it to fix |
| 184 | ln -s /usr/bin/nodejs /usr/local/bin/node |
| 185 | |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 186 | # install repo |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 187 | REPO_SHA256SUM="394d93ac7261d59db58afa49bb5f88386fea8518792491ee3db8baab49c3ecda" |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 188 | curl -o /tmp/repo 'https://gerrit.opencord.org/gitweb?p=repo.git;a=blob_plain;f=repo;hb=refs/heads/stable' |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 189 | echo "$REPO_SHA256SUM /tmp/repo" | sha256sum -c - |
| 190 | mv /tmp/repo /usr/local/bin/repo |
| 191 | chmod a+x /usr/local/bin/repo |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 192 | |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 193 | # install sonarqube scanner |
Zack Williams | 891922a | 2018-07-07 10:33:24 -0700 | [diff] [blame] | 194 | # dl link: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner |
| 195 | SONAR_SCANNER_CLI_VERSION="3.2.0.1227" |
| 196 | SONAR_SCANNER_CLI_SHA256SUM="07a50ec270a36cb83f26fe93233819c53c145248c638f4591880f1bd36e331d6" |
Zack Williams | 02e301e | 2018-10-08 12:09:58 -0700 | [diff] [blame] | 197 | curl -L -o /tmp/sonarscanner.zip "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_CLI_VERSION}-linux.zip" |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 198 | echo "$SONAR_SCANNER_CLI_SHA256SUM /tmp/sonarscanner.zip" | sha256sum -c - |
| 199 | pushd /opt |
| 200 | unzip /tmp/sonarscanner.zip |
| 201 | mv sonar-scanner-${SONAR_SCANNER_CLI_VERSION}-linux sonar-scanner |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 202 | rm -f /tmp/sonarscanner.zip |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 203 | popd |
| 204 | |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 205 | # install helm |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 206 | HELM_VERSION="2.11.0" |
| 207 | HELM_SHA256SUM="02a4751586d6a80f6848b58e7f6bd6c973ffffadc52b4c06652db7def02773a1" |
Zack Williams | 8aa5282 | 2018-04-05 09:22:15 -0700 | [diff] [blame] | 208 | HELM_PLATFORM="linux-amd64" |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 209 | curl -L -o /tmp/helm.tgz "https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-${HELM_PLATFORM}.tar.gz" |
Zack Williams | 8aa5282 | 2018-04-05 09:22:15 -0700 | [diff] [blame] | 210 | echo "$HELM_SHA256SUM /tmp/helm.tgz" | sha256sum -c - |
| 211 | pushd /tmp |
| 212 | tar -xzvf helm.tgz |
| 213 | mv ${HELM_PLATFORM}/helm /usr/local/bin/helm |
| 214 | chmod a+x /usr/local/bin/helm |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 215 | rm -rf helm.tgz ${HELM_PLATFORM} |
| 216 | popd |
| 217 | |
| 218 | # install minikube |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 219 | MINIKUBE_VERSION="0.30.0" |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 220 | MINIKUBE_DEB_VERSION="$(echo ${MINIKUBE_VERSION} | sed -n 's/\(.*\)\.\(.*\)/\1-\2/p')" |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 221 | MINIKUBE_SHA256SUM="c6c5aa5956f8ad5f61d426e9b8601ba95965a9c30bb80a9fe7525c64e6dd12fd" |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 222 | curl -L -o /tmp/minikube.deb "https://storage.googleapis.com/minikube/releases/v${MINIKUBE_VERSION}/minikube_${MINIKUBE_DEB_VERSION}.deb" |
| 223 | echo "$MINIKUBE_SHA256SUM /tmp/minikube.deb" | sha256sum -c - |
| 224 | pushd /tmp |
| 225 | dpkg -i minikube.deb |
| 226 | rm -f minikube.deb |
Zack Williams | 8aa5282 | 2018-04-05 09:22:15 -0700 | [diff] [blame] | 227 | popd |
| 228 | |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 229 | # install protobufs |
Zack Williams | cab43ba | 2018-09-19 09:58:25 -0700 | [diff] [blame] | 230 | PROTOC_VERSION="3.6.1" |
| 231 | PROTOC_SHA256SUM="6003de742ea3fcf703cfec1cd4a3380fd143081a2eb0e559065563496af27807" |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 232 | curl -L -o /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip |
| 233 | echo "$PROTOC_SHA256SUM /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip" | sha256sum -c - |
Kailash Khalasi | c4ff32d | 2018-06-28 18:24:52 -0700 | [diff] [blame] | 234 | unzip /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /tmp/protoc3 |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 235 | mv /tmp/protoc3/bin/* /usr/local/bin/ |
| 236 | mv /tmp/protoc3/include/* /usr/local/include/ |
Zack Williams | 3fc47ab | 2018-10-08 11:22:29 -0700 | [diff] [blame] | 237 | # fix permissions on include files |
| 238 | chmod -R a+r /usr/local/include/ |
Zack Williams | cab43ba | 2018-09-19 09:58:25 -0700 | [diff] [blame] | 239 | |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 240 | # give sudo permissions on minikube and protoc to jenkins user |
| 241 | cat <<EOF >/etc/sudoers.d/88-jenkins-minikube-protoc |
| 242 | Cmnd_Alias CMDS = /usr/local/bin/protoc, /usr/bin/minikube |
Zack Williams | 8173977 | 2018-05-14 16:35:47 -0700 | [diff] [blame] | 243 | Defaults:jenkins !requiretty |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 244 | jenkins ALL=(ALL) NOPASSWD:SETENV: CMDS |
Zack Williams | 8173977 | 2018-05-14 16:35:47 -0700 | [diff] [blame] | 245 | EOF |
| 246 | |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 247 | # remove apparmor |
| 248 | service apparmor stop |
| 249 | update-rc.d -f apparmor remove |
| 250 | apt-get remove apparmor-utils libapparmor-perl apparmor |
| 251 | update-grub |
| 252 | |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 253 | # clean up |
| 254 | apt-get clean |
| 255 | apt-get purge -y |
| 256 | apt-get autoremove -y |
| 257 | rm -rf /var/lib/apt/lists/* |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 258 | } |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 259 | |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 260 | all_systems() { |
| 261 | echo 'No common distribution configuration to perform' |
| 262 | } |
| 263 | |
| 264 | echo "---> Detecting OS" |
| 265 | ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') |
| 266 | |
| 267 | case "${ORIGIN}" in |
| 268 | fedora|centos|redhat) |
| 269 | echo "---> RH type system detected" |
| 270 | rh_systems |
| 271 | ;; |
| 272 | ubuntu) |
| 273 | echo "---> Ubuntu system detected" |
| 274 | ubuntu_systems |
| 275 | ;; |
| 276 | *) |
| 277 | echo "---> Unknown operating system" |
| 278 | ;; |
| 279 | esac |
| 280 | |
| 281 | # execute steps for all systems |
| 282 | all_systems |