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

Re: [Xen-users] Startup-Hook Script ?


  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Fajar A. Nugraha" <fajar@xxxxxxxxx>
  • Date: Tue, 01 Jul 2008 10:02:02 +0700
  • Delivery-date: Mon, 30 Jun 2008 20:02:43 -0700
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Steffen Heil wrote:
For example this is my iscsi script:

http://kinkrsoftware.nl/contrib/xen/block-iscsi

If you do file based stuff I suggest you to look at a wrapper around tap:aio://

As I use "phy:" for my devices, I added a script "block-boot-phy" as a copy
of block and modified it to copy the kernel out of the device that was
attached using "boot-phy:" and this works.

But it works too late. The kernel or initrd is already loaded at that point.


Since function-wise you're trying to achieve what pygrub does, it might be easier to create another pygrub-like script and put it as bootloader on your config file.

for example, pygrub takes these parameters :
/usr/bin/pygrub [-q|--quiet] [-i|--interactive] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] <image>

when used as bootloader on domU config file, pygrub will be invoked with something like
pygrub --output=/var/run/xend/boot/xenbl.3079 /dev/rootvg/testlv

Your script should only need to parse --output and <image>. The script output should be something like this, redirected to wherever --output points to : linux (kernel /var/run/xend/boot/boot_kernel._rjEHS)(ramdisk /var/run/xend/boot/boot_ramdisk.5uZPgQ)(args "ro root=/dev/hda1")

Attached is bash script that MIGHT work you. This script does not parse grub's config file, so you might need to manually adjust ARGS at the top of the script as needed (my test works fine with empty ARGS though).

Regards,

Fajar


Attachment: bootloader.sh
Description: application/shellscript

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.