Converting the MilaX Live CD for SPARC to a WANBOOT image

by Bernd Schemmer, November 2009

Last Update: 08.11.2009/bs

Table of Contents

  1. Converting the MilaX Live CD for SPARC to a WANBOOT image
    1. History
    2. Introduction
      1. Purpose
      2. Scope
      3. Prerequisites
      4. References
        1. VNC Clients
    3. Installation
      1. Convert the MilaX Live CD to a UFS Installation
      2. Convert the MilaX UFS Installation to a WANBOOT Image
    4. Using the MilaX WANBOOT Image
    5. Adding Files to the MilaX WANBOOT Image
      1. Adding Files to the MilaX WANBOOT Image Without Compression
      2. Adding Files to the MilaX WANBOOT Image With Compression
    6. Troubleshooting
      1. Files Are Read-Only in the MilaX WANBOOT Image
      2. /boot/solaris/bin/root_archive Not Found
      3. A Machine Cannot Boot From the WANBOOT Image
      4. The drd Daemon Fails on non-sun4v Machines
      5. The VNC  Viewer Freezes
      6. Some Keys Do Not Work in the Java VNC Viewer
    7. Appendix
      1. Using a ramdisk Instead of a Physical Slice for the MilaX UFS Installation
      2. MilaX WANBOOT Images
      3. The ufsinstall script for the UFS installation


History

Version/Date Changes
08.11.2009 v1.00/bs
inital release

Introduction

Purpose

MilaX is a small size Live CD distribution which runs completely off a CD.
MilaX is the perfect tool for troubleshooting a not-booting Solaris installation. MilaX is available for x86 and
for SPARC machines. Unfortunately a lot of SPARC machines reside in data centers and there is no easy access to
the CDROM drive of these machines. Therefore, it's difficult to use the MilaX Live CD in these environments. But
in most data centers, a WANBOOT server exists for the installation of the SPARC machines. So, to use MilaX also
for these machines, it's useful to convert the MilaX Live CD to a WANBOOT image.

This article describes how to convert the MilaX Live CD for SPARC to a WANBOOT image.

Scope

This article only describes how to convert the MilaX Live CD to a WANBOOT image – it does not talk about how
to use the MilaX WANBOOT image or how to set up a WANBOOT server.

Note: WANBOOT is only supported for SPARC machines.

Prerequisites

References

MilaX Homepage

Download page for MilaX SPARC ISO image 0.3.2

Using the MilaX Live CD for failsafe booting

Adding a Live CD Distribution to an existing Solaris installation

Talking about RAM disks in the Solaris OS

Using on the fly-decompression for UFS filesystems

Using WAN Boot From a Hard Disk on a System Running Solaris 9 and Above


VNC Clients

TightVNC

UltraVNC

RealVNC

Installation

Converting the MilaX Live CD to a WANBOOT image must be done in two steps:

First step: Convert the MilaX Live CD to a UFS installation.

Second step: Convert the MilaX UFS installation to a WANBOOT image.

Convert the MilaX Live CD to a UFS Installation

To convert the MilaX Live CD to a UFS installation, boot a SPARC machine with a free slice on one of the disks
and a recent Solaris 10 installation from the MilaX Live CD.

Note: Alternative: you can use a ramdisk with about 900 MB instead of a free slice; see the section
Using a ramdisk Instead of a Physical Slice for the MilaX UFS Installation below.

Log in a as user alex (password alex) to MilaX, become root user (password root), copy the script ufsinstall
(see The ufsinstall script for the UFS installation) to the /tmp directory, and make it executable with the chmod command:

# reboot -- " net -v -V "
Nov  1 13:39:27 v240 reboot: rebooted by root
Creating boot_archive for /tmp/maint1
updating /tmp/maint1/platform/sun4u/boot_archive
15+0 records in
15+0 records out
Nov  1 13:39:59 v240 ufs: NOTICE: alloc: /tmp/maint1: file system full
cat: write error: No space left on device
syncing file systems... done
rebooting...
...

Rebooting with command: boot cdrom
Boot device: /pci@1e,600000/ide@d/cdrom@0,0:f  File and args:
SunOS Release 5.11 Version MilaX_0.3.1 64-bit
Copyright 1983-2008 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hardware watchdog enabled
Remounting root read/write
Probing for device nodes ...
Preparing live image for use
Hostname: milax
Done mounting live image from memory
Configuring devices.
Mounting local partitions/cdroms
Using physical swap on hdd (/dev/dsk/c2t0d0s1)
Reading ZFS config: done.

milax console login: alex
Password:
Sun Microsystems Inc.   SunOS 5.11      MilaX_0.3.1     July 2008
(alex@milax)$ su -
Password:
Nov  1 04:50:03 milax su: 'su root' succeeded for alex on /dev/console
Sun Microsystems Inc.   SunOS 5.11      MilaX_0.3.1     July 2008
(root@milax)#
(root@milax)# cd /tmp
(root@milax)# scp xtrnaw7@192.168.1.180:/data/download/ufsinstall .
The authenticity of host '192.168.1.180 (192.168.1.180)' can't be established.
RSA key fingerprint is 70:83:8a:13:f1:9c:d8:d9:d2:7f:04:83:2c:e2:cc:be.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.180' (RSA) to the list of known hosts.
Password:
ufsinstall           100% |*****************************|  5866       00:00
(root@milax)# chmod 755 ufsinstall
(root@milax)# ls -l ufsinstall
-rwxr-xr-x   1 root     root        6051 Nov  1 15:44 ufsinstall

Now check that the target slice for the MilaX UFS installation is not already mounted (the MilaX Live CD
automatically mounts all existing slices with a file system known by MilaX). If it's mounted, unmount it.

Next run the ufsinstall script.

The syntax for the ufsinstall script is:

./ufsinstall [targetdevice]

targetdevice is the device on which MilaX will be installed. This should be a slice on one of the disks with
about 1 GB in size.

Example:

(root@milax)# ./ufsinstall /dev/dsk/c2t3d0s4
Installing MilaX to /dev/dsk/c2t3d0s4  - all files on that FS will be overwritten! Press enter to continue

umount: warning: /lib/libc.so.1 not in mnttab
umount: /lib/libc.so.1 not mounted
Warning: 1524 sector(s) in last cylinder unallocated
/dev/rdsk/c2t3d0s4:     4194828 sectors in 683 cylinders of 48 tracks, 128 sectors
        2048.3MB in 43 cyl groups (16 c/g, 48.00MB/g, 7744 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
 3248288, 3346720, 3445152, 3543584, 3642016, 3740448, 3838880, 3937312,
 4035744, 4134176
Starting to copy data from UFS root to /ufsroot - this may take some time.
/ufsroot/etc/crypto/certs/SUNWObjectCA linked to /ufsroot/etc/certs/SUNWObjectCA
/ufsroot/etc/rc0.d/K16apache linked to /ufsroot/etc/init.d/apache
...
tar: ./dev/.devfsadm_synch_door is not a file. Not dumped
tar: ./dev/.devname_lookup_door is not a file. Not dumped
tar: ./svc/volatile/repository_door is not a file. Not dumped
tar: ./svc/volatile/dladm/dlmgmt_door is not a file. Not dumped
tar: ./sysevent/devfsadm_event_channel/1 is not a file. Not dumped
tar: ./sysevent/devfsadm_event_channel/reg_door is not a file. Not dumped
tar: ./sysevent/syseventconfd_event_channel/reg_door is not a file. Not dumped
tar: ./sysevent/sysevent_door is not a file. Not dumped
Updating vfstab
Removing temporary files
rm: /ufsroot/var/tmp/*: No such file or directory

###################################################

MilaX now installed on ufs

real    2m11.748s
user    0m5.596s
sys     0m26.235s
(root@milax)#

# Note: As far as I know, you can ignore the error messages from the ufsinstall script.

# After the script is done, the slice with the MilaX UFS installation
# is still mounted to /ufsroot:
#
(root@milax)# df -h /ufsroot/
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c2t3d0s4      2.0G   812M   1.1G    42%    /ufsroot

Convert the MilaX UFS Installation to a WANBOOT Image

After converting the MilaX Live CD to a UFS installation, reboot the machine with the MilaX UFS installation
from the Solaris 10 installation.

Log in, become root, and execute the following steps from within Solaris 10:

# create temporary directories
#
root@v240:~# mkdir /tmp/milax_wanboot

root@v240:~# mkdir /tmp/milax_on_ufs

# mount the MilaX UFS installation
#
root@v240:~# mount /dev/dsk/c1t3d0s4 /tmp/milax_on_ufs

root@v240:~# df -h /tmp/milax_on_ufs/
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1t3d0s4      2.0G   659M   1.3G    34%    /tmp/milax_on_ufs

root@v240:~# ls /tmp/milax_on_ufs/
alex        boot        devices     kernel      lost+found  mnt         platform    root        system      usr
bin         dev         etc         lib         media       opt         proc        sbin        tmp         var

You can now add other files to the MilaX UFS installation if necessary.

After the customization is done, use the script root_archive to convert the MilaX UFS installation to a
WANBOOT image (root_archive is part of the normal Solaris installation):

 root@v240:~# time /boot/solaris/bin/root_archive packmedia /tmp/milax_wanboot /tmp/milax_on_ufs
/tmp/milax_wanboot/Solaris_*: No such file or directory
find: stat() error tmp/root/var/sadm/install: No such file or directory
find: stat() error tmp/root/var/sadm/pkg: No such file or directory
find: stat() error dt: No such file or directory
find: stat() error openwin/bin/mkfontdir: No such file or directory
find: stat() error openwin/lib/installalias: No such file or directory
find: stat() error openwin/server/lib/libfont.so.1: No such file or directory
find: stat() error openwin/server/lib/libtypesclr.so.0: No such file or directory
/tmp/milax_wanboot/Solaris_*: No such file or directory
find: stat() error usr/lib/install: No such file or directory

real    9m36.509s
user    7m51.572s
sys     6m13.434s
root@v240:~#

# Note: As far as I know, you can ignore the error messages from the root_archive script.

Now we have a MilaX WANBOOT image:

root@v240:~# ls -l  /tmp/milax_wanboot/boot/sparc.miniroot
-rw-r--r-T   1 root     root     511180800 Oct 31 19:26 /tmp/milax_wanboot/boot/sparc.miniroot

root@v240:~# ls -l /tmp/milax_wanboot/Tools/Boot/platform/sun4*/wanboot
-rw-r--r--   1 root     root     1191992 Oct 31 19:17 /tmp/milax_wanboot/Tools/Boot/platform/sun4u/wanboot
-rw-r--r--   1 root     root     1191256 Oct 31 19:17 /tmp/milax_wanboot/Tools/Boot/platform/sun4v/wanboot

Mostly all files in the WANBOOT image created by the script root_archive are compressed with fiocompress
(see Using on the fly-decompression for UFS filesystems), and therefore, they are read-only in the WANBOOT image. To get a
working WANBOOT image, we must correct this for the files that need to be writable.

In principle we could do this only for the files that must be writable, but it's more convenient to just make
all files in /var and /etc writable:

# Remove the compression from the files that must be writable
#

# lofi mount the MilaX WANBOOT image
#
root@v240:/var/tmp# lofiadm -a /tmp/milax_wanboot/boot/sparc.miniroot
/dev/lofi/1

root@v240:/var/tmp# mkdir /tmp/milax
root@v240:/var/tmp# mount /dev/lofi/1 /tmp/milax

# and use tar to remove the compression from the files in /var and /etc
#
root@v240:/var/tmp# cd /tmp/milax

root@v240:/tmp/milax# tar -cf /tmp/var.tar  var && rm -r var/* &&  tar -xf /tmp/var.tar  && rm /tmp/var.tar

root@v240:/tmp/milax# tar -cf /tmp/etc.tar  etc && rm -r etc/* &&  tar -xf /tmp/etc.tar  && rm /tmp/etc.tar

# umount the MilaX WANBOOT image
#
root@v240:/var/tmp# umount -f /dev/lofi/1

# and remove the lofi device
#
root@v240:/var/tmp# lofiadm -d /tmp/milax_wanboot/boot/sparc.miniroot

Using the MilaX WANBOOT Image

To use the MilaX WANBOOT image, simply copy the MilaX WANBOOT image and the WANBOOT files to the WANBOOT server, for example:

root@v240:~# scp  /tmp/milax_wanboot/boot/sparc.miniroot root@installserver:/var/apache2/htodcs/wanboot/rootimages/milax_wanboot_image
root@v240:~# scp  /tmp/milax_wanboot/Tools/Boot/platform/sun4u/wanboot  root@installserver:/var/apache2/htodcs/wanboot/bootimages/milax_wanboot_sun4u
root@v240:~# scp  /tmp/milax_wanboot/Tools/Boot/platform/sun4v/wanboot  root@installserver:/var/apache2/htodcs/wanboot/bootimages/milax_wanboot_sun4v

Then change the wanboot.conf files for the clients to use the MiliaX WANBOOT image. Example:

xtrnaw7@sol10:~$ cat /etc/netboot/v240/wanboot.conf
boot_file=/wanboot/bootimages/milax_milax_wanboot_sun4u
root_server=http://192.168.1.100/cgi-bin/wanboot-cgi
root_file=/wanboot/rootimages/milax_wanboot_image
encryption_type=none
system_conf=/profiles
server_authentication=no
client_authentication=no
resolve_hosts=
signature_type=
encryption_type=
system_conf=system.conf

Now you can boot your clients from the MilaX WANBOOT image by setting the nvram variable network-boot-arguments
with the appropriate values and issuing this command:

# in the ok prompt
#
boot net

# or from within a running Solaris
#
reboot -- "net"

Note:

This works only if the client supports WANBOOT in the OBP. For machines that do not support WANBOOT from the OBP,
you can use WANBOOT from hard disk or CD-ROM; see Using WAN Boot From a Hard Disk on a System Running Solaris 9 and Above.

Adding Files to the MilaX WANBOOT Image

There are two methods to add additional files to the MilaX WANBOOT image:

You can add files with or without compression.

Adding Files to the MilaX WANBOOT Image Without Compression

To add uncompressed files to the MilaX WANBOOT image, just lofi mount the image and add/change the files:

root@v240:/var/tmp# mkdir /tmp/maint

# lofi mount the MilaX WANBOOT image (/var/tmp/milax_wanboot_image in this example)
#
root@v240:/var/tmp# lofiadm -a /var/tmp/milax_wanboot_image
/dev/lofi/1

root@v240:/var/tmp# mount /dev/lofi/1 //tmp/maint
root@v240:/var/tmp# ls /tmp/maint
alex        boot        devices     kernel      lost+found  mnt         platform    root        system      usr
bin         dev         etc         lib         media       opt         proc        sbin        tmp         var

Now you can add files to the MilaX WANBOOT image by copying them to the directory /tmp/maint, for example:

root@v240:/var/tmp# mkdir /tmp/maint/tools
root@v240:/var/tmp# cd /maint/jwm/tools/
root@v240:/maint/jwm/tools# find . | cpio -pdum /tmp/maint/tools/

After the customization is finished, unmount the MilaX WANBOOT image and remove the lofi device:

root@v240:/maint/jwm/tools# umount -f /tmp/maint
root@v240:/maint/jwm/tools# lofiadm -d /dev/lofi/1

Now you can copy the changed MilaX WANBOOT image back to the WANBOOT server.

Adding Files to the MilaX WANBOOT Image With Compression

Adding new files with compression to the MilaX WANBOOT image is technically more complex:

# unpack the MilaX WANBOOT image (/var/tmp/milax_wanboot_image in this example)
#
root@v240:/var/tmp# mkdir /tmp/maint

# IMPORTANT: rename the MilaX WANBOOT image to sparc.miniroot if
#            the name is different!
#
root@v240:~# mv /var/tmp/milax_wanboot_image /var/tmp/sparc.miniroot

# and move it to a subdirectory named boot
#
root@v240:~# mkdir /var/tmp/boot
root@v240:~# mv /var/tmp/sparc.miniroot /var/tmp/boot

# Note: The name of the image and the name of the directory are hardcoded
# in the root_archive script ....


# unpack the MilaX WANBOOT image
#
root@v240:~#  /boot/solaris/bin/root_archive unpackmedia  /var/tmp/  /tmp/maint/
umount: /tmp/mnt664 busy
rmdir: directory "/tmp/mnt664": Directory is a mount point or in use
lofiadm: could not unmap file /var/tmp//boot/sparc.miniroot: Device busy
/var/tmp//Solaris_*: No such file or directory
bzcat: Can't open input file /var/tmp//./Tools/Boot/X.cpio.bz2: No such file or directory.
bzcat: Can't open input file /var/tmp//./Tools/Boot/pkg_db.cpio.bz2: No such file or directory.
rmdir: directory "/tmp/mnt664": Directory is a mount point or in use

# Note: As far as I know, you can ignore the error messages from the root_archive script.

# Note: The tools directory in the listing below was added manually before.

root@v240:~# ls /tmp/maint
alex        boot        devices     kernel      lost+found  mnt         platform    root        system      tools       var
bin         dev         etc         lib         media       opt         proc        sbin        tmp         usr

At this point, you can add the new files to the directory /tmp/maint.

After you're done, pack the image again:

root@v240:/tmp/maint/remote# mkdir /tmp/newimage

root@v240:/tmp#  /boot/solaris/bin/root_archive packmedia  /tmp/newimage/  /tmp/maint/
/tmp/newimage//Solaris_*: No such file or directory
find: stat() error tmp/root/var/sadm/install: No such file or directory
find: stat() error tmp/root/var/sadm/pkg: No such file or directory
find: stat() error openwin/bin/mkfontdir: No such file or directory
find: stat() error openwin/lib/installalias: No such file or directory
find: stat() error openwin/server/lib/libfont.so.1: No such file or directory
find: stat() error openwin/server/lib/libtypesclr.so.0: No such file or directory
/tmp/newimage//Solaris_*: No such file or directory
find: stat() error usr/lib/install: No such file or directory

# Note: As far as I know, you can ignore the error messages from the root_archive script.

root@v240:/# ls -l /tmp/newimage/boot/sparc.miniroot
-rw-r--r-T   1 root     root     608256000 Nov  1 13:26 /tmp/newimage/boot/sparc.miniroot

Now we must again uncompress the files in /var and /etc in the MilaX WANBOOT image:

# if there is still a lofimount active for the file sparc.miniroot, remove this mount manually:

root@v240:/tmp#  umount -f /dev/lofi/1

root@v240:/tmp# lofiadm -a /tmp/newimage/boot/sparc.miniroot
/dev/lofi/1
root@v240:/tmp# mkdir /tmp/maint1
root@v240:/tmp# mount /dev/lofi/1 /tmp/maint1
root@v240:/var/tmp# cd /tmp/maint

root@v240:/tmp#  tar -cf /tmp/etc.tar etc && rm -r etc/* && tar -xf /tmp/etc.tar &&  rm /tmp/etc.tar

root@v240:/tmp#  tar -cf /tmp/var.tar var && rm -r var/* && tar -xf /tmp/var.tar &&  rm /tmp/var.tar
root@v240:/tmp# cd /
root@v240:/# umount /tmp/maint1
root@v240:/# lofiadm -d /dev/lofi/1

Now you can copy the changed MilaX WANBOOT image back to the WANBOOT server.

Troubleshooting

Files Are Read-Only in the MilaX WANBOOT Image

Problem

I cannot change a file in the root file system after booting the MilaX WANBOOT image.

Reason

Most of the files in the MilaX WANBOOT image are compressed with /usr/sbin/fiocompress (see
Using on the fly-decompression for UFS filesystems), and therefore, you cannot overwrite or change them while
running the MilaX WANBOOT image. Instead, you'll get error messages like these:

alex@v240)$ touch /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm
touch: cannot change times on /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm

