[PATCH 2/2] Comment out the fstab lines with unknown filesystem rather then ignoring them
David Cantrell
dcantrell at redhat.com
Tue Jun 26 13:34:13 UTC 2012
Comments and questions below.
On Tue, Jun 26, 2012 at 02:11:19PM +0200, Vratislav Podzimek wrote:
> When doing upgrade, there is no need to ignore the fstab lines with filesystem
> Anaconda does not support. We can leave the lines as they are and just comment
> them out to prevent mounting problems during the next boot.
>
> Resolves: rhbz#754213
> ---
> fsset.py | 22 ++++++++++++++++++++--
> 1 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/fsset.py b/fsset.py
> index 9636003..64d948d 100644
> --- a/fsset.py
> +++ b/fsset.py
> @@ -1297,6 +1297,20 @@ class AutoFileSystem(PsudoFileSystem):
>
> fileSystemTypeRegister(AutoFileSystem())
>
> +class unknownFileSystem(FileSystemType):
> + def __init__(self, fstype):
> + FileSystemType.__init__(self)
> + self.partedFileSystemType = None
> + self.formattable = 0
> + self.checked = 0
> + self.linuxnativefs = 0
> + self.supported = 0
> +
> + self.name = fstype
> +
> + def formatDevice(self, entry, progress, chroot='/'):
> + pass
> +
> class BindFileSystem(PsudoFileSystem):
> def __init__(self):
> PsudoFileSystem.__init__(self, "bind")
> @@ -1456,6 +1470,10 @@ class FileSystemSet:
> options = entry.getOptions()
> if entry.mountpoint == "/" and options is not None:
> options = options.replace(",_netdev", ",_rnetdev")
> +
> + # comment out lines with unknown filesystem
> + if isinstance(entry.fsystem, unknownFileSystem):
> + device = "#" + device
Using isinstance() isn't my favorite, but there is clearly precedent for it
in rhel5-branch.
> fstab = fstab + format % (device, entry.mountpoint,
> entry.fsystem.getName(),
> options, entry.fsck,
> @@ -2969,8 +2987,8 @@ def readFstab (anaconda):
> break
> # "none" is valid as an fs type for bind mounts (#151458)
> if fsystem is None and (string.find(fields[3], "bind") == -1):
> - continue
> -
> + fsystem = unknownFileSystem(fstotry[0])
> +
Why fstotry[0] here?
> label = None
> if fields[0] == "none":
> device = Device()
--
David Cantrell <dcantrell at redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT
More information about the anaconda-patches
mailing list