#!/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:
-
-# live-boot hook
+[ "${QUIET}" ] || echo -n "live-boot:"
-# Reading configuration file from filesystem
+# Reading configuration files
if [ -e /etc/live/boot.conf ]
then
. /etc/live/boot.conf
done
fi
-# Handling live-boot
-
+# 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"
fi
done
-# udev dependencies (squeeze and newer)
+# udev dependencies
for FILE in /lib/udev/*_id
do
if [ ! -e "${DESTDIR}/${FILE}" ]
fi
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
# 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
copy_exec /usr/bin/eject /bin
fi
-[ "${QUIET}" ] || echo -n " "utils
+[ "${QUIET}" ] || echo -n " utils"
# Feature: Verify Checksums
copy_exec /usr/bin/sha256sum /bin
# 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
# Program: udev
if [ -x /sbin/udevadm ]
then
- [ "${QUIET}" ] || echo -n " "udev
+ [ "${QUIET}" ] || echo -n " udev"
copy_exec /sbin/udevadm /sbin
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
+ [ "${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
+ [ "${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"
+
+ #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
+ ;;
+esac
+
+case "${LIVE_UNIONMOUNT}" in
+ true)
+ [ "${QUIET}" ] || echo -n " unionmount"
+
+ # UnionMount
+ # only mount from patched util-linux can do this currently
+ copy_exec /bin/mount /bin/mount_full
+ ;;
+esac
[ "${QUIET}" ] || echo .
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH LIVE\-BOOT 7 18.07.2012 3.0~a36\-1 "Debian Live Project"
+.TH LIVE\-BOOT 7 25.07.2012 3.0~a37\-1 "Debian Live Project"
.SH NAME
\fBlive\-boot\fP \- System Boot Scripts
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH LIVE\-BOOT conf 18.07.2012 3.0~a36\-1 "Debian Live Project"
+.TH LIVE\-BOOT conf 25.07.2012 3.0~a37\-1 "Debian Live Project"
.SH NAME
\fBlive\-persistence.conf\fP \- Configuration file for persistence media in
-.TH LIVE\-BOOT 7 2012\-07\-18 3.0~a36-1 "Debian Live Project"
+.TH LIVE\-BOOT 7 2012\-07\-25 3.0~a37-1 "Debian Live Project"
.SH NAME
\fBlive\-boot\fR \- System Boot Scripts
-.TH LIVE\-BOOT conf 2012\-07\-18 3.0~a36-1 "Debian Live Project"
+.TH LIVE\-BOOT conf 2012\-07\-25 3.0~a37-1 "Debian Live Project"
.SH NAME
\fBlive-persistence.conf\fR \- Configuration file for persistence media in
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH LIVE\-BOOT 7 18.07.2012 3.0~a36\-1 "Proyecto Debian Live"
+.TH LIVE\-BOOT 7 25.07.2012 3.0~a37\-1 "Proyecto Debian Live"
.SH NOMBRE
\fBlive\-boot\fP \- Scripts de Arranque del Sistema
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH LIVE\-BOOT conf 18.07.2012 3.0~a36\-1 "Proyecto Debian Live"
+.TH LIVE\-BOOT conf 25.07.2012 3.0~a37\-1 "Proyecto Debian Live"
.SH NOMBRE
\fBlive\-persistence.conf\fP \- Fichero para configurar medios de almacenamiento
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a35-1\n"
-"POT-Creation-Date: 2012-07-18 23:56+0300\n"
+"Project-Id-Version: live-boot 3.0~a37-1\n"
+"POT-Creation-Date: 2012-07-25 17:21+0300\n"
"PO-Revision-Date: 2012-04-08 22:48+0300\n"
"Last-Translator: Daniel Baumann <daniel@debian.org>\n"
"Language-Team: none\n"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "2012-07-18"
-msgstr "18.07.2012"
+msgid "2012-07-25"
+msgstr "25.07.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a36-1"
+msgid "3.0~a37-1"
msgstr ""
#. type: TH
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a35-1\n"
-"POT-Creation-Date: 2012-07-18 23:56+0300\n"
+"Project-Id-Version: live-boot 3.0~a37-1\n"
+"POT-Creation-Date: 2012-07-25 17:21+0300\n"
"PO-Revision-Date: 2012-04-08 22:48+0300\n"
"Last-Translator: Daniel Baumann <daniel@debian.org>\n"
"Language-Team: none\n"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "2012-07-18"
-msgstr "18.07.2012"
+msgid "2012-07-25"
+msgstr "25.07.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a36-1"
+msgid "3.0~a37-1"
msgstr ""
#. type: TH
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a35-1\n"
-"POT-Creation-Date: 2012-07-18 23:56+0300\n"
+"Project-Id-Version: live-boot 3.0~a37-1\n"
+"POT-Creation-Date: 2012-07-25 17:21+0300\n"
"PO-Revision-Date: 2012-06-07 20:29+0200\n"
"Last-Translator: Carlos Zuferri «chals» <chals@altorricon.com>\n"
"Language-Team: none\n"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "2012-07-18"
-msgstr "18.07.2012"
+msgid "2012-07-25"
+msgstr "25.07.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a36-1"
-msgstr "3.0~a36-1"
+msgid "3.0~a37-1"
+msgstr "3.0~a37-1"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a35-1\n"
-"POT-Creation-Date: 2012-07-18 23:56+0300\n"
+"Project-Id-Version: live-boot 3.0~a37-1\n"
+"POT-Creation-Date: 2012-07-25 17:21+0300\n"
"PO-Revision-Date: 2012-06-07 19:11+0200\n"
"Last-Translator: Carlos Zuferri «chals» <chals@altorricon.com>\n"
"Language-Team: none\n"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "2012-07-18"
-msgstr "18.07.2012"
+msgid "2012-07-25"
+msgstr "25.07.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a36-1"
-msgstr "3.0~a36-1"
+msgid "3.0~a37-1"
+msgstr "3.0~a37-1"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
msgid ""
msgstr ""
"Project-Id-Version: live-boot VERSION\n"
-"POT-Creation-Date: 2012-07-18 23:56+0300\n"
+"POT-Creation-Date: 2012-07-25 17:21+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "2012-07-18"
+msgid "2012-07-25"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a36-1"
+msgid "3.0~a37-1"
msgstr ""
#. type: TH
msgid ""
msgstr ""
"Project-Id-Version: live-boot VERSION\n"
-"POT-Creation-Date: 2012-07-18 23:56+0300\n"
+"POT-Creation-Date: 2012-07-25 17:21+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "2012-07-18"
+msgid "2012-07-25"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a36-1"
+msgid "3.0~a37-1"
msgstr ""
#. type: TH
+++ /dev/null
-#!/bin/sh
-
-#set -e
-
-Cmdline ()
-{
- for _PARAMETER in ${_CMDLINE}
- do
- case "${_PARAMETER}" in
- live-boot.read-only|read-only)
- LIVE_READ_ONLY="true"
- ;;
-
- live-boot.swapon=*|swapon=*)
- LIVE_SWAPON="true"
- LIVE_SWAPON_DEVICES="${_PARAMETER#*swapon=}"
- ;;
-
- live-boot.swapon|swapon)
- LIVE_SWAPON="true"
- ;;
-
- live-boot.verify-checksums|verify-checksums)
- LIVE_VERIFY_CHECKSUMS="true"
- ;;
-
- # Special options
- live-boot.debug|debug)
- LIVE_DEBUG="true"
- ;;
- esac
- done
-}
--- /dev/null
+#!/bin/sh
+
+#set -e
+
+Debug ()
+{
+ for _PARAMETER in ${_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ live-boot.debug|debug)
+ LIVE_DEBUG="true"
+ ;;
+ esac
+ done
+
+ if [ "${LIVE_DEBUG}" != "true" ]
+ then
+ return 0
+ fi
+
+ set -x
+}
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
+
+ if [ "${LIVE_READ_ONLY}" != "true" ]
+ then
+ return 0
+ fi
+
# 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
Verify_checksums ()
{
+ for _PARAMETER in ${_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ live-boot.verify-checksums|verify-checksums)
+ LIVE_VERIFY_CHECKSUMS="true"
+ ;;
+ esac
+ done
+
+ if [ "${LIVE_VERIFY_CHECKSUMS}" != "true" ]
+ then
+ return 0
+ fi
+
_MOUNTPOINT="${1}"
_DIGESTS="sha512 sha384 sha256 sha224 sha1 md5"
#set -e
-Swapon ()
+Swap ()
{
- if [ "${LIVE_SWAPON}" != "true" ]
+ 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
+
+ if [ "${LIVE_SWAP}" != "true" ]
then
return 0
fi
- LIVE_SWAPON_DEVICES="${LIVE_SWAPON_DEVICES:-/dev/sd* /dev/vd*}"
+ LIVE_SWAP_DEVICES="${LIVE_SWAP_DEVICES:-/dev/sd* /dev/vd*}"
if [ -e /run ]
then
_FSTAB="/root/etc/fstab"
fi
- for _DEVICE in $(echo ${LIVE_SWAPON_DEVICES} | sed -e 's|,| |g')
+ for _DEVICE in $(echo ${LIVE_SWAP_DEVICES} | sed -e 's|,| |g')
do
if [ ! -b "${_DEVICE}" ]
then
. /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
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
Fstab
Netbase
- case "${LIVE_SWAPON}" in
- true)
- Swapon
- ;;
- esac
+ Swap
case "${UNIONFS}" in
unionfs-fuse)
local 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
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=*)
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