(alex@v240)$ echo >>/usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm
bash: /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm: Read-only file system

Solution / Workaround

To get around this error message, siimply move the file to /tmp and back to the original location, for example:

(root@v240)# mv /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm /tmp

(root@v240)# mv /tmp/Status.pm /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm

(root@v240)# ls -l /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm
-r-xr-xr-x   1 root     bin        20560 Oct 31 14:05 /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm

(root@v240)# du -hs /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm
21K   /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm

Now the file is not compressed any more and can be changed:

(root@v240)# echo >>/usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm

Note:

All files in /var and in /etc are not compressed in the MilaX WANBOOT image.

To check whether or not a file is compressed, use ls and du on the file and compare the outputs; if the
file size reported by ls and du differs, the file is compressed, for example:

(alex@v240)$ ls -l /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm
-r-xr-xr-x   1 root     bin        20560 Oct 31 14:05 /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm

(alex@v240)$ du -hs /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm
8K   /usr/apache/perl5/5.8.4/sun4-solaris/Apache/Status.pm

/boot/solaris/bin/root_archive Not Found

Problem

The script root_archive does not exist.

Reason

Your Solaris 10 installation is too old. You must use Solaris 10 10/08 or later. Alternatively, you can
install the kernel patch 137137-09 to get this feature.

