summaryrefslogtreecommitdiffstats
path: root/milo.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-07-04 18:18:54 +0000
committerMatt Wilson <msw@redhat.com>2000-07-04 18:18:54 +0000
commit8f10ab5981cb98203285895e832f494975e250eb (patch)
tree0d5006dbb029ac12a43b7479f2179ca2b2a57a87 /milo.py
parentf8a7a89bd4ecaf84151cf32897fe8f9a84a8b863 (diff)
downloadanaconda-8f10ab5981cb98203285895e832f494975e250eb.tar.gz
anaconda-8f10ab5981cb98203285895e832f494975e250eb.tar.xz
anaconda-8f10ab5981cb98203285895e832f494975e250eb.zip
initrd support in aboot
Diffstat (limited to 'milo.py')
-rw-r--r--milo.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/milo.py b/milo.py
index 3e890d905..94de4596e 100644
--- a/milo.py
+++ b/milo.py
@@ -34,8 +34,22 @@ def wholeDevice (path):
class MiloInstall:
def __init__ (self, todo):
+ self.initrdsMade = {}
self.todo = todo
+ def makeInitrd (self, kernelTag, instRoot):
+ initrd = "/boot/initrd%s.img" % (kernelTag, )
+ if not self.initrdsMade.has_key(initrd):
+ iutil.execWithRedirect("/sbin/mkinitrd",
+ [ "/sbin/mkinitrd",
+ "--ifneeded",
+ initrd,
+ kernelTag[1:] ],
+ stdout = None, stderr = None, searchPath = 1,
+ root = instRoot)
+ self.initrdsMade[kernelTag] = 1
+ return initrd
+
def writeAboot (self):
bootDevice = self.todo.fstab.getBootDevice ()
rootDevice = self.todo.fstab.getRootDevice ()[0]
@@ -75,9 +89,14 @@ class MiloInstall:
if (self.todo.hdList.has_key(package) and
self.todo.hdList[package].selected):
kernel = self.todo.hdList[package]
+ initrd = self.makeInitrd (tag, self.todo.instPath)
+ extra=""
+ if os.access (instRoot + initrd, os.R_OK):
+ extra=" initrd=%s/%s" % (kernelprefix, initrd)
version = "%s-%s" % (kernel['version'], kernel['release'])
- f.write ("%d:%d%svmlinuz-%s%s root=/dev/%s\n" %
- (lines, partition, kernelprefix, version, tag, rootDevice))
+ f.write ("%d:%d%svmlinuz-%s%s root=/dev/%s%s\n" %
+ (lines, partition, kernelprefix,
+ version, tag, rootDevice, extra))
lines = lines + 1
f.close ()