From 5edc4c540fb599f08dc342f5105e4b72e83aa7e8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 9 Mar 2011 17:11:33 +0100 Subject: [PATCH] Adding upstream version 3.0~a6. --- VERSION | 2 +- bin/live-snapshot | 6 ++--- manpages/de/live-boot.de.7 | 2 +- manpages/de/live-snapshot.de.1 | 2 +- manpages/en/live-boot.7 | 2 +- manpages/en/live-snapshot.1 | 2 +- manpages/po/de/live-boot.7.po | 12 +++++----- manpages/po/de/live-snapshot.1.po | 12 +++++----- manpages/pot/live-boot.7.pot | 6 ++--- manpages/pot/live-snapshot.1.pot | 6 ++--- scripts/live | 47 ++++++++++++++++++++++++++++++++------- 11 files changed, 65 insertions(+), 34 deletions(-) diff --git a/VERSION b/VERSION index 97c929b..7855bab 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0~a5 +3.0~a6 diff --git a/bin/live-snapshot b/bin/live-snapshot index 08e5fd6..991e704 100755 --- a/bin/live-snapshot +++ b/bin/live-snapshot @@ -7,7 +7,7 @@ # for reuse in another live-boot session. # Look at the manpage for more informations. # -# Copyright (C) 2006-2008 Marco Amadori +# Copyright (C) 2006-2010 Marco Amadori # Copyright (C) 2008 Chris Lamb # # This program is free software: you can redistribute it and/or modify @@ -39,7 +39,7 @@ fi . /usr/share/initramfs-tools/scripts/live-helpers -LIVE_CONF="/etc/live.conf" +LIVE_CONF="/etc/live/boot.d/snapshot.conf" if [ -r "${LIVE_CONF}" ] then @@ -242,7 +242,7 @@ Defaults () # Parse resync string if [ -n "${SNAP_RESYNC_STRING}" ] then - SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | sed -e 's|^/root\([^:.]*\).*$|'"${DEF_SNAP_COW}"'\1|') + SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | sed -r -e 's#^([^:]*).*$#'"${DEF_SNAP_COW}"'\1#') SNAP_DEV=$(echo "${SNAP_RESYNC_STRING}" | cut -f2 -d ':') SNAP_MNT=$(echo "${SNAP_RESYNC_STRING}" | cut -f3 -d ':') DEST="${MOUNTP}/${SNAP_MNT}" diff --git a/manpages/de/live-boot.de.7 b/manpages/de/live-boot.de.7 index f533597..3a9ecc8 100644 --- a/manpages/de/live-boot.de.7 +++ b/manpages/de/live-boot.de.7 @@ -3,7 +3,7 @@ .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* -.TH LIVE\-BOOT 7 06.09.2010 3.0~a5 "Debian Live Projekt" +.TH LIVE\-BOOT 7 14.09.2010 3.0~a6 "Debian Live Projekt" .SH NAME \fBlive\-boot\fP \- System Boot Skripte diff --git a/manpages/de/live-snapshot.de.1 b/manpages/de/live-snapshot.de.1 index b067e09..d102fbd 100644 --- a/manpages/de/live-snapshot.de.1 +++ b/manpages/de/live-snapshot.de.1 @@ -3,7 +3,7 @@ .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* -.TH LIVE\-BOOT 1 06.09.2010 3.0~a5 "Debian Live Projekt" +.TH LIVE\-BOOT 1 14.09.2010 3.0~a6 "Debian Live Projekt" .SH NAME \fBlive\-snapshot\fP \- simple script to ease persistence usage diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7 index f424f25..06915d6 100644 --- a/manpages/en/live-boot.7 +++ b/manpages/en/live-boot.7 @@ -1,4 +1,4 @@ -.TH LIVE\-BOOT 7 2010\-09\-06 3.0~a5 "Debian Live Project" +.TH LIVE\-BOOT 7 2010\-09\-14 3.0~a6 "Debian Live Project" .SH NAME \fBlive\-boot\fR \- System Boot Scripts diff --git a/manpages/en/live-snapshot.1 b/manpages/en/live-snapshot.1 index d2c82cc..3220f49 100644 --- a/manpages/en/live-snapshot.1 +++ b/manpages/en/live-snapshot.1 @@ -1,4 +1,4 @@ -.TH LIVE\-BOOT 1 2010\-09\-06 3.0~a5 "Debian Live Project" +.TH LIVE\-BOOT 1 2010\-09\-14 3.0~a6 "Debian Live Project" .SH NAME \fBlive\-snapshot\fR \- simple script to ease persistence usage diff --git a/manpages/po/de/live-boot.7.po b/manpages/po/de/live-boot.7.po index a305617..fe6797b 100644 --- a/manpages/po/de/live-boot.7.po +++ b/manpages/po/de/live-boot.7.po @@ -4,8 +4,8 @@ # msgid "" msgstr "" -"Project-Id-Version: live-boot 3.0~a5\n" -"POT-Creation-Date: 2010-09-06 15:17+0300\n" +"Project-Id-Version: live-boot 3.0~a6\n" +"POT-Creation-Date: 2010-09-14 08:52+0300\n" "PO-Revision-Date: 2010-05-24 12:34+0300\n" "Last-Translator: Daniel Baumann \n" "Language-Team: none\n" @@ -24,14 +24,14 @@ msgstr "LIVE-BOOT" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "2010-09-06" -msgstr "06.09.2010" +msgid "2010-09-14" +msgstr "14.09.2010" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "3.0~a5" -msgstr "3.0~a5" +msgid "3.0~a6" +msgstr "3.0~a6" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 diff --git a/manpages/po/de/live-snapshot.1.po b/manpages/po/de/live-snapshot.1.po index c1108be..d4b4764 100644 --- a/manpages/po/de/live-snapshot.1.po +++ b/manpages/po/de/live-snapshot.1.po @@ -4,8 +4,8 @@ # msgid "" msgstr "" -"Project-Id-Version: live-boot 3.0~a5\n" -"POT-Creation-Date: 2010-09-06 15:17+0300\n" +"Project-Id-Version: live-boot 3.0~a6\n" +"POT-Creation-Date: 2010-09-14 08:52+0300\n" "PO-Revision-Date: 2010-05-24 12:34+0300\n" "Last-Translator: Daniel Baumann \n" "Language-Team: none\n" @@ -24,14 +24,14 @@ msgstr "LIVE-BOOT" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "2010-09-06" -msgstr "06.09.2010" +msgid "2010-09-14" +msgstr "14.09.2010" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "3.0~a5" -msgstr "3.0~a5" +msgid "3.0~a6" +msgstr "3.0~a6" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 diff --git a/manpages/pot/live-boot.7.pot b/manpages/pot/live-boot.7.pot index e6b4c14..b1d7e91 100644 --- a/manpages/pot/live-boot.7.pot +++ b/manpages/pot/live-boot.7.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: live-boot VERSION\n" -"POT-Creation-Date: 2010-09-06 15:17+0300\n" +"POT-Creation-Date: 2010-09-14 08:52+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,13 +25,13 @@ msgstr "" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "2010-09-06" +msgid "2010-09-14" msgstr "" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "3.0~a5" +msgid "3.0~a6" msgstr "" #. type: TH diff --git a/manpages/pot/live-snapshot.1.pot b/manpages/pot/live-snapshot.1.pot index e8b6d2a..3e8f6e3 100644 --- a/manpages/pot/live-snapshot.1.pot +++ b/manpages/pot/live-snapshot.1.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: live-boot VERSION\n" -"POT-Creation-Date: 2010-09-06 15:17+0300\n" +"POT-Creation-Date: 2010-09-14 08:52+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,13 +25,13 @@ msgstr "" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "2010-09-06" +msgid "2010-09-14" msgstr "" #. type: TH #: en/live-boot.7:1 en/live-snapshot.1:1 #, no-wrap -msgid "3.0~a5" +msgid "3.0~a6" msgstr "" #. type: TH diff --git a/scripts/live b/scripts/live index d34279d..18881af 100755 --- a/scripts/live +++ b/scripts/live @@ -957,6 +957,8 @@ do_snap_copy () if [ -b "${fromdev}" ] then + log_success_msg "Copying snapshot ${fromdev} to ${todir}..." + # look for free mem if [ -n "${HOMEMOUNTED}" -a "${snap_type}" = "HOME" ] then @@ -994,9 +996,8 @@ do_snap_copy () return 0 else - return 1 - log_warning_msg "Unable to find the snapshot ${snap_type} medium" + return 1 fi } @@ -1026,6 +1027,16 @@ try_snap () snapdata="${1}" snap_mount="${2}" snap_type="${3}" + snap_relpath="${4}" + + if [ -z "${snap_relpath}" ] + then + # root snapshot, default usage + snap_relpath="/" + else + # relative snapshot (actually used just for "/home" snapshots) + snap_mount="${2}${snap_relpath}" + fi if [ -n "${snapdata}" ] && [ ! -b "${snapdata}" ] then @@ -1063,8 +1074,16 @@ try_snap () cpioargs='--unconditional --make-directories' fi - cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null - RES="$?" + if [ -s "${snapback}/${snapfile}" ] + then + BEFOREDIR="$(pwd)" + cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null + RES="$?" + cd "${BEFOREDIR}" + else + log_warning_msg "${snapback}/${snapfile} is empty, adding it for sync on reboot." + RES="0" + fi if [ "${RES}" != "0" ] then @@ -1096,7 +1115,7 @@ try_snap () if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}" then - log_warning_msg "Impossible to include the ${snap_type} Snapshot" + log_warning_msg "Impossible to include the ${snap_type} Snapshot (i)" return 1 else if [ -n "${snapfile}" ] @@ -1106,11 +1125,11 @@ try_snap () fi fi else - log_warning_msg "Impossible to include the ${snap_type} Snapshot" + log_warning_msg "Impossible to include the ${snap_type} Snapshot (o)" return 1 fi - echo "export ${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt + echo "export ${snap_type}SNAP=${snap_relpath}:${snapdev}:${snapfile}" >> snapshot.conf # for resync on reboot/halt return 0 } @@ -1448,7 +1467,7 @@ setup_unionfs () # Look for other snapshots to copy in try_snap "${root_snapdata}" "${rootmnt}" "ROOT" # This second type should be removed when snapshot grow smarter - try_snap "${home_snapdata}" "${rootmnt}/home" "HOME" + try_snap "${home_snapdata}" "${rootmnt}" "HOME" "/home" fi if [ -n "${SHOWMOUNTS}" ] @@ -1857,6 +1876,18 @@ mountroot () # when booting FAI, this simple workaround solves it ls /root/* >/dev/null 2>&1 + # copy snapshot configuration if exists + if [ -f snapshot.conf ] + then + log_begin_msg "Copying snapshot.conf to ${rootmnt}/etc/live/boot.d" + if [ ! -d "${rootmnt}/etc/live/boot.d" ] + then + mkdir -p "${rootmnt}/etc/live/boot.d" + fi + cp snapshot.conf "${rootmnt}/etc/live/boot.d/" + log_end_msg + fi + maybe_break live-bottom log_begin_msg "Running /scripts/live-bottom\n" -- 2.1.4