Sync with Debian (WIP) mika/debian_sync
authorMichael Prokop <mika@grml.org>
Wed, 27 Jan 2016 02:00:43 +0000 (03:00 +0100)
committerMichael Prokop <mika@grml.org>
Wed, 27 Jan 2016 02:34:31 +0000 (03:34 +0100)
15 files changed:
backend/initramfs-tools/kms.hook [changed mode: 0644->0755]
components/0020-read-only
components/9990-cmdline-old
components/9990-main.sh
components/9990-misc-helpers.sh
components/9990-mount-http.sh
components/9990-netbase.sh
components/9990-networking.sh
debian/rules
manpages/en/live-boot.7
manpages/es/live-boot.es.7
manpages/ja/live-boot.ja.7
manpages/po/es/live-boot.7.po
manpages/po/ja/live-boot.7.po
manpages/pot/live-boot.7.pot

old mode 100644 (file)
new mode 100755 (executable)
index a2c86ef..f56b8cf 100755 (executable)
@@ -54,7 +54,7 @@ Read_only ()
                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
 
index 975ade2..eb51ba5 100755 (executable)
@@ -45,8 +45,9 @@ Cmdline_old ()
                                ;;
 
                        ethdevice=*)
-                               ETHDEVICE="${_PARAMETER#ethdevice=}"
-                               export ETHDEVICE
+                               DEVICE="${_PARAMETER#ethdevice=}"
+                               ETHDEVICE="${DEVICE}"
+                               export DEVICE ETHDEVICE
                                ;;
 
                        ethdevice-timeout=*)
@@ -92,20 +93,19 @@ Cmdline_old ()
                                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
                                ;;
 
index 0c0bd68..0ae9996 100755 (executable)
@@ -192,8 +192,7 @@ Live ()
        Netbase
 
        Swap
-
-       Grml_Networking
+       #Grml_Networking
 
        exec 1>&6 6>&-
        exec 2>&7 7>&-
index 3355d60..fe0548b 100755 (executable)
@@ -1333,15 +1333,14 @@ do_union ()
                        ;;
 
                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
index d0f4900..2e68fe6 100755 (executable)
@@ -25,6 +25,9 @@ do_httpmount ()
                                                mount -t ramfs ram "${mountpoint}"
                                                mkdir -p "${dest}"
                                        fi
+                                       case "${url}" in
+                                               *:///*) url="${url%%:///*}://${ROOTSERVER}/${url##*:///}" ;;
+                                       esac
                                        if [ "${webfile}" = "FETCH" ]
                                        then
                                                case "$url" in
index df8d080..70f97b8 100755 (executable)
@@ -49,6 +49,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}
@@ -66,6 +67,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}" ]
index d5ed0fe..9613364 100755 (executable)
@@ -44,7 +44,7 @@ Device_from_bootif ()
 
                                if [ "$bootif_mac" = "$current_mac" ]
                                then
-                                       ETHDEVICE="${device##*/},$ETHDEVICE" # use ethdevice
+                                       DEVICE=${device##*/}
                                        break
                                fi
                        fi
@@ -52,24 +52,6 @@ Device_from_bootif ()
        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
@@ -80,20 +62,8 @@ do_netsetup ()
        [ -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
 
@@ -103,7 +73,14 @@ do_netsetup ()
                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"
@@ -112,29 +89,42 @@ do_netsetup ()
                        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
index 1d71477..05aed7e 100755 (executable)
@@ -1,9 +1,5 @@
 #!/usr/bin/make -f
 
-build:
-       # regular build.
-       dh build
-
 %:
        dh ${@} --parallel
 
@@ -12,23 +8,13 @@ override_dh_auto_install:
 
        # 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 .'
index 76e20a7..3d5624d 100644 (file)
@@ -132,8 +132,8 @@ If you boot with the normal quiet parameter, live\-boot hides most messages of i
 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
index 7e69103..61a1b9a 100644 (file)
@@ -248,10 +248,10 @@ Al añadir este parámetro, live\-boot trata de copiar los medios de sólo
 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)"
index 3d20f40..ec0a519 100644 (file)
@@ -183,9 +183,9 @@ live\-boot
 .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 "ファイル (古い情報)"
index a2d2264..d2c8682 100644 (file)
@@ -901,18 +901,18 @@ msgstr ""
 #. 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
index 1f2818b..4078ec9 100644 (file)
@@ -885,17 +885,17 @@ msgstr ""
 #. 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
index a965f40..32ccf0b 100644 (file)
@@ -735,15 +735,15 @@ msgstr ""
 #. 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