FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux User Repository

 
 
LinkBack Thread Tools
 
Old 05-28-2010, 03:58 PM
Hans de Goede
 
Default booty: make grubbyPartitionName and grubbydiskName take a device

---
booty/x86.py | 43 ++++++++++++++++++++++++-------------------
1 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/booty/x86.py b/booty/x86.py
index 09b17d9..4df2a97 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -134,8 +134,8 @@ class x86BootloaderInfo(efiBootloaderInfo):
bootDevs = self.getPhysicalDevices(bootDev)

installs = [(None,
- self.grubbyPartitionName(stage1Devs[0].name),
- self.grubbyPartitionName(bootDevs[0].name))]
+ self.grubbyPartitionName(stage1Devs[0]),
+ self.grubbyPartitionName(bootDevs[0]))]

if bootDev.type == "mdarray":

@@ -148,9 +148,11 @@ class x86BootloaderInfo(efiBootloaderInfo):
# 1) install stage1 on target disk/partiton
stage1Dev, mdMemberBootPart = matches[0]
installs = [(None,
- self.grubbyPartitionName(stage1Dev.name),
- self.grubbyPartitionName(mdMemberBootPart.name))]
- firstMdMemberDiskGrubbyName = self.grubbyDiskName(getDiskPart(mdMemberBootPart.n ame, self.storage)[0])
+ self.grubbyPartitionName(stage1Dev),
+ self.grubbyPartitionName(mdMemberBootPart))]
+ firstMdMemberDiskGrubbyName = self.grubbyDiskName(
+ self.storage.devicetree.getDeviceByName(
+ getDiskPart(mdMemberBootPart.name, self.storage)[0]))

# 2) and install stage1 on other members' disks/partitions too
# NOTES:
@@ -174,12 +176,14 @@ class x86BootloaderInfo(efiBootloaderInfo):
mdRaidDeviceRemap = (firstMdMemberDiskGrubbyName,
mdMemberBootDisk)

- stage1TargetGrubbyName = self.grubbyPartitionName(stage1Target.name)
- rootPartGrubbyName = self.grubbyPartitionName(mdMemberBootPart.name)
+ stage1TargetGrubbyName = self.grubbyPartitionName(stage1Target)
+ rootPartGrubbyName = self.grubbyPartitionName(mdMemberBootPart)

# now replace grub disk name part according to special device
# mapping
- old = self.grubbyDiskName(mdMemberBootDisk).strip('() ')
+ old = self.grubbyDiskName(
+ self.storage.devicetree.getDeviceByName(
+ mdMemberBootDisk)).strip('() ')
new = firstMdMemberDiskGrubbyName.strip('() ')
rootPartGrubbyName = rootPartGrubbyName.replace(old, new)
stage1TargetGrubbyName = stage1TargetGrubbyName.replace(old, new)
@@ -270,7 +274,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
f.write("# all kernel and initrd paths are relative "
"to /, eg.
")

- f.write('# root %s
' % self.grubbyPartitionName(bootDevs[0].name))
+ f.write('# root %s
' % self.grubbyPartitionName(bootDevs[0]))
f.write("# kernel %svmlinuz-version ro root=%s
" % (cfPath, rootDev.path))
f.write("# initrd %sinitrd-[generic-]version.img
" % (cfPath))
f.write("#boot=/dev/%s
" % (grubTarget))
@@ -313,7 +317,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
# we only want splashimage if they're not using a serial console
if os.access("%s/boot/grub/splash.xpm.gz" %(instRoot,), os.R_OK):
f.write('splashimage=%s%sgrub/splash.xpm.gz
'
- % (self.grubbyPartitionName(bootDevs[0].name), cfPath))
+ % (self.grubbyPartitionName(bootDevs[0]), cfPath))
f.write("hiddenmenu
")


@@ -327,7 +331,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
initrd = self.makeInitrd(kernelTag, instRoot)

f.write('title %s (%s)
' % (longlabel, version))
- f.write(' root %s
' % self.grubbyPartitionName(bootDevs[0].name))
+ f.write(' root %s
' % self.grubbyPartitionName(bootDevs[0]))

realroot = " root=%s" % rootDev.fstabSpec

@@ -370,7 +374,8 @@ class x86BootloaderInfo(efiBootloaderInfo):
if ((not longlabel) or (longlabel == "")):
continue
f.write('title %s
' % (longlabel))
- f.write(' rootnoverify %s
' % self.grubbyPartitionName(device))
+ f.write(' rootnoverify %s
' % self.grubbyPartitionName(
+ self.storage.devicetree.getDeviceByName(device)))
# f.write(' makeactive
')
f.write(' chainloader +1')
f.write('
')
@@ -428,7 +433,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
# be in the device map, they shouldn't still be in the list.
dev = self.storage.devicetree.getDeviceByName(drive)
if not dev.type == "mdarray":
- f.write("(%s) %s
" % (self.grubbyDiskName(drive), dev.path))
+ f.write("(%s) %s
" % (self.grubbyDiskName(dev), dev.path))
f.close()

def writeSysconfig(self, instRoot, grubTarget, upgrade):
@@ -451,16 +456,16 @@ class x86BootloaderInfo(efiBootloaderInfo):
f.write("forcelba=0
")
f.close()

- def grubbyDiskName(self, name):
- return "hd%d" % self.drivelist.index(name)
+ def grubbyDiskName(self, dev):
+ return "hd%d" % self.drivelist.index(dev.name)

def grubbyPartitionName(self, dev):
- (name, partNum) = getDiskPart(dev, self.storage)
+ (name, partNum) = getDiskPart(dev.name, self.storage)
+ disk = self.storage.devicetree.getDeviceByName(name)
if partNum != None:
- return "(%s,%d)" % (self.grubbyDiskName(name), partNum)
+ return "(%s,%d)" % (self.grubbyDiskName(disk), partNum)
else:
- return "(%s)" %(self.grubbyDiskName(name))
-
+ return "(%s)" %(self.grubbyDiskName(disk))

def getBootloaderConfig(self, instRoot, bl, kernelList,
chainList, defaultDev):
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:18 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org