imgcreate/live.py | 62 +++++++++++++++++++++++++++++++++++-------------------
1 file changed, 41 insertions(+), 21 deletions(-)
New commits:
commit 0cc8f2021b9650444cab38d316dc909148dfba38
Author: Joey Boggs <jboggs(a)redhat.com>
Date: Tue May 11 23:09:49 2010 +0000
add rd_NO_DM dracut cmdline options bz: 589783
diff --git a/imgcreate/live.py b/imgcreate/live.py
index efcd5f0..856cce8 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -484,7 +484,7 @@ menu hiddenrow 5
# tell dracut not to ask for LUKS passwords or activate mdraid sets
if isDracut:
- kern_opts = kernel_options + " rd_NO_LUKS rd_NO_MD"
+ kern_opts = kernel_options + " rd_NO_LUKS rd_NO_MD rd_NO_DM"
else:
kern_opts = kernel_options
commit 43c4758b0bc27d054c4705c0e8a301496c0f7aca
Author: Lubomir Rintel <lkundrak(a)v3.sk>
Date: Wed May 12 10:35:49 2010 -0400
Aside from mkinitrd, create equivalent dracut configuration as well.
This fixes live CD creation from RHEL6, where kernel, unlike in Fedora,
does not bundle the modules that are vital for Live image to start, such
as sr_mod or sd_mod.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 78cbff7..efcd5f0 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -182,12 +182,11 @@ class LiveImageCreatorBase(LoopImageCreator):
def _mount_instroot(self, base_on = None):
LoopImageCreator._mount_instroot(self, base_on)
self.__write_initrd_conf(self._instroot + "/etc/sysconfig/mkinitrd")
+ self.__write_dracut_conf(self._instroot + "/etc/dracut.conf")
def _unmount_instroot(self):
- try:
- os.unlink(self._instroot + "/etc/sysconfig/mkinitrd")
- except:
- pass
+ self.__restore_file(self._instroot + "/etc/sysconfig/mkinitrd")
+ self.__restore_file(self._instroot + "/etc/dracut.conf")
LoopImageCreator._unmount_instroot(self)
def __ensure_isodir(self):
@@ -207,30 +206,50 @@ class LiveImageCreatorBase(LoopImageCreator):
return env
- def __write_initrd_conf(self, path):
- if not os.path.exists(os.path.dirname(path)):
- makedirs(os.path.dirname(path))
- f = open(path, "a")
-
- f.write('LIVEOS="yes"\n')
- f.write('PROBE="no"\n')
- f.write('MODULES+="squashfs ext4 ext3 ext2 vfat msdos "\n')
- f.write('MODULES+="sr_mod sd_mod ide-cd cdrom "\n')
+ def __extra_filesystems(self):
+ return "squashfs ext4 ext3 ext2 vfat msdos ";
+ def __extra_drivers(self):
+ retval = "sr_mod sd_mod ide-cd cdrom "
for module in self.__modules:
if module == "=usb":
- f.write('MODULES+="ehci_hcd uhci_hcd ohci_hcd "\n')
- f.write('MODULES+="usb_storage usbhid "\n')
+ retval = retval + "ehci_hcd uhci_hcd ohci_hcd "
+ retval = retval + "usb_storage usbhid "
elif module == "=firewire":
- f.write('MODULES+="firewire-sbp2 firewire-ohci "\n')
- f.write('MODULES+="sbp2 ohci1394 ieee1394 "\n')
+ retval = retval + "firewire-sbp2 firewire-ohci "
+ retval = retval + "sbp2 ohci1394 ieee1394 "
elif module == "=mmc":
- f.write('MODULES+="mmc_block sdhci sdhci-pci "\n')
+ retval = retval + "mmc_block sdhci sdhci-pci "
elif module == "=pcmcia":
- f.write('MODULES+="pata_pcmcia "\n')
+ retval = retval + "pata_pcmcia "
else:
- f.write('MODULES+="' + module + ' "\n')
+ retval = retval + module + " "
+ return retval
+ def __restore_file(self,path):
+ try:
+ os.unlink(path)
+ except:
+ pass
+ if os.path.exists(path + '.rpmnew'):
+ os.rename(path + '.rpmnew', path)
+
+ def __write_initrd_conf(self, path):
+ if not os.path.exists(os.path.dirname(path)):
+ makedirs(os.path.dirname(path))
+ f = open(path, "a")
+ f.write('LIVEOS="yes"\n')
+ f.write('PROBE="no"\n')
+ f.write('MODULES+="' + self.__extra_filesystems() +
'"\n')
+ f.write('MODULES+="' + self.__extra_drivers() + '"\n')
+ f.close()
+
+ def __write_dracut_conf(self, path):
+ if not os.path.exists(os.path.dirname(path)):
+ makedirs(os.path.dirname(path))
+ f = open(path, "a")
+ f.write('filesystems+="' + self.__extra_filesystems() + '
"\n')
+ f.write('drivers+="' + self.__extra_drivers() + '
"\n')
f.close()
def __create_iso(self, isodir):
commit acef794c9225371e11d3e4b6e84805ef2911cc77
Author: Lubomir Rintel <lkundrak(a)v3.sk>
Date: Wed May 12 10:35:36 2010 -0400
This reverts commit 5f42d465badfc2b172e0bb10a2c0d2a27a164d27.
Apart from duplicating code (well, data) this intruduces a bug where
dracut.conf is written in the install root prior to dracut package
installed, which causes the vanilla configu file to be written out as
dracut.conf.rpmnew.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 0d044ee..78cbff7 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -181,11 +181,11 @@ class LiveImageCreatorBase(LoopImageCreator):
def _mount_instroot(self, base_on = None):
LoopImageCreator._mount_instroot(self, base_on)
- self.__write_initrd_conf(self._instroot + "/etc/dracut.conf")
+ self.__write_initrd_conf(self._instroot + "/etc/sysconfig/mkinitrd")
def _unmount_instroot(self):
try:
- os.unlink(self._instroot + "/etc/dracut.conf")
+ os.unlink(self._instroot + "/etc/sysconfig/mkinitrd")
except:
pass
LoopImageCreator._unmount_instroot(self)
@@ -212,23 +212,24 @@ class LiveImageCreatorBase(LoopImageCreator):
makedirs(os.path.dirname(path))
f = open(path, "a")
+ f.write('LIVEOS="yes"\n')
f.write('PROBE="no"\n')
- f.write('add_drivers+="squashfs ext4 ext3 ext2 vfat msdos
"\n')
- f.write('add_drivers+="sr_mod sd_mod ide-cd cdrom "\n')
+ f.write('MODULES+="squashfs ext4 ext3 ext2 vfat msdos "\n')
+ f.write('MODULES+="sr_mod sd_mod ide-cd cdrom "\n')
for module in self.__modules:
if module == "=usb":
- f.write('add_drivers+="ehci_hcd uhci_hcd ohci_hcd
"\n')
- f.write('add_drivers+="usb_storage usbhid "\n')
+ f.write('MODULES+="ehci_hcd uhci_hcd ohci_hcd "\n')
+ f.write('MODULES+="usb_storage usbhid "\n')
elif module == "=firewire":
- f.write('add_drivers+="firewire-sbp2 firewire-ohci
"\n')
- f.write('add_drivers+="sbp2 ohci1394 ieee1394 "\n')
+ f.write('MODULES+="firewire-sbp2 firewire-ohci "\n')
+ f.write('MODULES+="sbp2 ohci1394 ieee1394 "\n')
elif module == "=mmc":
- f.write('add_drivers+="mmc_block sdhci sdhci-pci "\n')
+ f.write('MODULES+="mmc_block sdhci sdhci-pci "\n')
elif module == "=pcmcia":
- f.write('add_drivers+="pata_pcmcia "\n')
+ f.write('MODULES+="pata_pcmcia "\n')
else:
- f.write('add_drivers+="' + module + ' "\n')
+ f.write('MODULES+="' + module + ' "\n')
f.close()
Show replies by date