Please fix the commit message format per commit guidelines
On 1/27/22 17:35, An?bal Lim?n wrote:
This script works to enable unattended-upgrades in package_deb apt/dpkg systems. Is missing configuration/integration to execute via systemd or init. Signed-off-by: Aníbal Limón <limon.ani...@gmail.com> Signed-off-by: Aníbal Limón <ani...@rzerosystems.com> --- ...de-Remove-distro_info-usage-to-check.patch | 78 +++++++++++++++++++ .../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 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?= <ani...@rzerosystems.com> +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 <ani...@rzerosystems.com> + +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..cfdd00465 --- /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} = "/usr/bin /usr/etc /usr/lib /usr/share"
let not use hard-coded paths which can be represented with bitbake variables through out this recipe
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#95136): https://lists.openembedded.org/g/openembedded-devel/message/95136 Mute This Topic: https://lists.openembedded.org/mt/88736519/21656 Group Owner: openembedded-devel+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-