diff --git a/blivet/__init__.py b/blivet/__init__.py index c685eefe5..83481b617 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -387,7 +387,7 @@ def reset(self, cleanupOnly=False): self.dumpState("initial") if not flags.installer_mode: - self.devicetree.getActiveMounts() + self.devicetree.handleNodevFilesystems() self.updateBootLoaderDiskList() diff --git a/blivet/devicetree.py b/blivet/devicetree.py index 75f00d036..e830a5773 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -2649,9 +2649,8 @@ def resolveDevice(self, devspec, blkidTab=None, cryptTab=None, options=None): log.debug("failed to resolve '%s'", devspec) return device - def getActiveMounts(self): - """ Reflect active mounts in the appropriate devices' formats. """ - log.info("collecting information about active mounts") + def handleNodevFilesystems(self): + for line in open("/proc/mounts").readlines(): try: (devspec, mountpoint, fstype, options, _rest) = line.split(None, 4) @@ -2659,17 +2658,6 @@ def getActiveMounts(self): log.error("failed to parse /proc/mounts line: %s", line) continue - if fstype == "btrfs": - # get the subvol name from /proc/self/mountinfo - for line in open("/proc/self/mountinfo").readlines(): - fields = line.split() - _subvol = fields[3] - _mountpoint = fields[4] - _devspec = fields[9] - if _mountpoint == mountpoint and _devspec == devspec: - log.debug("subvol %s", _subvol) - options += ",subvol=%s" % _subvol[1:] - if fstype in nodev_filesystems: if not flags.include_nodev: continue @@ -2691,10 +2679,3 @@ def getActiveMounts(self): n = len([d for d in self.devices if d.format.type == fstype]) device._name += ".%d" % n self._addDevice(device) - devspec = device.name - - device = self.resolveDevice(devspec, options=options) - if device is not None: - device.format.mountpoint = mountpoint # for future mounts - device.format._mountpoint = mountpoint # active mountpoint - device.format.mountopts = options