Bug 551469 - initrd is obsolete name for initial ram disk, use initramfs
Summary: initrd is obsolete name for initial ram disk, use initramfs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: appliance-tools
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Huff
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 546134 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-30 21:35 UTC by Marek Goldmann
Modified: 2010-03-03 01:58 UTC (History)
4 users (show)

Fixed In Version: appliance-tools-004.5-1.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-03 01:58:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Marek Goldmann 2009-12-30 21:35:13 UTC
Description of problem:

I found a bug in appliance-creator, exactly in appcreate/appliance.py, line 234:

230         for v in versions:
231             grub += "title %s (%s)\n" % (self.name, v)
232             grub += "        root (hd0,%d)\n" % bootdevnum
233             grub += "        kernel %s/vmlinuz-%s ro root=%s %s\n" % (prefix, v, rootdev, options)
234             grub += "        initrd %s/initrd-%s.img\n" % (prefix, v)
235 
236         logging.debug("Writing grub config %s/boot/grub/grub.conf" % self._instroot)
237         cfg = open(self._instroot + "/boot/grub/grub.conf", "w")
238         cfg.write(grub)
239         cfg.close()

Fedora 12 is using dracut to generate initrd files and initrd is a wrong name for those files from now. The new name is initramfs, so line 234 should look like:

234             grub += "        initrd %s/initramfs-%s.img\n" % (prefix, v)

Version-Release number of selected component (if applicable):

[oddthesis@lolek-f12 cirras]$ rpm -q appliance-tools
appliance-tools-004.4-3.fc12.noarch

How reproducible:

Always.

Comment 1 Marek Goldmann 2009-12-31 07:25:47 UTC
One thought:

Fixing this is not simple as changing only line 234. We should use "initramfs" only for Fedora in version 12 or higher, in other cases use "initrd".

Comment 2 Marek Goldmann 2010-01-02 09:00:15 UTC
Maybe we should check what ramdisk is installed?

--- appliance.py.orig	2010-01-02 09:40:03.373786038 +0100
+++ appliance.py	2010-01-02 09:58:38.482721695 +0100
@@ -227,11 +227,16 @@
             for version in kernels[kernel]:
                 versions.append(version)
 
+        if int(os.system("ls " + self._instroot + "/boot/initramfs* 2> /dev/null | wc -l")) > 0:
+            initrd = "initramfs"
+        else:
+            initrd = "initrd"
+
         for v in versions:
             grub += "title %s (%s)\n" % (self.name, v)
             grub += "        root (hd0,%d)\n" % bootdevnum
             grub += "        kernel %s/vmlinuz-%s ro root=%s %s\n" % (prefix, v, rootdev, options)
-            grub += "        initrd %s/initramfs-%s.img\n" % (prefix, v)
+            grub += "        initrd %s/%s-%s.img\n" % (prefix, initrd, v)
 
         logging.debug("Writing grub config %s/boot/grub/grub.conf" % self._instroot)
         cfg = open(self._instroot + "/boot/grub/grub.conf", "w")

Comment 3 Marek Goldmann 2010-01-02 10:31:24 UTC
Scratch my above comment (I'm not a Python programmer), check out this one:

--- appliance.py.orig	2010-01-02 09:40:03.373786038 +0100
+++ appliance.py	2010-01-02 11:22:44.204771295 +0100
@@ -227,11 +227,16 @@
             for version in kernels[kernel]:
                 versions.append(version)
 
+        if int(subprocess.Popen("ls " + self._instroot + "/boot/initramfs* | wc -l", shell=True, stdout=subprocess.PIPE).communicate()[0].strip()) > 0:
+            initrd = "initramfs"
+        else:
+            initrd = "initrd"
+
         for v in versions:
             grub += "title %s (%s)\n" % (self.name, v)
             grub += "        root (hd0,%d)\n" % bootdevnum
             grub += "        kernel %s/vmlinuz-%s ro root=%s %s\n" % (prefix, v, rootdev, options)
-            grub += "        initrd %s/initramfs-%s.img\n" % (prefix, v)
+            grub += "        initrd %s/%s-%s.img\n" % (prefix, initrd, v)
 
         logging.debug("Writing grub config %s/boot/grub/grub.conf" % self._instroot)
         cfg = open(self._instroot + "/boot/grub/grub.conf", "w")

Comment 4 David Huff 2010-02-09 18:54:47 UTC
*** Bug 546134 has been marked as a duplicate of this bug. ***

Comment 6 Fedora Update System 2010-02-10 15:44:01 UTC
appliance-tools-004.5-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/appliance-tools-004.5-1.fc12

Comment 7 Fedora Update System 2010-02-11 14:59:31 UTC
appliance-tools-004.5-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update appliance-tools'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-1777

Comment 8 Fedora Update System 2010-03-03 01:58:25 UTC
appliance-tools-004.5-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.