[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Staccali-install notes



On Thu, 2006-07-27 at 14:43 +0100, Mark McLoughlin wrote:

> > When staccali-install wants to create an initrd, it runs mkinitrd, which
> > in turn reads /etc/fstab to determine characteristics of the root
> > filesystem.  More likely than not /etc/fstab is going to be totally
> > inappropriate.  Instead staccali should conjure up its own fstab for
> > use by mkinitrd (we know where the root filesystem will be, so this
> > should be trivial).
> 
> 	Yeah, this goes back to the mail I sent out a while back about "what to
> do with an fstab on an image shared between diskless and cached
> clients".
Attached is the trivial code to pass --rootdev and --rootfs to mkinitrd
which avoids the fstab issue completely for staccali-install.

Jeff
	* bootloader.py (_mkinitrd): Accept argument containing path
	of the originlv.  Pass root device and filesystem type to
	mkinitrd rather than deriving them from /etc/fstab.
	(update_bootloader): Corresponding changes to call to _mkinitrd.

Index: src/stacaccli/common/bootloader.py
===================================================================
RCS file: /usr/local/CVS/stacaccli/src/stacaccli/common/bootloader.py,v
retrieving revision 1.1
diff -u -r1.1 bootloader.py
--- src/stacaccli/common/bootloader.py	19 Jun 2006 17:16:48 -0000	1.1
+++ src/stacaccli/common/bootloader.py	1 Aug 2006 20:59:28 -0000
@@ -109,7 +109,7 @@
     finally:
         os.remove (grubscript)
 
-def _mkinitrd (chroot, kernelversion, lvmdev):
+def _mkinitrd (chroot, kernelversion, lvmdev, originlv):
     initrd = "initrd-" + kernelversion + ".img"
         
     def tmpmount (chroot, subdir, type):
@@ -135,8 +135,11 @@
         pid = os.fork ()
         if pid == 0: # child
             os.chroot (chroot)
-            logger.run_command (MKINITRD_PATH + " -f /boot/" +
-                                initrd + " " + kernelversion)
+            logger.run_command (MKINITRD_PATH
+				+ " --rootfs=ext3"
+				+ " --rootdev=" + originlv
+ 				+ " -f /boot/" + initrd 
+				+ " " + kernelversion)
             os._exit (0)
 
         os.waitpid (pid, 0)
@@ -158,7 +161,7 @@
     try:
         kernel = _download_kernel (repository, kernelversion, bootdir)
 
-        initrd = _mkinitrd (chroot, kernelversion, vgi.lvmdev)
+        initrd = _mkinitrd (chroot, kernelversion, vgi.lvmdev, vgi.originlv_path)
 
         _install_bootloader (image.name, device, vgi.rootlv_path, chroot, kernel, initrd)
         

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]