Add Ubuntu Server 20.04 | Update packer config to new version

parent a4086e45
Pipeline #1662 passed with stages
in 17 seconds
---
name: "app-dev"
boot_wait: "10s"
boot_command:
- "<esc><wait>"
- "install <wait>"
- "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}} <wait>" # yamllint disable-line
- "auto <wait>"
- "netcfg/get_hostname=app-dev <wait>"
- "netcfg/get_domain=vagrant <wait>"
- "locale=en_US.UTF-8 <wait>"
- "country=US <wait>"
- "language=en_US:en <wait>"
- "kbd-chooser/method=us <wait>"
- "keyboard-configuration/xkb-keymap=us <wait>"
- "fb=false <wait>"
- "biosdevname=0 <wait>"
- "net.ifnames=0 <wait>"
- "debconf/frontend=noninteractive <wait>"
- "console-setup/ask_detect=false <wait>"
- "console-keymaps-at/keymap=us <wait>"
- "<enter><wait>"
docker_image: "hub.sys.im/debian:buster"
iso_checksum: "sha256:3dbb597b7f11dbda71cda08d4c1339c1eb565e784c75409987fa2b91182d9240"
iso_url: "https://files.sys.im/iso/debian-10.0.0-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
ssh_password: "vagrant"
ssh_port: 22
ssh_username: "root"
ssh_wait_timeout: "10000s"
provisioners:
docker:
- "type": "shell"
"execute_command": "{{.Vars}} sh -eux '{{.Path}}'"
"expect_disconnect": true
"scripts":
- "{{ user `scripts_dir` }}/docker-provision.sh"
vagrant:
- "type": "shell"
"execute_command": "{{.Vars}} sh -eux '{{.Path}}'"
"expect_disconnect": true
"scripts":
- "{{ user `scripts_dir` }}/vagrant-provision.sh"
guest_os_type:
virtualbox: "Debian_64"
parallels: "debian"
vmware: "debian-64"
tools_flavor:
parallels: "lin"
vmware: "linux"
variables:
"preseed_path": "preseed.cfg"
......@@ -10,8 +10,7 @@ boot_command:
docker_image: "hub.sys.im/centos:6"
iso_checksum: "56f7b078a3b443095ba006cdc85319c691251cda98c5d73d12ef6db7aff6b4c1"
iso_checksum_type: "sha256"
iso_checksum: "sha256:56f7b078a3b443095ba006cdc85319c691251cda98c5d73d12ef6db7aff6b4c1"
iso_url: "https://files.sys.im/iso/centos-6.10-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,8 +11,7 @@ boot_command:
docker_image: "hub.sys.im/centos:7"
iso_checksum: "19d94274ef856c4dfcacb2e7cfe4be73e442a71dd65cc3fb6e46db826040b56e"
iso_checksum_type: "sha256"
iso_checksum: "sha256:19d94274ef856c4dfcacb2e7cfe4be73e442a71dd65cc3fb6e46db826040b56e"
iso_url: "https://files.sys.im/iso/centos-7.6-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,9 +11,8 @@ boot_command:
docker_image: "hub.sys.im/centos:8"
iso_checksum: "7fea13202bf2f26989df4175aace8fdc16e1137f7961c33512cbfad844008948"
iso_checksum_type: "sha256"
iso_url: "https://files.sys.im/iso/centos-8.1-x64-netinstall.iso"
iso_checksum: "sha256:47ab14778c823acae2ee6d365d76a9aed3f95bb8d0add23a06536b58bb5293c0"
iso_url: "https://files.sys.im/iso/centos-8.2-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -25,8 +25,7 @@ boot_command:
docker_image: "hub.sys.im/debian:buster"
iso_checksum: "3dbb597b7f11dbda71cda08d4c1339c1eb565e784c75409987fa2b91182d9240"
iso_checksum_type: "sha256"
iso_checksum: "sha256:3dbb597b7f11dbda71cda08d4c1339c1eb565e784c75409987fa2b91182d9240"
iso_url: "https://files.sys.im/iso/debian-10.0.0-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -21,8 +21,7 @@ boot_command:
docker_image: "hub.sys.im/debian:jessie"
iso_checksum: "ea444d6f8ac95fd51d2aedb8015c57410d1ad19b494cedec6914c17fda02733c"
iso_checksum_type: "sha256"
iso_checksum: "sha256:ea444d6f8ac95fd51d2aedb8015c57410d1ad19b494cedec6914c17fda02733c"
iso_url: "https://files.sys.im/iso/debian-8.11.1-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -23,8 +23,7 @@ boot_command:
docker_image: "hub.sys.im/debian:stretch"
iso_checksum: "1f97a4b8dee7c3def5cd8215ff01b9edef27c901b28fa8b1ef4f022eff7c36c2"
iso_checksum_type: "sha256"
iso_checksum: "sha256:1f97a4b8dee7c3def5cd8215ff01b9edef27c901b28fa8b1ef4f022eff7c36c2"
iso_url: "https://files.sys.im/iso/debian-9.5-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,8 +11,7 @@ boot_command:
docker_image: "hub.sys.im/fedora:28"
iso_checksum: "ea1efdc692356b3346326f82e2f468903e8da59324fdee8b10eac4fea83f23fe"
iso_checksum_type: "sha256"
iso_checksum: "sha256:ea1efdc692356b3346326f82e2f468903e8da59324fdee8b10eac4fea83f23fe"
iso_url: "https://files.sys.im/iso/fedora-28-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,8 +11,7 @@ boot_command:
docker_image: "hub.sys.im/fedora:29"
iso_checksum: "aa7fb0e6e5b71774ebdaab0dae76bdd9246a5bc7aedc28b7f1103aaaf9750654"
iso_checksum_type: "sha256"
iso_checksum: "sha256:aa7fb0e6e5b71774ebdaab0dae76bdd9246a5bc7aedc28b7f1103aaaf9750654"
iso_url: "https://files.sys.im/iso/fedora-29-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,8 +11,7 @@ boot_command:
docker_image: "hub.sys.im/fedora:30"
iso_checksum: "28c94f90adc926ea035d56f5bf59058a9305566adb70c0c50d7a13fc6ab838cf"
iso_checksum_type: "sha256"
iso_checksum: "sha256:28c94f90adc926ea035d56f5bf59058a9305566adb70c0c50d7a13fc6ab838cf"
iso_url: "https://files.sys.im/iso/fedora-30-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -17,8 +17,7 @@ boot_command:
docker_image: "hub.sys.im/opensuse/leap:15"
iso_checksum: "609d0ad527ab13681b44e28326cd7941e87adfe8d522e2b31d0d7c71e9d92992"
iso_checksum_type: "sha256"
iso_checksum: "sha256:609d0ad527ab13681b44e28326cd7941e87adfe8d522e2b31d0d7c71e9d92992"
iso_url: "https://files.sys.im/iso/opensuse-leap-15.1-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -10,8 +10,7 @@ boot_command:
docker_image: "hub.sys.im/oraclelinux:6"
iso_checksum: "625044388ee60a031965a42a32f4c1de0c029268975edcd542fd14160e0dadcb"
iso_checksum_type: "sha256"
iso_checksum: "sha256:625044388ee60a031965a42a32f4c1de0c029268975edcd542fd14160e0dadcb"
iso_url: "https://files.sys.im/iso/oracle-6.10-x64-dvd.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,8 +11,7 @@ boot_command:
docker_image: "hub.sys.im/oraclelinux:7"
iso_checksum: "a3156e9dc53ace74b81f6e37f284b74498057efd02babebd88aa2a51cc44d7e7"
iso_checksum_type: "sha256"
iso_checksum: "sha256:a3156e9dc53ace74b81f6e37f284b74498057efd02babebd88aa2a51cc44d7e7"
iso_url: "https://files.sys.im/iso/oracle-7.6-x64-dvd.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,9 +11,8 @@ boot_command:
docker_image: "hub.sys.im/oraclelinux:8"
iso_checksum: "ef7fb49847aaec0012d9d848c7492a969531fe31e36fdd53d150762d40521b17"
iso_checksum_type: "sha256"
iso_url: "https://files.sys.im/iso/oracle-8.0-x64-dvd.iso"
iso_checksum: "sha256:67568941e976efb26a3d61cdbf98c5a46cd0b3463ec750992f305eee20957a6e"
iso_url: "https://files.sys.im/iso/oracle-8.2-x64-dvd.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -10,8 +10,7 @@ boot_command:
docker_image: "hub.sys.im/scientificlinux/sl:6"
iso_checksum: "dd0a33a7c5148aac43178fc0ce0df8ac313f9a8e6b62b439faedc84a1218318a"
iso_checksum_type: "sha256"
iso_checksum: "sha256:dd0a33a7c5148aac43178fc0ce0df8ac313f9a8e6b62b439faedc84a1218318a"
iso_url: "https://files.sys.im/iso/scientific-6.10-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -11,8 +11,7 @@ boot_command:
docker_image: "hub.sys.im/scientificlinux/sl:7"
iso_checksum: "6a5db3fb2c67428dda3b862e3e05ab4d6e57ecd13ce02fbb80c0869ea9c26f7b"
iso_checksum_type: "sha256"
iso_checksum: "sha256:6a5db3fb2c67428dda3b862e3e05ab4d6e57ecd13ce02fbb80c0869ea9c26f7b"
iso_url: "https://files.sys.im/iso/scientific-7.6-x64-netinstall.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -33,8 +33,7 @@ boot_command:
docker_image: "hub.sys.im/ubuntu:xenial"
iso_checksum: "16afb1375372c57471ea5e29803a89a5a6bd1f6aabea2e5e34ac1ab7eb9786ac"
iso_checksum_type: "sha256"
iso_checksum: "sha256:16afb1375372c57471ea5e29803a89a5a6bd1f6aabea2e5e34ac1ab7eb9786ac"
iso_url: "https://files.sys.im/iso/ubuntu-server-16.04.6-x64.iso"
shutdown_command: "/sbin/halt -h -p"
......
......@@ -34,8 +34,7 @@ boot_command:
docker_image: "hub.sys.im/ubuntu:bionic"
iso_checksum: "7d8e0055d663bffa27c1718685085626cb59346e7626ba3d3f476322271f573e"
iso_checksum_type: "sha256"
iso_checksum: "sha256:7d8e0055d663bffa27c1718685085626cb59346e7626ba3d3f476322271f573e"
iso_url: "https://files.sys.im/iso/ubuntu-server-18.04.3-x64.iso"
shutdown_command: "/sbin/halt -h -p"
......
---
name: "ubuntu-20"
boot_wait: "7s"
boot_command:
- "<esc><wait><f6><wait><esc><wait>"
- "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><wait>"
- "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><wait>"
- "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><wait>"
- "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><wait>"
- "/install/vmlinuz <wait>"
- "initrd=/install/initrd.gz <wait>"
- "auto=true "
- "netcfg/get_hostname=ubuntu-20 <wait>"
- "netcfg/get_domain=vagrant <wait>"
- "biosdevname=0 <wait>"
- "net.ifnames=0 <wait>"
- "debian-installer=en_US.UTF-8 <wait>"
- "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}} <wait>"
- "console-setup/ask_detect=false <wait>"
- "console-setup/layoutcode=us <wait>"
- "console-setup/modelcode=pc105 <wait>"
- "kbd-chooser/method=us <wait>"
- "keyboard-configuration/layout=USA <wait>"
- "keyboard-configuration/variant=USA <wait>"
- "locale=en_US.UTF-8 <wait>"
- "debconf/frontend=noninteractive <wait>"
- "fb=false <wait>"
- "noapic <wait>"
- "auto <wait>"
- "-- <wait>"
- "<enter><wait>"
docker_image: "hub.sys.im/ubuntu:focal"
iso_checksum: "sha256:36f15879bd9dfd061cd588620a164a82972663fdd148cce1f70d57d314c21b73"
iso_url: "https://files.sys.im/iso/ubuntu-server-20.04.0-x64.iso"
shutdown_command: "/sbin/halt -h -p"
ssh_password: "vagrant"
ssh_port: 22
ssh_username: "root"
ssh_wait_timeout: "10000s"
provisioners:
docker:
- "type": "shell"
"execute_command": "{{.Vars}} sh -eux '{{.Path}}'"
"expect_disconnect": true
"scripts":
- "{{ user `scripts_dir` }}/docker-provision.sh"
vagrant:
- "type": "shell"
"execute_command": "{{.Vars}} sh -eux '{{.Path}}'"
"expect_disconnect": true
"scripts":
- "{{ user `scripts_dir` }}/vagrant-provision.sh"
guest_os_type:
virtualbox: "Ubuntu_64"
parallels: "ubuntu"
vmware: "ubuntu-64"
tools_flavor:
parallels: "lin"
vmware: "linux"
variables:
"preseed_path": "preseed.cfg"
......@@ -198,7 +198,6 @@ def packer_config(profile, provider, box, version, user, token, headless, upload
"disk_size": f"{int(data_profile.get('disk', 10)) * 1024}",
"http_directory": f"{ DIR_HTTP }/{ box }",
"iso_checksum": data_box.get('iso_checksum'),
"iso_checksum_type": data_box.get('iso_checksum_type'),
"iso_url": data_box.get('iso_url'),
"shutdown_command": data_box.get('shutdown_command'),
"ssh_password": data_box.get('ssh_password'),
......
This diff is collapsed.
......@@ -92,7 +92,7 @@ d-i netcfg/hostname string debian-8
# If you select ftp, the mirror/country string does not need to be set.
d-i mirror/protocol string http
d-i mirror/country string manual
d-i mirror/http/hostname string archive.debian.org
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
......@@ -309,7 +309,7 @@ d-i apt-setup/use_mirror boolean true
# By default the installer requires that repositories be authenticated
# using a known gpg key. This setting can be used to disable that
# authentication. Warning: Insecure, not recommended.
#d-i debian-installer/allow_unauthenticated boolean true
d-i debian-installer/allow_unauthenticated boolean true
# Uncomment this to add multiarch configuration for i386
#d-i apt-setup/multiarch string i386
......
......@@ -59,6 +59,7 @@ bzip2
gcc
make
kernel-devel
kernel-uek-devel
perl
virt-what
tar
......
This diff is collapsed.
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get upgrade -y
apt-get autoclean
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
# Add vagrant user
useradd -U -m -s /bin/bash vagrant
echo "vagrant:vagrant" | chpasswd
# Add sudo without password
echo "Defaults:vagrant !requiretty" > /etc/sudoers.d/vagrant
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# Add insecure ssh key for vagrant
install -v -o vagrant -g vagrant -m 0700 -d /home/vagrant/.ssh
curl -o /home/vagrant/.ssh/authorized_keys -kL 'https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub'
chown vagrant:vagrant /home/vagrant/.ssh/authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
# Update packages
apt-get update
apt-get -y upgrade
# Install Parallels / Virtualbox / VMWare tools
platform=$(virt-what | head -n 1)
case "${platform}" in
parallels)
mount -o loop ~/prl-tools-lin.iso /mnt;
bash /mnt/install --install-unattended-with-deps
umount /mnt
rm -rf ~/prl-tools-lin.iso
;;
virtualbox)
# Blacklist pcspkr (Virtualbox vm don't have speaker)
echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist.conf
mount -o loop ~/VBoxGuestAdditions.iso /mnt;
sh /mnt/VBoxLinuxAdditions.run --nox11 || true
umount /mnt;
rm -rf ~/VBoxGuestAdditions.iso
;;
vmware)
mount -o loop ~/linux.iso /mnt
tar zxf /mnt/VMwareTools-*.tar.gz -C /tmp/
/tmp/vmware-tools-distrib/vmware-install.pl -f
umount /mnt
rm -rf ~/linux.iso
;;
esac
# Remove unused packages
apt-get --purge remove -y wpasupplicant wireless-tools wireless-regdb iw hicolor-icon-theme bluetooth bluez laptop-detect fontconfig fontconfig-config fonts-dejavu-core
# Remove old kernels
dpkg --get-selections | grep -v linux-image-amd64 | grep -v "linux-image-$(uname -r)" | grep linux-image | cut -f1 | xargs apt-get -y --purge remove
# Remove unused packages
apt-get --purge autoremove -y
apt install -y \
apt-transport-https \
curl \
gnupg2 \
ca-certificates \
lsb-release \
nano \
mlocate \
rsync \
unzip \
net-tools \
curl \
sudo \
htop \
mc \
screen \
iotop \
strace \
tcpdump \
telnet \
nload \
gcc \
make \
g++ \
ntpdate \
unixodbc-dev \
openjdk-11-jre-headless
# Add repositories
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
echo "deb http://nginx.org/packages/debian `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
curl -fsSL https://packages.sury.org/php/apt.gpg | apt-key add -
echo "deb https://packages.sury.org/php `lsb_release -cs` main" > /etc/apt/sources.list.d/php.list
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elk.list
curl -fsSL http://repo.mysql.com/RPM-GPG-KEY-mysql | apt-key add -
echo "deb [ arch=amd64 ] http://repo.mysql.com/apt/debian/ `lsb_release -cs` mysql-8.0" > /etc/apt/sources.list.d/mysql.list
echo "deb [ arch=amd64 ] http://repo.mysql.com/apt/debian/ `lsb_release -cs` mysql-tools" >> /etc/apt/sources.list.d/mysql.list
curl -fsSL https://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
curl -fsSL https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | apt-key add -
echo "deb https://packages.erlang-solutions.com/debian `lsb_release -cs` contrib" > /etc/apt/sources.list.d/erlang.list
echo "deb https://dl.bintray.com/rabbitmq/debian `lsb_release -cs` main" > /etc/apt/sources.list.d/rabbitmq.list
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
echo "deb https://deb.nodesource.com/node_12.x `lsb_release -cs` main" > /etc/apt/sources.list.d/nodejs.list
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
# Install packages
apt update
apt upgrade -y
apt install -y \
nginx \
php7.4 \
php7.4-common \
php7.4-cgi \
php7.4-cli \
php7.4-fpm \
php7.4-dev \
php7.4-mbstring \
php7.4-gd \
php7.4-xml \
php7.4-zip \
php7.4-pgsql \
php7.4-mysql \
php7.4-curl \
php7.4-bcmath \
php7.4-amqp \
php7.4-pdo \
php7.4-interbase \
php7.4-sybase \
php-redis \
php-pear \
php-dev \
filebeat \
logstash \
elasticsearch \
kibana \
mysql-community-server \
mysql-community-client \
rabbitmq-server \
redis-server \
nodejs \
yarn \
python3 \
python3-dev \
python3-venv \
python3-wheel \
python3-setuptools
cd /tmp
wget https://packages.microsoft.com/debian/10/prod/pool/main/m/msodbcsql17/msodbcsql17_17.5.2.1-1_amd64.deb
env ACCEPT_EULA=Y apt install -y /tmp/msodbcsql17_17.5.2.1-1_amd64.deb
rm -rf /tmp/msodbcsql17_17.5.2.1-1_amd64.deb
pecl install pdo_sqlsrv
# Clean apt cache
apt-get clean
# Remove apt cache directory
rm -rf /var/cache/apt
# Clean udev rules
rm -rf /dev/.udev/
rm -f /etc/udev/rules.d/70-persistent-net.rules
rm -f /etc/udev/rules.d/75-persistent-net-generator.rules
if [ -d "/var/lib/dhcp" ]; then
rm /var/lib/dhcp/*
fi
# Clean log files
find /var/log/ -name '*.log' -exec rm -f {} \;
# Clean temp folder
rm -rf /tmp/*
# Remove unused files
rm -rf /root/*.cfg
rm -rf /root/*.iso
rm -rf /root/*.log
# Shrink swap and root partitions
_UUID=$(lsblk -no UUID /dev/sda2)
_NAME=$(lsblk -no NAME /dev/sda2)
swapoff -a
dd if=/dev/zero of="/dev/${_NAME}" bs=1M || true
mkswap "/dev/${_NAME}" -L "swap" -U "${_UUID}"
dd if=/dev/zero of=/empty.file bs=1M || true
sync
rm -rf /empty.file
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get upgrade -y
apt-get autoclean
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
# Add vagrant user
useradd -U -m -s /bin/bash vagrant
echo "vagrant:vagrant" | chpasswd
# Add sudo without password
echo "Defaults:vagrant !requiretty" > /etc/sudoers.d/vagrant
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# Add insecure ssh key for vagrant
install -v -o vagrant -g vagrant -m 0700 -d /home/vagrant/.ssh
curl -o /home/vagrant/.ssh/authorized_keys -kL 'https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub'
chown vagrant:vagrant /home/vagrant/.ssh/authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
# Update packages
apt-get update
apt-get -y upgrade
# Install Parallels / Virtualbox / VMWare tools
platform=$(virt-what | head -n 1)
case "${platform}" in
parallels)
mount -o loop ~/prl-tools-lin.iso /mnt;
bash /mnt/install --install-unattended-with-deps
umount /mnt
rm -rf ~/prl-tools-lin.iso
;;
virtualbox)
# Blacklist pcspkr (Virtualbox vm don't have speaker)
echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist.conf
rmmod vboxguest # Unload ubuntu embedded vboxguest
mount -o loop ~/VBoxGuestAdditions.iso /mnt;
sh /mnt/VBoxLinuxAdditions.run --nox11
umount /mnt;
rm -rf ~/VBoxGuestAdditions.iso
;;
vmware)
mount -o loop ~/linux.iso /mnt
tar zxf /mnt/VMwareTools-*.tar.gz -C /tmp/
/tmp/vmware-tools-distrib/vmware-install.pl -f
umount /mnt
rm -rf ~/linux.iso
;;
esac
# Remove unused packages
# apt-get --purge remove -y gcc make cpp
# Remove headers
dpkg --get-selections | grep linux-headers | cut -f1 | xargs apt-get -y --purge remove
# Remove unused packages
apt-get --purge autoremove -y
# Clean apt cache
apt-get clean
# Remove apt cache directory
rm -rf /var/cache/apt
# Clean udev rules
rm -rf /dev/.udev/
rm -f /etc/udev/rules.d/70-persistent-net.rules
rm -f /etc/udev/rules.d/75-persistent-net-generator.rules