Solution / Workaround

Upgrade or patch your Solaris 10 installation.

A Machine Cannot Boot From the WANBOOT Image

Problem

Booting a machine from the MilaX WANBOOT image does not work and ends with an error message like this:

panic - kernel: Can't claim panicbuf virtual address
Program terminated{1}
ok

Reason

Not known yet.

Solution / Workaround

Recreate the image with more or fewer files so that the file size of the image is different. This helps
sometimes. Alternatively, you can try to use a more recent version of the wanboot program.

But these are only workarounds ....

The drd Daemon Fails on non-sun4v Machines

Problem:

The SMF service for the drd is in maintenance mode:

(root@v240) ~ # svcs -xsvc:/platform/sun4v/drd:default (logical domain dynamic reconfiguration)
State: maintenance since Wed Nov 04 13:17:27 2009
Reason: Restarting too quickly.  
See: http://sun.com/msg/SMF-8000-L5  
See: drd(1M)  
See: /var/svc/log/platform-sun4v-drd:default.log
Impact: This service is not running.

Reason

Not known

Solution / Workaround

Disable the drd daeom using svcadm manually:

svcadm disable drd

The drd daemon should not run on a sun4u machine. Therefore, you can ignore this error.

The VNC  Viewer Freezes

Problem

The VNC viewer running in Windows XP randomly freezes.

