# Handling live-boot
-if [ ! -e /usr/share/live-boot ]
+if [ ! -e /lib/live/boot ]
then
echo "W: live-boot-initramfs-tools (backend) installed without live-boot,"
echo "W: this initramfs will *NOT* have live support."
mkdir -p "${DESTDIR}/lib/live"
cp -a /lib/live/boot.sh /lib/live/boot "${DESTDIR}/lib/live"
-# Directories
-mkdir -p "${DESTDIR}"/lib/live-boot
-
# klibc dependencies
for FILE in /lib/libacl* /lib/libblkid* /lib/libuuid* /lib/libdevmapper* /lib/libattr*
do
if [ -e /lib/live/boot.sh ]
then
- /lib/live/boot.sh ${@}
+ . /lib/live/boot.sh
fi
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH LIVE\-BOOT 7 13.06.2012 3.0~a32\-1 "Debian Live Project"
+.TH LIVE\-BOOT 7 27.06.2012 3.0~a34\-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 13.06.2012 3.0~a32\-1 "Debian Live Project"
+.TH LIVE\-BOOT conf 27.06.2012 3.0~a34\-1 "Debian Live Project"
.SH NAME
\fBlive\-persistence.conf\fP \- Configuration file for persistence media in
-.TH LIVE\-BOOT 7 2012\-06\-13 3.0~a32-1 "Debian Live Project"
+.TH LIVE\-BOOT 7 2012\-06\-27 3.0~a34-1 "Debian Live Project"
.SH NAME
\fBlive\-boot\fR \- System Boot Scripts
-.TH LIVE\-BOOT conf 2012\-06\-13 3.0~a32-1 "Debian Live Project"
+.TH LIVE\-BOOT conf 2012\-06\-27 3.0~a34-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 13.06.2012 3.0~a32\-1 "Proyecto Debian Live"
+.TH LIVE\-BOOT 7 27.06.2012 3.0~a34\-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 13.06.2012 3.0~a32\-1 "Proyecto Debian Live"
+.TH LIVE\-BOOT conf 27.06.2012 3.0~a34\-1 "Proyecto Debian Live"
.SH NOMBRE
\fBlive\-persistence.conf\fP \- Fichero para configurar medios de almacenamiento
# German translations for live-boot package
-# (C) 2006-2012 Daniel Baumann <daniel@debian.org>
+# Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
# This file is distributed under the same license as the live-boot package.
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a33-1\n"
-"POT-Creation-Date: 2012-06-13 13:27+0300\n"
+"Project-Id-Version: live-boot 3.0~a34-1\n"
+"POT-Creation-Date: 2012-06-27 14:14+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-06-13"
-msgstr "13.06.2012"
+msgid "2012-06-27"
+msgstr "27.06.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a32-1"
+msgid "3.0~a34-1"
msgstr ""
#. type: TH
# German translations for live-boot package
-# (C) 2006-2012 Daniel Baumann <daniel@debian.org>
+# Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
# This file is distributed under the same license as the live-boot package.
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a33-1\n"
-"POT-Creation-Date: 2012-06-13 13:27+0300\n"
+"Project-Id-Version: live-boot 3.0~a34-1\n"
+"POT-Creation-Date: 2012-06-27 14:14+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-06-13"
-msgstr "13.06.2012"
+msgid "2012-06-27"
+msgstr "27.06.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a32-1"
+msgid "3.0~a34-1"
msgstr ""
#. type: TH
# Spanish translations for live-boot package
-# (C) 2012 Carlos Zuferri «chals» <chals@altorricon.com>
+# Copyright (C) 2012 Carlos Zuferri «chals» <chals@altorricon.com>
# This file is distributed under the same license as the live-boot package.
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a33-1\n"
-"POT-Creation-Date: 2012-06-13 13:27+0300\n"
+"Project-Id-Version: live-boot 3.0~a34-1\n"
+"POT-Creation-Date: 2012-06-27 14:14+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-06-13"
-msgstr "13.06.2012"
+msgid "2012-06-27"
+msgstr "27.06.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a32-1"
-msgstr "3.0~a32-1"
+msgid "3.0~a34-1"
+msgstr "3.0~a34-1"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
# Spanish translations for live-boot package
-# (C) 2012 Carlos Zuferri «chals» <chals@altorricon.com>
+# Copyright (C) 2012 Carlos Zuferri «chals» <chals@altorricon.com>
# This file is distributed under the same license as the live-boot package.
#
msgid ""
msgstr ""
-"Project-Id-Version: live-boot 3.0~a33-1\n"
-"POT-Creation-Date: 2012-06-13 13:27+0300\n"
+"Project-Id-Version: live-boot 3.0~a34-1\n"
+"POT-Creation-Date: 2012-06-27 14:14+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-06-13"
-msgstr "13.06.2012"
+msgid "2012-06-27"
+msgstr "27.06.2012"
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a32-1"
-msgstr "3.0~a32-1"
+msgid "3.0~a34-1"
+msgstr "3.0~a34-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-06-13 13:27+0300\n"
+"POT-Creation-Date: 2012-06-27 14:14+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-06-13"
+msgid "2012-06-27"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a32-1"
+msgid "3.0~a34-1"
msgstr ""
#. type: TH
msgid ""
msgstr ""
"Project-Id-Version: live-boot VERSION\n"
-"POT-Creation-Date: 2012-06-13 13:27+0300\n"
+"POT-Creation-Date: 2012-06-27 14:14+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-06-13"
+msgid "2012-06-27"
msgstr ""
#. type: TH
#: en/live-boot.7:1 en/live-persistence.conf.5:1
#, no-wrap
-msgid "3.0~a32-1"
+msgid "3.0~a34-1"
msgstr ""
#. type: TH
export PERSISTENCE_STORAGE
;;
- persistence-subtext=*)
- old_root_overlay_label="${old_root_overlay_label}-${_PARAMETER#persistence-subtext=}"
- old_home_overlay_label="${old_home_overlay_label}-${_PARAMETER#persistence-subtext=}"
- custom_overlay_label="${custom_overlay_label}-${_PARAMETER#persistence-subtext=}"
+ persistence-label=*)
+ old_root_overlay_label="${_PARAMETER#persistence-label=*}"
+ old_home_overlay_label="${_PARAMETER#persistence-label=*}"
+ custom_overlay_label="${_PARAMETER#persistence-label=*}"
;;
nopersistence)
rootmnt="${2}"
mac="${3}"
-
if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" ||
match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext2" ||
match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext3" ||
eval export "${STRING}"="${VALUE}"
}
-is_in_list_separator_helper () {
+is_in_list_separator_helper ()
+{
local sep=${1}
shift
local element=${1}
echo ${list} | grep -qe "^\(.*${sep}\)\?${element}\(${sep}.*\)\?$"
}
-is_in_space_sep_list () {
+is_in_space_sep_list ()
+{
local element=${1}
shift
is_in_list_separator_helper "[[:space:]]" "${element}" "${*}"
}
-is_in_comma_sep_list () {
+is_in_comma_sep_list ()
+{
local element=${1}
shift
is_in_list_separator_helper "," "${element}" "${*}"
grep -m1 "^${device} " /proc/mounts | cut -f2 -d ' '
}
-trim_path () {
- # remove all unnecessary /:s in the path, including last one (except
- # if path is just "/")
- echo ${1} | sed 's|//\+|/|g' | sed 's|^\(.*[^/]\)/$|\1|'
+trim_path ()
+{
+ # remove all unnecessary /:s in the path, including last one (except
+ # if path is just "/")
+ echo ${1} | sed 's|//\+|/|g' | sed 's|^\(.*[^/]\)/$|\1|'
}
what_is_mounted_on ()
return 0
}
-close_persistence_media () {
+close_persistence_media ()
+{
local device=${1}
local backing="$(where_is_mounted ${device})"
# in order to probe any filesystem it contains, like we do
# below. activate_custom_mounts() also depends on that any luks
# device already has been opened.
- if is_in_comma_sep_list luks ${PERSISTENCE_ENCRYPTION} && \
- is_luks_partition ${dev}
+ if is_in_comma_sep_list luks ${PERSISTENCE_ENCRYPTION} && is_luks_partition ${dev}
then
if luks_device=$(open_luks_device "${dev}")
then
fi
# Close luks device if it isn't used
- if [ -z "${result}" ] && [ -n "${luks_device}" ] && \
- is_active_luks_mapping "${luks_device}"
+ if [ -z "${result}" ] && [ -n "${luks_device}" ] && is_active_luks_mapping "${luks_device}"
then
/sbin/cryptsetup luksClose "${luks_device}"
fi
/sbin/cryptsetup status "${device}" 1>/dev/null 2>&1
}
-get_luks_backing_device () {
+get_luks_backing_device ()
+{
device=${1}
cryptsetup status ${device} 2> /dev/null | \
awk '{if ($1 == "device:") print $2}'
return
fi
- find "${src_dir}" -mindepth 1 -maxdepth 1 | while read src; do
+ find "${src_dir}" -mindepth 1 -maxdepth 1 | \
+ while read src
+ do
local dest="${dest_dir}$(basename "${src}")"
if [ -d "${src}" ]
then
local unionro1="${3}" # first underlying read-only branch (optional)
local unionro2="${4}" # second underlying read-only branch (optional)
- if [ "${UNIONTYPE}" = "aufs" ]
- then
- rw_opt="rw"
- ro_opt="rr+wh"
- noxino_opt="noxino"
- elif [ "${UNIONTYPE}" = "unionfs-fuse" ]
- then
- rw_opt="RW"
- ro_opt="RO"
- else
- rw_opt="rw"
- ro_opt="ro"
- fi
+ case "${UNIONTYPE}" in
+ aufs)
+ rw_opt="rw"
+ ro_opt="rr+wh"
+ noxino_opt="noxino"
+ ;;
+
+ unionfs-fuse)
+ rw_opt="RW"
+ ro_opt="RO"
+ ;;
+
+ *)
+ rw_opt="rw"
+ ro_opt="ro"
+ ;;
+ esac
case "${UNIONTYPE}" in
unionfs-fuse)
mountroot ()
{
- if [ -x /scripts/local-top/cryptroot ]; then
- /scripts/local-top/cryptroot
+ if [ -x /scripts/local-top/cryptroot ]
+ then
+ /scripts/local-top/cryptroot
fi
exec 6>&1
fi
- if [ -n "${ROOT_PID}" ] ; then
+ if [ -n "${ROOT_PID}" ]
+ then
echo "${ROOT_PID}" > "${rootmnt}"/live/root.pid
fi
# unionfs-fuse needs /dev to be bind-mounted for the duration of
# live-bottom; udev's init script will take care of things after that
- if [ "${UNIONTYPE}" = unionfs-fuse ]
- then
- mount -n -o bind /dev "${rootmnt}/dev"
- fi
+ case "${UNIONTYPE}" in
+ unionfs-fuse)
+ mount -n -o bind /dev "${rootmnt}/dev"
+ ;;
+ esac
# Move to the new root filesystem so that programs there can get at it.
if [ ! -d /root/live/image ]
;;
esac
- if [ "${UNIONFS}" = unionfs-fuse ]
- then
- umount "${rootmnt}/dev"
- fi
+ case "${UNIONFS}" in
+ unionfs-fuse)
+ umount "${rootmnt}/dev"
+ ;;
+ esac
exec 1>&6 6>&-
exec 2>&7 7>&-
kill ${tailpid}
- [ -w "${rootmnt}/var/log/" ] && mkdir -p /var/log/live && cp boot.log "${rootmnt}/var/log/live" 2>/dev/null
+ [ -w "${rootmnt}/var/log/" ] && mkdir -p "${rootmnt}/var/log/live" && cp boot.log "${rootmnt}/var/log/live" 2>/dev/null
}
IFFILE="/root/etc/network/interfaces"
- if [ "${STATICIP}" = "frommedia" -a -e "${IFFILE}" ]
+ if [ "${STATICIP}" = "frommedia" ] && [ -e "${IFFILE}" ]
then
# will use existent /etc/network/interfaces
log_end_msg
udevadm trigger
udevadm settle
- if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]
+ if [ -z "${NETBOOT}" ] && [ -n "${STATICIP}" ] && [ "${STATICIP}" != "frommedia" ]
then
- parsed=$(echo "${STATICIP}" | sed -e 's/,/ /g')
+ parsed=$(echo "${STATICIP}" | sed -e 's|,| |g')
for ifline in ${parsed}
do
[ -n "$ETHDEV_TIMEOUT" ] || ETHDEV_TIMEOUT=15
echo "Using timeout of $ETHDEV_TIMEOUT seconds for network configuration."
- if [ -z "${NETBOOT}" ] && [ -z "${FETCH}" ] && \
- [ -z "${HTTPFS}" ] && [ -z "${FTPFS}" ]
+ if [ -z "${NETBOOT}" ] && [ -z "${FETCH}" ] && [ -z "${HTTPFS}" ] && [ -z "${FTPFS}" ]
then
+ # support for Syslinux IPAPPEND parameter
+ # it sets the BOOTIF variable on the kernel parameter
+ if [ -n "${BOOTIF}" ]
+ then
+ # pxelinux sets BOOTIF to a value based on the mac address of the
+ # network card used to PXE boot, so use this value for DEVICE rather
+ # than a hard-coded device name from initramfs.conf. this facilitates
+ # network booting when machines may have multiple network cards.
+ # pxelinux sets BOOTIF to 01-$mac_address
+
+ # strip off the leading "01-", which isn't part of the mac
+ # address
+ temp_mac=${BOOTIF#*-}
+
+ # convert to typical mac address format by replacing "-" with ":"
+ bootif_mac=""
+ IFS='-'
+ for x in $temp_mac
+ do
+ if [ -z "$bootif_mac" ]
+ then
+ bootif_mac="$x"
+ else
+ bootif_mac="$bootif_mac:$x"
+ fi
+ done
+ unset IFS
- # support for Syslinux IPAPPEND parameter
- # it sets the BOOTIF variable on the kernel parameter
+ # look for devices with matching mac address, and set DEVICE to
+ # appropriate value if match is found.
- if [ -n "${BOOTIF}" ]
- then
- # pxelinux sets BOOTIF to a value based on the mac address of the
- # network card used to PXE boot, so use this value for DEVICE rather
- # than a hard-coded device name from initramfs.conf. this facilitates
- # network booting when machines may have multiple network cards.
- # pxelinux sets BOOTIF to 01-$mac_address
-
- # strip off the leading "01-", which isn't part of the mac
- # address
- temp_mac=${BOOTIF#*-}
-
- # convert to typical mac address format by replacing "-" with ":"
- bootif_mac=""
- IFS='-'
- for x in $temp_mac
+ for device in /sys/class/net/*
+ do
+ if [ -f "$device/address" ]
+ then
+ current_mac=$(cat "$device/address")
+
+ if [ "$bootif_mac" = "$current_mac" ]
+ then
+ DEVICE=${device##*/}
+ break
+ fi
+ fi
+ done
+ fi
+
+ # if ethdevice was not specified on the kernel command line
+ # make sure we try to get a working network configuration
+ # for *every* present network device (except for loopback of course)
+ if [ -z "$ETHDEVICE" ]
+ then
+ echo "If you want to boot from a specific device use bootoption ethdevice=..."
+ for device in /sys/class/net/*
+ do
+ dev=${device##*/}
+ if [ "$dev" != "lo" ]
+ then
+ ETHDEVICE="$ETHDEVICE $dev"
+ fi
+ done
+ fi
+
+ # split args of ethdevice=eth0,eth1 into "eth0 eth1"
+ for device in $(echo $ETHDEVICE | sed 's/,/ /g')
do
- if [ -z "$bootif_mac" ]
- then
- bootif_mac="$x"
- else
- bootif_mac="$bootif_mac:$x"
- fi
+ devlist="$devlist $device"
done
- unset IFS
-
- # look for devices with matching mac address, and set DEVICE to
- # appropriate value if match is found.
- for device in /sys/class/net/*
+ # this is tricky (and ugly) because ipconfig sometimes just hangs/runs into
+ # an endless loop; if execution fails give it two further tries, that's
+ # why we use '$devlist $devlist $devlist' for the other for loop
+ for dev in $devlist $devlist $devlist
do
- if [ -f "$device/address" ]
+ echo "Executing ipconfig -t $ETHDEV_TIMEOUT $dev"
+ ipconfig -t "$ETHDEV_TIMEOUT" $dev | tee -a /netboot.config &
+ jobid=$!
+ sleep "$ETHDEV_TIMEOUT" ; sleep 1
+ if [ -r /proc/"$jobid"/status ]
then
- current_mac=$(cat "$device/address")
-
- if [ "$bootif_mac" = "$current_mac" ]
- then
- DEVICE=${device##*/}
- break
- fi
+ echo "Killing job $jobid for device $dev as ipconfig ran into recursion..."
+ kill -9 $jobid
fi
- done
- fi
- # if ethdevice was not specified on the kernel command line
- # make sure we try to get a working network configuration
- # for *every* present network device (except for loopback of course)
- if [ -z "$ETHDEVICE" ] ; then
- echo "If you want to boot from a specific device use bootoption ethdevice=..."
- for device in /sys/class/net/*; do
- dev=${device##*/} ;
- if [ "$dev" != "lo" ] ; then
- ETHDEVICE="$ETHDEVICE $dev"
+ # if configuration of device worked we should have an assigned
+ # IP address, if so let's use the device as $DEVICE for later usage.
+ # simple and primitive approach which seems to work fine
+ if ifconfig $dev | grep -q 'inet.*addr:'
+ then
+ export DEVICE="$dev"
+ break
fi
done
- fi
-
- # split args of ethdevice=eth0,eth1 into "eth0 eth1"
- for device in $(echo $ETHDEVICE | sed 's/,/ /g') ; do
- devlist="$devlist $device"
- done
-
- # this is tricky (and ugly) because ipconfig sometimes just hangs/runs into
- # an endless loop; if execution fails give it two further tries, that's
- # why we use '$devlist $devlist $devlist' for the other for loop
- for dev in $devlist $devlist $devlist ; do
- echo "Executing ipconfig -t $ETHDEV_TIMEOUT $dev"
- ipconfig -t "$ETHDEV_TIMEOUT" $dev | tee -a /netboot.config &
- jobid=$!
- sleep "$ETHDEV_TIMEOUT" ; sleep 1
- if [ -r /proc/"$jobid"/status ] ; then
- echo "Killing job $jobid for device $dev as ipconfig ran into recursion..."
- kill -9 $jobid
- fi
-
- # if configuration of device worked we should have an assigned
- # IP address, if so let's use the device as $DEVICE for later usage.
- # simple and primitive approach which seems to work fine
- if ifconfig $dev | grep -q 'inet.*addr:' ; then
- export DEVICE="$dev"
- break
- fi
- done
-
else
for interface in ${DEVICE}; do
ipconfig -t "$ETHDEV_TIMEOUT" ${interface} | tee /netboot-${interface}.config
done
fi
- for interface in ${DEVICE}; do
+ for interface in ${DEVICE}
+ do
# source relevant ipconfig output
OLDHOSTNAME=${HOSTNAME}
[ -e /tmp/net-${interface}.conf ] && . /tmp/net-${interface}.conf
;;
esac
- if [ "${UNIONTYPE}" = unionfs-fuse ]
- then
- modprobe fuse
- fi
+ case "${UNIONTYPE}" in
+ unionfs-fuse)
+ modprobe fuse
+ ;;
+ esac
# run-init can't deal with images in a subdir, but we're going to
# move all of these away before it runs anyway. No, we're not,
fi
fstype=$(get_fstype "${backdev}")
- if [ "${fstype}" = "unknown" ]
- then
- panic "Unknown file system type on ${backdev} (${image})"
- fi
-
- if [ -z "${fstype}" ]
- then
- fstype="${imagename##*.}"
- log_warning_msg "Unknown file system type on ${backdev} (${image}), assuming ${fstype}."
- fi
+ case "${fstype}" in
+ unknown)
+ panic "Unknown file system type on ${backdev} (${image})"
+ ;;
+
+ "")
+ fstype="${imagename##*.}"
+ log_warning_msg "Unknown file system type on ${backdev} (${image}), assuming ${fstype}."
+ ;;
+ esac
+
+ case "${UNIONTYPE}" in
+ unionmount)
+ mpoint="${rootmnt}"
+ rofslist="${rootmnt} ${rofslist}"
+ ;;
+
+ *)
+ mpoint="${croot}/${imagename}"
+ rofslist="${mpoint} ${rofslist}"
+ ;;
+ esac
- if [ "${UNIONTYPE}" != "unionmount" ]
- then
- mpoint="${croot}/${imagename}"
- rofslist="${mpoint} ${rofslist}"
- else
- mpoint="${rootmnt}"
- rofslist="${rootmnt} ${rofslist}"
- fi
mkdir -p "${mpoint}"
log_begin_msg "Mounting \"${image}\" on \"${mpoint}\" via \"${backdev}\""
mount -t "${fstype}" -o ro,noatime "${backdev}" "${mpoint}" || panic "Can not mount ${backdev} (${image}) on ${mpoint}"
removable)
whitelistdev="$(removable_dev)"
;;
+
removable-usb)
whitelistdev="$(removable_usb_dev)"
;;
+
*)
whitelistdev=""
;;
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}"
;;
+
${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}"
elif [ -n "${NFS_COW}" ] && [ -z "${NOPERSISTENCE}" ]
then
# check if there are any nfs options
- if echo ${NFS_COW}|grep -q ','
+ if echo ${NFS_COW} | grep -q ','
then
nfs_cow_opts="-o nolock,$(echo ${NFS_COW}|cut -d, -f2-)"
nfs_cow=$(echo ${NFS_COW}|cut -d, -f1)
mac="$(get_mac)"
if [ -n "${mac}" ]
then
- cowdevice=$(echo ${nfs_cow}|sed "s/client_mac_address/${mac}/")
+ cowdevice=$(echo ${nfs_cow} | sed "s/client_mac_address/${mac}/")
cow_fstype="nfs"
else
panic "unable to determine mac address"
unionfs-fuse)
mount -o bind "${d}" "${live_rofs}"
;;
+
*)
mount -o move "${d}" "${live_rofs}"
;;
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); do
+ for ARGUMENT in $(cat /proc/cmdline)
+ do
case "${ARGUMENT}" in
netboot=*)
NETBOOT="${ARGUMENT#netboot=}"
esac
done
- if [ "$bootconf" != "BOOT=nfs" ] &&
- [ "$NETBOOT" = "" ] &&
- [ "$FETCH" = "" ] &&
- [ "$FTPFS" = "" ] &&
- [ "$HTTPFS" = "" ]
+ if [ "$bootconf" != "BOOT=nfs" ] && [ -z "$NETBOOT" ] && [ -z "$FETCH" ] && [ -z "$FTPFS" ] && [ -z "$HTTPFS" ]
then
- # Not a net boot : nothing to do
- return
+ # Not a net boot : nothing to do
+ return
fi
# we want to do some basic IP
# Available Ethernet interfaces ?
l_interfaces=""
echo "Waiting for ethernet card(s) up... If this fails, maybe the ethernet card is not supported by the kernel `uname -r`?"
- while [ -z "$l_interfaces" ]; do
- l_interfaces="$(cd /sys/class/net/ && ls -d eth* 2>/dev/null)"
+ while [ -z "$l_interfaces" ]
+ do
+ l_interfaces="$(cd /sys/class/net/ && ls -d eth* 2>/dev/null)"
done
- if [ $(echo $l_interfaces | wc -w) -lt 2 ]; then
+ if [ $(echo $l_interfaces | wc -w) -lt 2 ]
+ then
# only one interface : no choice
echo "DEVICE=$l_interfaces" >> /conf/param.conf
return
fi
# If user force to use specific device, write it
- for ARGUMENT in $(cat /proc/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."
- return
- ;;
- esac
+ for ARGUMENT in $(cat /proc/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."
+ return
+ ;;
+ esac
done
found_eth_dev=""
- while true; do
+ while true
+ do
echo -n "Looking for a connected Ethernet interface ..."
- for interface in $l_interfaces; do
+ for interface in $l_interfaces
+ do
# ATTR{carrier} is not set if this is not done
echo -n " $interface ?"
ipconfig -c none -d $interface -t 1 >/dev/null 2>&1
echo ''
- for step in 1 2 3 4 5; do
- for interface in $l_interfaces; do
+ for step in 1 2 3 4 5
+ do
+ for interface in $l_interfaces
+ do
carrier=$(cat /sys/class/net/$interface/carrier \
2>/dev/null)
# link detected
- if [ "$carrier" = 1 ]; then
- echo "Connected $interface found"
- # inform initrd's init script :
- found_eth_dev="$found_eth_dev $interface"
- fi
+
+ case "${carrier}" in
+ 1)
+ echo "Connected $interface found"
+ # inform initrd's init script :
+ found_eth_dev="$found_eth_dev $interface"
+ ;;
+ esac
done
- if [ -n "$found_eth_dev" ]; then
+ if [ -n "$found_eth_dev" ]
+ then
echo "DEVICE='$found_eth_dev'" >> /conf/param.conf
return
else