Re: [rhel6-branch] Copy /etc/multipath/wwids to the sysimage.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Better

On Mon, 2011-08-15 at 09:14 +0200, Ales Kozumplik wrote:
> /etc/multipath/wwids is a list of activated multipaths generated by the
> multipath tools. If it is missing in the sysimage it will be missing in
> the dracut initramfs and that, in rare cases, can cause race between mpath
> and lvm during boot.
> 
> Resolves: rhbz#701371
> ---
>  iutil.py            |   14 ++++++++++++++
>  storage/__init__.py |    1 +
>  2 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/iutil.py b/iutil.py
> index 596b5d2..ff1ef14 100644
> --- a/iutil.py
> +++ b/iutil.py
> @@ -22,6 +22,7 @@
>  
>  import glob
>  import os, string, stat, sys
> +import shutil
>  import signal
>  import os.path
>  from errno import *
> @@ -902,6 +903,19 @@ def setup_translations(module):
>          add_po_path(module, TRANSLATIONS_UPDATE_DIR)
>      module.textdomain("anaconda")
>  
> +def copy_to_sysimage(source, root_path):
> +    if not os.access(source, os.R_OK):
> +        log.info("copy_to_sysimage: source '%s' does not exist." % source)
> +        return False
> +
> +    target = root_path + source
> +    target_dir = os.path.dirname(target)
> +    log.debug("copy_to_sysimage: '%s' -> '%s'." % (source, target))
> +    if not os.path.isdir(target_dir):
> +        os.makedirs(target_dir)
> +    shutil.copy(source, target)
> +    return True
> +
>  def get_sysfs_attr(path, attr):
>      if not attr:
>          log.debug("get_sysfs_attr() called with attr=None")
> diff --git a/storage/__init__.py b/storage/__init__.py
> index 4e1532b..d644b10 100644
> --- a/storage/__init__.py
> +++ b/storage/__init__.py
> @@ -2194,6 +2194,7 @@ class FSSet(object):
>              f.close()
>          else:
>              log.info("not writing out mpath configuration")
> +        iutil.copy_to_sysimage("/etc/multipath/wwids", root_path=instPath)
>  
>      def crypttab(self):
>          # if we are upgrading, do we want to update crypttab?

-- 
Martin Gracik <mgracik@xxxxxxxxxx>

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux