From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Colin Guthrie <colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/6] dm/md: Only include UUIDs once in the command line.
Date: Thu, 24 Jan 2013 12:26:50 +0100 [thread overview]
Message-ID: <51011A7A.3060302@redhat.com> (raw)
In-Reply-To: <1358972106-2395-2-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
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 :)
next prev parent reply other threads:[~2013-01-24 11:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51011A7A.3060302@redhat.com \
--to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox