# for reuse in another live-boot session.
# Look at the manpage for more informations.
#
-# Copyright (C) 2006-2010 Marco Amadori <marco.amadori@gmail.com>
+# Copyright (C) 2006-2011 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
{
echo "${PROGRAM}"
echo
- echo "Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>"
+ echo "Copyright (C) 2006-2011 Marco Amadori <marco.amadori@gmail.com>"
echo "Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>"
echo
echo "This program is free software; you can redistribute it and/or modify"
echo "it under the terms of the GNU General Public License as published by"
- echo "the Free Software Foundation; either version 2 of the License, or"
+ echo "the Free Software Foundation; either version 3 of the License, or"
echo "(at your option) any later version."
echo
echo "This program is distributed in the hope that it will be useful,"
echo "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA"
echo
echo "On Debian systems, the complete text of the GNU General Public License"
- echo "can be found in /usr/share/common-licenses/GPL-2 file."
+ echo "can be found in /usr/share/common-licenses/GPL-3 file."
echo
echo "Homepage: <http://debian-live.alioth.debian.org/>"
. /usr/share/initramfs-tools/hook-functions
+[ "${QUIET}" ] || echo -n live-boot:
+
# live-boot hook
# Reading configuration file from filesystem
# Handling live-boot
+[ "${QUIET}" ] || echo -n " "core
# Configuration
if [ -e /usr/share/live-boot/languagelist ]
then
# Handling other stuff
+[ "${QUIET}" ] || echo -n " "filesystems
# Configuration: keymap (usefull when using encryption)
if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
then
# Filesystem: ntfs
manual_add_modules ntfs
+[ "${QUIET}" ] || echo -n " "devices
# Hardware: cdrom
manual_add_modules ide-cd
manual_add_modules ide-generic
copy_exec /usr/bin/eject /bin
fi
+[ "${QUIET}" ] || echo -n " "utils
# Program: md5sum
copy_exec /usr/bin/md5sum /bin
# Program: memdisk
if [ -x /usr/bin/memdiskfind ]
then
+[ "${QUIET}" ] || echo -n :memdisk
copy_exec /usr/bin/memdiskfind
manual_add_modules phram
manual_add_modules mtdblock
# Program: udev
if [ -x /sbin/udevadm ]
then
+ [ "${QUIET}" ] || echo -n " "udev
copy_exec /sbin/udevadm /sbin
fi
if [ -x /usr/bin/udevinfo ]
then
+ [ "${QUIET}" ] || echo -n " "udev
copy_exec /usr/bin/udevinfo /bin
fi
# Program: wget
if [ -x /usr/bin/wget ]
then
+ [ "${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
fi
# FUSE filesystem: httpfs2
if [ -x /usr/bin/httpfs2_ssl ]
then
+ [ "${QUIET}" ] || echo -n " "httpfs:ssl
copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
elif [ -x /usr/bin/httpfs2 ]
then
+ [ "${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
copy_exec /usr/bin/curlftpfs /bin
fi
# iSCSI
if [ -x /usr/sbin/iscsistart ]
then
- copy_exec /usr/sbin/iscsistart /bin
- #manual_add_modules ib_iser
- manual_add_modules iscsi_tcp
- manual_add_modules crc32c
+ [ "${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
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
+
+[ "${QUIET}" ] || echo .
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH LIVE\-BOOT 7 2011\-01\-11 3.0~a14 "Debian Live Projekt"
+.TH LIVE\-BOOT 7 2011\-03\-09 3.0~a15 "Debian Live Projekt"
.SH NAME
\fBlive\-boot\fP \- System Boot Skripte
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH LIVE\-BOOT 1 2011\-01\-11 3.0~a14 "Debian Live Projekt"
+.TH LIVE\-BOOT 1 2011\-03\-09 3.0~a15 "Debian Live Projekt"
.SH NAME
\fBlive\-snapshot\fP \- simple script to ease persistence usage
-.TH LIVE\-BOOT 7 2011\-01\-11 3.0~a14 "Debian Live Project"
+.TH LIVE\-BOOT 7 2011\-03\-09 3.0~a15 "Debian Live Project"
.SH NAME
\fBlive\-boot\fR \- System Boot Scripts
-.TH LIVE\-BOOT 1 2011\-01\-11 3.0~a14 "Debian Live Project"
+.TH LIVE\-BOOT 1 2011\-03\-09 3.0~a15 "Debian Live Project"
.SH NAME
\fBlive\-snapshot\fR \- simple script to ease persistence usage
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a14\n"
-"POT-Creation-Date: 2011-01-11 13:39+0100\n"
+"Project-Id-Version: live-boot 3.0~a15\n"
+"POT-Creation-Date: 2011-03-09 18:00+0100\n"
"PO-Revision-Date: 2010-05-24 12:34+0300\n"
"Last-Translator: Daniel Baumann <daniel@debian.org>\n"
"Language-Team: none\n"
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
#, no-wrap
-msgid "2011-01-11"
+msgid "2011-03-09"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
-msgid "3.0~a14"
-msgstr "3.0~a14"
+#, no-wrap
+msgid "3.0~a15"
+msgstr "3.0~a15"
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a14\n"
-"POT-Creation-Date: 2011-01-11 13:39+0100\n"
+"Project-Id-Version: live-boot 3.0~a15\n"
+"POT-Creation-Date: 2011-03-09 18:00+0100\n"
"PO-Revision-Date: 2010-05-24 12:34+0300\n"
"Last-Translator: Daniel Baumann <daniel@debian.org>\n"
"Language-Team: none\n"
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
#, no-wrap
-msgid "2011-01-11"
+msgid "2011-03-09"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
-msgid "3.0~a14"
-msgstr "3.0~a14"
+#, no-wrap
+msgid "3.0~a15"
+msgstr "3.0~a15"
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
msgid ""
msgstr ""
"Project-Id-Version: live-boot VERSION\n"
-"POT-Creation-Date: 2011-01-11 13:39+0100\n"
+"POT-Creation-Date: 2011-03-09 18:00+0100\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"
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
#, no-wrap
-msgid "2011-01-11"
+msgid "2011-03-09"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
#, no-wrap
-msgid "3.0~a14"
+msgid "3.0~a15"
msgstr ""
#. type: TH
msgid ""
msgstr ""
"Project-Id-Version: live-boot VERSION\n"
-"POT-Creation-Date: 2011-01-11 13:39+0100\n"
+"POT-Creation-Date: 2011-03-09 18:00+0100\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"
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
#, no-wrap
-msgid "2011-01-11"
+msgid "2011-03-09"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-snapshot.1:1
#, no-wrap
-msgid "3.0~a14"
+msgid "3.0~a15"
msgstr ""
#. type: TH
croot="/"
# Let's just mount the read-only file systems first
- rofsstring=""
rofslist=""
if [ "${UNIONTYPE}" = "aufs" ]
image_string="$(echo ${image_string} | sed -e 's/ /\n/g' | sort )"
fi
- [ -n "${MODULETORAMFILE}" ] && image_string="${image_directory}/$(basename ${MODULETORAMFILE})"
+ [ -n "${MODULETORAMFILE}" ] && image_string="${image_directory}/$(basename ${MODULETORAMFILE})"
mkdir -p "${croot}"
if [ -d "${image}" ]
then
# it is a plain directory: do nothing
- rofsstring="${image}=${roopt}:${rofsstring}"
rofslist="${image} ${rofslist}"
elif [ -f "${image}" ]
then
if [ "${UNIONTYPE}" != "unionmount" ]
then
mpoint="${croot}/${imagename}"
- rofsstring="${mpoint}=${roopt}:${rofsstring}" && rofslist="${mpoint} ${rofslist}"
+ rofslist="${mpoint} ${rofslist}"
else
mpoint="${rootmnt}"
+ rofslist="${rootmnt} ${rofslist}"
fi
mkdir -p "${mpoint}"
log_begin_msg "Mounting \"${image}\" on \"${mpoint}\" via \"${backdev}\""
# we have a plain root system
mkdir -p "${croot}/filesystem"
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" && rofsstring="${croot}/filesystem=${roopt}:${rofsstring}" && rofslist="${croot}/filesystem ${rofslist}"
+ 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}"
# probably broken:
mount -o bind ${croot}/filesystem $mountpoint
log_end_msg
fi
- rofsstring=${rofsstring%:}
-
mkdir -p /cow
# Looking for "${root_persistence}" device or file
if [ "${UNIONTYPE}" != "unionmount" ]
then
- if [ "${cow_fstype}" = "nfs" ]
- then
- log_begin_msg \
- "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow"
- nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \
- panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on /cow"
- else
- mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \
- panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on /cow"
- fi
+ if [ "${cow_fstype}" = "nfs" ]
+ then
+ log_begin_msg \
+ "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow"
+ nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \
+ panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on /cow"
+ else
+ mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \
+ panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on /cow"
+ fi
fi
rofscount=$(echo ${rofslist} |wc -w)
- if [ -n "${EXPOSED_ROOT}" ]
+ if [ ${rofscount} -ne 1 ]
then
- if [ ${rofscount} -ne 1 ]
- then
- panic "only one RO file system supported with exposedroot: ${rofslist}"
- fi
- exposedrootfs=${rofslist%% }
+ panic "only one RO file system supported with exposedroot: ${rofslist}"
+ fi
+ rofs=${rofslist%% }
- mount --bind ${exposedrootfs} ${rootmnt} || \
- panic "bind mount of ${exposedrootfs} failed"
+ if [ -n "${EXPOSED_ROOT}" ]
+ then
+ mount --bind ${rofs} ${rootmnt} || \
+ panic "bind mount of ${rofs} failed"
if [ -z "${SKIP_UNION_MOUNTS}" ]
then
else
cow_dirs=''
fi
+ else
+ cow_dirs="/"
+ fi
- for dir in ${cow_dirs}; do
- mkdir -p /cow${dir}
+ if [ "${cow_fstype}" != "tmpfs" ] && [ "${cow_dirs}" != "/" ] && [ "${UNIONTYPE}" = "unionmount" ]
+ then
+ true # FIXME: Maybe it does, I don't really know.
+ #panic "unionmount does not support subunions (${cow_dirs})."
+ fi
- case "${UNIONTYPE}" in
- unionfs-fuse)
- (ulimit -n 16384; unionfs-fuse -o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid /cow=RW:${exposedrootfs}${dir} "${rootmnt}${dir}" || panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option cow,noinitgroups,default_permissions,allow_other,use_ino,suid=/cow=RW:${exposedrootfs}${dir}")
- mkdir -p /dev/.initramfs/varrun
- pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
- ;;
+ unionmountopts=""
+ unionmountpoint=""
- *)
- mount -t ${UNIONTYPE} -o rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro ${UNIONTYPE} "${rootmnt}${dir}" || panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro"
- ;;
- esac
- done
- else
+ for dir in ${cow_dirs}; do
+ mkdir -p /cow${dir}
+
+ unionmountpoint="${rootmnt}${dir}"
+ unionrw="/cow${dir}"
+ unionro="${rofs}${dir}"
+ # We don't handle spaces and other junk gracefully here, hopefully not needed.
case "${UNIONTYPE}" in
unionfs-fuse)
- (ulimit -n 16384; unionfs-fuse -o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid /cow=RW:${rofsstring} "${rootmnt}" || panic "mount ${UNIONTYPE} on ${rootmnt} failed with option cow,noinitgroups,default_permissions,allow_other,use_ino,suid=/cow:RW:${rofsstring}")
- mkdir -p /dev/.initramfs/varrun
- pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
+ unionmountopts="-o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid"
+ unionmountopts="${unionmountopts} ${unionrw}=RW:${unionro}=RO"
+ ( sysctl -w fs.file-max=391524 ; ulimit -HSn 16384
+ unionfs-fuse ${unionmountopts} "${unionmountpoint}" ) && \
+ ( mkdir -p /dev/.initramfs/varrun
+ pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true )
;;
unionmount)
- mount_full -t ${cow_fstype} -o noatime,union,${cow_mountopt} ${cowdevice} "${rootmnt}" || panic "${UNIONTYPE} ${cowdevice} on ${rootmnt} failed with option noatime,union,${cow_mountopt}"
+ unionmountopts="-t ${cow_fstype} -o noatime,union,${cow_mountopt} ${cowdevice}"
+ mount_full $unionmountopts "${unionmountpoint}"
;;
+
*)
- mount -t ${UNIONTYPE} -o noatime,${noxino_opt}dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on ${rootmnt} failed with option noatime,${noxino_opt}dirs=/cow=rw:${rofsstring}"
+ unionmountopts="-o noatime,${noxino_opt}dirs=${unionrw}=rw:${unionro}=${roopt}"
+ mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
;;
- esac
- fi
+ esac || \
+ panic "mount ${UNIONTYPE} on ${unionmountpoint} failed with option ${unionmountopts}"
+ done
# Correct the permissions of /:
chmod 0755 "${rootmnt}"
then
echo "Warning: device for bootoption isofrom= ($FROMISO) not found.">>/live-boot.log
else
- mkdir /isofrom
- mount -t auto "$ISO_DEVICE" /isofrom
- ISO_NAME="$(echo $FROMISO | sed "s|$ISO_DEVICE||")"
- loopdevname=$(setup_loop "/isofrom/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
- devname="${loopdevname}"
+ fs_type=$(get_fstype "${ISO_DEVICE}")
+ if is_supported_fs ${fs_type}
+ then
+ mkdir /isofrom
+ mount -t $fs_type "$ISO_DEVICE" /isofrom
+ ISO_NAME="$(echo $FROMISO | sed "s|$ISO_DEVICE||")"
+ loopdevname=$(setup_loop "/isofrom/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
+ devname="${loopdevname}"
+ else
+ echo "Warning: unable to mount $ISO_DEVICE." >>/live.log
+ fi
fi
fi