public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] dracut: fix various issues with newly degraded md arrays
@ 2015-03-26  4:41 NeilBrown
       [not found] ` <20150326043938.10121.34223.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: NeilBrown @ 2015-03-26  4:41 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

When an md array is newly degraded at boot it will not be assembled
until mdraid_start.sh is run.
There are a few problem with the timeout handling that causes this
not to work properly in all circumstances.
These patches fix the bug I had reported.

Thanks,
NeilBrown


---

NeilBrown (4):
      mdraid/mdraid_start.sh: tell mainloop if we make progress.
      systemd/dracut-iniqueue - continue waiting if any timeout script makes progress
      dracut-systemd/rootfs-generator.sh: always create generated files.
      crypt/parse-crypt.sh: hide encrypted devices from systemd timeout warnings.


 modules.d/90crypt/parse-crypt.sh               |    4 ++
 modules.d/90mdraid/mdraid_start.sh             |    1 
 modules.d/98dracut-systemd/dracut-initqueue.sh |    1 
 modules.d/98dracut-systemd/rootfs-generator.sh |   15 ++++---
 modules.d/99base/dracut-lib.sh                 |   53 +++++++++++++++---------
 5 files changed, 48 insertions(+), 26 deletions(-)

--
Signature

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH] Take into account lib64 dirs when detecting version, modules and params
@ 2015-03-24 13:13 Amadeusz Żołnowski
       [not found] ` <1427202794-18834-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Amadeusz Żołnowski @ 2015-03-24 13:13 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Amadeusz Żołnowski

---
 lsinitrd.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lsinitrd.sh b/lsinitrd.sh
index 4f12c2c..dda0b74 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -108,6 +108,12 @@ if ! [[ -f "$image" ]]; then
     exit 1
 fi
 
