diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-04-20 19:59:02 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-04-20 19:59:02 +0000 |
commit | 87b0928251d0141332614c4c6a3cd8a85ff39614 (patch) | |
tree | cc0820e6955f095622193827fff88c066f57abb2 /fsset.py | |
parent | 922b91871fa523431a6e959f74077fe2857934ea (diff) | |
download | anaconda-87b0928251d0141332614c4c6a3cd8a85ff39614.tar.gz anaconda-87b0928251d0141332614c4c6a3cd8a85ff39614.tar.xz anaconda-87b0928251d0141332614c4c6a3cd8a85ff39614.zip |
fix upgrades with root on lvm1 (#121294)
Diffstat (limited to 'fsset.py')
-rw-r--r-- | fsset.py | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -17,6 +17,7 @@ import string import isys import iutil import os +import posix import errno import parted import sys @@ -1461,10 +1462,21 @@ class FileSystemSet: entry.mountpoint, msg)) sys.exit(0) + self.makeLVMNodes(instPath) + + def makeLVMNodes(self, instPath, trylvm1 = 0): # XXX hack to make the device node exist for the root fs if # it's a logical volume so that mkinitrd can create the initrd. root = self.getEntryByMountPoint("/") - if isinstance(root.device, LogicalVolumeDevice): + + rootlvm1 = 0 + if trylvm1: + dev = root.device.getDevice() + # lvm1 major is 58 + if posix.major(os.stat("%s/dev/%s" %(instPath, dev)).st_rdev) == 58: + rootlvm1 = 1 + + if isinstance(root.device, LogicalVolumeDevice) or rootlvm1: # now make sure all of the device nodes exist. *sigh* rc = iutil.execWithRedirect("lvm", ["lvm", "vgmknodes", "-v"], @@ -1480,10 +1492,12 @@ class FileSystemSet: os.makedirs(rootdir) dmdev = "/dev/mapper/" + root.device.getDevice().replace("/", "-") iutil.copyDeviceNode(dmdev, instPath + dmdev) + # unlink existing so that we dtrt on upgrades + if os.path.exists(instPath + rootDev): + os.unlink(instPath + rootDev) os.symlink(dmdev, instPath + rootDev) if not os.path.isdir("%s/etc/lvm" %(instPath,)): os.makedirs("%s/etc/lvm" %(instPath,)) -# raise RuntimeError def filesystemSpace(self, chroot='/'): space = [] |