diff options
author | Chris Lumens <clumens@redhat.com> | 2008-01-29 14:31:55 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-01-29 14:31:55 -0500 |
commit | 3335f2e37cf3c969ae7e3d68283f144459973441 (patch) | |
tree | 83e84af9161c45a3eabcddebe690ffb2cdad7ac7 | |
parent | 553f494dea845b8d3ae30af5977619ad05084af2 (diff) | |
download | anaconda-3335f2e37cf3c969ae7e3d68283f144459973441.tar.gz anaconda-3335f2e37cf3c969ae7e3d68283f144459973441.tar.xz anaconda-3335f2e37cf3c969ae7e3d68283f144459973441.zip |
Remove the last references to makeDevInode (#430784).
-rwxr-xr-x | command-stubs/list-harddrives-stub | 10 | ||||
-rwxr-xr-x | command-stubs/losetup-stub | 2 | ||||
-rwxr-xr-x | command-stubs/mknod-stub | 18 |
3 files changed, 6 insertions, 24 deletions
diff --git a/command-stubs/list-harddrives-stub b/command-stubs/list-harddrives-stub index 73f86c2e6..d5c88a76a 100755 --- a/command-stubs/list-harddrives-stub +++ b/command-stubs/list-harddrives-stub @@ -36,26 +36,24 @@ drives = isys.hardDriveDict() driveList = drives.keys() driveList.sort() -for drive in driveList: +for drive in driveList: if not isys.mediaPresent(drive): continue # try to open and get size skip = 0 - deviceFile = "/tmp/%s" % (drive,) - isys.makeDevInode(drive, deviceFile) + deviceFile = "/dev/%s" % (drive,) + try: dev = parted.PedDevice.get(deviceFile) except: skip = 1 - os.remove(deviceFile) if skip: continue sizeMB = (float(dev.heads * dev.cylinders * dev.sectors) / (1024 * 1024) * dev.sector_size) - - print drive, sizeMB + print drive, sizeMB diff --git a/command-stubs/losetup-stub b/command-stubs/losetup-stub index 57fbaccff..bf186a172 100755 --- a/command-stubs/losetup-stub +++ b/command-stubs/losetup-stub @@ -39,7 +39,6 @@ if len(argv) < 3: if argv[1] == "-d" and len(argv[2]) > 4 and argv[2][-5:-1] == "loop": try: - isys.makeDevInode(argv[2][-5:], argv[2]) isys.unlosetup(argv[2]) except SystemError, (errno, msg): print msg @@ -48,7 +47,6 @@ if argv[1] == "-d" and len(argv[2]) > 4 and argv[2][-5:-1] == "loop": if len(argv[1]) > 4 and argv[1][-5:-1] == "loop": try: - isys.makeDevInode(argv[1][-5:], argv[1]) isys.losetup(argv[1], argv[2]) except SystemError, (errno, msg): print msg diff --git a/command-stubs/mknod-stub b/command-stubs/mknod-stub index 03320abc0..dd72aeb24 100755 --- a/command-stubs/mknod-stub +++ b/command-stubs/mknod-stub @@ -26,8 +26,7 @@ import stat import os def usage(): - sys.stderr.write("Usage: %s <path> [b|c] <major> <minor> or\n" %(sys.argv[0],)) - sys.stderr.write("Usage: %s <path>\n" %(sys.argv[0],)) + sys.stderr.write("Usage: %s <path> [b|c] <major> <minor>\n" %(sys.argv[0],)) sys.exit(1) def main(): @@ -38,19 +37,6 @@ def main(): usage() path = sys.argv[1] - if (len(sys.argv) == 2): - drive = path - # strip off any path elements up until what's useful for making the - # inode - while (drive.find('/') != -1): - if (drive.startswith("cciss") or drive.startswith("ida") or - drive.startswith("rd") or drive.startswith("ataraid") - or drive.startswith("iseries") or drive.startswith("i2o") - or drive.startswith("sx8")): - break - drive = drive[drive.find('/') + 1:] - isys.makeDevInode(drive, path) - sys.exit(0) if len(sys.argv) < 5: usage() @@ -65,7 +51,7 @@ def main(): major = int(sys.argv[3]) minor = int(sys.argv[4]) path = sys.argv[1] - + os.mknod(path, 0644 | type, os.makedev(major, minor)) if __name__ == "__main__": |