diff --git a/tools/appliance/systemvmtemplate/http/preseed.cfg b/tools/appliance/systemvmtemplate/http/preseed.cfg index ce51f746c30..42718933ecb 100644 --- a/tools/appliance/systemvmtemplate/http/preseed.cfg +++ b/tools/appliance/systemvmtemplate/http/preseed.cfg @@ -45,6 +45,10 @@ d-i apt-setup/services-select multiselect security, updates d-i apt-setup/security_host string security.debian.org d-i apt-setup/local0/source boolean false d-i apt-setup/multiarch string i386 +d-i apt-setup/backports boolean true +d-i apt-setup/contrib boolean true +d-i apt-setup/multiverse boolean true +d-i apt-setup/universe boolean true ### Clock and time zone setup d-i clock-setup/utc boolean true @@ -56,13 +60,13 @@ d-i partman-auto/disk string /dev/vda d-i partman-auto/method string regular d-i partman-auto/expert_recipe string \ boot-root :: \ - 100 60 100 ext2 \ + 400 60 400 ext2 \ $primary{ } $bootable{ } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext2 } \ mountpoint{ /boot } \ . \ - 2240 40 2500 ext4 \ + 2240 40 4000 ext4 \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ mountpoint{ / } \ diff --git a/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh b/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh index ea75c2d8bf2..5699323f894 100644 --- a/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh +++ b/tools/appliance/systemvmtemplate/scripts/apt_upgrade.sh @@ -53,11 +53,16 @@ function apt_upgrade() { rm -fv /root/*.iso apt-get -q -y update + apt-get -q -y upgrade apt-get -q -y dist-upgrade + apt-get -q -y upgrade -t buster-backports + apt-get -q -y dist-upgrade -t buster-backports + apt-get -y autoremove --purge apt-get autoclean apt-get clean + reboot } return 2>/dev/null || apt_upgrade diff --git a/tools/appliance/systemvmtemplate/scripts/configure_grub.sh b/tools/appliance/systemvmtemplate/scripts/configure_grub.sh index 4d250c0417b..231aa764449 100644 --- a/tools/appliance/systemvmtemplate/scripts/configure_grub.sh +++ b/tools/appliance/systemvmtemplate/scripts/configure_grub.sh @@ -20,6 +20,9 @@ set -e set -x function configure_grub() { + # Remove the old/unused kernel + dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get remove -y --purge || true + apt-get -y autoremove --purge echo "blacklist floppy" > /etc/modprobe.d/blacklist-floppy.conf rmmod floppy || true update-initramfs -u diff --git a/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh b/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh index 82d08ce0584..d19fd06a8a7 100644 --- a/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh +++ b/tools/appliance/systemvmtemplate/scripts/install_systemvm_packages.sh @@ -22,7 +22,7 @@ set -x function install_vhd_util() { [[ -f /bin/vhd-util ]] && return - wget --no-check-certificate https://github.com/shapeblue/cloudstack-nonoss/raw/master/vhd-util -O /bin/vhd-util + wget --no-check-certificate https://github.com/shapeblue/cloudstack-nonoss/raw/main/vhd-util -O /bin/vhd-util chmod a+x /bin/vhd-util } @@ -42,7 +42,7 @@ function install_packages() { debconf_packages - local apt_get="apt-get --no-install-recommends -q -y" + local apt_get="apt-get --no-install-recommends -q -y -t buster-backports" ${apt_get} install grub-legacy \ rsyslog logrotate cron net-tools ifupdown tmux vim-tiny htop netbase iptables nftables \ @@ -76,8 +76,6 @@ function install_packages() { apt-get clean apt-get autoclean - ${apt_get} install links - #32 bit architecture support for vhd-util: not required for 32 bit template if [ "${arch}" != "i386" ]; then dpkg --add-architecture i386 diff --git a/tools/appliance/systemvmtemplate/template.json b/tools/appliance/systemvmtemplate/template.json index 5ec5f35a3b1..1e33241cd89 100644 --- a/tools/appliance/systemvmtemplate/template.json +++ b/tools/appliance/systemvmtemplate/template.json @@ -6,7 +6,14 @@ "type": "shell", "execute_command": "echo 'cloud' | sudo -u root -S bash {{.Path}}", "scripts": [ - "scripts/apt_upgrade.sh", + "scripts/apt_upgrade.sh" + ], + "expect_disconnect": true + }, + { + "type": "shell", + "execute_command": "echo 'cloud' | sudo -u root -S bash {{.Path}}", + "scripts": [ "scripts/configure_grub.sh", "scripts/configure_locale.sh", "scripts/configure_networking.sh", @@ -33,7 +40,7 @@ [ "-smp", "1" ] ], "format": "qcow2", - "disk_size": 2500, + "disk_size": 3000, "disk_interface": "virtio", "net_device": "virtio-net", "iso_url": "https://cdimage.debian.org/debian-cd/10.9.0/amd64/iso-cd/debian-10.9.0-amd64-netinst.iso",