All of lore.kernel.org
 help / color / mirror / Atom feed
* Various patches applied on Mageia that might be good for upstream
@ 2013-01-23 20:15 Colin Guthrie
       [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Colin Guthrie @ 2013-01-23 20:15 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

Hi,

We carry a few patches in Magea to the dracut package but some of them are
quite generic and probably apply to upstream too.

I've picked some that I think are applicable to upstream. You might not want
them all, but there are here for you if you do.

Certainly patch 1 seems safe and patch 6 will be needed on kernel > 3.8.

Cheers

Col


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

* [PATCH 1/6] dm/md: Only include UUIDs once in the command line.
       [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
@ 2013-01-23 20:15   ` Colin Guthrie
       [not found]     ` <1358972106-2395-2-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  2013-01-23 20:15   ` [PATCH 2/6] lvm: Ensure LVM is initialised in non-hostonly mode Colin Guthrie
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Colin Guthrie @ 2013-01-23 20:15 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Colin Guthrie

This shouldn't really cause any problems, but it's nice to be neat.

Also make the lvm check more efficient when running in kernel_only mode.
---
 modules.d/90dmraid/module-setup.sh | 7 +++++--
 modules.d/90lvm/module-setup.sh    | 6 +++---
 modules.d/90mdraid/module-setup.sh | 7 +++++--
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
index eb949dc..c3bddb7 100755
--- a/modules.d/90dmraid/module-setup.sh
+++ b/modules.d/90dmraid/module-setup.sh
@@ -3,7 +3,7 @@
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
 check() {
-    local _rootdev
+    local _rootdev _activated
     # if we don't have dmraid installed on the host system, no point
     # in trying to support it in the initramfs.
     type -P dmraid >/dev/null || return 1
@@ -32,7 +32,10 @@ check() {
 
         [[ ${DM_NAME} ]] || return 1
         if ! [[ $kernel_only ]]; then
-            echo " rd.dm.uuid=${DM_NAME} " >> "${initdir}/etc/cmdline.d/90dmraid.conf"
+            if ! strstr " ${_activated[*]} " " ${DM_NAME} "; then
+                echo " rd.dm.uuid=${DM_NAME} " >> "${initdir}/etc/cmdline.d/90dmraid.conf"
+                push _activated "${DM_NAME}"
+            fi
         fi
         return 0
     }
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index cefd3e9..a537b1a 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -12,11 +12,11 @@ check() {
         eval $(udevadm info --query=property --name=/dev/block/$1|egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
         [[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
         [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
-        if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
-            if ! [[ $kernel_only ]]; then
+        if ! [[ $kernel_only ]]; then
+            if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
                 echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
+                push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
             fi
-            push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
         fi
         return 0
     }
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
index 3b5620c..116b822 100755
--- a/modules.d/90mdraid/module-setup.sh
+++ b/modules.d/90mdraid/module-setup.sh
@@ -3,7 +3,7 @@
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
 check() {
-    local _rootdev
+    local _rootdev _activated
     # No mdadm?  No mdraid support.
     type -P mdadm >/dev/null || return 1
 
@@ -21,7 +21,10 @@ check() {
 
         [[ ${MD_UUID} ]] || return 1
         if ! [[ $kernel_only ]]; then
-            echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
+            if ! strstr " ${_activated[*]} " " ${MD_UUID} "; then
+                echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
+                push _activated "${MD_UUID}"
+            fi
         fi
         return 0
     }
-- 
1.8.1

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

* [PATCH 2/6] lvm: Ensure LVM is initialised in non-hostonly mode.
       [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  2013-01-23 20:15   ` [PATCH 1/6] dm/md: Only include UUIDs once in the command line Colin Guthrie
@ 2013-01-23 20:15   ` Colin Guthrie
       [not found]     ` <1358972106-2395-3-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  2013-01-23 20:15   ` [PATCH 3/6] resume: Ensure we remove the timout job when we find the resume device Colin Guthrie
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Colin Guthrie @ 2013-01-23 20:15 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Colin Guthrie

This is a bit of a hack, but it's needed if /usr is on LVM.
---
 modules.d/90lvm/module-setup.sh          | 3 +++
 modules.d/90lvm/non-hostonly-init-lvm.sh | 8 ++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 modules.d/90lvm/non-hostonly-init-lvm.sh

diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index a537b1a..611379a 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -49,6 +49,9 @@ install() {
             sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
         fi
     fi
+    if ! [[ $hostonly ]]; then
+        inst_hook pre-udev 30 "$moddir/non-hostonly-init-lvm.sh"
+    fi
 
     inst_rules 11-dm-lvm.rules
     # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
diff --git a/modules.d/90lvm/non-hostonly-init-lvm.sh b/modules.d/90lvm/non-hostonly-init-lvm.sh
new file mode 100644
index 0000000..2e9212c
--- /dev/null
+++ b/modules.d/90lvm/non-hostonly-init-lvm.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+printf 'cancel_wait_for_dev /dev/non-hostonly-lvm; rm "$job";' \
+    "$hookdir" >> $hookdir/initqueue/timeout/non-hostonly-lvm.sh
+
+wait_for_dev "/dev/non-hostonly-lvm"
-- 
1.8.1

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

* [PATCH 3/6] resume: Ensure we remove the timout job when we find the resume device
       [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  2013-01-23 20:15   ` [PATCH 1/6] dm/md: Only include UUIDs once in the command line Colin Guthrie
  2013-01-23 20:15   ` [PATCH 2/6] lvm: Ensure LVM is initialised in non-hostonly mode Colin Guthrie
@ 2013-01-23 20:15   ` Colin Guthrie
  2013-01-23 20:15   ` [PATCH 4/6] rootfs-block: Support lilo style device numbers Colin Guthrie
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Colin Guthrie @ 2013-01-23 20:15 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Colin Guthrie

---
 modules.d/95resume/resume-genrules.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
index f16df8c..c542c71 100755
--- a/modules.d/95resume/resume-genrules.sh
+++ b/modules.d/95resume/resume-genrules.sh
@@ -32,8 +32,8 @@ if [ -n "$resume" ]; then
             ${resume#/dev/};
     } >> /etc/udev/rules.d/99-resume.rules
 
-    printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; udevadm settle; }\n' \
-        "$resume" "$resume" >> $hookdir/initqueue/settled/resume.sh
+    printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
+        "$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
 
     printf 'warn "Cancelling resume operation. Device not found."; cancel_wait_for_dev /dev/resume; rm "$job" "%s/initqueue/settled/resume.sh";' \
         "$hookdir" >> $hookdir/initqueue/timeout/resume.sh
-- 
1.8.1

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

* [PATCH 4/6] rootfs-block: Support lilo style device numbers.
       [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
                     ` (2 preceding siblings ...)
  2013-01-23 20:15   ` [PATCH 3/6] resume: Ensure we remove the timout job when we find the resume device Colin Guthrie
@ 2013-01-23 20:15   ` Colin Guthrie
       [not found]     ` <1358972106-2395-5-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  2013-01-23 20:15   ` [PATCH 5/6] i18n: Run console_init prior to udev startup Colin Guthrie
  2013-01-23 20:15   ` [PATCH 6/6] kernel-modules: Add ehci support for kernel 3.8+ Colin Guthrie
  5 siblings, 1 reply; 14+ messages in thread
From: Colin Guthrie @ 2013-01-23 20:15 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Colin Guthrie

Lilo supplies root=900 rather than root=/dev/md0. Similarly it would say root=801 rather
than root=/dev/sda1.

This patch simply interprets that number and creates appropriate udev rules
to create the /dev/root symlink as needed.
---
 modules.d/95rootfs-block/block-genrules.sh | 11 ++++++++++-
 modules.d/95rootfs-block/parse-block.sh    |  4 ++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/modules.d/95rootfs-block/block-genrules.sh b/modules.d/95rootfs-block/block-genrules.sh
index 7f894ee..161183e 100755
--- a/modules.d/95rootfs-block/block-genrules.sh
+++ b/modules.d/95rootfs-block/block-genrules.sh
@@ -2,7 +2,16 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
-if [ "${root%%:*}" = "block" ]; then
+if [ -n "$rootdevnum" ]; then
+    major=$(( 0x$rootdevnum / 256 ))
+    minor=$(( 0x$rootdevnum - ( $major * 256 ) ))
+    {
+        printf 'ACTION=="add|change", ENV{MAJOR}=="%d", ENV{MINOR}=="%d", SYMLINK+="root"\n' \
+            $major $minor
+    } >> /etc/udev/rules.d/99-root.rules
+
+    wait_for_dev /dev/root
+elif [ "${root%%:*}" = "block" ]; then
     {
         printf 'KERNEL=="%s", SYMLINK+="root"\n' \
             ${root#block:/dev/}
diff --git a/modules.d/95rootfs-block/parse-block.sh b/modules.d/95rootfs-block/parse-block.sh
index 3745352..9efc51f 100755
--- a/modules.d/95rootfs-block/parse-block.sh
+++ b/modules.d/95rootfs-block/parse-block.sh
@@ -19,4 +19,8 @@ case "$root" in
     /dev/*)
         root="block:${root}"
         rootok=1 ;;
+    [1-9][0-9][0-9])
+        rootdevnum=$root
+        root=block:/dev/root
+        rootok=1 ;;
 esac
-- 
1.8.1

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

* [PATCH 5/6] i18n: Run console_init prior to udev startup.
       [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
                     ` (3 preceding siblings ...)
  2013-01-23 20:15   ` [PATCH 4/6] rootfs-block: Support lilo style device numbers Colin Guthrie
@ 2013-01-23 20:15   ` Colin Guthrie
       [not found]     ` <1358972106-2395-6-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  2013-01-23 20:15   ` [PATCH 6/6] kernel-modules: Add ehci support for kernel 3.8+ Colin Guthrie
  5 siblings, 1 reply; 14+ messages in thread
From: Colin Guthrie @ 2013-01-23 20:15 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Colin Guthrie

In some cases udev will initialise the encrypted disks and ask for a
password before it initialises the console.

This can result in the password for encrypted partitions being asked for
with the wrong keymap loaded.

So this patch just attempts to initialise things statically. It might
fail but udev will do it properly later anyway.
---
 modules.d/10i18n/i18n-pre-udev.sh | 7 +++++++
 modules.d/10i18n/module-setup.sh  | 1 +
 2 files changed, 8 insertions(+)
 create mode 100755 modules.d/10i18n/i18n-pre-udev.sh

diff --git a/modules.d/10i18n/i18n-pre-udev.sh b/modules.d/10i18n/i18n-pre-udev.sh
new file mode 100755
index 0000000..2033948
--- /dev/null
+++ b/modules.d/10i18n/i18n-pre-udev.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+if [ -x /lib/udev/console_init -a -e /dev/tty0 ]; then
+    /lib/udev/console_init /dev/tty0
+fi
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index 1ed1db6..21b0c05 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -89,6 +89,7 @@ install() {
         inst ${moddir}/console_init.sh /lib/udev/console_init
         inst_rules ${moddir}/10-console.rules
         inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
+        inst_hook pre-udev 10 "$moddir/i18n-pre-udev.sh"
     }
 
     install_all_kbd() {
-- 
1.8.1

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

* [PATCH 6/6] kernel-modules: Add ehci support for kernel 3.8+
       [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
                     ` (4 preceding siblings ...)
  2013-01-23 20:15   ` [PATCH 5/6] i18n: Run console_init prior to udev startup Colin Guthrie
@ 2013-01-23 20:15   ` Colin Guthrie
       [not found]     ` <1358972106-2395-7-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
  5 siblings, 1 reply; 14+ messages in thread
From: Colin Guthrie @ 2013-01-23 20:15 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Thomas Backlund

From: Thomas Backlund <tmb-odJJhXpcy38dnm+yROfE0A@public.gmane.org>

Kernel 3.8 split ehci-hcd into ehci-hcd, ehci-pci and ehci-platform,
so adapt the list to cope with this change.
---
 modules.d/90kernel-modules/module-setup.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 633a59d..f75bb61 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -41,7 +41,8 @@ installkernel() {
             sdhci_esdhc_imx mmci sdhci_tegra mvsdio \
             omap omapdrm omap_hsmmc sdhci_dove ahci_platform pata_imx sata_mv \
             atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
-            hid-logitech-dj hid-microsoft ehci-hcd ohci-hcd uhci-hcd xhci-hcd hid_generic \
+            hid-logitech-dj hid-microsoft ehci-hcd ehci-pci ehci-platform \
+            ohci-hcd uhci-hcd xhci-hcd hid_generic \
             unix
 
         # install virtual machine support
-- 
1.8.1

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

* Re: [PATCH 1/6] dm/md: Only include UUIDs once in the command line.
       [not found]     ` <1358972106-2395-2-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
@ 2013-01-24 11:26       ` Harald Hoyer
  0 siblings, 0 replies; 14+ messages in thread
From: Harald Hoyer @ 2013-01-24 11:26 UTC (permalink / raw)
  To: Colin Guthrie; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Am 23.01.2013 21:15, schrieb Colin Guthrie:
> This shouldn't really cause any problems, but it's nice to be neat.
> 
> Also make the lvm check more efficient when running in kernel_only mode.
> ---
>  modules.d/90dmraid/module-setup.sh | 7 +++++--
>  modules.d/90lvm/module-setup.sh    | 6 +++---
>  modules.d/90mdraid/module-setup.sh | 7 +++++--
>  3 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
> index eb949dc..c3bddb7 100755
> --- a/modules.d/90dmraid/module-setup.sh
> +++ b/modules.d/90dmraid/module-setup.sh
> @@ -3,7 +3,7 @@
>  # ex: ts=8 sw=4 sts=4 et filetype=sh
>  
>  check() {
> -    local _rootdev
> +    local _rootdev _activated
>      # if we don't have dmraid installed on the host system, no point
>      # in trying to support it in the initramfs.
>      type -P dmraid >/dev/null || return 1
> @@ -32,7 +32,10 @@ check() {
>  
>          [[ ${DM_NAME} ]] || return 1
>          if ! [[ $kernel_only ]]; then
> -            echo " rd.dm.uuid=${DM_NAME} " >> "${initdir}/etc/cmdline.d/90dmraid.conf"
> +            if ! strstr " ${_activated[*]} " " ${DM_NAME} "; then
> +                echo " rd.dm.uuid=${DM_NAME} " >> "${initdir}/etc/cmdline.d/90dmraid.conf"
> +                push _activated "${DM_NAME}"
> +            fi
>          fi
>          return 0
>      }
> diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
> index cefd3e9..a537b1a 100755
> --- a/modules.d/90lvm/module-setup.sh
> +++ b/modules.d/90lvm/module-setup.sh
> @@ -12,11 +12,11 @@ check() {
>          eval $(udevadm info --query=property --name=/dev/block/$1|egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
>          [[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
>          [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
> -        if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
> -            if ! [[ $kernel_only ]]; then
> +        if ! [[ $kernel_only ]]; then
> +            if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
>                  echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
> +                push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
>              fi
> -            push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
>          fi
>          return 0
>      }
> diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
> index 3b5620c..116b822 100755
> --- a/modules.d/90mdraid/module-setup.sh
> +++ b/modules.d/90mdraid/module-setup.sh
> @@ -3,7 +3,7 @@
>  # ex: ts=8 sw=4 sts=4 et filetype=sh
>  
>  check() {
> -    local _rootdev
> +    local _rootdev _activated
>      # No mdadm?  No mdraid support.
>      type -P mdadm >/dev/null || return 1
>  
> @@ -21,7 +21,10 @@ check() {
>  
>          [[ ${MD_UUID} ]] || return 1
>          if ! [[ $kernel_only ]]; then
> -            echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
> +            if ! strstr " ${_activated[*]} " " ${MD_UUID} "; then
> +                echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
> +                push _activated "${MD_UUID}"
> +            fi
>          fi
>          return 0
>      }
> 

which reminds me to rename push to var_push :)

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

* Re: [PATCH 2/6] lvm: Ensure LVM is initialised in non-hostonly mode.
       [not found]     ` <1358972106-2395-3-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
@ 2013-01-24 11:32       ` Harald Hoyer
       [not found]         ` <51011BB2.3010409-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Harald Hoyer @ 2013-01-24 11:32 UTC (permalink / raw)
  To: Colin Guthrie; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Am 23.01.2013 21:15, schrieb Colin Guthrie:
> This is a bit of a hack, but it's needed if /usr is on LVM.
> ---
>  modules.d/90lvm/module-setup.sh          | 3 +++
>  modules.d/90lvm/non-hostonly-init-lvm.sh | 8 ++++++++
>  2 files changed, 11 insertions(+)
>  create mode 100644 modules.d/90lvm/non-hostonly-init-lvm.sh
> 
> diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
> index a537b1a..611379a 100755
> --- a/modules.d/90lvm/module-setup.sh
> +++ b/modules.d/90lvm/module-setup.sh
> @@ -49,6 +49,9 @@ install() {
>              sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
>          fi
>      fi
> +    if ! [[ $hostonly ]]; then
> +        inst_hook pre-udev 30 "$moddir/non-hostonly-init-lvm.sh"
> +    fi
>  
>      inst_rules 11-dm-lvm.rules
>      # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
> diff --git a/modules.d/90lvm/non-hostonly-init-lvm.sh b/modules.d/90lvm/non-hostonly-init-lvm.sh
> new file mode 100644
> index 0000000..2e9212c
> --- /dev/null
> +++ b/modules.d/90lvm/non-hostonly-init-lvm.sh
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
> +# ex: ts=8 sw=4 sts=4 et filetype=sh
> +
> +printf 'cancel_wait_for_dev /dev/non-hostonly-lvm; rm "$job";' \
> +    "$hookdir" >> $hookdir/initqueue/timeout/non-hostonly-lvm.sh
> +
> +wait_for_dev "/dev/non-hostonly-lvm"
> 

huh? what does this try to do? This only ensures, that the timeout is reached.

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

* Re: [PATCH 4/6] rootfs-block: Support lilo style device numbers.
       [not found]     ` <1358972106-2395-5-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
@ 2013-01-24 11:40       ` Harald Hoyer
       [not found]         ` <51011D9C.4080901-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Harald Hoyer @ 2013-01-24 11:40 UTC (permalink / raw)
  To: Colin Guthrie; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Am 23.01.2013 21:15, schrieb Colin Guthrie:
> Lilo supplies root=900 rather than root=/dev/md0. Similarly it would say root=801 rather
> than root=/dev/sda1.
> 
> This patch simply interprets that number and creates appropriate udev rules
> to create the /dev/root symlink as needed.
> ---
>  modules.d/95rootfs-block/block-genrules.sh | 11 ++++++++++-
>  modules.d/95rootfs-block/parse-block.sh    |  4 ++++
>  2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/modules.d/95rootfs-block/block-genrules.sh b/modules.d/95rootfs-block/block-genrules.sh
> index 7f894ee..161183e 100755
> --- a/modules.d/95rootfs-block/block-genrules.sh
> +++ b/modules.d/95rootfs-block/block-genrules.sh
> @@ -2,7 +2,16 @@
>  # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
>  # ex: ts=8 sw=4 sts=4 et filetype=sh
>  
> -if [ "${root%%:*}" = "block" ]; then
> +if [ -n "$rootdevnum" ]; then
> +    major=$(( 0x$rootdevnum / 256 ))
> +    minor=$(( 0x$rootdevnum - ( $major * 256 ) ))
> +    {
> +        printf 'ACTION=="add|change", ENV{MAJOR}=="%d", ENV{MINOR}=="%d", SYMLINK+="root"\n' \
> +            $major $minor
> +    } >> /etc/udev/rules.d/99-root.rules
> +
> +    wait_for_dev /dev/root
> +elif [ "${root%%:*}" = "block" ]; then
>      {
>          printf 'KERNEL=="%s", SYMLINK+="root"\n' \
>              ${root#block:/dev/}
> diff --git a/modules.d/95rootfs-block/parse-block.sh b/modules.d/95rootfs-block/parse-block.sh
> index 3745352..9efc51f 100755
> --- a/modules.d/95rootfs-block/parse-block.sh
> +++ b/modules.d/95rootfs-block/parse-block.sh
> @@ -19,4 +19,8 @@ case "$root" in
>      /dev/*)
>          root="block:${root}"
>          rootok=1 ;;
> +    [1-9][0-9][0-9])
> +        rootdevnum=$root
> +        root=block:/dev/root

I would do just:

major=$(( 0x$root / 256 ))
minor=$(( 0x$root - ( $major * 256 ) ))
root=/dev/block/$major:$minor


> +        rootok=1 ;;
>  esac
> 


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

* Re: [PATCH 2/6] lvm: Ensure LVM is initialised in non-hostonly mode.
       [not found]         ` <51011BB2.3010409-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2013-01-24 11:40           ` Colin Guthrie
  0 siblings, 0 replies; 14+ messages in thread
From: Colin Guthrie @ 2013-01-24 11:40 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

'Twas brillig, and Harald Hoyer at 24/01/13 11:32 did gyre and gimble:
> Am 23.01.2013 21:15, schrieb Colin Guthrie:
>> This is a bit of a hack, but it's needed if /usr is on LVM.
>> ---
>>  modules.d/90lvm/module-setup.sh          | 3 +++
>>  modules.d/90lvm/non-hostonly-init-lvm.sh | 8 ++++++++
>>  2 files changed, 11 insertions(+)
>>  create mode 100644 modules.d/90lvm/non-hostonly-init-lvm.sh
>>
>> diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
>> index a537b1a..611379a 100755
>> --- a/modules.d/90lvm/module-setup.sh
>> +++ b/modules.d/90lvm/module-setup.sh
>> @@ -49,6 +49,9 @@ install() {
>>              sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
>>          fi
>>      fi
>> +    if ! [[ $hostonly ]]; then
>> +        inst_hook pre-udev 30 "$moddir/non-hostonly-init-lvm.sh"
>> +    fi
>>  
>>      inst_rules 11-dm-lvm.rules
>>      # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
>> diff --git a/modules.d/90lvm/non-hostonly-init-lvm.sh b/modules.d/90lvm/non-hostonly-init-lvm.sh
>> new file mode 100644
>> index 0000000..2e9212c
>> --- /dev/null
>> +++ b/modules.d/90lvm/non-hostonly-init-lvm.sh
>> @@ -0,0 +1,8 @@
>> +#!/bin/sh
>> +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
>> +# ex: ts=8 sw=4 sts=4 et filetype=sh
>> +
>> +printf 'cancel_wait_for_dev /dev/non-hostonly-lvm; rm "$job";' \
>> +    "$hookdir" >> $hookdir/initqueue/timeout/non-hostonly-lvm.sh
>> +
>> +wait_for_dev "/dev/non-hostonly-lvm"
>>
> 
> huh? what does this try to do? This only ensures, that the timeout is reached.

Well..... it's been a while, so my memory is fuzzy, but this was meant
to "solve" the problem of a non-hostonly initrd (i.e. one without
etc/cmdline.d/90lvm.conf), but where the system has a /usr on LVM but /
on a normal partition. i.e. it should initialise all volume groups it
finds in order to mount /usr.

In that setup I don't think lvm was initialised properly because the
initqueue loop was never entered at all and thus nothing actually
triggered the lvm vgchange.

So all this does is ensure the loop is run at least once, which triggers
the LVM init.

I'm going from memory here so a bit hazy - the explanation might not be
totally bang on. I'll see if I can test a non-hostonly initrd with that
kind of disk layout in my VMs to confirm it's still needed as I guess
there is a chance the "never run the initqueue" issue has been factored
out since 017 which is when I think I wrote this :)

Cheers

Col

-- 

Colin Guthrie
  http://colin.guthr.ie/

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

* Re: [PATCH 5/6] i18n: Run console_init prior to udev startup.
       [not found]     ` <1358972106-2395-6-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
@ 2013-01-24 12:03       ` Harald Hoyer
  0 siblings, 0 replies; 14+ messages in thread
From: Harald Hoyer @ 2013-01-24 12:03 UTC (permalink / raw)
  To: Colin Guthrie; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Am 23.01.2013 21:15, schrieb Colin Guthrie:
> In some cases udev will initialise the encrypted disks and ask for a
> password before it initialises the console.
> 
> This can result in the password for encrypted partitions being asked for
> with the wrong keymap loaded.
> 
> So this patch just attempts to initialise things statically. It might
> fail but udev will do it properly later anyway.
> ---
>  modules.d/10i18n/i18n-pre-udev.sh | 7 +++++++
>  modules.d/10i18n/module-setup.sh  | 1 +
>  2 files changed, 8 insertions(+)
>  create mode 100755 modules.d/10i18n/i18n-pre-udev.sh
> 
> diff --git a/modules.d/10i18n/i18n-pre-udev.sh b/modules.d/10i18n/i18n-pre-udev.sh
> new file mode 100755
> index 0000000..2033948
> --- /dev/null
> +++ b/modules.d/10i18n/i18n-pre-udev.sh
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
> +# ex: ts=8 sw=4 sts=4 et filetype=sh
> +
> +if [ -x /lib/udev/console_init -a -e /dev/tty0 ]; then
> +    /lib/udev/console_init /dev/tty0
> +fi
> diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
> index 1ed1db6..21b0c05 100755
> --- a/modules.d/10i18n/module-setup.sh
> +++ b/modules.d/10i18n/module-setup.sh
> @@ -89,6 +89,7 @@ install() {
>          inst ${moddir}/console_init.sh /lib/udev/console_init
>          inst_rules ${moddir}/10-console.rules
>          inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
> +        inst_hook pre-udev 10 "$moddir/i18n-pre-udev.sh"
>      }
>  
>      install_all_kbd() {
> 

On an initramfs with systemd inside, this was already fixed.

Will make this probably conditionally.

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

* Re: [PATCH 4/6] rootfs-block: Support lilo style device numbers.
       [not found]         ` <51011D9C.4080901-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2013-01-24 12:30           ` Colin Guthrie
  0 siblings, 0 replies; 14+ messages in thread
From: Colin Guthrie @ 2013-01-24 12:30 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

'Twas brillig, and Harald Hoyer at 24/01/13 11:40 did gyre and gimble:
> Am 23.01.2013 21:15, schrieb Colin Guthrie:
>> Lilo supplies root=900 rather than root=/dev/md0. Similarly it would say root=801 rather
>> than root=/dev/sda1.
>>
>> This patch simply interprets that number and creates appropriate udev rules
>> to create the /dev/root symlink as needed.
>> ---
>>  modules.d/95rootfs-block/block-genrules.sh | 11 ++++++++++-
>>  modules.d/95rootfs-block/parse-block.sh    |  4 ++++
>>  2 files changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/modules.d/95rootfs-block/block-genrules.sh b/modules.d/95rootfs-block/block-genrules.sh
>> index 7f894ee..161183e 100755
>> --- a/modules.d/95rootfs-block/block-genrules.sh
>> +++ b/modules.d/95rootfs-block/block-genrules.sh
>> @@ -2,7 +2,16 @@
>>  # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
>>  # ex: ts=8 sw=4 sts=4 et filetype=sh
>>  
>> -if [ "${root%%:*}" = "block" ]; then
>> +if [ -n "$rootdevnum" ]; then
>> +    major=$(( 0x$rootdevnum / 256 ))
>> +    minor=$(( 0x$rootdevnum - ( $major * 256 ) ))
>> +    {
>> +        printf 'ACTION=="add|change", ENV{MAJOR}=="%d", ENV{MINOR}=="%d", SYMLINK+="root"\n' \
>> +            $major $minor
>> +    } >> /etc/udev/rules.d/99-root.rules
>> +
>> +    wait_for_dev /dev/root
>> +elif [ "${root%%:*}" = "block" ]; then
>>      {
>>          printf 'KERNEL=="%s", SYMLINK+="root"\n' \
>>              ${root#block:/dev/}
>> diff --git a/modules.d/95rootfs-block/parse-block.sh b/modules.d/95rootfs-block/parse-block.sh
>> index 3745352..9efc51f 100755
>> --- a/modules.d/95rootfs-block/parse-block.sh
>> +++ b/modules.d/95rootfs-block/parse-block.sh
>> @@ -19,4 +19,8 @@ case "$root" in
>>      /dev/*)
>>          root="block:${root}"
>>          rootok=1 ;;
>> +    [1-9][0-9][0-9])
>> +        rootdevnum=$root
>> +        root=block:/dev/root
> 
> I would do just:
> 
> major=$(( 0x$root / 256 ))
> minor=$(( 0x$root - ( $major * 256 ) ))
> root=/dev/block/$major:$minor

Hmm, indeed, that does seem simpler :)

Of course this whole scheme is generally stupid anyway (majors have not
been limited to 256 for years), but meh.

Col
-- 

Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

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

* Re: [PATCH 6/6] kernel-modules: Add ehci support for kernel 3.8+
       [not found]     ` <1358972106-2395-7-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
@ 2013-02-13 16:42       ` Harald Hoyer
  0 siblings, 0 replies; 14+ messages in thread
From: Harald Hoyer @ 2013-02-13 16:42 UTC (permalink / raw)
  To: Colin Guthrie; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, Thomas Backlund

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

Am 23.01.2013 21:15, schrieb Colin Guthrie:
> From: Thomas Backlund <tmb-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
> 
> Kernel 3.8 split ehci-hcd into ehci-hcd, ehci-pci and ehci-platform,
> so adapt the list to cope with this change.
> ---
>  modules.d/90kernel-modules/module-setup.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
> index 633a59d..f75bb61 100755
> --- a/modules.d/90kernel-modules/module-setup.sh
> +++ b/modules.d/90kernel-modules/module-setup.sh
> @@ -41,7 +41,8 @@ installkernel() {
>              sdhci_esdhc_imx mmci sdhci_tegra mvsdio \
>              omap omapdrm omap_hsmmc sdhci_dove ahci_platform pata_imx sata_mv \
>              atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
> -            hid-logitech-dj hid-microsoft ehci-hcd ohci-hcd uhci-hcd xhci-hcd hid_generic \
> +            hid-logitech-dj hid-microsoft ehci-hcd ehci-pci ehci-platform \
> +            ohci-hcd uhci-hcd xhci-hcd hid_generic \
>              unix
>  
>          # install virtual machine support
> 

merged, thanks


[-- Attachment #2: S/MIME Kryptografische Unterschrift --]
[-- Type: application/pkcs7-signature, Size: 2399 bytes --]

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

end of thread, other threads:[~2013-02-13 16:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 20:15 Various patches applied on Mageia that might be good for upstream Colin Guthrie
     [not found] ` <1358972106-2395-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2013-01-23 20:15   ` [PATCH 1/6] dm/md: Only include UUIDs once in the command line Colin Guthrie
     [not found]     ` <1358972106-2395-2-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2013-01-24 11:26       ` Harald Hoyer
2013-01-23 20:15   ` [PATCH 2/6] lvm: Ensure LVM is initialised in non-hostonly mode Colin Guthrie
     [not found]     ` <1358972106-2395-3-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2013-01-24 11:32       ` Harald Hoyer
     [not found]         ` <51011BB2.3010409-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-24 11:40           ` Colin Guthrie
2013-01-23 20:15   ` [PATCH 3/6] resume: Ensure we remove the timout job when we find the resume device Colin Guthrie
2013-01-23 20:15   ` [PATCH 4/6] rootfs-block: Support lilo style device numbers Colin Guthrie
     [not found]     ` <1358972106-2395-5-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2013-01-24 11:40       ` Harald Hoyer
     [not found]         ` <51011D9C.4080901-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-24 12:30           ` Colin Guthrie
2013-01-23 20:15   ` [PATCH 5/6] i18n: Run console_init prior to udev startup Colin Guthrie
     [not found]     ` <1358972106-2395-6-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2013-01-24 12:03       ` Harald Hoyer
2013-01-23 20:15   ` [PATCH 6/6] kernel-modules: Add ehci support for kernel 3.8+ Colin Guthrie
     [not found]     ` <1358972106-2395-7-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2013-02-13 16:42       ` Harald Hoyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.