Hello,

For past couple of days I have been working on distro constructor to 
figure out how we can use it to create a RAW disk image  consisting of 
"custom" opensolaris virtual appliances  (read minimized without desktop 
features) which then as needed can be converted to either VDI or VMDK or 
AMI (Amazon EC2 images).

The concept that I am using is simple:  I created my own virtapp.xml  
(ala slim_cd.xml) with minimum packages that I need and  at the end  
where slim_cd create ISO image I create an hdd image formed by  using 
lofiadm on a blank file which acts as my logical empty hard disk of a 
fixed size say 3GB and then I  create a zpool on top of that lofi device 
and in the end I have an hard disk image which I can convert to VDI 
format using VBoxManage convertdd or any other format.

However I am seeing few problems:
My biggest problem that I have encountered is installing grub on this 
lofi device
installgrub fails if I use the following (lofi presents /dev/rlofi/1 as 
a character acess)

First of all /boot/solaris/update_grub returns but it actually fails 
while using lofi device  (without throwing any message)...

Doing the individual components I found the script update_grub is not 
handling zpools devices which are special devices for example it tries 
to prepend /dev/rdsk to every device it finds even if it is /dev/lofi/1

Secondly if I try to do the same steps manually I get two problems

First bootadm update on a lofi device throws error:
# bootadm update-menu -Z -R /mnt -o /dev/rlofi/1
bootadm: invalid device /dev/rlofi/1: cannot determine pool name
bootadm: failed to get pool for device: /dev/rlofi/1
bootadm: invalid device /dev/rlofi/1: cannot determine pool name
bootadm: failed to get pool name from /dev/rlofi/1
bootadm: failed to create GRUB boot signature for device: /dev/rlofi/1
bootadm: failed to get grubsign for root: /mnt, device /dev/rlofi/1


or even if I try the regular block access /dev/lofi/1
# bootadm update-menu -Z -R /mnt -o /dev/lofi/1
bootadm: invalid device /dev/lofi/1: cannot determine pool name
bootadm: failed to get pool for device: /dev/lofi/1
bootadm: invalid device /dev/lofi/1: cannot determine pool name
bootadm: failed to get pool name from /dev/lofi/1
bootadm: failed to create GRUB boot signature for device: /dev/lofi/1
bootadm: failed to get grubsign for root: /mnt, device /dev/lofi/1



The second problem with the manual approach is using installgrub on lofi 
device..
# installgrub /mnt/boot/grub/stage1 /mnt/boot/grub/stage2 /dev/rlofi/1
mount: /dev/lofi/1 is not a DOS filesystem.
cannot mount /dev/lofi/1

I can potentially try it with an actual hard disk but I don't have any 
spare one right now and thought I could leverage lofi to do the magic 
but guess not.. Does anybody have any other ideas?

Thanks in advance.

Regards,
Jignesh


-- 
Jignesh Shah           http://blogs.sun.com/jkshah                      
The New Sun Microsystems,Inc   http://sun.com/postgresql


Reply via email to