Reason

Not known yet

Solution / Workaround

Kill the VNC viewer session and start a new VNC viewer session.

This problem was seen with the VNC viewer from TightVNC and RealVNC but not yet with the VNC viewer from UltraVNC.

Some Keys Do Not Work in the Java VNC Viewer

Problem

Some keys (for example, tabulator, @, |) do not work in the Java VNC viewer used for connections via a Web browser.

Reason

Not known yet

Solution / Workaround

Use one of the standalone VNC executables to connect.

Appendix

Using a ramdisk Instead of a Physical Slice for the MilaX UFS Installation

If you do not have a free slice but your machine has enough memory (4 GB or more), you can use a ramdisk instead
of the slice to create the MilaX UFS installation.

For this method, boot the machine from the MilaX Live CD; log in as user alex (password alex), become root user
(password root), copy the script ufsinstall (see The ufsinstall script for the UFS installation below) to the /tmp directory, and make it executable with chmod.

Then do the following steps:

# create a ramdisk with 900 MB
#
(root@milax)# ramdiskadm -a milax 900m
/dev/ramdisk/milax

#
# and call the ufsinstall script with the name of the ramdisk:
#
(root@milax)# /tmp/ufsinstall /dev/ramdisk/milax
Installing MilaX to /dev/ramdisk/milax  - all files on that FS will be overwritten! Press enter to continue

