Mark Johnson wrote:
> I'll just cover how to build the domU and then
> follow up how to build the ramdisk and put it
> on a USB flash in a later e-mail.
The first problem is that program which builds
a boot archive doesn't handle the -s parameter
correctly.
e.g.
/boot/solaris/bin/root_archive
s) EXTRA_SPACE="$OPTARG"
I am hacking that script right now, adding an
extra 64M to my ramdisk.. Extra credit for anyone
who would like to contribute a fix for this :-)
: alpha[1]#; diff root_archive.new /boot/solaris/bin/root_archive
739,740c739
< END {print int((t + (64 * 1024 * 1024)) * 1.10 / 1024)}')
<
---
> END {print int(t * 1.10 / 1024)}')
: alpha[1]#;
To build a ramdisk, I make sure my disk based embedded domU
is shutdown first!!! Make sure you've configured it how
you want it to be, users, etc. Since this is a ramdisk,
you won't be able to make persistent changes to it.
This is off the top of my head, so there could be some typos.
: alpha[1]#; cp disk.img temp.img
: alpha[1]#; lofiadm -a `pwd`/temp.img
: alpha[1]#; mount /dev/lofi/1 /mnt
: alpha[1]#; rm /mnt/platform/i86pc/boot_archive
: alpha[1]#; rm /mnt/platform/i86pc/amd64/boot_archive
: alpha[1]#; mkdir -p xvm/amd64
: alpha[1]#; root_archive.new pack ./xvm/solaris.ramdisk /mnt
: alpha[1]#; cp /mnt/platform/i86xpv/kernel/unix xvm
: alpha[1]#; cp /mnt/boot/xen.gz xvm/
: alpha[1]#; cp /mnt/platform/i86xpv/kernel/amd64/unix xvm/amd64/
: alpha[1]#; cp /mnt/boot/amd64/xen.gz xvm/amd64/
Now you should have a ramdisk that you can boot on domU
and dom0. Here's my domU py file.
: alpha[1]#; cat ./xvm/guest.py
name = "embedded"
vcpus = 1
memory = "512"
kernel = "/tank/guests/embedded/boot/xvm/amd64/unix"
ramdisk = "/tank/guests/embedded/boot/xvm/solaris.ramdisk"
extra = "/platform/i86xpv/kernel/amd64/unix -k"
vif = ['']
Here's my dom0 grub menu.lst entry
--
title Embedded Solaris xVM (serial console)
kernel$ /boot/xvm/$ISADIR/xen.gz com1=9600,8n1 console=com1
module$ /boot/xvm/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -k -B
console=ttya
module$ /boot/xvm/solaris.ramdisk
Finally, you can put this on a USB or compact flash
drive. This should work on FAT32, etc, since it's just
a ramdisk file. Right now install_grub expects a Solaris
disk so the instructions below will just cover that.
o list usb disks, note the /dev/dsk/c<yourdisk>
# rmmount -l
o unmount all the usb flash partitions, verify they
are unmounted
# rmumount <usbflash>
# df -lk
o partition the usb flash stick, delete all partitions
and make 1 solaris 2 partition
# fdisk /dev/rdsk/c<yourdisk>p0
o format the partition. Put all of the flash in s0.
Save as SMI.
# format -e
o make it a UFS slice
# newfs /dev/rdsk/c<yourdisk>s0
o install grub
# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c<yourdisk>s0
o install the embedded dom0
# mount /dev/dsk/c1t0d0s0 /mnt
# cd /mnt
# <copy your xvm files to /mnt, see my layout below>
o Reboot off the USB flash (Exercise for the reader)
o login as root
o give it a spin, you can boot the same image your using
as a dom0 as a domU. (NOTE: the current py file assumes
you are booted in 64-bit)
# xm list
# <mount your usb disk over /boot>
# xm create -c /boot/xvm/guest.py
---
Here is the layout of my flash disk
: alpha[1]#; ls -lR
.:
total 20
drwxr-xr-x 2 root root 512 Jan 16 10:37 grub/
drwx------ 2 root root 8192 Jan 11 09:11 lost+found/
drwxr-xr-x 3 root root 512 Jan 16 10:37 xvm/
./grub:
total 2
-rw-r--r-- 1 root root 461 Jan 16 10:38 menu.lst
./lost+found:
total 0
./xvm:
total 197430
drwxr-xr-x 2 root root 512 Jan 11 08:35 amd64/
-rw-r--r-- 1 root root 244 Jan 11 16:56 guest.py
-rwxr-xr-x 1 root root 99340669 Jan 11 07:29 solaris.ramdisk*
-rwxr-xr-x 1 root root 1353352 Jan 11 07:29 unix*
-rwxr-xr-x 1 root root 300119 Jan 11 07:29 xen.gz*
./xvm/amd64:
total 4176
-rwxr-xr-x 1 root root 1780432 Jan 11 07:29 unix*
-rwxr-xr-x 1 root root 328566 Jan 11 07:29 xen.gz*
: alpha[1]#;
where...
: alpha[1]#; cat grub/menu.lst
default 0
fallback 1
timeout 10
serial --unit=0 --speed=9600
terminal --timeout=10 console serial
title Solaris xVM
kernel$ /xvm/$ISADIR/xen.gz
module$ /xvm/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -k -B
console=text
module$ /xvm/solaris.ramdisk
title Solaris xVM (serial console)
kernel$ /xvm/$ISADIR/xen.gz com1=9600,8n1 console=com1
module$ /xvm/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -k -B
console=ttya
module$ /xvm/solaris.ramdisk
: alpha[1]#;
I mount the USB stick over /boot, then run domUs with....
: alpha[1]#; cat xvm/guest.py
name = "embedded"
vcpus = 1
memory = "512"
kernel = "/boot/xvm/amd64/unix"
ramdisk = "/boot/xvm/solaris.ramdisk"
extra = "/platform/i86xpv/kernel/amd64/unix -k"
vif = ['','']
on_shutdown = "destroy"
on_reboot = "restart"
on_crash = "destroy"
_______________________________________________
xen-discuss mailing list
[email protected]