From 2855fb2de892e9842bfd953e3d7c885c2dc35374 Mon Sep 17 00:00:00 2001 From: An?bal Lim?n Date: Thu, 27 Jan 2022 20:46:28 -0600 Subject: unattended-upgrades: add new recipe version 2.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unattended-upgrades is a set of scripts that allows to execute unattended upgrades in debian based systems in this case when enable package_deb and add package management into the image. At this moment installs all the required script and files into the image leaving the configuration and execution to be implemented by distro. Signed-off-by: Aníbal Limón Signed-off-by: Aníbal Limón Signed-off-by: Khem Raj --- ...upgrade-Remove-distro_info-usage-to-check.patch | 78 ++++++++++++++++++++++ .../unattended-upgrades/unattended-upgrades_2.6.bb | 31 +++++++++ 2 files changed, 109 insertions(+) create mode 100644 meta-oe/recipes-devtools/unattended-upgrades/files/0001-unattended-upgrade-Remove-distro_info-usage-to-check.patch create mode 100644 meta-oe/recipes-devtools/unattended-upgrades/unattended-upgrades_2.6.bb (limited to 'meta-oe') diff --git a/meta-oe/recipes-devtools/unattended-upgrades/files/0001-unattended-upgrade-Remove-distro_info-usage-to-check.patch b/meta-oe/recipes-devtools/unattended-upgrades/files/0001-unattended-upgrade-Remove-distro_info-usage-to-check.patch new file mode 100644 index 000000000..d39427e9f --- /dev/null +++ b/meta-oe/recipes-devtools/unattended-upgrades/files/0001-unattended-upgrade-Remove-distro_info-usage-to-check.patch @@ -0,0 +1,78 @@ +From a52d763559d1017ca73d2a2933aba1c78ad354c6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= +Date: Thu, 27 Jan 2022 16:32:25 -0600 +Subject: [PATCH] unattended-upgrade: Remove distro_info usage to check devel + releases +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The distro-info python3 package is used to check if the release is a +devel release and choice if continue with unattended-upgrade for now +remove it because needs support into python3-distro-info [1]. + +[1] https://salsa.debian.org/debian/distro-info + +Signed-off-by: Aníbal Limón + +Upstream-Status: Inappropriate +--- + unattended-upgrade | 38 -------------------------------------- + 1 file changed, 38 deletions(-) + +diff --git a/unattended-upgrade b/unattended-upgrade +index 802d4d5..3b4e83e 100755 +--- a/unattended-upgrade ++++ b/unattended-upgrade +@@ -83,9 +83,6 @@ import apt + import apt_inst + import apt_pkg + +-import distro_info +- +- + # the reboot required flag file used by packages + REBOOT_REQUIRED_FILE = "/var/run/reboot-required" + KEPT_PACKAGES_FILE = "var/lib/unattended-upgrades/kept-back" +@@ -2061,41 +2058,6 @@ def run(options, # type: Options + if should_stop(): + return UnattendedUpgradesResult(False) + +- # check to see if want to auto-upgrade the devel release +- if apt_pkg.config.find("Unattended-Upgrade::DevRelease") == "auto": +- try: +- if DISTRO_ID.lower() == 'ubuntu': +- devel = (distro_info.UbuntuDistroInfo() . +- devel(result="object")) +- elif DISTRO_ID.lower() == 'debian': +- devel = (distro_info.DebianDistroInfo() . +- devel(result="object")) +- else: +- devel = (distro_info.DistroInfo(DISTRO_ID) . +- devel(result="object")) +- except Exception as e: +- logging.warning("Could not figure out development release: %s" % e) +- else: +- if ((devel.series == DISTRO_CODENAME +- and devel.release is not None +- and devel.release - date.today() > DEVEL_UNTIL_RELEASE)): +- syslog.syslog((_("Not running on this development " +- "release before %s") % +- (devel.release - DEVEL_UNTIL_RELEASE +- - datetime.timedelta(days=1)))) +- logging.warning(_("Not running on this development " +- "release before %s") % +- (devel.release - DEVEL_UNTIL_RELEASE +- - datetime.timedelta(days=1))) +- return UnattendedUpgradesResult(True) +- +- logging.debug("Running on the development release") +- elif "(development branch)" in DISTRO_DESC and not\ +- apt_pkg.config.find_b("Unattended-Upgrade::DevRelease", True): +- syslog.syslog(_("Not running on the development release.")) +- logging.info(_("Not running on the development release.")) +- return UnattendedUpgradesResult(True) +- + logging.info(_("Starting unattended upgrades script")) + + # check and get lock diff --git a/meta-oe/recipes-devtools/unattended-upgrades/unattended-upgrades_2.6.bb b/meta-oe/recipes-devtools/unattended-upgrades/unattended-upgrades_2.6.bb new file mode 100644 index 000000000..629d2b43d --- /dev/null +++ b/meta-oe/recipes-devtools/unattended-upgrades/unattended-upgrades_2.6.bb @@ -0,0 +1,31 @@ +SUMMARY = "This script upgrades packages automatically and unattended." +DESCRIPTION = "The purpose of unattended-upgrades is to keep the computer current with the latest security (and other) updates automatically." +HOMEPAGE = "https://wiki.debian.org/UnattendedUpgrades" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ + file://debian/copyright;md5=62b5f2ac0ede901fb245eefbe54c181f" + +SRC_URI = "git://github.com/mvo5/unattended-upgrades.git;protocol=https;branch=master \ + file://0001-unattended-upgrade-Remove-distro_info-usage-to-check.patch \ + " + +SRCREV = "c6db6fad26a2b83ba301b52ff5dee98cef7558ca" + +S = "${WORKDIR}/git" + +inherit setuptools3 + +DEPENDS += "apt intltool-native python3-distutils-extra-native" +RDEPENDS:${PN} += "apt lsb-release python3-apt python3-core python3-datetime python3-email python3-fcntl python3-io python3-logging python3-stringold python3-syslog" + +do_install:prepend () { + cp -v ${S}/data/50unattended-upgrades.Debian ${S}/data/50unattended-upgrades +} + +do_install:append () { + # fix bad installation path's + mv -v ${D}/usr/usr/share/* ${D}/usr/share/ + rm -r ${D}/usr/usr +} + +FILES:${PN} = "${bindir} ${exec_prefix}/etc ${libdir} ${datadir}" -- cgit v1.2.3-54-g00ecf