+dracutlibdirs() {
+    for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
+        echo "$d/$1"
+    done
+}
+
 extract_files()
 {
     (( ${#filenames[@]} == 1 )) && nofileinfo=1
@@ -124,7 +130,8 @@ extract_files()
 list_modules()
 {
     echo "dracut modules:"
-    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
+    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
+        $(dracutlibdirs modules.txt) 2>/dev/null
     ((ret+=$?))
 }
 
@@ -217,7 +224,8 @@ ret=0
 if (( ${#filenames[@]} > 0 )); then
     extract_files
 else
-    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
+    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
+        $(dracutlibdirs 'dracut-*') 2>/dev/null)
     ((ret+=$?))
     echo "Version: $version"
     echo
@@ -226,7 +234,8 @@ else
         echo "========================================================================"
     else
         echo -n "Arguments: "
-        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
+        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
+            $(dracutlibdirs build-parameter.txt) 2>/dev/null
         echo
         list_modules
         list_files
-- 
2.3.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH 4/4] 95fcoe-uefi: Test for EFI firmware
@ 2015-03-23 16:12 Thomas Renninger
       [not found] ` <1427127138-12932-5-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Renninger @ 2015-03-23 16:12 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
	Hannes Reinecke

From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>

The fcoe-uefi module should test for EFI firmware when called
in 'hostonly' mode; of no EFI firmware is found then the module
doesn't need to be included.

References: bnc#882412

Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
 modules.d/95fcoe-uefi/module-setup.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules.d/95fcoe-uefi/module-setup.sh b/modules.d/95fcoe-uefi/module-setup.sh
index 8b8c810..5d8477c 100755
--- a/modules.d/95fcoe-uefi/module-setup.sh
+++ b/modules.d/95fcoe-uefi/module-setup.sh
@@ -2,6 +2,9 @@
 
 # called by dracut
 check() {
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
+        [ -d /sys/firmware/efi ] || return 255
+    }
     require_binaries dcbtool fipvlan lldpad ip readlink || return 1
     return 0
 }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH] Add support for ethernet point-to-point connections configured via DHCP
@ 2015-03-05 11:07 Gerd von Egidy
  2015-03-26 15:38 ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot
  0 siblings, 1 reply; 14+ messages in thread
From: Gerd von Egidy @ 2015-03-05 11:07 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

When current dracut receives an ip with netmask of 255.255.255.255 via DHCP,
setting the also supplied default gateway fails (because it is obviously not
within the netmask).

The setup with a netmask of /32 is quite common in colocation datacenters
where you don't want the machines of two different customers to directly talk
to each other. At least two of the biggest colocation providers in Germany
(1&1 and Strato) do it that way. NetworkManager supports this kind of setup
and the dhclient-scripts of several distributions too.

In this patch I have implemented a simple approach very similar to what is
found in Debian. The dhclient-script from Fedora uses a more sophisticated
approach, but that relies on the ipcalc utility which would introduce a
dependency on Fedora-initscripts for dracut.

Signed-off-by: Gerd von Egidy <gerd.von.egidy-XXsH3GEs1jrby3iVrkZq2A@public.gmane.org>
---
 modules.d/40network/dhclient-script.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
index 50f1985..98352ec 100755
--- a/modules.d/40network/dhclient-script.sh
+++ b/modules.d/40network/dhclient-script.sh
@@ -43,7 +43,13 @@ setup_interface() {
         valid_lft ${lease_time} preferred_lft ${lease_time} \
         dev $netif
 
-    [ -n "$gw" ] && echo ip route replace default via $gw dev $netif > /tmp/net.$netif.gw
+    if [ -n "$gw" ] ; then
+        if [ "$mask" == "255.255.255.255" ] ; then
+            # point-to-point connection => set explicit route to gateway
+            echo ip route add $gw dev $netif > /tmp/net.$netif.gw
+        fi
+        echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw
+    fi
 
     [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
     if  [ -n "$namesrv" ] ; then
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH] crypt: don't use systemd for crypto handling
@ 2015-03-04  7:49 Jan Synacek
       [not found] ` <1425455385-28495-1-git-send-email-jsynacek-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Synacek @ 2015-03-04  7:49 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA
  Cc: harald-H+wXaHxf7aLQT0dZR+AlfA, jsynacek-H+wXaHxf7aLQT0dZR+AlfA

There already is the code necessary to handle an encrypted root
device. The "rd.luks.key" option is not handled the same way in systemd
as it is in dracut, so some setups (like having the keyfile on a
separate device) don't work.
---
 modules.d/90crypt/crypt-run-generator.sh | 31 ----------------------
 modules.d/90crypt/module-setup.sh        |  9 -------
 modules.d/90crypt/parse-crypt.sh         | 44 +++++++++-----------------------
 3 files changed, 12 insertions(+), 72 deletions(-)
 delete mode 100755 modules.d/90crypt/crypt-run-generator.sh

diff --git a/modules.d/90crypt/crypt-run-generator.sh b/modules.d/90crypt/crypt-run-generator.sh
deleted file mode 100755
index 3c5d7b1..0000000
--- a/modules.d/90crypt/crypt-run-generator.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-. /lib/dracut-lib.sh
-type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
-
-dev=$1
-luks=$2
-
-crypttab_contains "$luks" && exit 0
-
-allowdiscards="-"
-
-# parse for allow-discards
-if strstr "$(cryptsetup --help)" "allow-discards"; then
-    if discarduuids=$(getargs "rd.luks.allow-discards"); then
-        discarduuids=$(str_replace "$discarduuids" 'luks-' '')
-        if strstr " $discarduuids " " ${luks##luks-}"; then
-            allowdiscards="allow-discards"
-        fi
-    elif getargbool 0 rd.luks.allow-discards; then
-        allowdiscards="allow-discards"
-    fi
-fi
-
-echo "$luks $dev - timeout=0,$allowdiscards" >> /etc/crypttab
-
-if command -v systemctl >/dev/null; then
-    systemctl daemon-reload
-    systemctl start cryptsetup.target
-fi
-exit 0
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index ea1e340..5b3001f 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -85,14 +85,5 @@ install() {
 
     inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
 
-    inst_multiple -o \
-        $systemdutildir/system-generators/systemd-cryptsetup-generator \
-        $systemdutildir/systemd-cryptsetup \
-        $systemdsystemunitdir/systemd-ask-password-console.path \
-        $systemdsystemunitdir/systemd-ask-password-console.service \
-        $systemdsystemunitdir/cryptsetup.target \
-        $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
-        systemd-ask-password systemd-tty-ask-password-agent
-    inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
     dracut_need_initqueue
 }
diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh
index 94ad1f6..f2bc181 100755
--- a/modules.d/90crypt/parse-crypt.sh
+++ b/modules.d/90crypt/parse-crypt.sh
@@ -19,25 +19,13 @@ else
 
             luksid=${luksid##luks-}
 
-            if [ -z "$DRACUT_SYSTEMD" ]; then
-                {
-                    printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
-                    printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
-                    printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
-                    printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
-                    printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
-                } >> /etc/udev/rules.d/70-luks.rules.new
-            else
-                if ! crypttab_contains "$luksid"; then
-                    {
-                        printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
-                        printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
-                        printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
-                        printf -- '--name systemd-cryptsetup-%%k %s start ' $(command -v systemctl)
-                        printf -- 'systemd-cryptsetup@luks$$(dev_unit_name -$env{ID_FS_UUID}).service"\n'
-                    } >> /etc/udev/rules.d/70-luks.rules.new
-                fi
-            fi
+            {
+                printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
+                printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
+                printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
+                printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
+                printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
+            } >> /etc/udev/rules.d/70-luks.rules.new
 
             uuid=$luksid
             while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
@@ -50,19 +38,11 @@ else
             } >> $hookdir/emergency/90-crypt.sh
         done
     elif getargbool 0 rd.auto; then
-        if [ -z "$DRACUT_SYSTEMD" ]; then
-            {
-                printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
-                printf -- '--unique --settled --onetime --name cryptroot-ask-%%k '
-                printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout
-            } >> /etc/udev/rules.d/70-luks.rules.new
-        else
-            {
-                printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
-                printf -- '--unique --settled --onetime --name crypt-run-generator-%%k '
-                printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v crypt-run-generator)
-            } >> /etc/udev/rules.d/70-luks.rules.new
-        fi
+        {
+            printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
+            printf -- '--unique --settled --onetime --name cryptroot-ask-%%k '
+            printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout
+        } >> /etc/udev/rules.d/70-luks.rules.new
     fi
 
     echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules.new
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH] base/dracut-lib.sh: remove bashism
@ 2015-02-24 19:28 Alexander Tsoy
       [not found] ` <E1YQLG5-00009v-BS-C3g8GgeTu50ox3rIn2DAYQ@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Alexander Tsoy @ 2015-02-24 19:28 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

---
 modules.d/99base/dracut-lib.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 079c9a2..fd627dc 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -886,7 +886,9 @@ dev_unit_name()
     dev="${dev##/}"
     dev="$(str_replace "$dev" '\' '\x5c')"
     dev="$(str_replace "$dev" '-' '\x2d')"
-    dev=${dev/#\./\\x2e}
+    if [ "${dev##.}" != "$dev" ]; then
+        dev="\x2e${dev##.}"
+    fi
     dev="$(str_replace "$dev" '/' '-')"
 
     printf -- "%s" "$dev"
-- 
2.0.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH] Take into account lib64 dirs when detecting version, modules and params
@ 2015-01-11 14:12 Amadeusz Żołnowski
       [not found] ` <1420985530-5006-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Amadeusz Żołnowski @ 2015-01-11 14:12 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Amadeusz Żołnowski

---
 lsinitrd.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lsinitrd.sh b/lsinitrd.sh
index 4f12c2c..dc1f88f 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -124,7 +124,7 @@ extract_files()
 list_modules()
 {
     echo "dracut modules:"
-    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
+    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib64/dracut/modules.txt' 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
     ((ret+=$?))
 }
 
@@ -217,7 +217,7 @@ ret=0
 if (( ${#filenames[@]} > 0 )); then
     extract_files
 else
-    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
+    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib64/dracut/dracut-*' 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
     ((ret+=$?))
     echo "Version: $version"
     echo
@@ -226,7 +226,7 @@ else
         echo "========================================================================"
     else
         echo -n "Arguments: "
-        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
+        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib64/dracut/build-parameter.txt' 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
         echo
         list_modules
         list_files
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-03-26 16:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-26  4:41 [PATCH 0/4] dracut: fix various issues with newly degraded md arrays NeilBrown
     [not found] ` <20150326043938.10121.34223.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-03-26  4:41   ` [PATCH 1/4] mdraid/mdraid_start.sh: tell mainloop if we make progress NeilBrown
2015-03-26  4:41   ` [PATCH 2/4] systemd/dracut-iniqueue - continue waiting if any timeout script makes progress NeilBrown
2015-03-26  4:41   ` [PATCH 3/4] dracut-systemd/rootfs-generator.sh: always create generated files NeilBrown
2015-03-26  4:41   ` [PATCH 4/4] crypt/parse-crypt.sh: hide encrypted devices from systemd timeout warnings NeilBrown
     [not found]     ` <20150326044148.10121.15286.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-03-26 11:51       ` Harald Hoyer
2015-03-26 15:38       ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot
  -- strict thread matches above, loose matches on Subject: below --
2015-03-24 13:13 [PATCH] Take into account lib64 dirs when detecting version, modules and params Amadeusz Żołnowski
     [not found] ` <1427202794-18834-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
2015-03-26 15:38   ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot
2015-03-23 16:12 [PATCH 4/4] 95fcoe-uefi: Test for EFI firmware Thomas Renninger
     [not found] ` <1427127138-12932-5-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2015-03-26 15:38   ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot
2015-03-05 11:07 [PATCH] Add support for ethernet point-to-point connections configured via DHCP Gerd von Egidy
2015-03-26 15:38 ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot
2015-03-04  7:49 [PATCH] crypt: don't use systemd for crypto handling Jan Synacek
     [not found] ` <1425455385-28495-1-git-send-email-jsynacek-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-26 15:38   ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot
     [not found]     ` <20150326153844.5437.48101.githubbot-/GRfruIG/bJJrt6ceOoM5Ad3sJO0fIaJ@public.gmane.org>
2015-03-26 16:42       ` Harald Hoyer
2015-02-24 19:28 [PATCH] base/dracut-lib.sh: remove bashism Alexander Tsoy
     [not found] ` <E1YQLG5-00009v-BS-C3g8GgeTu50ox3rIn2DAYQ@public.gmane.org>
2015-03-26 15:38   ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot
2015-01-11 14:12 [PATCH] Take into account lib64 dirs when detecting version, modules and params Amadeusz Żołnowski
     [not found] ` <1420985530-5006-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
2015-03-26 15:38   ` [Dracut GitHub] Patchset imported to github Dracut GitHub Import Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox