- fix possible issues with linux->grub device name conversion

- try to fix a weird issue with writelines() in trigger_remove_boot_grub()

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1458 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2008-03-12 17:22:28 +00:00
parent 8f7ab42f1c
commit 6fe6318a4e
+10 -2
View File
@@ -6559,7 +6559,8 @@ timeout=10
new_conf.append(line)
f = open(etpConst['systemroot']+"/boot/grub/grub.conf","w")
f.writelines(new_conf)
for line in new_conf:
f.write(line)
f.flush()
f.close()
@@ -6611,8 +6612,15 @@ timeout=10
# get disk
match = re.subn("[0-9]","",gboot)
gdisk = match[0]
if gdisk == '':
self.Entropy.updateProgress(
bold(" QA Warning: ") + brown("cannot match %s device with a GRUB one!! Cannot properly configure kernel! Defaulting to (hd0,0)") % (gboot,),
importance = 0,
header = red(" ##")
)
return "(hd0,0)"
match = re.subn("[a-z/]","",gboot)
gpartnum = str(int(match[0])-1)
gpartnum = str(int(gdisk)-1)
# now match with grub
device_map = etpConst['packagestmpdir']+"/grub.map"
if os.path.isfile(device_map):