Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package transactional-update for
openSUSE:Factory checked in at 2021-10-26 20:13:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/transactional-update (Old)
and /work/SRC/openSUSE:Factory/.transactional-update.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "transactional-update"
Tue Oct 26 20:13:28 2021 rev:82 rq:927034 version:3.6.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/transactional-update/transactional-update.changes
2021-10-22 10:45:28.432234401 +0200
+++
/work/SRC/openSUSE:Factory/.transactional-update.new.1890/transactional-update.changes
2021-10-26 20:13:30.802004088 +0200
@@ -1,0 +2,21 @@
+Fri Oct 22 17:53:36 UTC 2021 - Ignaz Forster <[email protected]>
+
+- Version 3.6.0
+ - Simplify mount hierarchy by just using a single slave bind
+ mount as the root of the update environment; this may avoid the
+ error messages of failed unmounts
+ May fix [boo#1191945]
+
+-------------------------------------------------------------------
+Tue Oct 12 09:42:57 UTC 2021 - Ignaz Forster <[email protected]>
+
+- Version 3.5.7
+ Various fixes affecting Salt support:
+ - t-u: Don't squash stderr messages into stdout
+ - t-u: Correctly handle case when the snapshot has been deleted due to
+ using --drop-if-no-change: Don't show reboot messages and avoid an awk
+ error message [bsc#1191475]
+ - tukit: Make inotify handler less sensitive / ignore more directories
+ [bsc#1191475]
+
+-------------------------------------------------------------------
Old:
----
transactional-update-3.5.6.tar.gz
New:
----
transactional-update-3.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ transactional-update.spec ++++++
--- /var/tmp/diff_new_pack.xa2zAj/_old 2021-10-26 20:13:31.374004390 +0200
+++ /var/tmp/diff_new_pack.xa2zAj/_new 2021-10-26 20:13:31.378004392 +0200
@@ -26,7 +26,7 @@
%{!?_distconfdir: %global _distconfdir %{_prefix}%{_sysconfdir}}
Name: transactional-update
-Version: 3.5.6
+Version: 3.6.0
Release: 0
Summary: Transactional Updates with btrfs and snapshots
License: GPL-2.0-or-later AND LGPL-2.1-or-later
++++++ transactional-update-3.5.6.tar.gz -> transactional-update-3.6.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-3.5.6/NEWS
new/transactional-update-3.6.0/NEWS
--- old/transactional-update-3.5.6/NEWS 2021-09-24 01:10:02.000000000 +0200
+++ new/transactional-update-3.6.0/NEWS 2021-10-22 19:49:32.000000000 +0200
@@ -2,8 +2,22 @@
Copyright (C) 2016-2021 Thorsten Kukuk, Ignaz Forster et al.
+Version 3.6
+* Simplify mount hierarchy by just using a single slave bind mount as
+ the root of the update environment; this may avoid the error
+ messages of failed unmounts
+
+Version 3.5.7
+Various fixes affecting Salt support:
+* t-u: Don't squash stderr messages into stdout
+* t-u: Correctly handle case when the snapshot has been deleted due to
+ using --drop-if-no-change: Don't show reboot messages and avoid an awk
+ error message [bsc#1191475]
+* tukit: Make inotify handler less sensitive / ignore more directories
+ [bsc#1191475]
+
Version 3.5.6
-* tukit: Add S/390 bootloader support [bsc#852640]
+* tukit: Add S/390 bootloader support [bsc#1189807]
* t-u: support purge-kernels with t-u patch [bsc#1190788]
Version 3.5.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-3.5.6/configure.ac
new/transactional-update-3.6.0/configure.ac
--- old/transactional-update-3.5.6/configure.ac 2021-09-24 01:10:02.000000000
+0200
+++ new/transactional-update-3.6.0/configure.ac 2021-10-22 19:49:32.000000000
+0200
@@ -1,9 +1,9 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(transactional-update, 3.5.6)
+AC_INIT(transactional-update, 3.6.0)
# Increase on any interface change and reset revision
LIBTOOL_CURRENT=3
# Increase or reset on any VERSION update
-LIBTOOL_REVISION=4
+LIBTOOL_REVISION=5
# Increase if interface change is backwards compatible, reset otherwise
LIBTOOL_AGE=3
AC_CANONICAL_SYSTEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-3.5.6/lib/Mount.cpp
new/transactional-update-3.6.0/lib/Mount.cpp
--- old/transactional-update-3.5.6/lib/Mount.cpp 2021-09-24
01:10:02.000000000 +0200
+++ new/transactional-update-3.6.0/lib/Mount.cpp 2021-10-22
19:49:32.000000000 +0200
@@ -279,10 +279,45 @@
Mount::mount(prefix);
}
-
PropagatedBindMount::PropagatedBindMount(std::string mountpoint, unsigned long
flags)
: BindMount(mountpoint, flags | MS_REC | MS_SLAVE)
{
}
+std::vector<std::filesystem::path> MountList::getList(std::filesystem::path
prefix) {
+ int rc = 0;
+ std::string err;
+
+ std::vector<std::filesystem::path> list;
+ struct libmnt_table* mount_table = mnt_new_table();
+ struct libmnt_iter* mount_iter = mnt_new_iter(MNT_ITER_FORWARD);
+ struct libmnt_fs* mount_fs;
+
+ if ((rc = mnt_table_parse_mtab(mount_table, NULL)) != 0)
+ err = "Couldn't read fstab for reading mount points: " +
std::to_string(rc);
+ while (rc == 0) {
+ if ((rc = mnt_table_next_fs(mount_table, mount_iter, &mount_fs)) == 0)
{
+ std::filesystem::path target;
+ if ((target = mnt_fs_get_target(mount_fs)) == "") {
+ err = "Could't read target for mount point list.";
+ break;
+ }
+ if (target == "/")
+ continue;
+ list.push_back(prefix / target.relative_path());
+ } else if (rc < 0) {
+ err = "Error iterating fstab: " + std::to_string(rc);
+ break;
+ }
+ }
+
+ mnt_free_iter(mount_iter);
+ mnt_free_table(mount_table);
+
+ if (!err.empty()) {
+ throw std::runtime_error{err};
+ }
+ return list;
+}
+
} // namespace TransactionalUpdate
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-3.5.6/lib/Mount.hpp
new/transactional-update-3.6.0/lib/Mount.hpp
--- old/transactional-update-3.5.6/lib/Mount.hpp 2021-09-24
01:10:02.000000000 +0200
+++ new/transactional-update-3.6.0/lib/Mount.hpp 2021-10-22
19:49:32.000000000 +0200
@@ -11,6 +11,7 @@
#include <filesystem>
#include <libmount/libmount.h>
#include <string>
+#include <vector>
namespace TransactionalUpdate {
@@ -57,6 +58,13 @@
PropagatedBindMount(std::string mountpoint, unsigned long flags = 0);
};
+class MountList
+{
+public:
+ MountList() = delete;
+ static std::vector<std::filesystem::path> getList(std::filesystem::path
prefix = "/");
+};
+
} // namespace TransactionalUpdate
#endif // T_U_MOUNT_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-3.5.6/lib/Transaction.cpp
new/transactional-update-3.6.0/lib/Transaction.cpp
--- old/transactional-update-3.5.6/lib/Transaction.cpp 2021-09-24
01:10:02.000000000 +0200
+++ new/transactional-update-3.6.0/lib/Transaction.cpp 2021-10-22
19:49:32.000000000 +0200
@@ -32,6 +32,7 @@
namespace fs = std::filesystem;
static int inotifyFd;
+std::vector<std::filesystem::path> inotifyExcludes;
class Transaction::impl {
public:
@@ -93,6 +94,14 @@
}
void Transaction::impl::mount() {
+ // GRUB needs to have an actual mount point for the root partition, so
+ // mount the snapshot directory on a temporary mount point
+ char bindTemplate[] = "/tmp/transactional-update-XXXXXX";
+ bindDir = mkdtemp(bindTemplate);
+ std::unique_ptr<BindMount> mntBind{new BindMount{bindDir, MS_UNBINDABLE}};
+ mntBind->setSource(snapshot->getRoot());
+ mntBind->mount();
+
dirsToMount.push_back(std::make_unique<PropagatedBindMount>("/dev"));
dirsToMount.push_back(std::make_unique<BindMount>("/var/log"));
@@ -103,7 +112,6 @@
Mount mntVar{"/var"};
if (mntVar.isMount()) {
- dirsToMount.push_back(std::make_unique<BindMount>("/var/cache"));
if (fs::is_directory("/var/lib/zypp"))
dirsToMount.push_back(std::make_unique<BindMount>("/var/lib/zypp"));
dirsToMount.push_back(std::make_unique<BindMount>("/var/lib/ca-certificates"));
@@ -119,6 +127,21 @@
dirsToMount.push_back(std::move(mntEtc));
}
+ // Set up temporary directories, so changes will be discarded automatically
+ dirsToMount.push_back(std::make_unique<BindMount>("/var/cache"));
+ std::unique_ptr<Mount> mntTmp{new Mount{"/tmp"}};
+ mntTmp->setType("tmpfs");
+ mntTmp->setSource("tmpfs");
+ dirsToMount.push_back(std::move(mntTmp));
+ std::unique_ptr<Mount> mntRun{new Mount{"/run"}};
+ mntRun->setType("tmpfs");
+ mntRun->setSource("tmpfs");
+ dirsToMount.push_back(std::move(mntRun));
+ std::unique_ptr<Mount> mntVarTmp{new Mount{"/var/tmp"}};
+ mntVarTmp->setType("tmpfs");
+ mntVarTmp->setSource("tmpfs");
+ dirsToMount.push_back(std::move(mntVarTmp));
+
// Mount platform specific GRUB directories for GRUB updates
for (auto& path: fs::directory_iterator("/boot/grub2")) {
if (fs::is_directory(path)) {
@@ -143,22 +166,14 @@
dirsToMount.push_back(std::make_unique<BindMount>("/.snapshots"));
for (auto it = dirsToMount.begin(); it != dirsToMount.end(); ++it) {
- it->get()->mount(snapshot->getRoot());
+ it->get()->mount(bindDir);
}
- // When all mounts are set up, then bind mount everything into a temporary
- // directory - GRUB needs to have an actual mount point for the root
- // partition
- char bindTemplate[] = "/tmp/transactional-update-XXXXXX";
- bindDir = mkdtemp(bindTemplate);
- std::unique_ptr<BindMount> mntBind{new BindMount{bindDir, MS_REC}};
- mntBind->setSource(snapshot->getRoot());
- mntBind->mount();
dirsToMount.push_back(std::move(mntBind));
}
void Transaction::impl::addSupplements() {
- supplements = Supplements(snapshot->getRoot());
+ supplements = Supplements(bindDir);
Mount mntVar{"/var"};
if (mntVar.isMount()) {
@@ -169,14 +184,6 @@
supplements.addFile(fs::path{"/run/netconfig"});
supplements.addFile(fs::path{"/run/systemd/resolve/resolv.conf"});
supplements.addFile(fs::path{"/run/systemd/resolve/stub-resolv.conf"});
- if (fs::is_directory("/var/cache/dnf"))
- supplements.addDir(fs::path{"/var/cache/dnf"});
- if (fs::is_directory("/var/cache/yum"))
- supplements.addDir(fs::path{"/var/cache/yum"});
- if (fs::is_directory("/var/cache/PackageKit"))
- supplements.addDir(fs::path{"/var/cache/PackageKit"});
- if (fs::is_directory("/var/cache/zypp"))
- supplements.addDir(fs::path{"/var/cache/zypp"});
supplements.addDir(fs::path{"/var/spool"});
}
@@ -184,10 +191,16 @@
int Transaction::impl::inotifyAdd(const char *pathname, const struct stat
*sbuf, int type, struct FTW *ftwb) {
if (!(type == FTW_D))
return 0;
- if (inotify_add_watch(inotifyFd, pathname, IN_MODIFY | IN_MOVE | IN_CREATE
| IN_DELETE | IN_ATTRIB | IN_ONESHOT | IN_ONLYDIR | IN_DONT_FOLLOW) == -1)
+ std::vector<std::filesystem::path>::iterator it;
+ for (it = inotifyExcludes.begin(); it != inotifyExcludes.end(); it++) {
+ if (std::string(pathname).find(*it) == 0)
+ return 0;
+ }
+ int num;
+ if ((num = inotify_add_watch(inotifyFd, pathname, IN_MODIFY | IN_MOVE |
IN_CREATE | IN_DELETE | IN_ATTRIB | IN_ONESHOT | IN_ONLYDIR | IN_DONT_FOLLOW))
== -1)
tulog.info("WARNING: Cannot register inotify watch for ", pathname);
else
- tulog.debug("Watching ", pathname);
+ tulog.debug("Watching ", pathname, " with descriptor number ", num);
return 0;
}
@@ -263,7 +276,7 @@
throw std::runtime_error{"Read() from inotify fd returned 0!"};
if (numRead == -1)
throw std::runtime_error{"Reading from inotify fd failed: " +
std::string(strerror(errno))};
- tulog.debug("inotify: Exiting after event on ", ((struct inotify_event
*)buf)->name);
+ tulog.debug("inotify: Exiting after event on descriptor number ",
((struct inotify_event *)buf)->wd, " in ", ((struct inotify_event *)buf)->name);
}
return ret;
}
@@ -275,6 +288,7 @@
throw std::runtime_error{"Couldn't initialize inotify."};
// Recursively register all directories of the root file system
+ inotifyExcludes = MountList::getList(snapshot->getRoot());
nftw(snapshot->getRoot().c_str(), inotifyAdd, 20, FTW_MOUNT |
FTW_PHYS);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/transactional-update-3.5.6/sbin/transactional-update.in
new/transactional-update-3.6.0/sbin/transactional-update.in
--- old/transactional-update-3.5.6/sbin/transactional-update.in 2021-09-24
01:10:02.000000000 +0200
+++ new/transactional-update-3.6.0/sbin/transactional-update.in 2021-10-22
19:49:32.000000000 +0200
@@ -95,7 +95,7 @@
exec 4>&2
fi
# Log stderr to log file
-exec 2> >(exec tee -a "${LOGFILE}")
+exec 2> >(exec tee -a "${LOGFILE}" >&2)
self_update() {
if [ ${DO_SELF_UPDATE} == 0 ]; then
@@ -1479,6 +1479,13 @@
tukit ${TUKIT_OPTS} close "${SNAPSHOT_ID}"
fi
+ # If --drop-if-no-change is used, then the snapshot may not exist any more;
+ # the remaining code is not applicable in this case.
+ if [ ! -e "${SNAPSHOT_DIR}/etc/fstab" -a ${EXITCODE} -eq 0 ]; then
+ SNAPSHOT_ID=
+ quit 0
+ fi
+
# Check for installation artefacts: Packages may have created files in
# directories outside of the root file system; these files will not be
# visible in the actual system as they are shadowed by the real mount