Hello community,
here is the log from the commit of package transactional-update for
openSUSE:Factory checked in at 2019-12-07 15:18:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/transactional-update (Old)
and /work/SRC/openSUSE:Factory/.transactional-update.new.4691 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "transactional-update"
Sat Dec 7 15:18:01 2019 rev:47 rq:751697 version:2.20
Changes:
--------
---
/work/SRC/openSUSE:Factory/transactional-update/transactional-update.changes
2019-09-27 14:45:23.017242935 +0200
+++
/work/SRC/openSUSE:Factory/.transactional-update.new.4691/transactional-update.changes
2019-12-07 15:21:52.259741410 +0100
@@ -1,0 +2,13 @@
+Fri Nov 8 10:27:10 UTC 2019 - Ignaz Forster <[email protected]>
+
+- Update to version 2.20
+ - Add the option `--continue` to extend an existing snapshot. This can be
+ used to perform multiple operations before rebooting into the new state.
+ [gh#openSUSE/transactional-update#16]
+ - Make sure the dracut service to print warnings on /etc overlay conflicts
+ also runs in the pre-made images.
+ - Add "none" reboot method
+ - Remove conflicting overlay artifacts in case an existing overlay directory
+ will be reused
+
+-------------------------------------------------------------------
Old:
----
transactional-update-2.17.tar.gz
New:
----
transactional-update-2.20.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ transactional-update.spec ++++++
--- /var/tmp/diff_new_pack.QibgTp/_old 2019-12-07 15:21:53.079741297 +0100
+++ /var/tmp/diff_new_pack.QibgTp/_new 2019-12-07 15:21:53.087741295 +0100
@@ -1,7 +1,7 @@
#
# spec file for package transactional-update
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: transactional-update
-Version: 2.17
+Version: 2.20
Release: 0
Summary: Transactional Updates with btrfs and snapshots
License: GPL-2.0-or-later
++++++ transactional-update-2.17.tar.gz -> transactional-update-2.20.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-2.17/NEWS
new/transactional-update-2.20/NEWS
--- old/transactional-update-2.17/NEWS 2019-09-25 17:08:33.000000000 +0200
+++ new/transactional-update-2.20/NEWS 2019-11-28 19:16:20.000000000 +0100
@@ -2,6 +2,15 @@
Copyright (C) 2016-2019 Thorsten Kukuk et al.
+Version 2.20
+* Add the option `--continue` to extend an existing snapshot; this can be
+ used to perform multiple operations before rebooting into the new state
+* Make sure the dracut service to print warnings on /etc overlay conflicts
+ also runs in the pre-made images
+* Add "none" reboot method
+* Remove conflicting overlay artifacts in case an existing overlay directory
+ will be reused
+
Version 2.17
* Provide network in shell on systems where resolv.conf is pointing to /run
directly [boo#1151081]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-2.17/configure.ac
new/transactional-update-2.20/configure.ac
--- old/transactional-update-2.17/configure.ac 2019-09-25 17:08:33.000000000
+0200
+++ new/transactional-update-2.20/configure.ac 2019-11-28 19:16:20.000000000
+0100
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(transactional-update, 2.17)
+AC_INIT(transactional-update, 2.20)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([sbin/transactional-update.in])
AC_PREFIX_DEFAULT(/usr)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transactional-update-2.17/dracut/module-setup.sh
new/transactional-update-2.20/dracut/module-setup.sh
--- old/transactional-update-2.17/dracut/module-setup.sh 2019-09-25
17:08:33.000000000 +0200
+++ new/transactional-update-2.20/dracut/module-setup.sh 2019-11-28
19:16:20.000000000 +0100
@@ -1,16 +1,6 @@
#!/bin/bash
# called by dracut
-check() {
- test -f /etc/fstab.sys || [[ -n $add_fstab || -n $fstab_lines ]]
-}
-
-# called by dracut
-depends() {
- echo fstab-sys
-}
-
-# called by dracut
install() {
inst_script "$moddir/transactional-update-etc-cleaner.sh"
/bin/transactional-update-etc-cleaner
inst_simple "$moddir/transactional-update-etc-cleaner.service"
$systemdsystemunitdir/transactional-update-etc-cleaner.service
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/transactional-update-2.17/dracut/transactional-update-etc-cleaner.sh
new/transactional-update-2.20/dracut/transactional-update-etc-cleaner.sh
--- old/transactional-update-2.17/dracut/transactional-update-etc-cleaner.sh
2019-09-25 17:08:33.000000000 +0200
+++ new/transactional-update-2.20/dracut/transactional-update-etc-cleaner.sh
2019-11-28 19:16:20.000000000 +0100
@@ -26,18 +26,23 @@
warn_on_conflicting_files() {
local dir="${1:-.}"
local file
- local snapdir="${PREV_ETC_OVERLAY}/${dir}"
+ local basedir="${PREV_ETC_OVERLAY}/${dir}"
+ local checkdir="${CURRENT_ETC_OVERLAY}/${dir}"
- pushd "${CURRENT_ETC_OVERLAY}/${dir}" >/dev/null
+ echo "Checking for conflicts between ${PREV_ETC_OVERLAY}/${dir} and
${CURRENT_ETC_OVERLAY}/${dir}..."
+
+ pushd "${checkdir}" >/dev/null
for file in .[^.]* ..?* *; do
# Filter unexpanded globs of "for" loop
if [ ! -e "${file}" ]; then
continue
fi
- if [ -e "${snapdir}/${file}" -a "${snapdir}/${file}" -nt
"${CURRENT_ETC_OVERLAY}" ]; then
+ # Check whether a file present in a newer layer is also present in the
+ # original layer and has a timestamp from after branching the (first)
+ # snapshot.
+ if [ -e "${basedir}/${file}" -a "${basedir}/${file}" -nt
"${NEW_OVERLAYS[-1]}" ]; then
echo "WARNING: ${dir}/${file} or its contents changed in both old and
new snapshot after snapshot creation!"
- continue
fi
# Recursively process directories
@@ -56,7 +61,36 @@
PREV_ETC_OVERLAY="${NEWROOT}/var/lib/overlay/${PREV_SNAPSHOT_ID}/etc"
if [ "${CURRENT_SNAPSHOT_ID}" = "${EXPECTED_SNAPSHOT_ID}" -a -e
"${CURRENT_ETC_OVERLAY}" ]; then
+ NEW_OVERLAYS=()
+ for option in `findmnt --noheadings --output OPTIONS /${NEWROOT}/etc | tr
',' ' '`; do
+ case "${option%=*}" in
+ upperdir)
+ NEW_OVERLAYS[0]="${option#*=}"
+ ;;
+ lowerdir)
+ # If the previous overlay is not part of the stack just skip
+ if [[ $option != *"${PREV_ETC_OVERLAY}"* ]]; then
+ NEW_OVERLAYS=()
+ break
+ fi
+
+ i=1
+ for lowerdir in `echo ${option#*=} | tr ':' ' '`; do
+ if [ ${lowerdir} = ${PREV_ETC_OVERLAY} ]; then
+ break
+ fi
+ NEW_OVERLAYS[$i]="${lowerdir}"
+ ((i++))
+ done
+ ;;
+ esac
+ done
+
rm "${TU_FLAGFILE}"
- warn_on_conflicting_files
+
+ for overlay in "${NEW_OVERLAYS[@]}"; do
+ CURRENT_ETC_OVERLAY="${overlay}"
+ warn_on_conflicting_files
+ done
fi
fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/transactional-update-2.17/etc/transactional-update.conf
new/transactional-update-2.20/etc/transactional-update.conf
--- old/transactional-update-2.17/etc/transactional-update.conf 2019-09-25
17:08:33.000000000 +0200
+++ new/transactional-update-2.20/etc/transactional-update.conf 2019-11-28
19:16:20.000000000 +0100
@@ -2,7 +2,7 @@
# See transactional-update.conf(5) for details
# Reboot method
-# Valid values: auto salt rebootmgr systemd kexec
+# Valid values: auto salt rebootmgr systemd kexec none
#REBOOT_METHOD=auto
# zypper update method
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/transactional-update-2.17/man/transactional-update.8.xml
new/transactional-update-2.20/man/transactional-update.8.xml
--- old/transactional-update-2.17/man/transactional-update.8.xml
2019-09-25 17:08:33.000000000 +0200
+++ new/transactional-update-2.20/man/transactional-update.8.xml
2019-11-28 19:16:20.000000000 +0100
@@ -79,12 +79,13 @@
</para>
<para>
To achieve this <command>transactional-update</command> is using Btrfs'
-snapshot mechanism. Updates will be performed in a new snapshot of the root
-file system. The snapshot is created with
-<citerefentry
project='snapper'><refentrytitle>snapper</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-for the update
+snapshot mechanism, combined with the default distribution tools. Whenever an
+update of the root file system is going to be performed,
+<citerefentry
project='snapper'><refentrytitle>snapper</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+will create a new snapshot of the root file system first. This new snapshot is
+then used to perform the update, e.g. by calling
<citerefentry
project='zypper'><refentrytitle>zypper</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-is called with the <option>-R</option> option pointing to the new snapshot.
+with the <option>-R</option> option pointing to the new snapshot.
If no errors occured the snapshot will be set as the new default snapshot and
set as read-only. In case of errors the snapshot will be deleted again.
</para>
@@ -102,12 +103,11 @@
removed at a later time (see the <option>cleanup</option> option).
</para>
<warning>
-If a file was changed both in the new snapshot (e.g. if a package installed a
-new version of the configuration file or used fillup-templates) and in the
-currently running system after creation of the new snapshot (e.g. if the
-administrator or configuration management software changed a file) only the
-version of the new snapshot will be visible. When rebooting into the new
-snapshot for the first time
+If a file in <filename class='directory'>/etc</filename> has been changed
+during the update and is <emphasis>also</emphasis> changed in the running
+system after the snapshot has been taken, then only the version of the new
+snapshot will be visible after a reboot.
+When booting into the new snapshot for the first time
<filename>transactional-update-etc-cleaner.service</filename> will print a
warning about such conflicts to the system log file.
</warning>
@@ -453,6 +453,7 @@
<refsect1 id='see_also'><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>transactional-update.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry
project='systemd'><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
-<citerefentry
project='systemd'><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry></para>
+<citerefentry
project='systemd'><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
+<ulink
url="https://kubic.opensuse.org/documentation/transactional-update-guide/transactional-update.html">The
Transactional Update Guide</ulink></para>
</refsect1>
</refentry>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/transactional-update-2.17/man/transactional-update.conf.5.xml
new/transactional-update-2.20/man/transactional-update.conf.5.xml
--- old/transactional-update-2.17/man/transactional-update.conf.5.xml
2019-09-25 17:08:33.000000000 +0200
+++ new/transactional-update-2.20/man/transactional-update.conf.5.xml
2019-11-28 19:16:20.000000000 +0100
@@ -135,10 +135,29 @@
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>none</literal></term>
+ <listitem>
+ <para>
+ Ignores any reboot request, the user has to reboot the
+ machine manually or by other means.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>UPDATE_METHOD</varname></term>
+ <listitem>
+ <para>
+ Specify the zypper update method to use. This value is used for
+
<citerefentry><refentrytitle>transactional-update.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>UPDATE_METHOD</varname></term>
<listitem>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/transactional-update-2.17/sbin/transactional-update.in
new/transactional-update-2.20/sbin/transactional-update.in
--- old/transactional-update-2.17/sbin/transactional-update.in 2019-09-25
17:08:33.000000000 +0200
+++ new/transactional-update-2.20/sbin/transactional-update.in 2019-11-28
19:16:20.000000000 +0100
@@ -72,6 +72,7 @@
FORCE_NONINTERACTIVE=""
SNAPSHOT_ID=""
SNAPSHOT_DIR=""
+BASE_SNAPSHOT_ID=""
MOUNT_DIR=""
SNAPPER_NO_DBUS=""
TMPFILE=""
@@ -120,35 +121,36 @@
echo "system."
echo ""
echo "General Commands:"
- echo "cleanup Mark unused snapshots for snapper removal"
- echo "grub.cfg Regenerate grub.cfg"
- echo "bootloader Reinstall the bootloader"
- echo "initrd Regenerate initrd"
- echo "kdump Regenerate kdump initrd"
- echo "shell Open rw shell in new snapshot before exiting"
- echo "reboot Reboot after update"
+ echo "cleanup Mark unused snapshots for snapper removal"
+ echo "grub.cfg Regenerate grub.cfg"
+ echo "bootloader Reinstall the bootloader"
+ echo "initrd Regenerate initrd"
+ echo "kdump Regenerate kdump initrd"
+ echo "shell Open rw shell in new snapshot before
exiting"
+ echo "reboot Reboot after update"
echo ""
echo "Package Commands:"
echo "Defaults: (i) interactive command; (n) non-interactive command"
- echo "dup Call 'zypper dup' (n)"
- echo "up Call 'zypper up' (n)"
- echo "patch Call 'zypper patch' (n)"
- echo "migration Updates systems registered via SCC / SMT (i)"
- echo "pkg install ... Install individual packages (i)"
- echo "pkg remove ... Remove individual packages (i)"
- echo "pkg update ... Updates individual packages (i)"
+ echo "dup Call 'zypper dup' (n)"
+ echo "up Call 'zypper up' (n)"
+ echo "patch Call 'zypper patch' (n)"
+ echo "migration Updates systems registered via SCC / SMT
(i)"
+ echo "pkg install ... Install individual packages (i)"
+ echo "pkg remove ... Remove individual packages (i)"
+ echo "pkg update ... Updates individual packages (i)"
echo ""
echo "Standalone Commands:"
- echo "rollback [<number>] Set the current or given snapshot as default
snapshot"
- echo "rollback last Set the last working snapshot as default
snapshot"
+ echo "rollback [<number>] Set the current or given snapshot as
default snapshot"
+ echo "rollback last Set the last working snapshot as default
snapshot"
echo ""
echo "Options:"
- echo "--interactive, -i Use interactive mode for package command"
- echo "--non-interactive, -n Use non-interactive mode for package command"
- echo "--no-selfupdate Skip checking for newer version"
- echo "--quiet Don't print warnings and infos to stdout"
- echo "--help, -h Display this help and exit"
- echo "--version Display version and exit"
+ echo "--interactive, -i Use interactive mode for package command"
+ echo "--non-interactive, -n Use non-interactive mode for package
command"
+ echo "--continue [<number>], -c Use latest or given snapshot as base"
+ echo "--no-selfupdate Skip checking for newer version"
+ echo "--quiet Don't print warnings and infos to stdout"
+ echo "--help, -h Display this help and exit"
+ echo "--version Display version and exit"
exit $1
}
@@ -451,7 +453,7 @@
# Check for /etc overlay
for fstab in "$1"/etc/fstab{,.sys}; do
if [ -e "$fstab" ] ; then
- overlay_options="`awk '$2 == "/etc" && $3 == "overlay" && $4 ~
"workdir=/sysroot/var/lib/overlay/work-etc" { print $4 }' "$fstab"`"
+ overlay_options="`findmnt --noheadings --types "overlay" --options
"workdir=/sysroot/var/lib/overlay/work-etc" --output OPTIONS --tab-file
"$fstab" /etc`"
[ -n "${overlay_options}" ] && break
fi
done
@@ -494,12 +496,19 @@
fstab_oldest_active_snapshot="${fstab_oldest_active_snapshot:-/.snapshots/${CURRENT_SNAPSHOT_ID}/snapshot}"
}
+# Replace all /sysroot prefixes from /etc fstab entry; for the overlays in /var
+# the prefix can simply be removed, while the lowest layer - the /etc directory
+# on the root file system - has to be replaced with the actual snapshot path,
+# as /etc overmounted with the current overlay already.
+parse_lowerdirs_for_mount() {
+ fstab_lowerdirs=("${fstab_lowerdirs[@]///sysroot\/var//var}")
+ echo ${fstab_lowerdirs[@]///sysroot/$1} | tr ' ' ':'
+}
+
# Sync /etc mount contents to target directory
sync_etc() {
- local mount_opts overlay_id current_upper
+ local mount_opts overlay_id
- get_etc_overlay_from /
- current_upper="${fstab_upper}"
get_etc_overlay_from "$1"
# After fresh installations there's no overlay to sync yet
@@ -516,10 +525,7 @@
if [ "${fstab_upper}" != "${current_upper}" ]; then
mount_opts+="${fstab_upper#/sysroot}:"
fi
- # Replace all /sysroot prefixes; for /var it can simply be removed, the
- # remaining root file system has to be replaced with the oldest snapshot
- fstab_lowerdirs=("${fstab_lowerdirs[@]///sysroot\/var//var}")
- mount_opts+="`echo ${fstab_lowerdirs[@]///sysroot/$1} | tr ' ' ':'`"
+ mount_opts+="`parse_lowerdirs_for_mount $1`"
mount -t overlay overlay "${ETC_OVERLAY_DIR}" -o ${mount_opts}
if [ $? -ne 0 ]; then
log_error "ERROR: mount of old overlay stack from $1 failed!"
@@ -668,6 +674,16 @@
FORCE_NONINTERACTIVE="${ZYPPER_NONINTERACTIVE}"
shift
;;
+ -c|--continue)
+ # Check whether we got an optional snapshot number argument
+ if [[ $2 =~ ^[0-9]+$ ]]; then
+ BASE_SNAPSHOT_ID="$2"
+ shift
+ else
+ BASE_SNAPSHOT_ID="default"
+ fi
+ shift
+ ;;
--no-selfupdate)
DO_SELF_UPDATE=0
shift
@@ -741,6 +757,14 @@
telem_start
+SNAPPER_VERSION=`snapper --version | head -1 | cut -d ' ' -f 2`
+if [ -n "${BASE_SNAPSHOT_ID}" -a $(zypper --terse versioncmp $SNAPPER_VERSION
0.8.4) -lt 0 ]; then
+ echo "ERROR: snapper >= 0.8.4 required for --continue option!"
+ log_info "transactional-update finished"
+ telem_finish 1
+ exit 1
+fi
+
if [ "`stat -f -c %T /`" != "btrfs" ]; then
log_error "ERROR: not using btrfs as root file system!"
log_info "transactional-update finished"
@@ -775,7 +799,13 @@
DEFAULT_SNAPSHOT_ID=`btrfs subvolume get-default / | sed -e
's|.*.snapshots/\(.*\)/snapshot|\1|g'`
RO_ROOT=`btrfs property get / ro | sed -e 's|ro=||'`
-get_etc_overlay_from "/.snapshots/${CURRENT_SNAPSHOT_ID}/snapshot"
+if [ -z "${BASE_SNAPSHOT_ID}" ]; then
+ BASE_SNAPSHOT_ID="${CURRENT_SNAPSHOT_ID}"
+elif [ "${BASE_SNAPSHOT_ID}" = "default" ]; then
+ BASE_SNAPSHOT_ID="${DEFAULT_SNAPSHOT_ID}"
+fi
+
+get_etc_overlay_from "/.snapshots/${BASE_SNAPSHOT_ID}/snapshot"
if [ -n "$fstab_upper" ]; then
log_info "/etc on overlayfs detected."
ETC_IS_OVERLAY=1
@@ -917,18 +947,25 @@
-o ${RUN_SHELL} -eq 1 -o ${REWRITE_BOOTLOADER} -eq 1 \
-o ${DO_REGISTRATION} -eq 1 ]; then
- # If the current snapshot and the default snapshot differ
- # there have been changes that we are now discarding.
- if [ "${DEFAULT_SNAPSHOT_ID}" -ne "${CURRENT_SNAPSHOT_ID}" ]; then
- log_info "WARNING: Default snapshot differs from current snapshot."
- log_info "WARNING: Any changes within the previous snapshot will be
discarded!"
+ if [ "${DEFAULT_SNAPSHOT_ID}" -ne "${BASE_SNAPSHOT_ID}" ]; then
+ log_info "WARNING: You are creating a snapshot from a different base
(${BASE_SNAPSHOT_ID}) than the"
+ log_info " current default snapshot (${DEFAULT_SNAPSHOT_ID})."
+ if [ "${BASE_SNAPSHOT_ID}" -eq "${CURRENT_SNAPSHOT_ID}" ]; then
+ log_info " If you want to continue a previous snapshot use
the --continue"
+ log_info " option, otherwise the previous changes will be
discarded."
+ fi
fi
# Create the working snapshot
- SNAPSHOT_ID=`snapper create -p -u "transactional-update-in-progress=yes"
-d "Snapshot Update of #${CURRENT_SNAPSHOT_ID}"`
+ snapper_args=(create --print-number --userdata
"transactional-update-in-progress=yes")
+ if [ "${BASE_SNAPSHOT_ID}" -ne "${CURRENT_SNAPSHOT_ID}" ]; then
+ snapper_args+=(--from ${BASE_SNAPSHOT_ID})
+ fi
+ snapper_args+=(--description "Snapshot Update of #${BASE_SNAPSHOT_ID}")
+ SNAPSHOT_ID=`snapper "${snapper_args[@]}"`
if [ $? -ne 0 ]; then
SNAPPER_NO_DBUS="--no-dbus"
- SNAPSHOT_ID=`snapper --no-dbus create -p -u
"transactional-update-in-progress=yes" -d "Snapshot Update of
#${CURRENT_SNAPSHOT_ID}"`
+ SNAPSHOT_ID=`snapper ${SNAPPER_NO_DBUS} "${snapper_args[@]}"`
if [ $? -ne 0 ]; then
log_error "ERROR: snapper create failed!"
quit 1
@@ -947,20 +984,29 @@
if [ ${ETC_IS_OVERLAY} -eq 1 ]; then
# Create new /etc overlay for snapshot
ETC_OVERLAY_DIR="/var/lib/overlay/${SNAPSHOT_ID}/etc"
+ ETC_OVERLAY_DIR_PREV="/var/lib/overlay/${BASE_SNAPSHOT_ID}/etc"
ETC_OVERLAY_WORK_DIR="${ETC_OVERLAY_DIR}-work"
+
+ # If the user is calling `snapper delete` on the latest snapshot, then
+ # the snapshot number will be reused; make sure to delete any artifacts
+ rm -f "${ETC_OVERLAY_DIR}"
+
mkdir -p "${ETC_OVERLAY_DIR}" "${ETC_OVERLAY_WORK_DIR}"
+ get_etc_overlay_from /
+ current_upper="${fstab_upper}"
+
# Copy the contents of oldest /etc layer into snapshot
sync_etc "${fstab_oldest_active_snapshot}" "${SNAPSHOT_DIR}"
- get_etc_overlay_from "/.snapshots/${CURRENT_SNAPSHOT_ID}/snapshot"
+ get_etc_overlay_from "/.snapshots/${BASE_SNAPSHOT_ID}/snapshot"
# Special handling /etc/fstab{.sys}: dracut needs the *current* version
# of the files in the snapshot, as the overlay is not yet mounted
# during early boot - in fact the files are required to be able to
# mount the overlays
- cp /etc/fstab "${SNAPSHOT_DIR}/etc"
- if [ -e /etc/fstab.sys ]; then
- cp -a /etc/fstab.sys "${SNAPSHOT_DIR}/etc"
+ cp "${ETC_OVERLAY_DIR_PREV}/fstab" "${SNAPSHOT_DIR}/etc"
+ if [ -e "${ETC_OVERLAY_DIR_PREV}/fstab.sys" ]; then
+ cp -a "${ETC_OVERLAY_DIR_PREV}/fstab.sys" "${SNAPSHOT_DIR}/etc"
fi
# Migrate fstab.sys' /var and overlay entries to regular fstab
@@ -1047,8 +1093,15 @@
quit 1
fi
if [ ${ETC_IS_OVERLAY} -eq 1 ]; then
+ lowerdir="${fstab_upper///sysroot\/var//var}:"
+ lowerdir+="`parse_lowerdirs_for_mount
"/.snapshots/${BASE_SNAPSHOT_ID}/snapshot"`"
+ # Check whether the current upper directory is part of the snapshot's
lower
+ # directory stack; if so use reuse /etc directly instead, as mounting
+ # the same upper directory multiple times is not supported by overlayfs
+ lowerdir="${lowerdir/${current_upper#/sysroot}*/\/etc}"
+
etc_opts="defaults,"
- etc_opts+="lowerdir=/etc,"
+ etc_opts+="lowerdir=${lowerdir},"
etc_opts+="upperdir=${ETC_OVERLAY_DIR},"
etc_opts+="workdir=${ETC_OVERLAY_WORK_DIR}"
mount -t overlay overlay ${SNAPSHOT_DIR}/etc -o ${etc_opts}
@@ -1329,6 +1382,8 @@
kexec)
reboot_via_kexec
;;
+ none)
+ ;;
*)
log_info "Unsupported reboot method, falling back to 'auto';
please"
log_info "check your configuration in ${CONFFILE}."