Adding upstream version 3.0~a6. upstream/3.0_a6
authorDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:11:33 +0000 (17:11 +0100)
committerDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:11:33 +0000 (17:11 +0100)
VERSION
bin/live-snapshot
manpages/de/live-boot.de.7
manpages/de/live-snapshot.de.1
manpages/en/live-boot.7
manpages/en/live-snapshot.1
manpages/po/de/live-boot.7.po
manpages/po/de/live-snapshot.1.po
manpages/pot/live-boot.7.pot
manpages/pot/live-snapshot.1.pot
scripts/live

diff --git a/VERSION b/VERSION
index 97c929b..7855bab 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.0~a5
+3.0~a6
index 08e5fd6..991e704 100755 (executable)
@@ -7,7 +7,7 @@
 #   for reuse in another live-boot session.
 #   Look at the manpage for more informations.
 #
-# Copyright (C) 2006-2008 Marco Amadori <marco.amadori@gmail.com>
+# Copyright (C) 2006-2010 Marco Amadori <marco.amadori@gmail.com>
 # Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
 #
 # 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}"
index f533597..3a9ecc8 100644 (file)
@@ -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
index b067e09..d102fbd 100644 (file)
@@ -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
index f424f25..06915d6 100644 (file)
@@ -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
index d2c82cc..3220f49 100644 (file)
@@ -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
index a305617..fe6797b 100644 (file)
@@ -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 <daniel@debian.org>\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
index c1108be..d4b4764 100644 (file)
@@ -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 <daniel@debian.org>\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
index e6b4c14..b1d7e91 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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
index e8b6d2a..3e8f6e3 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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
index d34279d..18881af 100755 (executable)
@@ -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"