--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package live-boot
The version in wheezy was at alpha stage of development. We have, at
long last, a final release which is the only supportable version for the
lifetime of wheezy.
I have attached a cleaned up diff which lists at the top the specific
cleanups performed to make review easier.
unblock live-boot/3.0.1-1
-- System Information:
Debian Release: 7.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.7-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
This is a diff 3.0~a35-1..3.0.1-1:
* without manpage translation changes
* with filenames adjusted to account for file renames providing a minimal diff
diff -Naurp live-boot.orig/backends/initramfs-tools/live.hook live-boot/backends/initramfs-tools/live.hook
--- live-boot.orig/backends/initramfs-tools/live.hook 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/backends/initramfs-tools/live.hook 2013-02-15 09:38:12.505340670 +0100
@@ -1,55 +1,31 @@
#!/bin/sh
-# initramfs hook for live-boot (Debian Live)
-
set -e
-# initramfs-tools header
-
-PREREQ=""
-
-prereqs()
-{
- echo "${PREREQ}"
-}
-
-case "${1}" in
- prereqs)
- prereqs
- exit 0
- ;;
-esac
-
. /usr/share/initramfs-tools/hook-functions
-[ "${QUIET}" ] || echo -n live-boot:
+[ "${QUIET}" ] || echo -n "live-boot:"
-# live-boot hook
-
-# Reading configuration file from filesystem
-if [ -e /etc/live/boot.conf ]
-then
- . /etc/live/boot.conf
-fi
-
-if ls /etc/live/boot.d/*.conf > /dev/null 2>&1
-then
- for _FILE in /etc/live/boot.d/*.conf
- do
- . ${_FILE}
- done
-fi
-
-# Handling live-boot
+# Reading configuration file from filesystem and live-media
+for _FILE in /etc/live/boot.conf /etc/live/boot/* \
+ /lib/live/mount/media/live/boot.conf /lib/live/mount/media/live/boot/*
+do
+ if [ -e "${_FILE}" ]
+ then
+ . "${_FILE}"
+ fi
+done
+# Checking live-boot
if [ ! -e /lib/live/boot ]
then
+ echo
echo "W: live-boot-initramfs-tools (backend) installed without live-boot,"
echo "W: this initramfs will *NOT* have live support."
exit 0
fi
-[ "${QUIET}" ] || echo -n " "core
+[ "${QUIET}" ] || echo -n " core"
mkdir -p "${DESTDIR}/lib/live"
cp -a /lib/live/boot.sh /lib/live/boot "${DESTDIR}/lib/live"
@@ -63,29 +39,25 @@ do
fi
done
-# udev dependencies (squeeze and newer)
+# udev dependencies
for FILE in /lib/udev/*_id
do
- if [ ! -e "${DESTDIR}/${FILE}" ]
- then
- mkdir -p "${DESTDIR}/lib/udev"
- copy_exec "${FILE}" /lib/udev
- fi
+ copy_exec "${FILE}"
done
+# wheezy/sid
if [ -e /lib/udev/rules.d/60-cdrom_id.rules ]
then
mkdir -p ${DESTDIR}/lib/udev/rules.d
cp -p /lib/udev/rules.d/60-cdrom_id.rules ${DESTDIR}/lib/udev/rules.d
fi
-# Handling other stuff
+[ "${QUIET}" ] || echo -n " filesystems"
-[ "${QUIET}" ] || echo -n " "filesystems
# Configuration: keymap (usefull when using encryption)
if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
then
- copy_exec /bin/loadkeys /bin
+ copy_exec /bin/loadkeys
mkdir -p "${DESTDIR}"/etc
cp /etc/console/boottime.kmap.gz "${DESTDIR}"/etc
@@ -104,7 +76,7 @@ manual_add_modules btrfs
# Filesystem: cifs
if [ -x /sbin/mount.cifs ]
then
- copy_exec /sbin/mount.cifs /sbin
+ copy_exec /sbin/mount.cifs
manual_add_modules cifs
fi
@@ -112,6 +84,10 @@ fi
manual_add_modules ext3
manual_add_modules ext4
+# Filesystem: hfs/hfsplus
+manual_add_modules hfs
+manual_add_modules hfsplus
+
# Filesystem: jffs2
manual_add_modules jffs2
@@ -121,7 +97,7 @@ then
fi
# Filesystem: squashfs
-copy_exec /sbin/losetup /sbin
+copy_exec /sbin/losetup
manual_add_modules loop
manual_add_modules squashfs
manual_add_modules sqlzma
@@ -147,7 +123,7 @@ manual_add_modules vfat
# Filesystem: ntfs
manual_add_modules ntfs
-[ "${QUIET}" ] || echo -n " "devices
+[ "${QUIET}" ] || echo -n " devices"
# Hardware: cdrom
manual_add_modules ide-cd
manual_add_modules ide-generic
@@ -167,16 +143,24 @@ then
copy_exec /usr/bin/eject /bin
fi
-[ "${QUIET}" ] || echo -n " "utils
+# Program: mount
+# fuse does not work with klibc mount
+copy_exec /bin/mount /bin/mount.util-linux
+
+[ "${QUIET}" ] || echo -n " utils"
# Feature: Verify Checksums
-copy_exec /usr/bin/sha256sum /bin
-copy_exec /usr/bin/md5sum /bin
+if [ -e /etc/progress-linux_version ]
+then
+ copy_exec /usr/bin/sha256sum /bin
+else
+ copy_exec /usr/bin/md5sum /bin
+fi
# Program: memdisk
if [ -x /usr/bin/memdiskfind ]
then
-[ "${QUIET}" ] || echo -n :memdisk
+[ "${QUIET}" ] || echo -n " memdisk"
copy_exec /usr/bin/memdiskfind
manual_add_modules phram
manual_add_modules mtdblock
@@ -185,27 +169,27 @@ fi
# Program: udev
if [ -x /sbin/udevadm ]
then
- [ "${QUIET}" ] || echo -n " "udev
- copy_exec /sbin/udevadm /sbin
+ [ "${QUIET}" ] || echo -n " udev"
+ copy_exec /sbin/udevadm
fi
if [ -x /usr/bin/udevinfo ]
then
- [ "${QUIET}" ] || echo -n " "udev
+ [ "${QUIET}" ] || echo -n " udev"
copy_exec /usr/bin/udevinfo /bin
fi
# Program: wget
if [ -x /usr/bin/wget ]
then
- [ "${QUIET}" ] || echo -n " "wget
+ [ "${QUIET}" ] || echo -n " wget"
copy_exec /usr/bin/wget /bin
fi
# Program: blockdev
if [ -x /sbin/blockdev ]
then
- [ "${QUIET}" ] || echo -n " "blockdev
- copy_exec /sbin/blockdev /sbin
+ [ "${QUIET}" ] || echo -n " blockdev"
+ copy_exec /sbin/blockdev
fi
# FUSE kernel module
@@ -214,49 +198,50 @@ manual_add_modules fuse
# FUSE filesystem: httpfs2
if [ -x /usr/bin/httpfs2_ssl ]
then
- [ "${QUIET}" ] || echo -n " "httpfs:ssl
+ [ "${QUIET}" ] || echo -n " httpfs:ssl"
copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
elif [ -x /usr/bin/httpfs2 ]
then
- [ "${QUIET}" ] || echo -n " "httpfs
+ [ "${QUIET}" ] || echo -n " httpfs"
copy_exec /usr/bin/httpfs2 /bin/httpfs
fi
# FUSE filesystem: curlftpfs
if [ -x /usr/bin/curlftpfs ]
then
- [ "${QUIET}" ] || echo -n " "ftpfs
+ [ "${QUIET}" ] || echo -n " ftpfs"
copy_exec /usr/bin/curlftpfs /bin
fi
# iSCSI
if [ -x /usr/sbin/iscsistart ]
then
- [ "${QUIET}" ] || echo -n " "iscsi
+ [ "${QUIET}" ] || echo -n " iscsi"
copy_exec /usr/sbin/iscsistart /bin
#manual_add_modules ib_iser
manual_add_modules iscsi_tcp
manual_add_modules crc32c
fi
-if [ "${LIVE_DNS}" = "true" ]
-then
- [ "${QUIET}" ] || echo -n " "dns
- #copy_exec /lib/libnss_files.so.* /lib # /etc/hosts and /etc/passwd
- copy_exec /lib/libnss_dns.so.* /lib # DNS server
- #copy_exec /lib/libnss_compat.so.* /lib # /etc/passwd
-
- # Configuration file - may be needed if /etc/hosts is used.
- #mkdir -p $DESTDIR/etc
- #cp -p /etc/nsswitch.conf $DESTDIR/etc
-fi
+# Some experimental stuff
-if [ "${LIVE_UNIONMOUNT}" = "true" ]
-then
- [ "${QUIET}" ] || echo -n " "unionmount
- # UnionMount
- # only mount from patched util-linux can do this currently
- copy_exec /bin/mount /bin/mount_full
-fi
+case "${LIVE_DNS}" in
+ true)
+ [ "${QUIET}" ] || echo -n " dns"
+
+ # /lib/libnss_dns.so.*:a DNS
+ # /lib/libnss_files.so.*: /etc/hosts and /etc/passwd
+ # /lib/libnss_compat.so.*: /etc/passwd
+
+ for _SHLIB in $(find /lib -name 'libnss_dns.so.*')
+ do
+ copy_exec "${_SHLIB}"
+ done
+
+ # might be needed if /etc/hosts is used
+ #mkdir -p "${DESTDIR}/etc"
+ #cp -p /etc/nsswitch.conf "${DESTDIR}/etc"
+ ;;
+esac
[ "${QUIET}" ] || echo .
diff -Naurp live-boot.orig/bin/live-new-uuid live-boot/bin/live-new-uuid
--- live-boot.orig/bin/live-new-uuid 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/bin/live-new-uuid 1970-01-01 01:00:00.000000000 +0100
@@ -1,86 +0,0 @@
-#!/bin/sh
-# -*- coding: utf-8 -*-
-#
-# «live-new-uuid» - Creates and injects new UUIDs for live disks
-#
-# Create new UUIDs for disks to prevent conflicts and booting the wrong live
-# directory. Particularly useful in creating recovery disks that need to be
-# able to also work with recovery partitioning schemes.
-#
-# Copyright (C) 2008, Dell Inc.
-#
-# Author:
-# - Mario Limonciello <Mario_Limonciello@Dell.com>
-#
-# This script is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this application; if not, write to the Free Software Foundation, Inc., 51
-# Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-##################################################################################
-
-set -e
-
-help() {
- echo
- echo "USAGE: $0 initrd.{l,g}z <path-to-new-initrd> <path-to-new-live-uuid> "
- echo
- echo "initrd.{l,g}z is the absolute path to the original gzipped or lzmaed initramfs"
- echo "<path-to-new-initrd> is the destination directory for the new compressed initramfs"
- echo "<path-to-new-live-uuid> is the destination directory for the new live-uuid-TYPE "
- echo
- echo "if either path is absent, they will end up in the current directory "
- echo "TYPE is determined by an already existing live-uuid-* or by 'uname -s'"
-}
-
-if [ "$#" = "0" ] || [ "x$1" = x-h ] || [ "x$1" = x--help ]; then
- help
- exit 3
-fi
-
-CWD=`pwd`
-TEMPDIR=`mktemp -d /tmp/uuid-XXXXXX`
-TYPE=`uname -r | cut -d '-' -f 3`
-
-if echo "$1" | grep ".lz$" >/dev/null; then
- COMPRESSOR="lzma"
- SUFFIX=".lz"
-elif echo "$1" | grep ".gz$" >/dev/null; then
- COMPRESSOR="gzip"
- SUFFIX=".gz"
-else
- echo "Unsupported archive type."
- exit 2
-fi
-
-if [ -z "$2" ] || [ ! -d "$2" ] || [ "$2" = "." ]; then
- COMPRESS_DIR="$CWD"
-else
- COMPRESS_DIR="$2"
-fi
-
-if [ -z "$3" ] || [ ! -d "$3" ] || [ "$3" = "." ]; then
- LIVEDIR="$CWD"
-else
- LIVEDIR="$3"
-fi
-
-cd "$TEMPDIR"
-$COMPRESSOR -cd "$1" -S "$SUFFIX" | cpio -id
-uuidgen -r > conf/uuid.conf
-find . | cpio --quiet --dereference -o -H newc | $COMPRESSOR -9c > "$COMPRESS_DIR/initrd$SUFFIX"
-if [ "$(ls "$LIVEDIR/live-uuid"-* >/dev/null 2>&1 | wc -l)" = 1 ]; then
- cp conf/uuid.conf "$LIVEDIR/live-uuid"-*
-else
- cp conf/uuid.conf "$LIVEDIR/live-uuid-$TYPE"
-fi
-cd "$CWD"
-rm -rf "$TEMPDIR"
diff -Naurp live-boot.orig/debian/changelog live-boot/debian/changelog
--- live-boot.orig/debian/changelog 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/changelog 2013-02-15 10:02:24.924680558 +0100
@@ -1,3 +1,280 @@
+live-boot (3.0.1-1) unstable; urgency=low
+
+ [ chals ]
+ * Updating Spanish translation of live-boot man page, persistence-label.
+
+ [ Daniel Baumann ]
+ * Dropping German manpage translations stubs for the release.
+
+ -- Daniel Baumann <daniel@debian.org> Thu, 14 Feb 2013 19:33:17 +0100
+
+live-boot (3.0.0-1) unstable; urgency=low
+
+ [ Daniel Baumann ]
+ * Updating manpage year handling for 2013.
+
+ [ Richard Nelson ]
+ * Replace noprompt with noeject on manpage.
+
+ [ Daniel Baumann ]
+ * Updating noeject description in manpage.
+
+ [ chals ]
+ * Updating Spanish translation in respect to noeject.
+
+ [ Daniel Baumann ]
+ * Dropping dpkg compression level.
+ * Calling df with -P to avoid line wraps with overly long mountpoints.
+
+ [ Tails developers ]
+ * Improving test for /etc/fstab.d support by testing for its existence
+ instead of /run's one.
+
+ [ Daniel Baumann ]
+ * Removing some dead code in netbase parts.
+
+ [ Gaudenz Steinlin ]
+ * Fixing support for multiple squashfs images (Closes: #696494).
+ * Fixing mounting of rootfs, cow and medium filesystems (Closes:
+ #696495).
+
+ [ Daniel Baumann ]
+ * Correcting persistence-label handling fwrt/ legacy live-boot 2.x
+ support, thanks to Mike Gach <gach.mqt@gmail.com> (Closes: #697873).
+
+ -- Daniel Baumann <daniel@debian.org> Tue, 12 Feb 2013 08:23:17 +0100
+
+live-boot (3.0~b11-1) unstable; urgency=low
+
+ * Updating year in copyright file.
+ * Supporting legacy filenames for checksums in debian within verify-
+ checksums.
+ * Correcting legacy filename for checksum files.
+ * By default including sha256sum only in progress-linux, keep md5sum
+ legacy for debian.
+
+ -- Daniel Baumann <daniel@debian.org> Wed, 02 Jan 2013 11:32:21 +0100
+
+live-boot (3.0~b10-1) unstable; urgency=low
+
+ [ Daniel Baumann ]
+ * Adding live-tools to recommends.
+
+ [ Michal Suchanek ]
+ * Including util-linux mount in initramfs.
+
+ [ Daniel Baumann ]
+ * Making overwriting of /bin/mount within initramfs with mount.util-
+ linux dependent on fuse usage, not on some additional boot parameter.
+ * Correcting spelling typo in bug script.
+
+ [ Richard Nelson ]
+ * Update manpage information of ip= param to correctly reflect what
+ 9990-netbase.sh expects.
+
+ [ Daniel Baumann ]
+ * Cleaning up manpage po files.
+
+ [ Evgeni Golov ]
+ * Do not fix mountpoints with live-persistence.conf as home-rw/live-rw.
+
+ -- Daniel Baumann <daniel@debian.org> Mon, 17 Dec 2012 20:22:50 +0100
+
+live-boot (3.0~b9-1) unstable; urgency=low
+
+ [ Tails developers ]
+ * Making the /live to /lib/live move for the persistence code.
+ * Handling already mounted persistence backing media correctly.
+ * Fixing persistence-media option when no devices are attached.
+ * Using 'local' in a safe way.
+
+ -- Daniel Baumann <daniel@debian.org> Mon, 10 Dec 2012 20:01:21 +0100
+
+live-boot (3.0~b8-1) unstable; urgency=low
+
+ * Removing eject from recommends, the script that ejects the live medium
+ is in live-config these days.
+ * Removing file from recommends, no usage of file in live-boot anymore.
+ * Updating package lists in bug script to match current implementations.
+ * Adding dpkg-source local options.
+
+ -- Daniel Baumann <daniel@debian.org> Fri, 30 Nov 2012 14:48:16 +0100
+
+live-boot (3.0~b7-1) unstable; urgency=low
+
+ [ Daniel Baumann ]
+ * Updating file paths for /lib/live/mount. See
+ http://lists.debian.org/debian-live/2012/10/msg00021.html for more
+ information.
+ * Renaming /lib/live/mount/image to /lib/live/mount/medium. See
+ http://lists.debian.org/debian-live/2012/10/msg00023.html for more
+ information.
+ * Updating package descriptions.
+ * Properly wrap package descriptions to 80 characters per line.
+
+ [ Tails developers ]
+ * Adding support for the previous persistence configuration file name,
+ for compatibility with systems that have been deployed with live-
+ persistence.conf already.
+
+ -- Daniel Baumann <daniel@debian.org> Wed, 07 Nov 2012 15:04:32 +0100
+
+live-boot (3.0~b6-1) unstable; urgency=low
+
+ * Including hfs and hfsplus modules in initrd to access filesystems on
+ apple systems.
+ * Stopping to put a tmpfs on /root/lib/live from within initramfs, it
+ over-'layered' most prominently the live systems /lib/live/config,
+ making the runtime configuration impossible and the tmpfs is not
+ used or needed in the first place anyway.
+ * Renaming rofs to more intuitive rootfs.
+ * Removing source-only readme file about boot scripts from the binary
+ package.
+ * Renaming the boot scripts readme file to fixme to make it even more
+ obvious.
+
+ -- Daniel Baumann <daniel@debian.org> Tue, 02 Oct 2012 10:32:44 +0200
+
+live-boot (3.0~b5-1) unstable; urgency=low
+
+ * Updating to standards version 3.9.4.
+ * Removing showmounts option as it's enable always anyway.
+ * Applying slightly modified patch from Reinhard Tartler
+ <siretart@tauware.de> to ensure that a potentially stray tmpfs on
+ /live/overlay gets removed to fix netboot failures (Closes:
+ #685375).
+
+ -- Daniel Baumann <daniel@debian.org> Sun, 30 Sep 2012 10:07:09 +0200
+
+live-boot (3.0~b4-1) unstable; urgency=low
+
+ * Switching to final name for the persistence configuration file
+ 'persistence.conf' in line with boot parameter.
+ * Moving remaining stuff from /live to /lib/live to avoid further
+ namespace pollution.
+
+ -- Daniel Baumann <daniel@debian.org> Thu, 27 Sep 2012 13:23:33 +0200
+
+live-boot (3.0~b3-1) unstable; urgency=low
+
+ [ Daniel Baumann ]
+ * Always move live filesystem mounts to /root within initramfs,
+ regardless if mountpoint already exists or not (Closes: #688782).
+
+ [ Gaudenz Steinlin ]
+ * Removing mountpoint if no persistence layer is found on a device.
+
+ [ Daniel Baumann ]
+ * Exposing rofs and persistence mounts under /live in the live
+ systems, not just initramfs only (Closes: #687099).
+ * Updating code for exposing of overlay mounts under /live too.
+
+ -- Daniel Baumann <daniel@debian.org> Wed, 26 Sep 2012 14:40:32 +0200
+
+live-boot (3.0~b2-1) unstable; urgency=low
+
+ * Recreating /etc/live/boot in postinst.
+ * Removing /etc/live/boot if empty on purge in postrm.
+ * Regenerating initramfs on remove.
+
+ -- Daniel Baumann <daniel@debian.org> Fri, 24 Aug 2012 12:37:23 +0200
+
+live-boot (3.0~b1-1) unstable; urgency=low
+
+ [ chals ]
+ * Fixing build error in 'es' man pages caused by a newline conflict.
+
+ [ Daniel Baumann ]
+ * Removing live-new-uuid, a rewritten one goes to live-tools.
+ * Adding slightly modified patch from Steven Shiau
+ <steven@nchc.org.tw> to transition to /run for network interface
+ definition files which fixes resolv.conf creation for netboot.
+
+ [ Steven Shiau ]
+ * Reading /conf/param.conf after Select_eth_device in main function to
+ fix network booting (Closes: #683240).
+
+ [ Daniel Baumann ]
+ * Moving reading of initramfs-tools functions to initramfs-tools
+ script.
+ * Consistently using case instead of if for conditionals in script
+ boilerplate.
+ * Laying tmpfs on /live/overlay only during initramfs stage, fixes
+ boot failure with plain filesystems (Closes: #681579).
+ * Correcting DNS inclusion in initramfs-tools hook, thanks to Steven
+ Shiau <steven@nchc.org.tw> for reporting.
+ * Simplifying usage of copy_exec function from hooks-function in
+ initramfs-tools hook.
+ * Using /etc/live/boot/*.conf instead of /etc/live/boot.d/*.conf and
+ /live/image/live/boot/*.conf instead of
+ /live/image/live/boot.d/*.conf for consistency reasons.
+ * Reading configuration file from filesystem and live-media at runtime
+ too.
+ * Reading configuration files in initramfs-tools hook too.
+
+ [ Steven Shiau ]
+ * Adding support for nameserver in ip= boot parameter.
+
+ [ Daniel Baumann ]
+ * Making nameserver assignment from ip= bootparameter work with
+ persistence.
+ * Correcting permissions of /tmp which apparently somehow get mixed up
+ along the way.
+ * Updating scripts readme about transition to plugin based
+ architecture.
+
+ -- Daniel Baumann <daniel@debian.org> Thu, 16 Aug 2012 12:21:04 +0200
+
+live-boot (3.0~a38-1) unstable; urgency=low
+
+ [ Daniel Baumann ]
+ * Extending verify-checksums parameters to allow specifying custom
+ list of digests.
+ * Harmonizing GPL boilerplate texts.
+
+ [ Richard Nelson ]
+ * Correct left over references to old initramfs-tools.sh (Closes:
+ #682504).
+
+ -- Daniel Baumann <daniel@debian.org> Fri, 27 Jul 2012 00:20:39 +0200
+
+live-boot (3.0~a37-1) unstable; urgency=low
+
+ [ Daniel Baumann ]
+ * Cleaning up initramfs-tools hook.
+
+ [ Tails developers ]
+ * Fixing persistence backward-compatibility mode (Closes: #681176).
+
+ [ Daniel Baumann ]
+ * Making swap function self contained.
+ * Making read-only function self contained.
+ * Making verify-checksums function self contained.
+ * Factoring out debug into an own function.
+ * Extending read-only parameters to allow specifying custom list of
+ devices.
+ * Avoid re-access /proc/cmdline in select-eth-device function and use
+ internal variable instead.
+
+ -- Daniel Baumann <daniel@debian.org> Wed, 25 Jul 2012 17:18:06 +0200
+
+live-boot (3.0~a36-1) unstable; urgency=low
+
+ * Adding temporary notes in a readme file.
+ * Renaming boot scripts for refactoring them into numbered plugins.
+ * Renaming mountroot function to main to provide a generic live-boot
+ entry point for initramfs generators.
+ * Adding temporary redirection layer for dracut initramfs generator.
+ * Adding redirection layer for initramfs-tools initramfs generator.
+ * Splitting out already reviewed cmdline parsing script.
+ * Splitting out already reviewed read-only script.
+ * Splitting out already reviewed swapon script.
+ * Splitting out already reviewed verify-checksums script.
+ * Adding support for defining one or more explicit swap partitions to
+ be used.
+
+ -- Daniel Baumann <daniel@debian.org> Wed, 18 Jul 2012 23:56:06 +0200
+
live-boot (3.0~a35-1) unstable; urgency=low
* Correcting typo in fstab function call in mountroot, thanks to
diff -Naurp live-boot.orig/debian/control live-boot/debian/control
--- live-boot.orig/debian/control 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/control 2013-02-15 10:02:24.924680558 +0100
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Live Project <debian-live@lists.debian.org>
Uploaders: Daniel Baumann <daniel@debian.org>
Build-Depends: debhelper (>= 9)
-Standards-Version: 3.9.3
+Standards-Version: 3.9.4
Homepage: http://live.debian.net/devel/live-boot/
Vcs-Browser: http://live.debian.net/gitweb/?p=live-boot.git
Vcs-Git: git://live.debian.net/git/live-boot.git
@@ -12,11 +12,11 @@ Vcs-Git: git://live.debian.net/git/live-
Package: live-boot
Architecture: all
Depends: ${misc:Depends}, live-boot-initramfs-tools | live-boot-backend
-Recommends: live-boot-doc, eject, file, rsync, uuid-runtime
+Recommends: live-boot-doc, live-tools, rsync, uuid-runtime
Suggests: curlftpfs, cryptsetup, httpfs2, unionfs-fuse, wget
-Description: Debian Live - System Boot Scripts
- live-boot contains the scripts that configure a Debian Live system during the
- boot process (early userspace).
+Description: Live System Boot Scripts
+ live-boot contains the scripts that configure a live system during the boot
+ process (early userspace).
.
In addition to live-boot, a backend for the initrd generation is required, such
as live-boot-initramfs-tools.
@@ -27,9 +27,9 @@ Architecture: all
Depends: ${misc:Depends}
Conflicts: live-boot (<< 3.0~a18~)
Replaces: live-boot
-Description: Debian Live - System Boot Scripts (documentation)
- live-boot contains the scripts that configure a Debian Live system during the
- boot process (early userspace).
+Description: Live System Boot Scripts (documentation)
+ live-boot contains the scripts that configure a live system during the boot
+ process (early userspace).
.
This package contains the documentation.
@@ -40,8 +40,8 @@ Depends:
Conflicts: live-boot-backend
Replaces: live-boot-backend
Provides: live-boot-backend
-Description: Debian Live - System Boot Scripts (initramfs-tools backend)
- live-boot contains the scripts that configure a Debian Live system during the
- boot process (early userspace).
+Description: Live System Boot Scripts (initramfs-tools backend)
+ live-boot contains the scripts that configure a live system during the boot
+ process (early userspace).
.
This package contains the initramfs-tools backend.
diff -Naurp live-boot.orig/debian/copyright live-boot/debian/copyright
--- live-boot.orig/debian/copyright 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/copyright 2013-02-15 09:38:12.517340211 +0100
@@ -4,11 +4,10 @@ Upstream-Contact: Debian Live Project <d
Source: http://live.debian.net/archive/packages/live-boot/
Files: *
-Copyright: 2006-2012 Daniel Baumann <daniel@debian.org>
+Copyright: 2006-2013 Daniel Baumann <daniel@debian.org>
2005-2008 Canonical Ltd. <http://www.cannonical.com/>
2008 Chris Lamb <chris@debian.org>
2006-2007 Marco Amadori <marco.amadori@gmail.com>
- 2008 Dell Inc. <http://www.dell.com/>
License: GPL-3+
License: GPL-3+
diff -Naurp live-boot.orig/debian/live-boot.bug-presubj live-boot/debian/live-boot.bug-presubj
--- live-boot.orig/debian/live-boot.bug-presubj 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/live-boot.bug-presubj 2013-02-15 09:38:12.517340211 +0100
@@ -1,9 +1,9 @@
Before submitting a bug report against live-boot, please make sure
-that you have read our guidlines for Debian Live bug reports:
+that you have read our guidelines for Debian Live bug reports:
http://live.debian.net/manual/
-By providing the required information as outlined in the guidlines makes
+By providing the required information as outlined in the guidelines makes
sure that we can optimally reproduce and fix bugs, not doing so wastes a
lot of time for both the maintainers and the submitters.
diff -Naurp live-boot.orig/debian/live-boot.bug-script live-boot/debian/live-boot.bug-script
--- live-boot.orig/debian/live-boot.bug-script 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/live-boot.bug-script 2013-02-15 09:38:12.517340211 +0100
@@ -1,15 +1,15 @@
#!/bin/sh
# Checking depends
-dpkg -l busybox file initramfs-tools sudo udev user-setup
+dpkg -l busybox busybox-initramfs initramfs-tools udev
# Checking recommends
-dpkg -l eject uuid-runtime wget
+dpkg -l rsync uuid-runtime
# Checking suggests
-dpkg -l loop-aes-utils curlftpfs genext2fs httpfs2 squashfs-tools mtd-tools
+dpkg -l curlftpfs cryptsetup httpfs2 unionfs-fuse wget
# Checking other packages
-dpkg -l cryptsetup plymouth
+dpkg -l plymouth
exit 0
diff -Naurp live-boot.orig/debian/live-boot-initramfs-tools.postrm live-boot/debian/live-boot-initramfs-tools.postrm
--- live-boot.orig/debian/live-boot-initramfs-tools.postrm 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/debian/live-boot-initramfs-tools.postrm 2013-02-15 09:38:12.517340211 +0100
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+ remove)
+ if [ -x /usr/sbin/update-initramfs ] && [ -e /etc/initramfs-tools/initramfs.conf ]
+ then
+ update-initramfs -u
+ fi
+ ;;
+
+ purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Naurp live-boot.orig/debian/live-boot.install live-boot/debian/live-boot.install
--- live-boot.orig/debian/live-boot.install 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/live-boot.install 2013-02-15 09:38:12.517340211 +0100
@@ -1,2 +1 @@
lib
-sbin
diff -Naurp live-boot.orig/debian/live-boot.postinst live-boot/debian/live-boot.postinst
--- live-boot.orig/debian/live-boot.postinst 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/debian/live-boot.postinst 2013-02-15 09:38:12.517340211 +0100
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+ configure)
+ mkdir -p /etc/live/boot
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Naurp live-boot.orig/debian/live-boot.postrm live-boot/debian/live-boot.postrm
--- live-boot.orig/debian/live-boot.postrm 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/debian/live-boot.postrm 2013-02-15 09:38:12.517340211 +0100
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+ purge)
+ rmdir --ignore-fail-on-non-empty /etc/live/boot > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty /etc/live > /dev/null 2>&1 || true
+ ;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Naurp live-boot.orig/debian/rules live-boot/debian/rules
--- live-boot.orig/debian/rules 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/rules 2013-02-15 09:38:12.517340211 +0100
@@ -8,13 +8,14 @@ override_dh_auto_install:
# Removing useless files
rm -f debian/tmp/usr/share/doc/live-boot/COPYING
+ rm -f debian/lib/live/boot/FIXME
# live-boot-initramfs-tools
mkdir -p debian/live-boot-initramfs-tools/usr/share
mv debian/tmp/usr/share/initramfs-tools debian/live-boot-initramfs-tools/usr/share
override_dh_builddeb:
- dh_builddeb -- -Zxz -z9
+ dh_builddeb -- -Zxz
override_dh_install:
dh_install --fail-missing
diff -Naurp live-boot.orig/debian/source/local-options live-boot/debian/source/local-options
--- live-boot.orig/debian/source/local-options 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/debian/source/local-options 2013-02-15 09:38:12.517340211 +0100
@@ -0,0 +1 @@
+abort-on-upstream-changes
diff -Naurp live-boot.orig/debian/source/options live-boot/debian/source/options
--- live-boot.orig/debian/source/options 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/debian/source/options 2013-02-15 09:38:12.517340211 +0100
@@ -1,2 +1 @@
compression = xz
-compression-level = 9
diff -Naurp live-boot.orig/Makefile live-boot/Makefile
--- live-boot.orig/Makefile 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/Makefile 2013-02-15 09:38:12.505340670 +0100
@@ -4,7 +4,7 @@ SHELL := sh -e
LANGUAGES = $(shell cd manpages/po && ls)
-SCRIPTS = backends/*/* bin/* scripts/*.sh scripts/*/*
+SCRIPTS = backends/*/* bin/* scripts/*.sh scripts/*/*-*
all: build
@@ -46,9 +46,6 @@ install:
cp -r scripts/boot.sh scripts/boot $(DESTDIR)/lib/live
# Installing executables
- mkdir -p $(DESTDIR)/sbin
- cp bin/live-new-uuid bin/live-swapfile $(DESTDIR)/sbin
-
mkdir -p $(DESTDIR)/usr/share/initramfs-tools/hooks
cp backends/initramfs-tools/live.hook $(DESTDIR)/usr/share/initramfs-tools/hooks/live
mkdir -p $(DESTDIR)/usr/share/initramfs-tools/scripts
diff -Naurp live-boot.orig/manpages/bin/update-version.sh live-boot/manpages/bin/update-version.sh
--- live-boot.orig/manpages/bin/update-version.sh 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/manpages/bin/update-version.sh 2013-02-15 09:38:12.505340670 +0100
@@ -1,9 +1,9 @@
#!/bin/sh
## live-boot(7) - System Boot Scripts
-## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
+## Copyright (C) 2006-2013 Daniel Baumann <daniel@debian.org>
##
-## live-boot comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
@@ -35,7 +35,9 @@ do
then
for _FILE in po/${_LANGUAGE}/*.po
do
- sed -i -e "s|^msgstr .*.2012\"$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" "${_FILE}"
+ sed -i -e "s|^msgstr .*.2013-.*$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
+ -e "s|^msgstr .*.2013\"$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
+ "${_FILE}"
done
fi
done
@@ -45,6 +47,8 @@ if ls po/pt_BR/*.po > /dev/null 2>&1
then
for _FILE in po/pt_BR/*.po
do
- sed -i -e "s|^msgstr .*-2012\"$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" "${_FILE}"
+ sed -i -e "s|^msgstr .*.2013-.*$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
+ -e "s|^msgstr .*-2013\"$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
+ "${_FILE}"
done
fi
diff -Naurp live-boot.orig/manpages/en/live-boot.7 live-boot/manpages/en/live-boot.7
--- live-boot.orig/manpages/en/live-boot.7 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/manpages/en/live-boot.7 2013-02-15 10:02:24.924680558 +0100
@@ -1,4 +1,4 @@
-.TH LIVE\-BOOT 7 2012\-06\-28 3.0~a35-1 "Debian Live Project"
+.TH LIVE\-BOOT 7 2013\-02\-14 3.0.1-1 "Debian Live Project"
.SH NAME
\fBlive\-boot\fR \- System Boot Scripts
@@ -23,7 +23,7 @@ To configure the live\-boot parameters u
In addition, there are some more boot parameters to influence the behaviour, see below.
.SS Configuration Files
-\fBlive\-boot\fR can be configured (but not activated) through configuration files. Those files can be placed either in the root filesystem itself (/etc/live/boot.conf, /etc/live/boot.d/*.conf), or on the live media (live/boot.conf, live/boot.d/*.conf).
+\fBlive\-boot\fR can be configured (but not activated) through configuration files. Those files can be placed either in the root filesystem itself (/etc/live/boot.conf, /etc/live/boot/*), or on the live media (live/boot.conf, live/boot/*).
.SH OPTIONS
\fBlive\-boot\fR currently features the following parameters.
@@ -74,7 +74,7 @@ Allows to use a filesystem from within a
Do not check that any UUID embedded in the initramfs matches the discovered medium. live\-boot may be told to generate a UUID by setting LIVE_GENERATE_UUID=1 when building the initramfs.
.IP "\fBverify\-checksums\fR" 4
If specified, an MD5 sum is calculated on the live media during boot and compared to the value found in md5sum.txt found in the root directory of the live media.
-.IP "\fBip\fR=[\fIDEVICE\fR]:[\fICLIENT_IP\fR]:[\fISERVER_IP\fR]:[\fIGATEWAY_IP\fR]:[\fINETMASK\fR]:[\fIHOSTNAME\fR]:[\fIAUTOCONF\fR] [,[\fIDEVICE\fR]:[\fICLIENT_IP\fR]:[\fISERVER_IP\fR]:[\fIGATEWAY_IP\fR]:[\fINETMASK\fR]:[\fIHOSTNAME\fR]:[\fIAUTOCONF\fR]]" 4
+.IP "\fBip\fR=[\fIDEVICE\fR]:[\fICLIENT_IP\fR]:[\fINETMASK\fR]:[\fIGATEWAY_IP\fR]:[\fINAMESERVER\fR] [,[\fIDEVICE\fR]:[\fICLIENT_IP\fR]:[\fINETMASK\fR]:[\fIGATEWAY_IP\fR]:[\fINAMESERVER\fR]]" 4
Let you specify the name(s) and the options of the interface(s) that should be configured at boot time. Do not specify this if you want to use dhcp (default). It will be changed in a future release to mimick official kernel boot param specification (e.g. ip=10.0.0.1::10.0.0.254:255.255.255.0::eth0,:::::eth1:dhcp).
.IP "\fBip\fR=[\fIfrommedia\fR]" 4
If this variable is set, dhcp and static configuration are just skipped and the system will use the (must be) media\-preconfigured /etc/network/interfaces instead.
@@ -100,16 +100,14 @@ This lets you specify custom nfs options
This parameter disables the default disabling of filesystem checks in /etc/fstab. If you have static filesystems on your harddisk and you want them to be checked at boot time, use this parameter, otherwise they are skipped.
.IP "\fBnopersistence\fR" 4
disables the "persistence" feature, useful if the bootloader (like syslinux) has been installed with persistence enabled.
-.IP "\fBnoprompt\fR" 4
-Do not prompt to eject the CD or remove the USB flash drive on reboot.
-.IP "\fBnoprompt\fR=\fITYPE\fR" 4
-This tells live-boot not to prompt to eject the CD (when noprompt=cd) or remove the USB flash drive (when noprompt=usb) on reboot.
+.IP "\fBnoeject\fR" 4
+Do not prompt to eject the live medium.
.IP "\fBramdisk\-size\fR" 4
This parameters allows to set a custom ramdisk size (it's the '\-o size' option of tmpfs mount). By default, there is no ramdisk size set, so the default of mount applies (currently 50% of available RAM). Note that this option has no currently no effect when booting with toram.
.IP "\fBswapon\fR" 4
This parameter enables usage of local swap partitions.
.IP "\fBpersistence\fR" 4
-live\-boot will probe devices for persistence media. These can be partitions (with the correct GPT name), filesystems (with the correct label) or image files (with the correct file name). Overlays are labeled/named "persistence" (see \fIlive-persistence.conf\fR(5)). Overlay image files have extensions which determines their filesystem, e.g. "persistence.ext4".
+live\-boot will probe devices for persistence media. These can be partitions (with the correct GPT name), filesystems (with the correct label) or image files (with the correct file name). Overlays are labeled/named "persistence" (see \fIpersistence.conf\fR(5)). Overlay image files have extensions which determines their filesystem, e.g. "persistence.ext4".
.IP "\fBpersistence\-encryption\fR=\fITYPE1\fR,\fITYPE2\fR ... \fITYPEn\fR" 4
This option determines which types of encryption that we allow to be used when probing devices for persistence media. If "none" is in the list, we allow unencrypted media; if "luks" is in the list, we allow LUKS\-encrypted media. Whenever a device containing encrypted media is probed the user will be prompted for the passphrase. The default value is "none".
.IP "\fBpersistence\-media\fR={\fIremovable\fR|\fIremovable\-usb\fR}" 4
@@ -122,12 +120,12 @@ live\-boot will look for persistency fil
Filesystem changes are not saved back to persistence media. In particular, overlays and netboot NFS mounts are mounted read-only.
.IP "\fBpersistence\-storage\fR=\fITYPE1\fR,\fITYPE2\fR ... \fITYPEn\fR" 4
This option determines which types of persistence storage to consider when probing for persistence media. If "filesystem" is in the list, filesystems with matching labels will be used; if "file" is in the list, all filesystems will be probed for archives and image files with matching filenames. The default is "file,filesystem".
-.IP "\fBpersistence\-subtext\fR=\fISUFFIX\fR" 4
-Add a suffix when searching for the image filenames or partition labels to use for the above mentioned persistence feature, the SUFFIX will be added after a dash (e.g.: "live-sn" would transform to "live-sn-SUFFIX"). This is handy to test multiple live-boot based live-systems with different persistence storage choices.
+.IP "\fBpersistence\-label\fR=\fILABEL\fR" 4
+live-boot will use the name "LABEL" instead of "persistence" when searching for persistent storage. LABEL can be any valid filename, partition label, or GPT name. This option replaces the less flexible persistent\-subtext option from version 2 of live-boot. If you wish to continue using legacy names for persistent storage, use the full name with this option, e.g. persistence\-label=live-rw-foo
.IP "\fBquickreboot\fR" 4
This option causes live\-boot to reboot without attempting to eject the media and without asking the user to remove the boot media.
.IP "\fBshowmounts\fR" 4
-This parameter will make live\-boot to show on "/" the ro filesystems (mostly compressed) on "/live". This is not enabled by default because could lead to problems by applications like "mono" which store binary paths on installation.
+This parameter will make live\-boot to show on "/" the ro filesystems (mostly compressed) on "/lib/live". This is not enabled by default because could lead to problems by applications like "mono" which store binary paths on installation.
.IP "\fBsilent\fR" 4
If you boot with the normal quiet parameter, live\-boot hides most messages of its own. When adding silent, it hides all.
.IP "\fBtodisk\fR=\fIDEVICE\fR" 4
@@ -148,13 +146,13 @@ This optional file (inside the live medi
.SH FILES
.IP "\fB/etc/live/boot.conf\fR" 4
-.IP "\fB/etc/live/boot.d/*.conf\fR" 4
+.IP "\fB/etc/live/boot/*\fR" 4
.IP "\fBlive/boot.conf\fR" 4
-.IP "\fBlive/boot.d/*.conf\fR" 4
-.IP "\fBlive-persistence.conf\fR" 4
+.IP "\fBlive/boot/*\fR" 4
+.IP "\fBpersistence.conf\fR" 4
.SH SEE ALSO
-\fIlive-persistence.conf\fR(5)
+\fIpersistence.conf\fR(5)
.PP
\fIlive\-build\fR(7)
.PP
diff -Naurp live-boot.orig/manpages/en/live-persistence.conf.5 live-boot/manpages/en/live-persistence.conf.5
--- live-boot.orig/manpages/en/live-persistence.conf.5 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/manpages/en/live-persistence.conf.5 2013-02-15 10:02:24.924680558 +0100
@@ -1,17 +1,17 @@
-.TH LIVE\-BOOT conf 2012\-06\-28 3.0~a35-1 "Debian Live Project"
+.TH LIVE\-BOOT conf 2013\-02\-14 3.0.1-1 "Debian Live Project"
.SH NAME
-\fBlive-persistence.conf\fR \- Configuration file for persistence media in
+\fBpersistence.conf\fR \- Configuration file for persistence media in
live\-boot
.SH DESCRIPTION
If live-boot probes a persistence volume with the label (or GPT name,
or file name, but from now on we will just say "label") "persistence",
that volume's persistence is fully customizable through the
-\fBlive-persistence.conf\fR file stored on the root of its file system. Any such
+\fBpersistence.conf\fR file stored on the root of its file system. Any such
labeled volume must have such a file, or it will be ignored.
.PP
-The format of \fBlive-persistence.conf\fR allows empty lines and lines starting
+The format of \fBpersistence.conf\fR allows empty lines and lines starting
with a "#" (used for comments), both which will be ignored. A so
called "custom mount" has the format:
.PP
@@ -37,7 +37,7 @@ All custom mounts will be done in an ord
mounts can "hide" each other. For instance, if we have the two
\fIDIR\fR:s /a and /a/b it would always be the case that /a is mounted
first, then /a/b. This remains true no matter how the lines in
-\fBlive-persistence.conf\fR are ordered, or if several \fBlive-persistence.conf\fR files
+\fBpersistence.conf\fR are ordered, or if several \fBpersistence.conf\fR files
on different persistence media are used at the same time. However, it
is forbidden for custom mounts to have their source directory inside
the source directory of another custom mount, so the source
@@ -55,7 +55,7 @@ bootstrapping will not happen when the \
options are used (see below).
.SH OPTIONS
-Custom mounts defined in \fBlive-persistence.conf\fR accept the following
+Custom mounts defined in \fBpersistence.conf\fR accept the following
options in a coma-separated list:
.IP "\fBsource\fR=\fIPATH\fR" 4
When given, store the persistence changes into \fIPATH\fR on the
@@ -102,7 +102,7 @@ live-boot's \fBunion\fR boot parameter,
.SH DIRECTORIES
.IP "\fB/live/persistence\fR" 4
All persistence volumes will be mounted here (in a directory
-corresponding to the device name). The \fBlive-persistence.conf\fR file can
+corresponding to the device name). The \fBpersistence.conf\fR file can
easily be edited through this mount, as well as any source directories
(which is especially practical for custom mounts using the
\fBlink\fR option).
@@ -110,7 +110,7 @@ easily be edited through this mount, as
.SH EXAMPLES
Let's say we have a persistence volume \fIVOL\fR with the a
-\fBlive-persistence.conf\fR file containing the following four lines (numbered
+\fBpersistence.conf\fR file containing the following four lines (numbered
for ease of reference):
.TP 7
1.
@@ -174,7 +174,7 @@ Link:
(from c)
.PP
One could argue, though, that lines 1 and 2 in the example
-\fBlive-persistence.conf\fR file above are unnecessary since line 3 already
+\fBpersistence.conf\fR file above are unnecessary since line 3 already
would make all of /home persistent. The \fBlink\fR option is
intended for situations where you don't want a complete directory to
be persistent, only certain files in it or its sub-directories.
@@ -209,5 +209,5 @@ package in the Debian Bug Tracking Syste
Live mailing list at <\fIdebian-live@lists.debian.org\fR>.
.SH AUTHOR
-live\-persistence.conf was written by anonym <\fIanonym@lavabit.com\fR> for the
+persistence.conf was written by anonym <\fIanonym@lavabit.com\fR> for the
Debian project.
diff -Naurp live-boot.orig/manpages/po4a.cfg live-boot/manpages/po4a.cfg
--- live-boot.orig/manpages/po4a.cfg 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/manpages/po4a.cfg 2013-02-15 10:02:24.928680402 +0100
@@ -1,4 +1,4 @@
-[po4a_langs] de es
+[po4a_langs] es
[po4a_paths] pot/$master.pot $lang:po/$lang/$master.po
[type: man] en/live-boot.7 $lang:$lang/live-boot.$lang.7
-[type: man] en/live-persistence.conf.5 $lang:$lang/live-persistence.conf.$lang.5
+[type: man] en/persistence.conf.5 $lang:$lang/persistence.conf.$lang.5
diff -Naurp live-boot.orig/scripts/boot/0010-dracut live-boot/scripts/boot/0010-dracut
--- live-boot.orig/scripts/boot/0010-dracut 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/scripts/boot/0010-dracut 2013-02-15 09:38:12.505340670 +0100
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+#set -e
+
+DRACUT_FIXME ()
+{
+ # dracut entry point for live-boot is FIXME(); function
+ Main
+}
diff -Naurp live-boot.orig/scripts/boot/0020-initramfs-tools live-boot/scripts/boot/0020-initramfs-tools
--- live-boot.orig/scripts/boot/0020-initramfs-tools 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/scripts/boot/0020-initramfs-tools 2013-02-15 09:38:12.505340670 +0100
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+#set -e
+
+if [ -e /scripts/functions ]
+then
+ . /scripts/functions
+fi
+
+mountroot ()
+{
+ # initramfs-tools entry point for live-boot is mountroot(); function
+ Main
+}
diff -Naurp live-boot.orig/scripts/boot/0110-debug live-boot/scripts/boot/0110-debug
--- live-boot.orig/scripts/boot/0110-debug 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/scripts/boot/0110-debug 2013-02-15 09:38:12.505340670 +0100
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+#set -e
+
+Debug ()
+{
+ for _PARAMETER in ${_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ live-boot.debug|debug)
+ LIVE_DEBUG="true"
+ ;;
+ esac
+ done
+
+ case "${LIVE_DEBUG}" in
+ true)
+ ;;
+
+ *)
+ return 0
+ ;;
+ esac
+
+ # Write the trace output
+ set -x
+}
diff -Naurp live-boot.orig/scripts/boot/0120-read-only live-boot/scripts/boot/0120-read-only
--- live-boot.orig/scripts/boot/0120-read-only 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/0120-read-only 2013-02-15 09:38:12.505340670 +0100
@@ -4,18 +4,41 @@
Read_only ()
{
+ for _PARAMETER in ${_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ live-boot.read-only=*|read-only=*)
+ LIVE_READ_ONLY="true"
+ LIVE_READ_ONLY_DEVICES="${_PARAMETER#*read-only=}"
+ ;;
+
+ live-boot.read-only|read-only)
+ LIVE_READ_ONLY="true"
+ ;;
+ esac
+ done
+
+ case "${LIVE_READ_ONLY}" in
+ true)
+ ;;
+
+ *)
+ return 0
+ ;;
+ esac
+
# Marking some block devices as read-only to ensure that nothing
# gets written as linux still writes to 'only' read-only mounted filesystems.
- _DEVICES="/dev/sd* /dev/vd*"
+ LIVE_READ_ONLY_DEVICES="${LIVE_READ_ONLY_DEVICES:-/dev/sd* /dev/vd*}"
- for _DEVICE in ${_DEVICES}
+ for _DEVICE in $(echo ${LIVE_READ_ONLY_DEVICES} | sed -e 's|,| |g')
do
if [ ! -b "${_DEVICE}" ]
then
continue
fi
- echo -n "Setting ${_DEVICE} read-only..." > /dev/console
+ echo -n "live-boot: Setting ${_DEVICE} read-only..." > /dev/console
blockdev --setro ${_DEVICE}
_RETURN="${?}"
diff -Naurp live-boot.orig/scripts/boot/3010-verify-checksums live-boot/scripts/boot/3010-verify-checksums
--- live-boot.orig/scripts/boot/3010-verify-checksums 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/3010-verify-checksums 2013-02-15 09:38:12.505340670 +0100
@@ -4,37 +4,63 @@
Verify_checksums ()
{
+ for _PARAMETER in ${_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ live-boot.verify-checksums=*|verify-checksums=*)
+ LIVE_VERIFY_CHECKSUMS="true"
+ LIVE_VERIFY_CHECKSUMS_DIGESTS="${_PARAMETER#*verify-checksums=}"
+ ;;
+
+ live-boot.verify-checksums|verify-checksums)
+ LIVE_VERIFY_CHECKSUMS="true"
+ ;;
+ esac
+ done
+
+ case "${LIVE_VERIFY_CHECKSUMS}" in
+ true)
+ ;;
+
+ *)
+ return 0
+ ;;
+ esac
+
_MOUNTPOINT="${1}"
- _DIGESTS="sha512 sha384 sha256 sha224 sha1 md5"
+ LIVE_VERIFY_CHECKSUMS_DIGESTS="${LIVE_VERIFY_CHECKSUMS_DIGESTS:-sha512 sha384 sha256 sha224 sha1 md5}"
_TTY="/dev/tty8"
log_begin_msg "Verifying checksums"
cd "${_MOUNTPOINT}"
- for _DIGEST in ${_DIGESTS}
+ for _DIGEST in $(echo ${LIVE_VERIFY_CHECKSUMS_DIGESTS} | sed -e 's|,| |g')
do
- _CHECKSUMS="$(echo ${_DIGEST} | tr [a-z] [A-Z])SUMS"
-
- if [ -e "${_CHECKSUMS}" ]
- then
- echo "Found ${_CHECKSUMS}..." > "${_TTY}"
+ _CHECKSUMS="$(echo ${_DIGEST} | tr [a-z] [A-Z])SUMS ${_DIGEST}sum.txt"
- if [ -e "/bin/${_DIGEST}sum" ]
+ for _CHECKSUM in ${_CHECKSUMS}
+ do
+ if [ -e "${_CHECKSUM}" ]
then
- echo "Checking ${_CHECKSUMS}..." > "${_TTY}"
+ echo "Found ${_CHECKSUM}..." > "${_TTY}"
- # Verify checksums
- /bin/${_DIGEST}sum -c "${_CHECKSUMS}" < "${_TTY}" > "${_TTY}"
- _RETURN="${?}"
-
- # Stop after first verification
- break
- else
- echo "Not found /bin/${_DIGEST}sum..." > "${_TTY}"
+ if [ -e "/bin/${_DIGEST}sum" ]
+ then
+ echo "Checking ${_CHECKSUM}..." > "${_TTY}"
+
+ # Verify checksums
+ /bin/${_DIGEST}sum -c "${_CHECKSUM}" < "${_TTY}" > "${_TTY}"
+ _RETURN="${?}"
+
+ # Stop after first verification
+ break
+ else
+ echo "Not found /bin/${_DIGEST}sum..." > "${_TTY}"
+ fi
fi
- fi
+ done
done
log_end_msg
diff -Naurp live-boot.orig/scripts/boot/3020-swapon live-boot/scripts/boot/3020-swapon
--- live-boot.orig/scripts/boot/3020-swapon 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/3020-swapon 2013-02-15 10:02:24.928680402 +0100
@@ -2,11 +2,34 @@
#set -e
-Swapon ()
+Swap ()
{
- _DEVICES="/dev/sd* /dev/vd*"
+ for _PARAMETER in ${_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ live-boot.swap=*|swap=*)
+ LIVE_SWAP="true"
+ LIVE_SWAP_DEVICES="${_PARAMETER#*swap=}"
+ ;;
+
+ live-boot.swap|swap)
+ LIVE_SWAP="true"
+ ;;
+ esac
+ done
+
+ case "${LIVE_SWAP}" in
+ true)
+ ;;
+
+ *)
+ return 0
+ ;;
+ esac
+
+ LIVE_SWAP_DEVICES="${LIVE_SWAP_DEVICES:-/dev/sd* /dev/vd*}"
- if [ -e /run ]
+ if [ -e /root/etc/fstab.d ]
then
# wheezy
_FSTAB="/root/etc/fstab.d/swap"
@@ -15,7 +38,7 @@ Swapon ()
_FSTAB="/root/etc/fstab"
fi
- for _DEVICE in ${_DEVICES}
+ for _DEVICE in $(echo ${LIVE_SWAP_DEVICES} | sed -e 's|,| |g')
do
if [ ! -b "${_DEVICE}" ]
then
@@ -41,7 +64,7 @@ Swapon ()
fi
# Add new swap entries
- for _DEVICE in _SWAP_DEVICES
+ for _DEVICE in ${_SWAP_DEVICES}
do
echo "${_DEVICE} swap swap defaults 0 0" >> "${_FSTAB}"
done
diff -Naurp live-boot.orig/scripts/boot/9990-aaa-fixme.sh live-boot/scripts/boot/9990-aaa-fixme.sh
--- live-boot.orig/scripts/boot/9990-aaa-fixme.sh 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/scripts/boot/9990-aaa-fixme.sh 2013-02-15 10:02:24.928680402 +0100
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+export PATH="/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
+
+echo "/root/lib" >> /etc/ld.so.conf
+echo "/root/usr/lib" >> /etc/ld.so.conf
+
+mountpoint="/live/medium"
+alt_mountpoint="/media"
+LIVE_MEDIA_PATH="live"
+
+HOSTNAME="host"
+
+mkdir -p "${mountpoint}"
+tried="/tmp/tried"
+
+# Create /etc/mtab for debug purpose and future syncs
+if [ ! -d /etc ]
+then
+ mkdir /etc/
+fi
+
+if [ ! -f /etc/mtab ]
+then
+ touch /etc/mtab
+fi
+
+if [ ! -x "/bin/fstype" ]
+then
+ # klibc not in path -> not in initramfs
+ export PATH="${PATH}:/usr/lib/klibc/bin"
+fi
+
+# handle upgrade path from old udev (using udevinfo) to
+# recent versions of udev (using udevadm info)
+if [ -x /sbin/udevadm ]
+then
+ udevinfo='/sbin/udevadm info'
+else
+ udevinfo='udevinfo'
+fi
+
+old_root_overlay_label="live-rw"
+old_home_overlay_label="home-rw"
+custom_overlay_label="persistence"
+persistence_list="persistence.conf"
+old_persistence_list="live-persistence.conf"
+
+if [ ! -f /live.vars ]
+then
+ touch /live.vars
+fi
diff -Naurp live-boot.orig/scripts/boot/9990-cmdline-old live-boot/scripts/boot/9990-cmdline-old
--- live-boot.orig/scripts/boot/9990-cmdline-old 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-cmdline-old 2013-02-15 09:38:12.505340670 +0100
@@ -2,30 +2,11 @@
#set -e
-Cmdline ()
+Cmdline_old ()
{
for _PARAMETER in ${_CMDLINE}
do
case "${_PARAMETER}" in
- live-boot.read-only|read-only)
- LIVE_READ_ONLY="true"
- ;;
-
- live-boot.swapon)
- LIVE_SWAPON="true"
- ;;
-
- live-boot.verify-checksums|verify-checksums)
- LIVE_VERIFY_CHECKSUMS="true"
- ;;
-
- # Special options
- live-boot.debug|debug)
- LIVE_DEBUG="true"
- ;;
-
-
- # parameters below need review (FIXME)
skipconfig)
NOFSTAB="true"
NONETWORKING="true"
@@ -207,8 +188,6 @@ Cmdline ()
;;
persistence-label=*)
- old_root_overlay_label="${_PARAMETER#persistence-label=*}"
- old_home_overlay_label="${_PARAMETER#persistence-label=*}"
custom_overlay_label="${_PARAMETER#persistence-label=*}"
;;
@@ -222,11 +201,6 @@ Cmdline ()
export QUICKUSBMODULES
;;
- showmounts)
- SHOWMOUNTS="true"
- export SHOWMOUNTS
- ;;
-
todisk=*)
TODISK="${_PARAMETER#todisk=}"
export TODISK
diff -Naurp live-boot.orig/scripts/boot/9990-fstab.sh live-boot/scripts/boot/9990-fstab.sh
--- live-boot.orig/scripts/boot/9990-fstab.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-fstab.sh 2013-02-15 10:02:24.928680402 +0100
@@ -6,14 +6,14 @@ Fstab ()
{
# FIXME: stop hardcoding overloading of initramfs-tools functions
. /scripts/functions
- . /lib/live/boot/initramfs-tools.sh
+ . /lib/live/boot/9990-initramfs-tools.sh
if [ -n "${NOFSTAB}" ]
then
return
fi
- if [ -e /run ]
+ if [ -e /root/etc/fstab.d ]
then
# wheezy
_FSTAB="/root/etc/fstab.d/live"
diff -Naurp live-boot.orig/scripts/boot/9990-main.sh live-boot/scripts/boot/9990-main.sh
--- live-boot.orig/scripts/boot/9990-main.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-main.sh 2013-02-15 09:38:12.505340670 +0100
@@ -2,7 +2,7 @@
# set -e
-mountroot ()
+Main ()
{
if [ -x /scripts/local-top/cryptroot ]
then
@@ -19,22 +19,25 @@ mountroot ()
. /live.vars
_CMDLINE="$(cat /proc/cmdline)"
- Cmdline
+ Cmdline_old
- case "${LIVE_DEBUG}" in
- true)
- set -x
- ;;
- esac
+ Debug
- case "${LIVE_READ_ONLY}" in
- true)
- Read_only
- ;;
- esac
+ Read_only
Select_eth_device
+ if [ -e /conf/param.conf ]
+ then
+ . /conf/param.conf
+ fi
+
+ if [ -n "${FUSE_MOUNT}" ]
+ then
+ # fuse does not work with klibc mount
+ ln -f /bin/mount.util-linux /bin/mount
+ fi
+
# Needed here too because some things (*cough* udev *cough*)
# changes the timeout
@@ -91,11 +94,7 @@ mountroot ()
panic "Unable to find a medium containing a live file system"
fi
- case "${LIVE_VERIFY_CHECKSUMS}" in
- true)
- Verify_checksums "${livefs_root}"
- ;;
- esac
+ Verify_checksums "${livefs_root}"
if [ "${TORAM}" ]
then
@@ -136,10 +135,23 @@ mountroot ()
mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}"
fi
+ # At this point /root should contain the final root filesystem.
+ # Move all mountpoints below /live into /root/lib/live/mount.
+ # This has to be done after mounting the root filesystem to /
+ # otherwise these mount points won't be accessible from the running system.
+ for _MOUNT in $(cat /proc/mounts | cut -f 2 -d " " | grep -e "^/live/")
+ do
+ local newmount
+ newmount="${rootmnt}/lib/live/mount/${_MOUNT#/live/}"
+ mkdir -p "${newmount}"
+ mount -o move "${_MOUNT}" "${newmount}" > /dev/null 2>&1 || \
+ mount -o bind "${_MOUNT}" "${newmount}" > /dev/null || \
+ log_warning_msg "W: failed to move or bindmount ${_MOUNT} to ${newmount}"
+ done
if [ -n "${ROOT_PID}" ]
then
- echo "${ROOT_PID}" > "${rootmnt}"/live/root.pid
+ echo "${ROOT_PID}" > "${rootmnt}"/lib/live/root.pid
fi
log_end_msg
@@ -152,12 +164,6 @@ mountroot ()
;;
esac
- # Move to the new root filesystem so that programs there can get at it.
- if [ ! -d /root/live/image ]
- then
- mkdir -p /root/live/image
- mount --move /live/image /root/live/image
- fi
# aufs2 in kernel versions around 2.6.33 has a regression:
# directories can't be accessed when read for the first the time,
@@ -165,13 +171,6 @@ mountroot ()
# when booting FAI, this simple workaround solves it
ls /root/* >/dev/null 2>&1
- # Move findiso directory to the new root filesystem so that programs there can get at it.
- if [ -d /live/findiso ] && [ ! -d /root/live/findiso ]
- then
- mkdir -p /root/live/findiso
- mount -n --move /live/findiso /root/live/findiso
- fi
-
# if we do not unmount the ISO we can't run "fsck /dev/ice" later on
# because the mountpoint is left behind in /proc/mounts, so let's get
# rid of it when running from RAM
@@ -179,10 +178,10 @@ mountroot ()
then
losetup -d /dev/loop0
- if is_mountpoint /root/live/findiso
+ if is_mountpoint /root/lib/live/mount/findiso
then
- umount /root/live/findiso
- rmdir --ignore-fail-on-non-empty /root/live/findiso \
+ umount /root/lib/live/mount/findiso
+ rmdir --ignore-fail-on-non-empty /root/lib/live/mount/findiso \
>/dev/null 2>&1 || true
fi
fi
@@ -202,11 +201,7 @@ mountroot ()
Fstab
Netbase
- case "${LIVE_SWAPON}" in
- true)
- Swapon
- ;;
- esac
+ Swap
case "${UNIONFS}" in
unionfs-fuse)
diff -Naurp live-boot.orig/scripts/boot/9990-misc-helpers.sh live-boot/scripts/boot/9990-misc-helpers.sh
--- live-boot.orig/scripts/boot/9990-misc-helpers.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-misc-helpers.sh 2013-02-15 10:02:24.928680402 +0100
@@ -65,7 +65,8 @@ get_backing_device ()
match_files_in_dir ()
{
# Does any files match pattern ${1} ?
- local pattern="${1}"
+ local pattern
+ pattern="${1}"
if [ "$(echo ${pattern})" != "${pattern}" ]
then
@@ -378,24 +379,27 @@ really_export ()
is_in_list_separator_helper ()
{
- local sep=${1}
+ local sep element list
+ sep=${1}
shift
- local element=${1}
+ element=${1}
shift
- local list=${*}
+ list=${*}
echo ${list} | grep -qe "^\(.*${sep}\)\?${element}\(${sep}.*\)\?$"
}
is_in_space_sep_list ()
{
- local element=${1}
+ local element
+ element=${1}
shift
is_in_list_separator_helper "[[:space:]]" "${element}" "${*}"
}
is_in_comma_sep_list ()
{
- local element=${1}
+ local element
+ element=${1}
shift
is_in_list_separator_helper "," "${element}" "${*}"
}
@@ -512,25 +516,28 @@ trim_path ()
what_is_mounted_on ()
{
- local dir="$(trim_path ${1})"
+ local dir
+ dir="$(trim_path ${1})"
grep -m1 "^[^ ]\+ ${dir} " /proc/mounts | cut -d' ' -f1
}
chown_ref ()
{
- local reference="${1}"
+ local reference targets owner
+ reference="${1}"
shift
- local targets=${@}
- local owner=$(stat -c %u:%g "${reference}")
+ targets=${@}
+ owner=$(stat -c %u:%g "${reference}")
chown -h ${owner} ${targets}
}
chmod_ref ()
{
- local reference="${1}"
+ local reference targets rights
+ reference="${1}"
shift
- local targets=${@}
- local rights=$(stat -c %a "${reference}")
+ targets=${@}
+ rights=$(stat -c %a "${reference}")
chmod ${rights} ${targets}
}
@@ -593,7 +600,7 @@ fs_size ()
size=$(expr ${size} + ${size} / 20 ) # FIXME: 5% more to be sure
else
# free space
- size="$(df -k | grep -s ${mountp} | awk '{print $4}')"
+ size="$(df -kP | grep -s ${mountp} | awk '{print $4}')"
fi
if [ -n "${doumount}" ]
@@ -616,12 +623,13 @@ load_keymap ()
setup_loop ()
{
- local fspath=${1}
- local module=${2}
- local pattern=${3}
- local offset=${4}
- local encryption=${5}
- local readonly=${6}
+ local fspath module pattern offset encryption readonly
+ fspath=${1}
+ module=${2}
+ pattern=${3}
+ offset=${4}
+ encryption=${5}
+ readonly=${6}
# the output of setup_loop is evaluated in other functions,
# modprobe leaks kernel options like "libata.dma=0"
@@ -723,19 +731,25 @@ try_mount ()
fi
}
+# Try to mount $device to the place expected by live-boot. If $device
+# is already mounted somewhere, move it to the expected place. If
+# we're only probing $device (to check if it has custom persistence)
+# $probe should be set, which suppresses warnings upon failure. On
+# success, print the mount point for $device.
mount_persistence_media ()
{
- local device=${1}
- local probe=${2}
+ local device probe backing old_backing fstype mount_opts
+ device=${1}
+ probe=${2}
- local backing="/live/persistence/$(basename ${device})"
+ backing="/live/persistence/$(basename ${device})"
mkdir -p "${backing}"
- local old_backing="$(where_is_mounted ${device})"
+ old_backing="$(where_is_mounted ${device})"
if [ -z "${old_backing}" ]
then
- local fstype="$(get_fstype ${device})"
- local mount_opts="rw,noatime"
+ fstype="$(get_fstype ${device})"
+ mount_opts="rw,noatime"
if [ -n "${PERSISTENCE_READONLY}" ]
then
mount_opts="ro,noatime"
@@ -760,14 +774,19 @@ mount_persistence_media ()
rmdir "${backing}"
return 1
fi
+ else
+ # This means that $device has already been mounted on
+ # the place expected by live-boot, so we're done.
+ echo ${backing}
+ return 0
fi
- return 0
}
close_persistence_media ()
{
- local device=${1}
- local backing="$(where_is_mounted ${device})"
+ local device backing
+ device=${1}
+ backing="$(where_is_mounted ${device})"
if [ -d "${backing}" ]
then
@@ -833,22 +852,25 @@ open_luks_device ()
get_gpt_name ()
{
- local dev="${1}"
+ local dev
+ dev="${1}"
/sbin/blkid -s PART_ENTRY_NAME -p -o value ${dev} 2>/dev/null
}
is_gpt_device ()
{
- local dev="${1}"
+ local dev
+ dev="${1}"
[ "$(/sbin/blkid -s PART_ENTRY_SCHEME -p -o value ${dev} 2>/dev/null)" = "gpt" ]
}
probe_for_gpt_name ()
{
- local overlays="${1}"
- local dev="${2}"
+ local overlays dev gpt_dev gpt_name
+ overlays="${1}"
+ dev="${2}"
- local gpt_dev="${dev}"
+ gpt_dev="${dev}"
if is_active_luks_mapping ${dev}
then
# if $dev is an opened luks device, we need to check
@@ -861,7 +883,7 @@ probe_for_gpt_name ()
return
fi
- local gpt_name=$(get_gpt_name ${gpt_dev})
+ gpt_name=$(get_gpt_name ${gpt_dev})
for label in ${overlays}
do
if [ "${gpt_name}" = "${label}" ]
@@ -873,8 +895,9 @@ probe_for_gpt_name ()
probe_for_fs_label ()
{
- local overlays="${1}"
- local dev="${2}"
+ local overlays dev
+ overlays="${1}"
+ dev="${2}"
for label in ${overlays}
do
@@ -887,11 +910,12 @@ probe_for_fs_label ()
probe_for_file_name ()
{
- local overlays="${1}"
- local dev="${2}"
+ local overlays dev ret backing
+ overlays="${1}"
+ dev="${2}"
- local ret=""
- local backing="$(mount_persistence_media ${dev} probe)"
+ ret=""
+ backing="$(mount_persistence_media ${dev} probe)"
if [ -z "${backing}" ]
then
return
@@ -902,7 +926,8 @@ probe_for_file_name ()
path=${backing}/${PERSISTENCE_PATH}${label}
if [ -f "${path}" ]
then
- local loopdev=$(setup_loop "${path}" "loop" "/sys/block/loop*")
+ local loopdev
+ loopdev=$(setup_loop "${path}" "loop" "/sys/block/loop*")
ret="${ret} ${label}=${loopdev}"
fi
done
@@ -911,7 +936,9 @@ probe_for_file_name ()
then
echo ${ret}
else
+ # unmount and remove mountpoint
umount ${backing} > /dev/null 2>&1 || true
+ rmdir ${backing} > /dev/null 2>&1 || true
fi
}
@@ -934,17 +961,19 @@ find_persistence_media ()
# ${white_list_devices} is non-empty, only devices in it will be
# scanned.
- local overlays="${1}"
- local white_listed_devices="${2}"
- local ret=""
+ local overlays white_listed_devices ret black_listed_devices
+ overlays="${1}"
+ white_listed_devices="${2}"
+ ret=""
- local black_listed_devices="$(what_is_mounted_on /live/image)"
+ black_listed_devices="$(what_is_mounted_on /live/medium)"
for dev in $(storage_devices "${black_listed_devices}" "${white_listed_devices}")
do
- local result=""
+ local result luks_device
+ result=""
- local luks_device=""
+ luks_device=""
# Check if it's a luks device; we'll have to open the device
# in order to probe any filesystem it contains, like we do
# below. activate_custom_mounts() also depends on that any luks
@@ -1120,11 +1149,12 @@ link_files ()
# is non-empty, remove mask from all source paths when
# creating links (will be necessary if we change root, which
# live-boot normally does (into $rootmnt)).
+ local src_dir dest_dir src_mask
# remove multiple /:s and ensure ending on /
- local src_dir="$(trim_path ${1})/"
- local dest_dir="$(trim_path ${2})/"
- local src_mask="${3}"
+ src_dir="$(trim_path ${1})/"
+ dest_dir="$(trim_path ${2})/"
+ src_mask="${3}"
# This check can only trigger on the inital, non-recursive call since
# we create the destination before recursive calls
@@ -1137,7 +1167,8 @@ link_files ()
find "${src_dir}" -mindepth 1 -maxdepth 1 | \
while read src
do
- local dest="${dest_dir}$(basename "${src}")"
+ local dest final_src
+ dest="${dest_dir}$(basename "${src}")"
if [ -d "${src}" ]
then
if [ -z "$(ls -A "${src}")" ]
@@ -1152,7 +1183,7 @@ link_files ()
fi
link_files "${src}" "${dest}" "${src_mask}"
else
- local final_src=${src}
+ final_src=${src}
if [ -n "${src_mask}" ]
then
final_src="$(echo ${final_src} | sed "s|^${src_mask}||")"
@@ -1166,10 +1197,12 @@ link_files ()
do_union ()
{
- local unionmountpoint="${1}" # directory where the union is mounted
- local unionrw="${2}" # branch where the union changes are stored
- local unionro1="${3}" # first underlying read-only branch (optional)
- local unionro2="${4}" # second underlying read-only branch (optional)
+ local unionmountpoint unionrw unionro
+ unionmountpoint="${1}" # directory where the union is mounted
+ shift
+ unionrw="${1}" # branch where the union changes are stored
+ shift
+ unionro="${*}" # space separated list of read-only branches (optional)
case "${UNIONTYPE}" in
aufs)
@@ -1193,13 +1226,12 @@ do_union ()
unionfs-fuse)
unionmountopts="-o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid"
unionmountopts="${unionmountopts} ${unionrw}=${rw_opt}"
- if [ -n "${unionro1}" ]
+ if [ -n "${unionro}" ]
then
- unionmountopts="${unionmountopts}:${unionro1}=${ro_opt}"
- fi
- if [ -n "${unionro2}" ]
- then
- unionmountopts="${unionmountopts}:${unionro2}=${ro_opt}"
+ for rofs in ${unionro}
+ do
+ unionmountopts="${unionmountopts}:${rofs}=${ro_opt}"
+ done
fi
( sysctl -w fs.file-max=391524 ; ulimit -HSn 16384
unionfs-fuse ${unionmountopts} "${unionmountpoint}" ) && \
@@ -1208,21 +1240,27 @@ do_union ()
;;
overlayfs)
- # XXX: can unionro2 be used? (overlayfs only handles two dirs, but perhaps they can be chained?)
- # XXX: and can unionro1 be optional? i.e. can overlayfs skip lowerdir?
- unionmountopts="-o noatime,lowerdir=${unionro1},upperdir=${unionrw}"
+ # XXX: can multiple unionro be used? (overlayfs only handles two dirs, but perhaps they can be chained?)
+ # XXX: and can unionro be optional? i.e. can overlayfs skip lowerdir?
+ if echo ${unionro} | grep -q " "
+ then
+ panic "Multiple lower filesystems are currently not supported with overlayfs (unionro = ${unionro})."
+ elif [ -z "${unionro}" ]
+ then
+ panic "Overlayfs needs at least one lower filesystem (read-only branch)."
+ fi
+ unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}"
mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
;;
*)
unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}"
- if [ -n "${unionro1}" ]
- then
- unionmountopts="${unionmountopts}:${unionro1}=${ro_opt}"
- fi
- if [ -n "${unionro2}" ]
+ if [ -n "${unionro}" ]
then
- unionmountopts="${unionmountopts}:${unionro2}=${ro_opt}"
+ for rofs in ${unionro}
+ do
+ unionmountopts="${unionmountopts}:${rofs}=${ro_opt}"
+ done
fi
mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
;;
@@ -1231,15 +1269,16 @@ do_union ()
get_custom_mounts ()
{
- # Side-effect: leaves $devices with live-persistence.conf mounted in /live/persistence
+ # Side-effect: leaves $devices with persistence.conf mounted in /live/persistence
# Side-effect: prints info to file $custom_mounts
- local custom_mounts=${1}
+ local custom_mounts devices bindings links
+ custom_mounts=${1}
shift
- local devices=${@}
+ devices=${@}
- local bindings="/tmp/bindings.list"
- local links="/tmp/links.list"
+ bindings="/tmp/bindings.list"
+ links="/tmp/links.list"
rm -rf ${bindings} ${links} 2> /dev/null
for device in ${devices}
@@ -1249,16 +1288,21 @@ get_custom_mounts ()
continue
fi
- local device_name="$(basename ${device})"
- local backing=$(mount_persistence_media ${device})
+ local device_name backing include_list
+ device_name="$(basename ${device})"
+ backing=$(mount_persistence_media ${device})
if [ -z "${backing}" ]
then
continue
fi
- local include_list="${backing}/${persistence_list}"
- if [ ! -r "${include_list}" ]
+ if [ -r "${backing}/${persistence_list}" ]
+ then
+ include_list="${backing}/${persistence_list}"
+ elif [ -r "${backing}/${old_persistence_list}" ]
then
+ include_list="${backing}/${old_persistence_list}"
+ else
continue
fi
@@ -1275,14 +1319,15 @@ get_custom_mounts ()
continue
fi
- if trim_path ${dir} | grep -q -e "^[^/]" -e "^/live\(/.*\)\?$" -e "^/\(.*/\)\?\.\.\?\(/.*\)\?$"
+ if trim_path ${dir} | grep -q -e "^[^/]" -e "^/lib" -e "^/lib/live\(/.*\)\?$" -e "^/\(.*/\)\?\.\.\?\(/.*\)\?$"
then
- log_warning_msg "Skipping unsafe custom mount ${dir}: must be an absolute path containing neither the \".\" nor \"..\" special dirs, and cannot be \"/live\" or any sub-directory therein."
+ log_warning_msg "Skipping unsafe custom mount ${dir}: must be an absolute path containing neither the \".\" nor \"..\" special dirs, and cannot be \"/lib\", or \"/lib/live\" or any of its sub-directories."
continue
fi
- local opt_source=""
- local opt_link=""
+ local opt_source opt_link source full_source full_dest
+ opt_source=""
+ opt_link=""
for opt in $(echo ${options} | tr ',' ' ');
do
case "${opt}" in
@@ -1301,10 +1346,10 @@ get_custom_mounts ()
esac
done
- local source="${dir}"
+ source="${dir}"
if [ -n "${opt_source}" ]
then
- if echo ${opt_source} | grep -q -e "^/" -e "^\(.*/\)\?\.\.\?\(/.*\)\?$" && [ "${source}" != "." ]
+ if echo ${opt_source} | grep -q -e "^/" -e "^\(.*/\)\?\.\.\?\(/.*\)\?$" && [ "${opt_source}" != "." ]
then
log_warning_msg "Skipping unsafe custom mount with option source=${opt_source}: must be either \".\" (the media root) or a relative path w.r.t. the media root that contains neither comas, nor the special \".\" and \"..\" path components"
continue
@@ -1313,8 +1358,8 @@ get_custom_mounts ()
fi
fi
- local full_source="$(trim_path ${backing}/${source})"
- local full_dest="$(trim_path ${rootmnt}/${dir})"
+ full_source="$(trim_path ${backing}/${source})"
+ full_dest="$(trim_path ${rootmnt}/${dir})"
if [ -n "${opt_link}" ]
then
echo "${device} ${full_source} ${full_dest} ${options}" >> ${links}
@@ -1335,8 +1380,9 @@ get_custom_mounts ()
# We need to make sure that no two custom mounts have the same sources
# or are nested; if that is the case, too much weird stuff can happen.
- local prev_source="impossible source" # first iteration must not match
- local prev_dest=""
+ local prev_source prev_dest
+ prev_source="impossible source" # first iteration must not match
+ prev_dest=""
# This sort will ensure that a source /a comes right before a source
# /a/b so we only need to look at the previous source
sort -k2 -b ${custom_mounts} |
@@ -1353,14 +1399,16 @@ get_custom_mounts ()
activate_custom_mounts ()
{
- local custom_mounts="${1}" # the ouput from get_custom_mounts()
- local used_devices=""
+ local custom_mounts used_devices
+ custom_mounts="${1}" # the ouput from get_custom_mounts()
+ used_devices=""
while read device source dest options # < ${custom_mounts}
do
- local opt_bind="true"
- local opt_link=""
- local opt_union=""
+ local opt_bind opt_link opt_union
+ opt_bind="true"
+ opt_link=""
+ opt_union=""
for opt in $(echo ${options} | tr ',' ' ');
do
case "${opt}" in
@@ -1440,34 +1488,34 @@ activate_custom_mounts ()
fi
# XXX: If CONFIG_AUFS_ROBR is added to the Debian kernel we can
- # ignore the loop below and set rofs_dest_backing=$dest
- local rofs_dest_backing=""
+ # ignore the loop below and set rootfs_dest_backing=$dest
+ local rootfs_dest_backing
+ rootfs_dest_backing=""
if [ -n "${opt_link}"]
then
- for d in /live/rofs/*
+ for d in /live/rootfs/*
do
if [ -n "${rootmnt}" ]
then
- rofs_dest_backing="${d}/$(echo ${dest} | sed -e "s|${rootmnt}||")"
+ fs="${d}/$(echo ${dest} | sed -e "s|${rootmnt}||")"
else
- rofs_dest_backing="${d}/${dest}"
+ fs="${d}/${dest}"
fi
- if [ -d "${rofs_dest_backing}" ]
+ if [ -d "${fs}" ]
then
- break
- else
- rofs_dest_backing=""
+ rootfs_dest_backing="${rootfs_dest_backing} ${fs}"
fi
done
fi
+ local cow_dir links_source
if [ -n "${opt_link}" ] && [ -z "${PERSISTENCE_READONLY}" ]
then
link_files ${source} ${dest} ${rootmnt}
elif [ -n "${opt_link}" ] && [ -n "${PERSISTENCE_READONLY}" ]
then
- mkdir -p /live/persistence
- local links_source=$(mktemp -d /live/persistence/links-source-XXXXXX)
+ mkdir -p ${rootmnt}/lib/live/mount/persistence
+ links_source=$(mktemp -d ${rootmnt}/lib/live/mount/persistence/links-source-XXXXXX)
chown_ref ${source} ${links_source}
chmod_ref ${source} ${links_source}
# We put the cow dir in the below strange place to
@@ -1475,31 +1523,24 @@ activate_custom_mounts ()
# has its own directory and isn't nested with some
# other custom mount (if so that mount's files would
# be linked, causing breakage.
- local cow_dir="/live/overlay/live/persistence/$(basename ${links_source})"
+ cow_dir="/live/overlay/lib/live/mount/persistence/$(basename ${links_source})"
mkdir -p ${cow_dir}
chown_ref "${source}" "${cow_dir}"
chmod_ref "${source}" "${cow_dir}"
- do_union ${links_source} ${cow_dir} ${source} ${rofs_dest_backing}
+ do_union ${links_source} ${cow_dir} ${source} ${rootfs_dest_backing}
link_files ${links_source} ${dest} ${rootmnt}
elif [ -n "${opt_union}" ] && [ -z "${PERSISTENCE_READONLY}" ]
then
- do_union ${dest} ${source} ${rofs_dest_backing}
+ do_union ${dest} ${source} ${rootfs_dest_backing}
elif [ -n "${opt_bind}" ] && [ -z "${PERSISTENCE_READONLY}" ]
then
mount --bind "${source}" "${dest}"
elif [ -n "${opt_bind}" -o -n "${opt_union}" ] && [ -n "${PERSISTENCE_READONLY}" ]
then
# bind-mount and union mount are handled the same
- # in read-only mode, but note that rofs_dest_backing
+ # in read-only mode, but note that rootfs_dest_backing
# is non-empty (and necessary) only for unions
- if [ -n "${rootmnt}" ]
- then
- local cow_dir="$(echo ${dest} | sed -e "s|^${rootmnt}|/live/overlay/|")"
- else
- # This is happens if persistence is activated
- # post boot
- local cow_dir="/live/overlay/${dest}"
- fi
+ cow_dir="/live/overlay/${dest}"
if [ -e "${cow_dir}" ] && [ -z "${opt_link}" ]
then
# If an earlier custom mount has files here
@@ -1510,7 +1551,7 @@ activate_custom_mounts ()
mkdir -p ${cow_dir}
chown_ref "${source}" "${cow_dir}"
chmod_ref "${source}" "${cow_dir}"
- do_union ${dest} ${cow_dir} ${source} ${rofs_dest_backing}
+ do_union ${dest} ${cow_dir} ${source} ${rootfs_dest_backing}
fi
PERSISTENCE_IS_ON="1"
@@ -1527,23 +1568,24 @@ activate_custom_mounts ()
fix_backwards_compatibility ()
{
- local device=${1}
- local dir=${2}
- local opt=${3}
+ local device dir opt backing include_list
+ device=${1}
+ dir=${2}
+ opt=${3}
if [ -n "${PERSISTENCE_READONLY}" ]
then
return
fi
- local backing="$(mount_persistence_media ${device})"
+ backing="$(mount_persistence_media ${device})"
if [ -z "${backing}" ]
then
return
fi
- local include_list="${backing}/${persistence_list}"
- if [ ! -r "${include_list}" ]
+ include_list="${backing}/${persistence_list}"
+ if [ ! -r "${include_list}" ] && [ ! -r "${backing}/${old_persistence_list}" ]
then
echo "# persistence backwards compatibility:
${dir} ${opt},source=." > "${include_list}"
diff -Naurp live-boot.orig/scripts/boot/9990-mount-http.sh live-boot/scripts/boot/9990-mount-http.sh
--- live-boot.orig/scripts/boot/9990-mount-http.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-mount-http.sh 2013-02-15 09:38:12.509340516 +0100
@@ -8,8 +8,9 @@ do_httpmount ()
for webfile in HTTPFS FTPFS FETCH
do
- local url="$(eval echo \"\$\{${webfile}\}\")"
- local extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
+ local url extension dest
+ url="$(eval echo \"\$\{${webfile}\}\")"
+ extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
if [ -n "$url" ]
then
@@ -20,7 +21,7 @@ do_httpmount ()
mkdir -p "${alt_mountpoint}"
dest="${alt_mountpoint}"
else
- local dest="${mountpoint}/${LIVE_MEDIA_PATH}"
+ dest="${mountpoint}/${LIVE_MEDIA_PATH}"
mount -t ramfs ram "${mountpoint}"
mkdir -p "${dest}"
fi
diff -Naurp live-boot.orig/scripts/boot/9990-mount-iscsi.sh live-boot/scripts/boot/9990-mount-iscsi.sh
--- live-boot.orig/scripts/boot/9990-mount-iscsi.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-mount-iscsi.sh 2013-02-15 09:38:12.509340516 +0100
@@ -7,7 +7,8 @@ do_iscsi()
do_netsetup
#modprobe ib_iser
modprobe iscsi_tcp
- local debugopt=""
+ local debugopt
+ debugopt=""
[ "${DEBUG}" = "true" ] && debugopt="-d 8"
#FIXME this name is supposed to be unique - some date + ifconfig hash?
ISCSI_INITIATORNAME="iqn.1993-08.org.debian.live:01:$(echo "${HWADDR}" | sed -e s/://g)"
@@ -21,12 +22,14 @@ do_iscsi()
then
panic "Failed to log into iscsi target"
fi
- local host="$(ls -d /sys/class/scsi_host/host*/device/iscsi_host:host* \
- /sys/class/scsi_host/host*/device/iscsi_host/host* | sed -e 's:/device.*::' -e 's:.*host::')"
+ local host
+ host="$(ls -d /sys/class/scsi_host/host*/device/iscsi_host:host* \
+ /sys/class/scsi_host/host*/device/iscsi_host/host* | sed -e 's:/device.*::' -e 's:.*host::')"
if [ -n "${host}" ]
then
- local devices=""
- local i=0
+ local devices i
+ devices=""
+ i=0
while [ -z "${devices}" -a $i -lt 60 ]
do
sleep 1
diff -Naurp live-boot.orig/scripts/boot/9990-netbase.sh live-boot/scripts/boot/9990-netbase.sh
--- live-boot.orig/scripts/boot/9990-netbase.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-netbase.sh 2013-02-15 09:38:12.509340516 +0100
@@ -11,11 +11,12 @@ Netbase ()
# FIXME: stop hardcoding overloading of initramfs-tools functions
. /scripts/functions
- . /lib/live/boot/initramfs-tools.sh
+ . /lib/live/boot/9990-initramfs-tools.sh
log_begin_msg "Preconfiguring networking"
IFFILE="/root/etc/network/interfaces"
+ DNSFILE="/root/etc/resolv.conf"
if [ "${STATICIP}" = "frommedia" ] && [ -e "${IFFILE}" ]
then
@@ -43,6 +44,7 @@ EOF
ifaddress="$(echo ${ifline} | cut -f2 -d ':')"
ifnetmask="$(echo ${ifline} | cut -f3 -d ':')"
ifgateway="$(echo ${ifline} | cut -f4 -d ':')"
+ nameserver="$(echo ${ifline} | cut -f5 -d ':')"
cat >> "${IFFILE}" << EOF
allow-hotplug ${ifname}
@@ -60,6 +62,17 @@ cat >> "${IFFILE}" << EOF
EOF
fi
+
+ if [ -n "${nameserver}" ]
+ then
+ if [ -e "${DNSFILE}" ]
+ then
+ grep -v ^nameserver "${DNSFILE}" > "${DNSFILE}.tmp"
+ mv "${DNSFILE}.tmp" "${DNSFILE}"
+ fi
+
+ echo "nameserver ${nameserver}" >> "${DNSFILE}"
+ fi
done
else
if [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]
@@ -122,20 +135,5 @@ EOF
fi
fi
- #if [ ! -x /root/usr/sbin/NetworkManager ]
- #then
- # for i in eth0 eth1 eth2 ath0 wlan0
- # do
- # grep -q "iface ${i}" ${IFFILE} && continue
- #
- #cat >> "${IFFILE}" << EOF
- #allow-hotplug ${i}
- #iface ${i} inet dhcp
- #
- #EOF
- #
- # done
- #fi
-
log_end_msg
}
diff -Naurp live-boot.orig/scripts/boot/9990-networking.sh live-boot/scripts/boot/9990-networking.sh
--- live-boot.orig/scripts/boot/9990-networking.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-networking.sh 2013-02-15 10:02:24.928680402 +0100
@@ -110,7 +110,13 @@ do_netsetup ()
else
for interface in ${DEVICE}; do
ipconfig -t "$ETHDEV_TIMEOUT" ${interface} | tee /netboot-${interface}.config
+
+ # squeeze
[ -e /tmp/net-${interface}.conf ] && . /tmp/net-${interface}.conf
+
+ # wheezy
+ [ -e /run/net-${interface}.conf ] && . /run/net-${interface}.conf
+
if [ "$IPV4ADDR" != "0.0.0.0" ]
then
break
@@ -122,7 +128,13 @@ do_netsetup ()
do
# source relevant ipconfig output
OLDHOSTNAME=${HOSTNAME}
+
+ # squeeze
[ -e /tmp/net-${interface}.conf ] && . /tmp/net-${interface}.conf
+
+ # wheezy
+ [ -e /run/net-${interface}.conf ] && . /run/net-${interface}.conf
+
[ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
export HOSTNAME
diff -Naurp live-boot.orig/scripts/boot/9990-overlay.sh live-boot/scripts/boot/9990-overlay.sh
--- live-boot.orig/scripts/boot/9990-overlay.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-overlay.sh 2013-02-15 10:02:24.928680402 +0100
@@ -36,7 +36,7 @@ setup_unionfs ()
croot="/"
# Let's just mount the read-only file systems first
- rofslist=""
+ rootfslist=""
if [ -z "${PLAIN_ROOT}" ]
then
@@ -101,7 +101,7 @@ setup_unionfs ()
if [ -d "${image}" ]
then
# it is a plain directory: do nothing
- rofslist="${image} ${rofslist}"
+ rootfslist="${image} ${rootfslist}"
elif [ -f "${image}" ]
then
if losetup --help 2>&1 | grep -q -- "-r\b"
@@ -126,12 +126,12 @@ setup_unionfs ()
case "${UNIONTYPE}" in
unionmount)
mpoint="${rootmnt}"
- rofslist="${rootmnt} ${rofslist}"
+ rootfslist="${rootmnt} ${rootfslist}"
;;
*)
mpoint="${croot}/${imagename}"
- rofslist="${mpoint} ${rofslist}"
+ rootfslist="${mpoint} ${rootfslist}"
;;
esac
@@ -147,7 +147,7 @@ setup_unionfs ()
log_begin_msg "Mounting \"${image_directory}\" on \"${croot}/filesystem\""
mount -t $(get_fstype "${image_directory}") -o ro,noatime "${image_directory}" "${croot}/filesystem" || \
panic "Can not mount ${image_directory} on ${croot}/filesystem" && \
- rofslist="${croot}/filesystem ${rofslist}"
+ rootfslist="${croot}/filesystem ${rootfslist}"
# probably broken:
mount -o bind ${croot}/filesystem $mountpoint
log_end_msg
@@ -155,9 +155,8 @@ setup_unionfs ()
# tmpfs file systems
touch /etc/fstab
- mkdir -p /live
- mount -t tmpfs tmpfs /live
mkdir -p /live/overlay
+ mount -t tmpfs tmpfs /live/overlay
# Looking for persistence devices or files
if [ -n "${PERSISTENCE}" ] && [ -z "${NOPERSISTENCE}" ]
@@ -190,49 +189,58 @@ setup_unionfs ()
done
fi
- case "${PERSISTENCE_MEDIA}" in
- removable)
- whitelistdev="$(removable_dev)"
- ;;
-
- removable-usb)
- whitelistdev="$(removable_usb_dev)"
- ;;
+ local whitelistdev
+ whitelistdev=""
+ if [ -n "${PERSISTENCE_MEDIA}" ]
+ then
+ case "${PERSISTENCE_MEDIA}" in
+ removable)
+ whitelistdev="$(removable_dev)"
+ ;;
- *)
- whitelistdev=""
- ;;
- esac
+ removable-usb)
+ whitelistdev="$(removable_usb_dev)"
+ ;;
+ esac
+ if [ -z "${whitelistdev}" ]
+ then
+ whitelistdev="ignore_all_devices"
+ fi
+ fi
if is_in_comma_sep_list overlay ${PERSISTENCE_METHOD}
then
overlays="${old_root_overlay_label} ${old_home_overlay_label} ${custom_overlay_label}"
fi
- local overlay_devices=""
- for media in $(find_persistence_media "${overlays}" "${whitelistdev}")
- do
- media="$(echo ${media} | tr ":" " ")"
+ local overlay_devices
+ overlay_devices=""
+ if [ "${whitelistdev}" != "ignore_all_devices" ]
+ then
+ for media in $(find_persistence_media "${overlays}" "${whitelistdev}")
+ do
+ media="$(echo ${media} | tr ":" " ")"
- case ${media} in
- ${old_root_overlay_label}=*)
- device="${media#*=}"
- fix_backwards_compatibility ${device} / union
- overlay_devices="${overlay_devices} ${device}"
- ;;
+ case ${media} in
+ ${old_root_overlay_label}=*)
+ device="${media#*=}"
+ fix_backwards_compatibility ${device} / union
+ overlay_devices="${overlay_devices} ${device}"
+ ;;
- ${old_home_overlay_label}=*)
- device="${media#*=}"
- fix_backwards_compatibility ${device} /home bind
- overlay_devices="${overlay_devices} ${device}"
- ;;
+ ${old_home_overlay_label}=*)
+ device="${media#*=}"
+ fix_backwards_compatibility ${device} /home bind
+ overlay_devices="${overlay_devices} ${device}"
+ ;;
- ${custom_overlay_label}=*)
- device="${media#*=}"
- overlay_devices="${overlay_devices} ${device}"
- ;;
- esac
- done
+ ${custom_overlay_label}=*)
+ device="${media#*=}"
+ overlay_devices="${overlay_devices} ${device}"
+ ;;
+ esac
+ done
+ fi
elif [ -n "${NFS_COW}" ] && [ -z "${NOPERSISTENCE}" ]
then
# check if there are any nfs options
@@ -290,19 +298,19 @@ setup_unionfs ()
fi
fi
- rofscount=$(echo ${rofslist} |wc -w)
+ rootfscount=$(echo ${rootfslist} |wc -w)
- rofs=${rofslist%% }
+ rootfs=${rootfslist%% }
if [ -n "${EXPOSED_ROOT}" ]
then
- if [ ${rofscount} -ne 1 ]
+ if [ ${rootfscount} -ne 1 ]
then
- panic "only one RO file system supported with exposedroot: ${rofslist}"
+ panic "only one RO file system supported with exposedroot: ${rootfslist}"
fi
- mount --bind ${rofs} ${rootmnt} || \
- panic "bind mount of ${rofs} failed"
+ mount --bind ${rootfs} ${rootmnt} || \
+ panic "bind mount of ${rootfs} failed"
if [ -z "${SKIP_UNION_MOUNTS}" ]
then
@@ -327,16 +335,17 @@ setup_unionfs ()
then
# FIXME: handle PERSISTENCE_READONLY
unionmountopts="-t ${cow_fstype} -o noatime,union,${cow_mountopt} ${cowdevice}"
- mount_full $unionmountopts "${unionmountpoint}"
+ # unionmount only works with util-linux mount
+ mount.util-linux $unionmountopts "${unionmountpoint}"
else
cow_dir="/live/overlay${dir}"
- rofs_dir="${rofs}${dir}"
+ rootfs_dir="${rootfs}${dir}"
mkdir -p ${cow_dir}
if [ -n "${PERSISTENCE_READONLY}" ] && [ "${cowdevice}" != "tmpfs" ]
then
- do_union ${unionmountpoint} ${cow_dir} ${root_backing} ${rofs_dir}
+ do_union ${unionmountpoint} ${cow_dir} ${root_backing} ${rootfs_dir}
else
- do_union ${unionmountpoint} ${cow_dir} ${rofs_dir}
+ do_union ${unionmountpoint} ${cow_dir} ${rootfs_dir}
fi
fi || panic "mount ${UNIONTYPE} on ${unionmountpoint} failed with option ${unionmountopts}"
done
@@ -344,49 +353,51 @@ setup_unionfs ()
# Correct the permissions of /:
chmod 0755 "${rootmnt}"
- live_rofs_list=""
- # SHOWMOUNTS is necessary for custom mounts with the union option
- # Since we may want to do custom mounts in user-space it's best to always enable SHOWMOUNTS
- if true #[ -n "${SHOWMOUNTS}" ] || ( [ -n "${PERSISTENCE}" ] && [ -z "${NOPERSISTENCE}" ] 1)
+ # Correct the permission of /tmp:
+ if [ -d "${rootmnt}/tmp" ]
then
- # XXX: is the for loop really necessary? rofslist can only contain one item (see above XXX about EXPOSEDROOT) and this is also assumed elsewhere above (see use of $rofs above).
- for d in ${rofslist}
- do
- live_rofs="/live/rofs/${d##*/}"
- live_rofs_list="${live_rofs_list} ${live_rofs}"
- mkdir -p "${live_rofs}"
- case d in
- *.dir)
- # do nothing # mount -o bind "${d}" "${live_rofs}"
- ;;
- *)
- case "${UNIONTYPE}" in
- unionfs-fuse)
- mount -o bind "${d}" "${live_rofs}"
- ;;
-
- *)
- mount -o move "${d}" "${live_rofs}"
- ;;
- esac
- ;;
- esac
- done
+ chmod 1777 "${rootmnt}"/tmp
fi
+ live_rootfs_list=""
+ for d in ${rootfslist}
+ do
+ live_rootfs="/live/rootfs/${d##*/}"
+ live_rootfs_list="${live_rootfs_list} ${live_rootfs}"
+ mkdir -p "${live_rootfs}"
+ case d in
+ *.dir)
+ # do nothing # mount -o bind "${d}" "${live_rootfs}"
+ ;;
+ *)
+ case "${UNIONTYPE}" in
+ unionfs-fuse)
+ mount -o bind "${d}" "${live_rootfs}"
+ ;;
+
+ *)
+ mount -o move "${d}" "${live_rootfs}"
+ ;;
+ esac
+ ;;
+ esac
+ done
+
# Adding custom persistence
if [ -n "${PERSISTENCE}" ] && [ -z "${NOPERSISTENCE}" ]
then
- local custom_mounts="/tmp/custom_mounts.list"
+ local custom_mounts
+ custom_mounts="/tmp/custom_mounts.list"
rm -rf ${custom_mounts} 2> /dev/null
# Gather information about custom mounts from devies detected as overlays
get_custom_mounts ${custom_mounts} ${overlay_devices}
- [ -n "${DEBUG}" ] && cp ${custom_mounts} "/live/persistence"
+ [ -n "${DEBUG}" ] && cp ${custom_mounts} "/lib/live/mount/persistence"
# Now we do the actual mounting (and symlinking)
- local used_overlays=""
+ local used_overlays
+ used_overlays=""
used_overlays=$(activate_custom_mounts ${custom_mounts})
rm ${custom_mounts}
@@ -400,11 +411,8 @@ setup_unionfs ()
done
fi
- mkdir -p "${rootmnt}/live"
- mount -o move /live "${rootmnt}/live" >/dev/null 2>&1 || mount -o bind /live "${rootmnt}/live" || log_warning_msg "Unable to move or bind /live to ${rootmnt}/live"
-
- # shows cow fs on /overlay (FIXME: do we still need/want this? probably yes)
- mkdir -p "${rootmnt}/live/overlay"
- mount -o move /live/overlay "${rootmnt}/live/overlay" >/dev/null 2>&1 || mount -o bind /overlay "${rootmnt}/live/overlay" || log_warning_msg "Unable to move or bind /overlay to ${rootmnt}/live/overlay"
-
+ # ensure that a potentially stray tmpfs gets removed
+ # otherways, initramfs-tools is unable to remove /live
+ # and fails to boot
+ umount /live/overlay || true
}
diff -Naurp live-boot.orig/scripts/boot/9990-select-eth-device.sh live-boot/scripts/boot/9990-select-eth-device.sh
--- live-boot.orig/scripts/boot/9990-select-eth-device.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot/9990-select-eth-device.sh 2013-02-15 09:38:12.509340516 +0100
@@ -6,7 +6,7 @@ Select_eth_device ()
bootconf=$(egrep '^BOOT=' /conf/initramfs.conf | tail -1)
# can be superseded by command line (used by Debian-Live's netboot for example)
- for ARGUMENT in $(cat /proc/cmdline)
+ for ARGUMENT in ${_CMDLINE}
do
case "${ARGUMENT}" in
netboot=*)
@@ -40,13 +40,13 @@ Select_eth_device ()
fi
# If user force to use specific device, write it
- for ARGUMENT in $(cat /proc/cmdline)
+ for ARGUMENT in ${_CMDLINE}
do
case "${ARGUMENT}" in
live-netdev=*)
NETDEV="${ARGUMENT#live-netdev=}"
echo "DEVICE=$NETDEV" >> /conf/param.conf
- echo "Found live-netdev parameter in /proc/cmdline. Force to use network device $NETDEV."
+ echo "Found live-netdev parameter, forcing to to use network device $NETDEV."
return
;;
esac
diff -Naurp live-boot.orig/scripts/boot/FIXME live-boot/scripts/boot/FIXME
--- live-boot.orig/scripts/boot/FIXME 1970-01-01 01:00:00.000000000 +0100
+++ live-boot/scripts/boot/FIXME 2013-02-15 09:38:12.509340516 +0100
@@ -0,0 +1,30 @@
+Note
+----
+
+live-boot is moving from a monolithic script into a proper
+plugin architecture for better maintenance and customization.
+
+Additionally, this will allow us to abstract initramfs-tools
+integration to also support other initrd generators, such as
+dracut.
+
+Unfortunately, from a developers point of view, we could no
+finish this in time for wheezy, but we will finish this for
+jessie. Please excuse the sorry state of the 9990-* scripts.
+From a users point of view, it doesn't matter at all though.
+
+
+Scripts overview
+----------------
+
+00xx initramfs "bootstrapping"
+
+0xxx live-boot internals
+
+1xxx find and mount rootfs
+
+2xxx find and mount persistence
+
+3xxx anything after that involves read or write access to the rootfs
+
+9xxx FIXME
diff -Naurp live-boot.orig/scripts/boot.sh live-boot/scripts/boot.sh
--- live-boot.orig/scripts/boot.sh 2013-02-15 10:02:14.573084426 +0100
+++ live-boot/scripts/boot.sh 2013-02-15 09:38:12.505340670 +0100
@@ -2,66 +2,19 @@
# set -e
-if [ -e /scripts/functions ]
-then
- # initramfs-tools specific (FIXME)
- . /scripts/functions
-fi
+# Reading configuration file from filesystem and live-media
+for _FILE in /etc/live/boot.conf /etc/live/boot/*
+do
+ if [ -e "${_FILE}" ]
+ then
+ . "${_FILE}"
+ fi
+done
-for _SCRIPT in /lib/live/boot/*
+for _SCRIPT in /lib/live/boot/????-*
do
if [ -e "${_SCRIPT}" ]
then
. ${_SCRIPT}
fi
done
-
-export PATH="/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
-
-echo "/root/lib" >> /etc/ld.so.conf
-echo "/root/usr/lib" >> /etc/ld.so.conf
-
-mountpoint="/live/image"
-alt_mountpoint="/media"
-LIVE_MEDIA_PATH="live"
-
-HOSTNAME="host"
-
-mkdir -p "${mountpoint}"
-tried="/tmp/tried"
-
-# Create /etc/mtab for debug purpose and future syncs
-if [ ! -d /etc ]
-then
- mkdir /etc/
-fi
-
-if [ ! -f /etc/mtab ]
-then
- touch /etc/mtab
-fi
-
-if [ ! -x "/bin/fstype" ]
-then
- # klibc not in path -> not in initramfs
- export PATH="${PATH}:/usr/lib/klibc/bin"
-fi
-
-# handle upgrade path from old udev (using udevinfo) to
-# recent versions of udev (using udevadm info)
-if [ -x /sbin/udevadm ]
-then
- udevinfo='/sbin/udevadm info'
-else
- udevinfo='udevinfo'
-fi
-
-old_root_overlay_label="live-rw"
-old_home_overlay_label="home-rw"
-custom_overlay_label="persistence"
-persistence_list="live-persistence.conf"
-
-if [ ! -f /live.vars ]
-then
- touch /live.vars
-fi
diff -Naurp live-boot.orig/VERSION live-boot/VERSION
--- live-boot.orig/VERSION 2013-02-15 10:02:14.569084582 +0100
+++ live-boot/VERSION 2013-02-15 10:02:24.924680558 +0100
@@ -1 +1 @@
-3.0~a35-1
+3.0.1-1
--- End Message ---