Bug fix crash install if /dev/disk/by-id is not exists

develop
Mike Hiretsky 14 years ago
parent 2943cbe099
commit 217eb2bb12

@ -247,13 +247,17 @@ class fillVars(varsShare):
slpRootDev = rootDev.split("/dev/")
if len(slpRootDev) == 2:
rDev = slpRootDev[1]
devLines = os.listdir("/dev/disk/by-id")
for name in devLines:
pathname = path.join("/dev/disk/by-id", name)
if path.islink(pathname):
if rDev in os.readlink(pathname) and "usb-" in name:
rootType = "usb-hdd"
break
if os.path.exists('/dev/disk/by-id'):
devLines = os.listdir("/dev/disk/by-id")
for name in devLines:
pathname = path.join("/dev/disk/by-id", name)
if path.islink(pathname):
if rDev in os.readlink(pathname) and \
"usb-" in name:
rootType = "usb-hdd"
break
else:
devLines = None
if not devLines:
return ""
if rootType == "ram":

Loading…
Cancel
Save