WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [RFC][PATCH] create an initrd for dom0 in install.sh script

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [RFC][PATCH] create an initrd for dom0 in install.sh script
From: Harry Butterworth <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Mar 2006 16:08:04 +0100
Delivery-date: Thu, 30 Mar 2006 15:09:00 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The attached patch creates an initrd for dom0 during execution of the
install.sh script when the installation is being performed to the root
directory.

I chose the initrd name to correspond with the documentation in the
README file in the dist directory.

It works for me on my ubuntu x86_64 installation but it's untested on
anything else.  I'm guessing that this stuff is probably very distro
specific so it probably not a good idea to actually apply this patch
until it has been tested on some other distros etc.

I'm guessing that the initrd created for dom0 in general won't work for
domU domains.  I'm not sure what to do about that.

Also my script-fu is weak so even what little is here could probably be
better.

Harry.

# HG changeset patch
# User harry@xxxxxxxxxxxxxxxxxxxxx
# Node ID 7d648c1099b21f36de09acf5481122ceaeb1fde4
# Parent  9239f190736d85933bbe64eca0613c24c07617df
Create an initrd for dom0 in the install script.

diff -r 9239f190736d -r 7d648c1099b2 install.sh
--- a/install.sh        Wed Mar 29 23:11:53 2006
+++ b/install.sh        Thu Mar 30 14:57:57 2006
@@ -44,6 +44,18 @@
 (cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
 rm -rf "$tmp"
 
+if [ -x "$(which mkinitrd)" ] && [ -x "$(which depmod)" ] && [ $dst ==
'/' ]; then
+  cd $src/lib/modules
+  for i in *; do
+    echo " - creating initrd-$i.img for dom0"
+    depmod $i
+    mkinitrd -o $dst/boot/initrd-$i.img $i
+  done
+  cd -
+else
+  echo " - you may need to create an initrd for dom0"
+fi
+
 echo "All done."
 
 echo "Checking to see whether prerequisite tools are installed..."
diff -r 9239f190736d -r 7d648c1099b2
linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile
--- a/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile  Wed Mar 29
23:11:53 2006
+++ b/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile  Thu Mar 30
14:57:57 2006
@@ -19,3 +19,4 @@
        install -m0664 .config
$(INSTALL_ROOT)/boot/config-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
        install -m0664 System.map
$(INSTALL_ROOT)/boot/System.map-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
        ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
$(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
+       ln -f -s initrd-$(XINSTALL_NAME)$(INSTALL_SUFFIX).img
$(INSTALL_ROOT)/boot/initrd-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX).img

Attachment: initrd.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>