esac
done
- if grep -qe persistence /proc/cmdline
+ if grep -qw persistence /proc/cmdline
then
printf " * Persistence mode enabled, searching for persistency related devices to unlock\n" >/dev/console
;;
ethdevice=*)
- ETHDEVICE="${_PARAMETER#ethdevice=}"
- export ETHDEVICE
+ DEVICE="${_PARAMETER#ethdevice=}"
+ ETHDEVICE="${DEVICE}"
+ export DEVICE ETHDEVICE
;;
ethdevice-timeout=*)
export FROMISO
;;
- ignore_bootid)
- IGNORE_BOOTID="Yes"
- export IGNORE_BOOTID
- ;;
-
ignore_uuid)
IGNORE_UUID="true"
export IGNORE_UUID
;;
ip=*)
- # copy complete ip=args into staticip, and
- # keep multiple uses.
- STATICIP="${STATICIP} ${_PARAMETER}"
+ STATICIP="${_PARAMETER#ip=}"
+
+ if [ -z "${STATICIP}" ]
+ then
+ STATICIP="frommedia"
+ fi
+
export STATICIP
;;
Netbase
Swap
-
- Grml_Networking
+ #Grml_Networking
exec 1>&6 6>&-
exec 2>&7 7>&-
;;
overlay)
- # XXX: can multiple unionro be used? (overlay only handles two dirs, but perhaps they can be chained?)
- # XXX: and can unionro be optional? i.e. can overlay skip lowerdir?
- if echo ${unionro} | grep -q " "
- then
- panic "Multiple lower filesystems are currently not supported with overlay (unionro = ${unionro})."
- elif [ -z "${unionro}" ]
+ # XXX: can unionro be optional? i.e. can overlay skip lowerdir?
+ if [ -z "${unionro}" ]
then
panic "overlay needs at least one lower filesystem (read-only branch)."
fi
+ # Multiple lower layers can now be given using the the colon (":") as a
+ # separator character between the directory names.
+ unionro="$(echo ${unionro} | sed -e 's| |:|g')"
# overlayfs requires:
# + a workdir to become mounted
# + workdir and upperdir to reside under the same mount
mount -t ramfs ram "${mountpoint}"
mkdir -p "${dest}"
fi
+ case "${url}" in
+ *:///*) url="${url%%:///*}://${ROOTSERVER}/${url##*:///}" ;;
+ esac
if [ "${webfile}" = "FETCH" ]
then
case "$url" in
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}
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}" ]
if [ "$bootif_mac" = "$current_mac" ]
then
- ETHDEVICE="${device##*/},$ETHDEVICE" # use ethdevice
+ DEVICE=${device##*/}
break
fi
fi
fi
}
-get_ipconfig_para()
-{
- if [ $# != 1 ] ; then
- echo "Missin parameter for $0"
- return
- fi
- devname=$1
- for ip in ${STATICIP} ; do
- case $ip in
- *:$devname:*)
- echo $ip
- return
- ;;
- esac
- done
- echo $devname
-}
-
do_netsetup ()
{
modprobe -q af_packet # For DHCP
[ -n "$ETHDEV_TIMEOUT" ] || ETHDEV_TIMEOUT=15
echo "Using timeout of $ETHDEV_TIMEOUT seconds for network configuration."
- # Our modus operandi for getting a working network setup is this:
- # * If ip=* is set, pass that to ipconfig and be done
- # * Else, try dhcp on all devices in this order:
- # ethdevice= bootif= <all interfaces>
-
- ALLDEVICES="$(cd /sys/class/net/ && ls -1 2>/dev/null | grep -v '^lo$' )"
-
- # Turn on all interfaces before doing anything, to avoid timing problems
- # during link negotiation.
- echo "Net: Turning on all device links..."
- for device in ${ALLDEVICES}; do
- ipconfig -c none -d $device -t 1 2>/dev/null >/dev/null
- done
-
+ if [ -z "${NETBOOT}" ] && [ -z "${FETCH}" ] && [ -z "${HTTPFS}" ] && [ -z "${FTPFS}" ]
+ then
# See if we can select the device from BOOTIF
Device_from_bootif
if [ -z "$ETHDEVICE" ]
then
echo "If you want to boot from a specific device use bootoption ethdevice=..."
- ETHDEVICE="$ALLDEVICES"
+ 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"
devlist="$devlist $device"
done
- for dev in $devlist ; do
- param="$(get_ipconfig_para $dev)"
- if [ -n "$NODHCP" ] && [ "$param" = "$dev" ] ; then
- echo "Ignoring network device $dev due to nodhcp." | tee -a /boot.log
- continue
+ # 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
- echo "Executing ipconfig -t $ETHDEV_TIMEOUT $param"
- ipconfig -t "$ETHDEV_TIMEOUT" "$param" | tee -a /netboot.config
# 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
-
- IPV4ADDR="0.0.0.0"
- if [ -e "/run/net-${device}.conf" ]; then
- . /run/net-${device}.conf
+ if ifconfig $dev | grep -q 'inet.*addr:'
+ then
+ export DEVICE="$dev"
+ break
fi
- if [ "${IPV4ADDR}" != "0.0.0.0" ]; then
- export DEVICE="$dev $DEVICE"
- # break # exit loop as we just use the irst
+ done
+ else
+ for interface in ${DEVICE}; do
+ ipconfig -t "$ETHDEV_TIMEOUT" ${interface} | tee /netboot-${interface}.config
+
+ [ -e /run/net-${interface}.conf ] && . /run/net-${interface}.conf
+
+ if [ "$IPV4ADDR" != "0.0.0.0" ]
+ then
+ break
fi
done
- unset devlist
+ fi
for interface in ${DEVICE}
do
#!/usr/bin/make -f
-build:
- # regular build.
- dh build
-
%:
dh ${@} --parallel
# Removing useless files
rm -f debian/tmp/usr/share/doc/live-boot-grml/COPYING
- rm -f debian/lib/live/boot/FIXME
- # live-boot-initramfs-tools
+ # live-boot-grml-initramfs-tools
mkdir -p debian/live-boot-grml-initramfs-tools/usr/share
mv debian/tmp/usr/share/initramfs-tools debian/live-boot-grml-initramfs-tools/usr/share
- # this is needed because dpatch doesn't do file modes on diffs
- # and we can't execute this fix during build stage as new files
- # might be installed during dh_quilt_patch
- chmod a+rx debian/live-boot-grml-initramfs-tools/usr/share/initramfs-tools/scripts/*
- chmod a+rx debian/live-boot-grml-initramfs-tools/usr/share/initramfs-tools/hooks/*
-
override_dh_builddeb:
dh_builddeb -- -Zxz
override_dh_install:
dh_install --fail-missing
-
-override_dh_installinit:
- dh_installinit -p live-boot-grml --no-restart-on-upgrade --no-start --update-rcd-params='start 89 0 6 .'
Adding this parameter, live\-boot will try to copy the entire read\-only media to the specified device before mounting the root filesystem. It probably needs a lot of free space. Subsequent boots should then skip this step and just specify the "live\-media=DEVICE" boot parameter with the same DEVICE used this time.
.IP "\fBtoram\fR" 4
Adding this parameter, live\-boot will try to copy the whole read\-only media to the computer's RAM before mounting the root filesystem. This could need a lot of ram, according to the space used by the read\-only media.
-.IP "\fBunion\fR=aufs|overlay\fR" 4
-By default, live\-boot uses aufs. With this parameter, you can switch to overlay.
+.IP "\fBunion\fR=overlay|aufs\fR" 4
+By default, live\-boot uses overlay. With this parameter, you can switch to aufs.
.\" FIXME
.\" FIXME
lectura enteros en la memoria RAM del ordenador antes de montar el sistema
de ficheros raíz. Para esto puede ser necesaria mucha memoria RAM, según el
espacio utilizado por los medios de sólo lectura.
-.IP \fBunion\fP=aufs|overlay 4
+.IP \fBunion\fP=overlay|aufs 4
.\" FIXME
-Por defecto, live\-boot usa aufs. Con este parámetro, se puede cambiar a
-overlay.
+Por defecto, live\-boot usa overlay. Con este parámetro, se puede cambiar a
+aufs.
.\" FIXME
.SH "FICHEROS (antiguos)"
.IP \fBtoram\fP 4
このパラメータを追加すると、live\-boot はルートファイルシステムをマウントする前に読み取り専用メディア全体をそのコンピュータの RAM
にコピーしようとします。その読み取り専用メディアで利用している容量により、これには多くの RAM が必要となるかもしれません。
-.IP \fBunion\fP=aufs|overlay 4
+.IP \fBunion\fP=overlay|aufs 4
.\" FIXME
-デフォルトで live\-boot は aufs を利用します。このパラメータにより overlay に切り替えることができます。
+デフォルトで live\-boot は overlay を利用します。このパラメータにより aufs に切り替えることができます。
.\" FIXME
.SH "ファイル (古い情報)"
#. type: IP
#: en/live-boot.7:135
#, no-wrap
-msgid "B<union>=aufs|overlay"
-msgstr "B<union>=aufs|overlay"
+msgid "B<union>=overlay|aufs"
+msgstr "B<union>=overlay|aufs"
#. FIXME
#. type: Plain text
#: en/live-boot.7:138
msgid ""
-"By default, live-boot uses aufs. With this parameter, you can switch to "
-"overlay."
+"By default, live-boot uses overlay. With this parameter, you can switch to "
+"aufs."
msgstr ""
-"Por defecto, live-boot usa aufs. Con este parámetro, se puede cambiar a "
-"overlay."
+"Por defecto, live-boot usa overlay. Con este parámetro, se puede cambiar a "
+"aufs."
#. FIXME
#. type: SH
#. type: IP
#: en/live-boot.7:135
#, no-wrap
-msgid "B<union>=aufs|overlay"
-msgstr "B<union>=aufs|overlay"
+msgid "B<union>=overlay|aufs"
+msgstr "B<union>=overlay|aufs"
#. FIXME
#. type: Plain text
#: en/live-boot.7:138
msgid ""
-"By default, live-boot uses aufs. With this parameter, you can switch to "
-"overlay."
+"By default, live-boot uses overlay. With this parameter, you can switch to "
+"aufs."
msgstr ""
-"デフォルトで live-boot は aufs を利用します。このパラメータにより overlay に"
+"デフォルトで live-boot は overlay を利用します。このパラメータにより aufs に"
"切り替えることができます。"
#. FIXME
#. type: IP
#: en/live-boot.7:135
#, no-wrap
-msgid "B<union>=aufs|overlay"
+msgid "B<union>=overlay|aufs"
msgstr ""
#. FIXME
#. type: Plain text
#: en/live-boot.7:138
msgid ""
-"By default, live-boot uses aufs. With this parameter, you can switch to "
-"overlay."
+"By default, live-boot uses overlay. With this parameter, you can switch to "
+"aufs."
msgstr ""
#. FIXME