diff options
author | An?bal Lim?n <limon.anibal@gmail.com> | 2022-01-27 20:46:28 -0600 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-01-28 09:40:58 -0800 |
commit | 2855fb2de892e9842bfd953e3d7c885c2dc35374 (patch) | |
tree | fca9ef9e7865e1250da846466d3b5fbc59aed6f9 /meta-oe/recipes-devtools | |
parent | a95d3a0f33099039e943143d31117051fb7f23a5 (diff) | |
download | meta-openembedded-2855fb2de892e9842bfd953e3d7c885c2dc35374.tar.gz |
unattended-upgrades: add new recipe version 2.6
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 <limon.anibal@gmail.com>
Signed-off-by: Aníbal Limón <anibal@rzerosystems.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools')
2 files changed, 109 insertions, 0 deletions
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 @@ | |||
1 | From a52d763559d1017ca73d2a2933aba1c78ad354c6 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal@rzerosystems.com> | ||
3 | Date: Thu, 27 Jan 2022 16:32:25 -0600 | ||
4 | Subject: [PATCH] unattended-upgrade: Remove distro_info usage to check devel | ||
5 | releases | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | The distro-info python3 package is used to check if the release is a | ||
11 | devel release and choice if continue with unattended-upgrade for now | ||
12 | remove it because needs support into python3-distro-info [1]. | ||
13 | |||
14 | [1] https://salsa.debian.org/debian/distro-info | ||
15 | |||
16 | Signed-off-by: Aníbal Limón <anibal@rzerosystems.com> | ||
17 | |||
18 | Upstream-Status: Inappropriate | ||
19 | --- | ||
20 | unattended-upgrade | 38 -------------------------------------- | ||
21 | 1 file changed, 38 deletions(-) | ||
22 | |||
23 | diff --git a/unattended-upgrade b/unattended-upgrade | ||
24 | index 802d4d5..3b4e83e 100755 | ||
25 | --- a/unattended-upgrade | ||
26 | +++ b/unattended-upgrade | ||
27 | @@ -83,9 +83,6 @@ import apt | ||
28 | import apt_inst | ||
29 | import apt_pkg | ||
30 | |||
31 | -import distro_info | ||
32 | - | ||
33 | - | ||
34 | # the reboot required flag file used by packages | ||
35 | REBOOT_REQUIRED_FILE = "/var/run/reboot-required" | ||
36 | KEPT_PACKAGES_FILE = "var/lib/unattended-upgrades/kept-back" | ||
37 | @@ -2061,41 +2058,6 @@ def run(options, # type: Options | ||
38 | if should_stop(): | ||
39 | return UnattendedUpgradesResult(False) | ||
40 | |||
41 | - # check to see if want to auto-upgrade the devel release | ||
42 | - if apt_pkg.config.find("Unattended-Upgrade::DevRelease") == "auto": | ||
43 | - try: | ||
44 | - if DISTRO_ID.lower() == 'ubuntu': | ||
45 | - devel = (distro_info.UbuntuDistroInfo() . | ||
46 | - devel(result="object")) | ||
47 | - elif DISTRO_ID.lower() == 'debian': | ||
48 | - devel = (distro_info.DebianDistroInfo() . | ||
49 | - devel(result="object")) | ||
50 | - else: | ||
51 | - devel = (distro_info.DistroInfo(DISTRO_ID) . | ||
52 | - devel(result="object")) | ||
53 | - except Exception as e: | ||
54 | - logging.warning("Could not figure out development release: %s" % e) | ||
55 | - else: | ||
56 | - if ((devel.series == DISTRO_CODENAME | ||
57 | - and devel.release is not None | ||
58 | - and devel.release - date.today() > DEVEL_UNTIL_RELEASE)): | ||
59 | - syslog.syslog((_("Not running on this development " | ||
60 | - "release before %s") % | ||
61 | - (devel.release - DEVEL_UNTIL_RELEASE | ||
62 | - - datetime.timedelta(days=1)))) | ||
63 | - logging.warning(_("Not running on this development " | ||
64 | - "release before %s") % | ||
65 | - (devel.release - DEVEL_UNTIL_RELEASE | ||
66 | - - datetime.timedelta(days=1))) | ||
67 | - return UnattendedUpgradesResult(True) | ||
68 | - | ||
69 | - logging.debug("Running on the development release") | ||
70 | - elif "(development branch)" in DISTRO_DESC and not\ | ||
71 | - apt_pkg.config.find_b("Unattended-Upgrade::DevRelease", True): | ||
72 | - syslog.syslog(_("Not running on the development release.")) | ||
73 | - logging.info(_("Not running on the development release.")) | ||
74 | - return UnattendedUpgradesResult(True) | ||
75 | - | ||
76 | logging.info(_("Starting unattended upgrades script")) | ||
77 | |||
78 | # 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 @@ | |||
1 | SUMMARY = "This script upgrades packages automatically and unattended." | ||
2 | DESCRIPTION = "The purpose of unattended-upgrades is to keep the computer current with the latest security (and other) updates automatically." | ||
3 | HOMEPAGE = "https://wiki.debian.org/UnattendedUpgrades" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ | ||
6 | file://debian/copyright;md5=62b5f2ac0ede901fb245eefbe54c181f" | ||
7 | |||
8 | SRC_URI = "git://github.com/mvo5/unattended-upgrades.git;protocol=https;branch=master \ | ||
9 | file://0001-unattended-upgrade-Remove-distro_info-usage-to-check.patch \ | ||
10 | " | ||
11 | |||
12 | SRCREV = "c6db6fad26a2b83ba301b52ff5dee98cef7558ca" | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | inherit setuptools3 | ||
17 | |||
18 | DEPENDS += "apt intltool-native python3-distutils-extra-native" | ||
19 | RDEPENDS:${PN} += "apt lsb-release python3-apt python3-core python3-datetime python3-email python3-fcntl python3-io python3-logging python3-stringold python3-syslog" | ||
20 | |||
21 | do_install:prepend () { | ||
22 | cp -v ${S}/data/50unattended-upgrades.Debian ${S}/data/50unattended-upgrades | ||
23 | } | ||
24 | |||
25 | do_install:append () { | ||
26 | # fix bad installation path's | ||
27 | mv -v ${D}/usr/usr/share/* ${D}/usr/share/ | ||
28 | rm -r ${D}/usr/usr | ||
29 | } | ||
30 | |||
31 | FILES:${PN} = "${bindir} ${exec_prefix}/etc ${libdir} ${datadir}" | ||