umount: warning: /lib/libc.so.1 not in mnttab
umount: /lib/libc.so.1 not mounted
/dev/rramdisk/milax:    1843200 sectors in 3072 cylinders of 1 tracks, 600 sectors
        900.0MB in 192 cyl groups (16 c/g, 4.69MB/g, 2240 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 9632, 19232, 28832, 38432, 48032, 57632, 67232, 76832, 86432,
 1747232, 1756832, 1766432, 1776032, 1785632, 1795232, 1804832, 1814432,
 1824032, 1833632
Starting to copy data from UFS root to /ufsroot - this may take some time.
/ufsroot/etc/crypto/certs/SUNWObjectCA linked to /ufsroot/etc/certs/SUNWObjectCA
/ufsroot/etc/rc0.d/K16apache linked to /ufsroot/etc/init.d/apache
....
tar: ./sysevent/sysevent_door is not a file. Not dumped
Updating vfstab
Removing temporary files
rm: /ufsroot/var/tmp/*: No such file or directory
###################################################

MilaX now installed on ufs
(root@milax)#

After the script is done, save the ramdisk in a file on one of the hard disk partitions with enough free space:

(root@milax)# dd if=/dev/ramdisk/milax of=/mnt/solaris0/milax_img_from_ram_disk bs=1048576
900+0 records in
900+0 records out

Now boot the machine into Solaris 10, log in, become root user, and execute the following steps:

#
# lofi mount the image of the ramdisk
#
root@v240:~# lofiadm -a /milax_img_from_ram_disk
/dev/lofi/1

root@v240:~# mkdir /tmp/milax_wanboot
root@v240:~#  mkdir /tmp/milax_on_ufs

root@v240:~# mount /dev/lofi/1 /tmp/milax_on_ufs/

root@v240:~# ls /tmp/milax_on_ufs/
alex        boot        devices     kernel      lost+found  mnt         platform    root        system      usr
bin         dev         etc         lib         media       opt         proc        sbin        tmp         var

# Now you can continue with the steps described above to convert the MilaX UFS image to a WANBOOT image:

time /boot/solaris/bin/root_archive packmedia /tmp/milax_wanboot /tmp/milax_on_ufs
find: stat() error tmp/root/var/sadm/install: No such file or directory
find: stat() error tmp/root/var/sadm/pkg: No such file or directory
find: stat() error dt: No such file or directory
find: stat() error openwin/bin/mkfontdir: No such file or directory
find: stat() error openwin/lib/installalias: No such file or directory
find: stat() error openwin/server/lib/libfont.so.1: No such file or directory
find: stat() error openwin/server/lib/libtypesclr.so.0: No such file or directory
/tmp/milax_wanboot/Solaris_*: No such file or directory
find: stat() error usr/lib/install: No such file or directory
real    9m36.509s
user    7m51.572s
sys     6m13.434s

# Note: As far as I know, you can ignore the error messages from the root_archive script.

# Remove the compression from the files that must be writable.
#

# lofi mount the MilaX WANBOOT image
#
root@v240:/var/tmp# lofiadm -a /tmp/milax_wanboot/boot/sparc.miniroot
/dev/lofi/1

root@v240:/var/tmp# mkdir /tmp/milax
root@v240:/var/tmp# mount /dev/lofi/1 /tmp/milax

# and use tar to remove the compression from the files /var and /etc
#
root@v240:/var/tmp# cd /tmp/milax

root@v240:/tmp/milax# tar -cf /tmp/var.tar  var && rm -r var/* &&  tar -xf /tmp/var.tar  && rm /tmp/var.tar

root@v240:/tmp/milax# tar -cf /tmp/etc.tar  etc && rm -r etc/* &&  tar -xf /tmp/etc.tar  && rm /tmp/etc.tar

# umount the MilaX WANBOOT image
#
root@v240:/var/tmp# umount -f /dev/lofi/1

# and remove the lofi device
#
root@v240:/var/tmp# lofiadm -d /tmp/milax_wanboot/boot/sparc.miniroot

MilaX WANBOOT Images

If you do not want to create your own MilaX WANBOOT image, you can download one of the MilaX WANBOOT images from my web site:

Either the MilaX WANBOOT image with command line interface only (this is plain MilaX without additional tools):

milax_3.2_wanboot_image_v100.img.gz

Or the Extended MilaX WANBOOT image with additional tools and scripts:

milax_3.2_wanboot_image_with_vnc_v100.img.gz

The Extended MilaX WANBOOT image contains the following (in addition to the tools already included in MilaX):

To start the VNC server, use the script /remote/vnc_with_jwm.sh after booting from the Extended MilaX WANBOOT
image, for example:

(alex@v240) ~ $ /remote/vnc_with_jwm.sh
Setting environment for jwm  ...
LD_LIBRARY_PATH for jwm is: /remote/jwm/lib/test:[...]:/usr/local/lib
PATH for jwm is: /remote/jwm/tools/scripts:/remote/jwm/bin/5.11:[...]:/usr/sbin
[vnc_with_jwm.sh] Using the VNC Server direct ...
[vnc_with_jwm.sh] Starting the VNC Server with jwm window manager ...
[vnc_with_jwm.sh] Using the home directory "/tmp/jwm_homedir.1019"
[vnc_with_jwm.sh] Creating the directory "/tmp/jwm_homedir.1019" ...
[vnc_with_jwm.sh] Copying files to the home directory ...
3568 blocks
[vnc_with_jwm.sh] Please enter a new password for the VNC server:
Password:
Verify:
[vnc_with_jwm.sh] Using the xterm binary "/remote/jwm/tools/bin/xterm"
[vnc_with_jwm.sh] Creating the dynamic menues ...
[vnc_with_jwm.sh] Executing "/remote/jwm/etc/create_dynamic_filesystem_menu_entries.sh" ...
Creating the dynamic menue "/tmp/jwm_homedir.1019/jwm-filesystems" ...
[vnc_with_jwm.sh] Executing "/remote/jwm/etc/create_dynamic_network_adapter_menu_entries.sh" ...
Creating the dynamic menue "/tmp/jwm_homedir.1019/jwm-network" ...
[vnc_with_jwm.sh] Executing "/remote/jwm/etc/create_dynamic_san_menu_entries.sh" ...
Creating the dynamic menue "/tmp/jwm_homedir.1019/jwm-san" ...
Failed to load FC-HBA common library
ERROR
[vnc_with_jwm.sh] Executing "/remote/jwm/etc/create_dynamic_vcs_menu_entries.sh" ...
Creating the dynamic menue "/tmp/jwm_homedir.1019/jwm-vcs" ...
[vnc_with_jwm.sh] Executing "/remote/jwm/etc/create_dynamic_vxvm_menu_entries.sh" ...
Creating the dynamic menue "/tmp/jwm_homedir.1019/jwm-vxvm" ...
[vnc_with_jwm.sh] Executing "/remote/jwm/etc/create_dynamic_zone_menu_entries.sh" ...
Creating the dynamic menue "/tmp/jwm_homedir.1019/jwm-zones" ...
[vnc_with_jwm.sh] Executing "/remote/jwm/etc/create_dynamic_zpool_menu_entries.sh" ...
Creating the dynamic menue "/tmp/jwm_homedir.1019/jwm-zfs" ...
[vnc_with_jwm.sh] Configuring fonts ...
[vnc_with_jwm.sh] Using the fonts in the directory "/remote/jwm/fonts/" ...
[vnc_with_jwm.sh] Starting the VNC server for the display :1 (= port 5901; web browser port: 5801)
+ /remote/jwm/vnc/bin/vncserver -v -co /tmp/jwm/X11/rgb :1 -depth 16 -fp /remote/jwm/fonts/misc \
  -p 0 -s 0 -AlwaysShared -Protocol3.3 -httpd /remote/jwm/vnc/bin/java -IdleTimeout=0 -geometry 1280x800
xauth:  creating new authority file /tmp/jwm_homedir.1019/.Xauthority

New 'v240:1 (alex)' desktop is v240:1

Starting applications specified in /tmp/jwm_homedir.1019/.vnc/xstartup
Log file is /tmp/jwm_homedir.1019/.vnc/v240:1.log

[vnc_with_jwm.sh] Use the script "/tmp/stop_jwm.1019.sh" to stop the xserver
[vnc_with_jwm.sh] Use the script "/tmp/remove_jwm.1019.sh" to remove the temporary jwm files and
directories from the server
[vnc_with_jwm.sh]
(alex@v240) ~ $


To connect to the VNC server use vncviewer, where x is the display number used by the VNC server:

vncviewer <ip_or_hostname_of_the_vncserver>:590x

For example:

xtrnaw7@t61p:/tmp$ vncviewer 192.168.1.5:5901 &
[1] 2941

VNC Viewer Free Edition 4.1.3 for X - built May  5 2009 19:30:21
Copyright (C) 2002-2008 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Sun Nov  8 11:52:28 2009
 CConn:       connected to host 192.168.1.5 port 5901
 CConnection: Server supports RFB protocol version 3.3
 CConnection: Using RFB protocol version 3.3

Sun Nov  8 11:52:32 2009
 TXImage:     Using default colormap and visual, TrueColor, depth 24.
 CConn:       Using pixel format depth 6 (8bpp) rgb222
 CConn:       Using ZRLE encoding
 CConn:       Throughput 20000 kbit/s - changing to hextile encoding
 CConn:       Throughput 20000 kbit/s - changing to full colour
 CConn:       Using pixel format depth 24 (32bpp) little-endian rgb888
 CConn:       Using hextile encoding

xtrnaw7@t61p:/tmp$

Alternatively, you can use a web browser to connect to the VNC server; in this case, use the following URL, where
x is the display number used by the VNC server:

http://<vncserver_ip_or_hostname>:580x

For example:

http:// 192.168.1.5:5801

Notes:

To start another VNC server, simply call the script again. The script automatically searches the next free port
for the new VNC server.

There's also a script to start the VNC server for local access only:

/remote/ vnc_with_jwm_and_ssh.sh

This script starts the VNC server for local access only and starts an SSH tunnel to connect to the VNC server.
The tunnel uses the ports:

local       remote
5901        7901
5902        7902
...
5909        7909

To connect to the VNC server, first start an SSH tunnel on the client  and then start vncviewer to connect
to the forwarded port on the client.

There are two example scripts to connect to the VNC server via SSH in the Extened MilaX WANBOOT image:

(root@v240) ~ # ls -l /remote/ssh_for_vnc_client.*
-rw-r--r--   1 alex     adm         1887 Oct  5 06:46 /remote/ssh_for_vnc_client.cmd
-rwxr-xr-x   1 alex     adm         3142 Oct 25 01:50 /remote/ssh_for_vnc_client.sh

The .cmd script is for machines running Windows and the .sh script is for machines running Solaris (or other
flavors of UNIX).

Note:

See the file /remote/jwm/README in the Extended MilaX WANBOOT image for additional information.

The ufsinstall script for the UFS installation

#!/usr/bin/ksh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or [http://www.opensolaris.org/os/licensing].
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Script to install MilaX for SPARC to UFS
#
# By  Bernd Schemmer, Oct 2009
# based on the script zfsinstall originally written
# By Alexander R. Eremin, April 4 2008.
# 07 July 2008 Sparc version
# Thanks to Tim Foster for basic zfs-boot script
#
#
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root"
exit 1
fi


# check arguments
if [ "$#" -lt 1 ] || [ $1 == "-h" ] || [ $1 == "--help" ]
then
echo "Usage : ufsinstall <root_slice> "
echo "eg. ./ufsinstall c0t0d0s0 "
exit 1
fi

#
# Examine memory requirements
#

# get available virtual memory in megabytes
VIRTMEM=`/sbin/sysmem`; VIRTMEM=`expr $VIRTMEM / 1024`

# get total physical memory in megabytes
PHYSMEM=`/usr/sbin/prtconf | grep '^Memory size: ' | \
sed -e 's/^Memory size: //' -e 's/ .*$//' `

MEMUNIT=`/usr/sbin/prtconf | grep '^Memory size: ' | \
sed -e 's/^Memory size: [0-9|0-9][0-9|0-9]* //' `

case $MEMUNIT in
Kilobytes) PHYSMEM=`expr $PHYSMEM / 1024` ;;
Megabytes) ;;
Gigabytes) PHYSMEM=`expr $PHYSMEM * 1024` ;;
Terabytes) PHYSMEM=`expr $PHYSMEM * 1024 * 1024` ;;
*)         PHYSMEM=0 ;;
esac

export PHYSMEM
MIN_INSTALL_PHYSMEM=256

if [ "$PHYSMEM" -lt "$MIN_INSTALL_PHYSMEM" ] ; then
echo "This installer requires a minimum of $MIN_INSTALL_PHYSMEM MB of physical memory"
echo "to install.  This system only has $PHYSMEM MB of physical memory."
echo
echo "Exiting to shell"
exit
fi

home=/usr/dss/share/hdinstall

[ -b $1 ] && ROOT_FS=$1 || ROOT_FS=/dev/dsk/$1
ROOT_FS_RAW=$( echo ${ROOT_FS}| sed "s#/dsk/#/rdsk/#" ) |

echo ""
echo "Installing MilaX to $ROOT_FS  - all files on that FS will be overwritten! Press enter to continue"
read USERINPUT

# umount the processor specific library
#
umount /lib/libc.so.1

yes | newfs ${ROOT_FS_RAW}

mkdir -p /ufsroot
mount  $ROOT_FS /ufsroot
if [ $? != 0 ]
then
echo "Unable to mount the new root filesystem ${ROOT_FS} on /ufsroot. Exiting now."
exit 1
fi

# start copying main data over to it
echo "Starting to copy data from UFS root to /ufsroot - this may take some time."
cd /
find . -xdev -depth -print | cpio -pvdm /ufsroot 2>&1 > /dev/null
mkdir -p /ufsroot/alex
cd /alex
find . -xdev -depth -print | cpio -pvdm /ufsroot/alex 2>&1 > /dev/null
mkdir -p /ufsroot/root
cd /root
find . -xdev -depth -print | cpio -pvdm /ufsroot/root 2>&1 > /dev/null

mkdir -p /ufsroot/usr
cd /usr
find . -xdev -depth -print | cpio -pvdm /ufsroot/usr 2>&1 > /dev/null

mkdir -p /ufsroot/system/object
mkdir -p /ufsroot/system/contract
mkdir -p /ufsroot/tmp
mkdir -p /ufsroot/proc
mkdir -p /ufsroot/var/run

chmod 555 /ufsroot/system/object
chmod 555 /ufsroot/system/contract
chmod 555 /ufsroot/proc
chmod 777 /ufsroot/tmp
chmod 755 /ufsroot/etc/svc/volatile
chmod 755 /ufsroot/var/run
chmod 755 /ufsroot/usr
chmod 755 /ufsroot/alex
chmod 755 /ufsroot/root
chown -R alex:adm /ufsroot/alex

# now populate the devices and /dev directories in /ufsroot
# do this by lofs mounting / and pulling the files directly
mkdir -p /ufs-root-tmp.$$
mount -F lofs -o nosub / /ufs-root-tmp.$$
(cd /ufs-root-tmp.$$; tar cf - devices dev ) | (cd /ufsroot; tar xfp -) 2>&1 > /dev/null
cd /
umount /ufs-root-tmp.$$
rm -rf /ufs-root-tmp.$$

cd /dev
tar cf - . | (cd /ufsroot/dev ; tar xfp -)
cd /devices
tar cf - . | (cd /ufsroot/devices ; tar xfp -)
# copy last etc
cd /etc
tar cf - . | (cd /ufsroot/etc ; tar xfp -) 2>&1 > /dev/null

# rebuild svc at first boot
rm -f /ufsroot/var/svc/manifest/system/filesystem/live-root-fs.xml
rm -f /ufsroot/var/svc/manifest/system/filesystem/live-root-fs.xml
rm -f /ufsroot/var/svc/manifest/system/filesystem/usr-fs.xml
rm -f /ufsroot/var/svc/manifest/system/dss-sysidtool.xml
rm -f /ufsroot/etc/system
cp $home/misc/root-fs.xml /ufsroot/var/svc/manifest/system/filesystem/
cp $home/misc/usr-fs.xml /ufsroot/var/svc/manifest/system/filesystem/
cp $home/misc/sysidtool.xml /ufsroot/var/svc/manifest/system/
cp $home/misc/system /ufsroot/etc/
cp /lib/svc/seed/global.db /ufsroot/etc/svc/repository.db

# copy vfstab
cp $home/misc/vfstab /ufsroot/etc/vfstab

echo "Updating vfstab"
echo "/devices/ramdisk-root:a -       /       ufs     -       no      rw">> /ufsroot/etc/vfstab

echo "Removing temporary files"
find /ufsroot/var/log  -type f -exec rm {} \;
rm /ufsroot/var/svc/log/*
rm /ufsroot/var/tmp/*

### # Note: The follwoing steps are only neccessary if you want to boot from the UFS slice!

### # Update the bootarchive
### #
### echo "Updating boot-archive"
### /usr/sbin/bootadm update-archive -R /ufsroot 2>&1 > /dev/null
### &nbsp;
### echo "Installing bootblk on ${ROOT_FS}
### /usr/sbin/installboot  /platform/`uname -m`/lib/fs/ufs/bootblk ${ROOT_FS_RAW}


echo "###################################################"
echo
echo "MilaX now installed on ufs"