From d28ff99736c538becce9e651acff79651aa4f418 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Tue, 3 Sep 2024 16:05:34 -0600 Subject: [PATCH] more stuff we don't need --- debian/cloud-init.postinst | 77 -------------------------------------- debian/cloud-init.postrm | 4 -- debian/cloud-init.preinst | 2 +- debian/cloud-init.prerm | 6 --- 4 files changed, 1 insertion(+), 88 deletions(-) delete mode 100644 debian/cloud-init.prerm diff --git a/debian/cloud-init.postinst b/debian/cloud-init.postinst index f7eabf27fffa..ab25da6bd726 100644 --- a/debian/cloud-init.postinst +++ b/debian/cloud-init.postinst @@ -7,81 +7,4 @@ set -e set -f # disable pathname expansion db_capb escape # to support carriage return / multi-line values -fix_lp1889555() { - local oldver="$1" last_bad_ver="20.3-2-g371b392c-0ubuntu1" - dpkg --compare-versions "$oldver" le-nl "$last_bad_ver" || return 0 - - # if cloud-init's grub module did not run, then it did not break anything. - [ -f /var/lib/cloud/instance/sem/config_grub_dpkg ] || return 0 - - # Don't do anything unless we have grub - command -v grub-install > /dev/null || return 0 - - # Make sure that we are not chrooted. - [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ] && return 0 - - # Check if we are in a container, i.e. LXC - if systemd-detect-virt --quiet --container || lxc-is-container 2>/dev/null; then - return 0 - fi - - # This bug only applies to NVMe devices - [ -e /dev/nvme0 ] || return 0 - - db_get grub-pc/install_devices && grub_cfg_dev=${RET} || return 0 - - # If the current setting is not the (potentially-incorrect) default we - # expect, this implies user intervention so leave things alone - [ "$grub_cfg_dev" = "/dev/sda" ] || return 0 - - correct_idev="$(python3 -c "import logging; from cloudinit.config.cc_grub_dpkg import fetch_idevs; print(fetch_idevs(logging.getLogger()))")" || return 0 - - # If correct_idev is the empty string, we failed to determine the correct - # install device; do nothing - [ -z "$correct_idev" ] && return 0 - - # If the correct_idev is already configured, do nothing - [ "$grub_cfg_dev" = "$correct_idev" ] && return 0 - - echo "Reconfiguring grub install device due to mismatch (LP: #1889555)" - echo " grub should use $correct_idev but is configured for $grub_cfg_dev" - db_set grub-pc/install_devices "$correct_idev" - db_set grub-pc/install_devices_empty "false" -} - -rename_hook_hotplug_udev_rule() { - local oldver="$1" last_bad_ver="24.3~1g6e4153b3-0ubuntu1" - dpkg --compare-versions "$oldver" le-nl "$last_bad_ver" || return 0 - # Avoids LP: #1946003 see commit: b519d861aff8b44a0610c176cb34adcbe28df144 - if [ -f /etc/udev/rules.d/10-cloud-init-hook-hotplug.rules ]; then - mv -f /etc/udev/rules.d/10-cloud-init-hook-hotplug.rules \ - /etc/udev/rules.d/90-cloud-init-hook-hotplug.rules - fi -} - -update_maas_spelling(){ - local oldver="$1" last_bad_ver="24.3~1g6e4153b3-0ubuntu1" - dpkg --compare-versions "$oldver" le-nl "$last_bad_ver" || return 0 - if db_get cloud-init/datasources; then - values="$RET" - if [ "${values#*MaaS}" != "${values}" ]; then - # if db had old MAAS spelling, fix it. - values=$(echo "$values" | sed 's,MaaS,MAAS,g') - db_set cloud-init/datasources "$values" - fi - cat > /etc/cloud/cloud.cfg.d/90_dpkg.cfg < /dev/null 2>&1 || return 0 rm -f /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg diff --git a/debian/cloud-init.prerm b/debian/cloud-init.prerm deleted file mode 100644 index 8954fa4d7c28..000000000000 --- a/debian/cloud-init.prerm +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e -rm -f /etc/cron.d/cloudinit-updates - -#DEBHELPER#