
I hope to prepare clean patch soon.
root@opensolaris:/jack# ./zfsinstall c4t1d0s0
Test TI started in real mode...
Target type specified: BE
BE target prepared successfully
BE target created successfully
Starting to copy data from UFS root to /zfsroot - this may take some time.
Updating vfstab
Updating boot-archive
updating /zfsroot//platform/sun4u/boot_archive
Installing zfs bootblk on /dev/rdsk/c4t1d0s0
###################################################
OpenSolaris now installed.
root@opensolaris:/jack# beadm umount opensolaris
root@opensolaris:/jack# reboot -- disk1
...
Sun Ultra 60 UPA/PCI (UltraSPARC-II 360MHz), Keyboard Present
OpenBoot 3.17, 512 MB memory installed, Serial #
Ethernet address 8:0:20:b8:a3:b9, Host ID: 80b8a3b9
Rebooting with command: boot disk1
Boot device: /pci@1f,4000/scsi@3/disk@1,0 File and args:
SunOS Release 5.11 Version snv_125 64-bit
Copyright 1983-2009 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
WARNING: consconfig: cannot find driver for screen device /SUNW,ffb@1e,0
Can't find driver for console framebuffer
Hostname: opensolaris
Configuring devices.
Loading smf(5) service descriptions: 137/137
Reading ZFS config: done.
Mounting ZFS filesystems: (6/6)
opensolaris console login:
...
# beadm list
BE Active Mountpoint Space Policy Created
-- ------ ---------- ------- ------ -------
opensolaris NR / 580.69M static 2009-11-10 01:45
#
# mkdir -p /opt/livecd/s0.
# mount -F hsfs `lofiadm -a osol-1002-122-ai-sparc.iso` /mnt
# cd /opt/livecd/tmp
# echo snv122 > .volumeid
# mv .autoinstall .livecd
# cd /opt/livecd/s0/boot/
# root_archive pack boot_archive /opt/livecd/tmp
# cd /opt/livecd/
# mkisofs -G s0/boot/hsfs.bootblock -B ... -l -ldots -R -N -D -V snv122 -o /opt/sparc_snv122.iso s0/
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 824 4.00GB (825/0/0) 8395200
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 14086 68.35GB (14087/0/0) 143349312
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
zpool create opensolaris c0t2d0s0
zfs create opensolaris/rootfs
zfs set compression=on opensolaris/rootfs
zfs set mountpoint=legacy opensolaris/rootfs
mkdir /zfsroot
mount -f zfs opensolaris/rootfs /zfsroot
SUNWcsd
SUNWcs
SUNWcsl
SUNWcakr
SUNWcar
SUNWcfcl
SUNWckr
SUNWcnetr
SUNWcurl
SUNWefc
SUNWerid
SUNWesu
SUNWfctl
SUNWpd
SUNWfchba
SUNWfruid
SUNWgnu-idn
SUNWgss
SUNWgssc
SUNWinstall-libs
SUNWipf
SUNWipkg
SUNWkey
SUNWkvm
SUNWldom
SUNWlexpt
SUNWlibC
SUNWlibms
SUNWlibsasl
SUNWloc
SUNWlxml
SUNWmd
SUNWnfsc
SUNWnfsckr
SUNWopenssl
SUNWperl584core
SUNWpicl
SUNWpool
SUNWpr
SUNWsmapi
SUNWrmodu
SUNWssh
SUNWsshcu
SUNWsshd
SUNWPython
SUNWpython-pyopenssl
SUNWTcl
SUNWTk
SUNWadmap
SUNWadmlib-sysid
SUNWadmr
SUNWbash
SUNWbip
SUNWbzip
SUNWtecla
SUNWtls
SUNWtoo
SUNWwbsup
SUNWxwrtl
SUNWzfs
SUNWzfskr
SUNWzlib
SUNWzone
SUNWintgige
entire
pkg image-create -F -f -a opensolaris.org=http://pkg.opensolaris.org /zfsroot
cd /zfsroot
for pkg in `cat pkg.lst`; do pkg install --no-refresh --no-index $pkg; done
echo "etc/zfs/zpool.cache" >> /zfsroot/boot/solaris/filelist.ramdisk
zpool set bootfs=opensolaris/rootfs opensolaris
echo "opensolaris/rootfs - / zfs - no -" >> /zfsroot/etc/vfstab
mkdir -p /opensolaris/platform/sun4v
cp /zfsroot/platform/sun4v/bootlst /opensolaris/platform/sun4v/
cp /zfsroot/lib/svc/seed/global.db /zfsroot/etc/svc/repository.db
devfsadm -R /zfsroot
bootadm update-archive -R /zfsroot
installboot -F zfs /platform/sun4v/lib/fs/zfs/bootblk /dev/rdsk/c0t2d0s0
ok boot disk2
...
Sun Fire T200, No Keyboard
Copyright 2008 Sun Microsystems, Inc. All rights reserved.
OpenBoot 4.28.9, 16256 MB memory available
...
Boot device: /pci@780/pci@0/pci@9/scsi@0/disk@2 File and args:
SunOS Release 5.11 Version snv_111b 64-bit
Copyright 1983-2009 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: unknown
Configuring devices.
Loading smf(5) service descriptions: 84/84
Reading ZFS config: done.
Mounting ZFS filesystems: (2/2)
unknown console login: root
Password:
Sun Microsystems Inc. SunOS 5.11 snv_111b November 2008
root@unknown:~# df -h
Filesystem size used avail capacity Mounted on
opensolaris/rootfs 3.9G 630M 3.3G 16% /
/devices 0K 0K 0K 0% /devices
/dev 0K 0K 0K 0% /dev
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 12G 176K 12G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
fd 0K 0K 0K 0% /dev/fd
swap 12G 0K 12G 0% /tmp
swap 12G 16K 12G 1% /var/run
opensolaris 3.9G 60K 3.3G 1% /opensolaris
# ./test_td -d
Disk discovery
Total number of disks: 3
---------------------------------
num | name| ctype|size [MB]|
---------------------------------
1 | c2t0d0| usb| 976|
2 | c0d0| ata| 76350|
3 | c1d0| ata| 38166|
---------------------------------
# ./test_td -p all
Partition discovery for all disks
-------------------------------------
num | name| active| ID| lswp|
-------------------------------------
1 | c2t0d0p1| Yes| BF| No|
2 | c0d0p1| Yes| BF| No|
3 | c1d0p3| No| 83| No|
4 | c1d0p2| Yes| 83| No|
5 | c1d0p1| No| 82| Yes|
-------------------------------------
# ./test_td -d -v
Disk discovery
Total number of disks: 3
-------------------------------------------------------------------------------
num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size [MB]|
-------------------------------------------------------------------------------
1 | c2t0d0| Multi| usb| FIXED| Yes| VF| 512| 1999872| 976|
2 | c0d0| unknown| ata| FIXED| No| VF| 512| 156364992| 76350|
3 | c1d0| unknown| ata| FIXED| No| VF| 512| 78164352| 38166|
-------------------------------------------------------------------------------
# ./test_td -p all -v
Partition discovery for all disks
---------------------------------------------------------------------
num | name| active| ID| lswp| 1st block|#of blocks|size [MB]|
---------------------------------------------------------------------
1 | c2t0d0p1| Yes| BF| No| 2048| 1996800| 975|
2 | c0d0p1| Yes| BF| No| 16065| 156344580| 76340|
3 | c1d0p3| No| 83| No| 20547135| 57609090| 28129|
4 | c1d0p2| Yes| 83| No| 1012095| 19535040| 9538|
5 | c1d0p1| No| 82| Yes| 63| 1012032| 494|
---------------------------------------------------------------------
# cd /opt/SUNWspro; find .
.
./lib
./lib/crt1x.o
./lib/crti.o
./lib/sys
./lib/sys/libyabe.so
./lib/sys/lib_I_quad.so
./lib/sys/libsunir.so
./lib/sys/liblni.so.1
./lib/libdwarf.so
./lib/crt1.o
./lib/libmopt.a
./lib/libdwarf.so.1
./lib/lib_I_dbg_gen.so.1
./lib/values-xa.o
./lib/libm.il
./lib/lib_I_dbg_gen.so
./lib/crtn.o
./bin
./bin/iropt
./bin/fbe
./bin/cc
./bin/ir2hf
./bin/ube
./bin/acomp
# du -hs
19M .
entire
SUNWcsd
SUNWcs
~$ uname -a
SunOS sysadm 5.11 snv_110 i86pc i386 i86pc
~$ ./busybox
BusyBox v1.2.0 (2009.04.20-10:06+0000) multi-call binary
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!
Currently defined functions:
[, [[, awk, bunzip2, busybox, bzcat, cat, chgrp, chmod, chown, chroot, clear, cp, cpio, cut, date, dd, df, du, echo, ed, egrep, env, false,
fgrep, find, grep, gunzip, gzip, halt, head, hostid, hostname, hush, id, init, kill, less, ls, md5sum, mkdir, mknod, mount, mv, nc, nslookup,
poweroff, printf, ps, pwd, reboot, rm, sed, sh, sleep, sort, tar, tee, telnet, test, touch, tr, true, tty, umount, uname, unzip, vi, wc, whoami,
xargs, yes, zcat
cpu 8 0 141 313 230 0 0
#include <kstat.h> #include <sys/sysinfo.h> #include <stdio.h> #include <string.h> static kstat_ctl_t *kc; static kstat_t *ksp; static unsigned int cpu_user, cpu_system, cpu_nice, cpu_idle, cpu_iowait; int main(int argc, char **argv) { cpu_stat_t *cpu_stat; kc = kstat_open(); if (kc != NULL) { ksp = kstat_lookup(kc, "cpu_stat", 0, "cpu_stat0"); if (ksp != NULL && ksp->ks_type == KSTAT_TYPE_RAW) { if (kstat_read(kc, ksp, NULL) != -1 && ksp->ks_data_size == sizeof(cpu_stat_t)) { cpu_stat = (cpu_stat_t *)ksp->ks_data; cpu_user=cpu_stat->cpu_sysinfo.cpu[CPU_USER]; cpu_nice=cpu_stat->cpu_sysinfo.cpu[CPU_WAIT]; cpu_system = cpu_stat->cpu_sysinfo.cpu[CPU_KERNEL] ; cpu_iowait=cpu_stat->cpu_syswait.iowait; cpu_idle=cpu_stat->cpu_sysinfo.cpu[CPU_IDLE]; printf("cpu %d %d %d %d %d 0 0\n", cpu_user,cpu_nice,cpu_system,cpu_idle,cpu_iowait); } } } }
STATE STIME FMRI online 19:49:10 svc:/system/svc/restarter:default online 19:49:13 svc:/network/datalink-management:default online 19:49:14 svc:/system/filesystem/usr:default online 19:49:14 svc:/system/filesystem/root:default online 19:49:14 svc:/system/utmp:default online 19:49:21 svc:/system/device/local:default online 19:49:21 svc:/milestone/devices:default online 19:49:22 svc:/system/filesystem/minimal:default online 19:49:22 svc:/system/manifest-import:default online 19:49:23 svc:/system/rmtmpfiles:default online 19:49:23 svc:/system/filesystem/local:default online 19:49:23 svc:/application/xserver:default online 19:49:24 svc:/system/console-login:default online 19:49:49 svc:/network/initial:default online 19:49:57 svc:/network/loopback:default online 19:49:58 svc:/system/system-log:default online 19:50:01 svc:/system/cryptosvc:default online 19:50:04 svc:/system/dbus:default online 19:50:04 svc:/network/physical:default online 19:50:06 svc:/system/identity:node online 19:50:14 svc:/network/rpc/bind:default online 19:50:18 svc:/system/hal:default online 19:50:20 svc:/network/inetd:default online 19:50:25 svc:/network/rpc/gss:default
...
# Turn on I/O tracing if requested and possible
trace=`prtconf -v /devices|sed -n '/trace/{;n;p;}'|cut -f 2 -d\'`
if [ "$trace" = "on" ]; then
if [ -n "$mntpt" ]; then
outputfile="${mntpt}/traceout"
echo "Enabling I/O Tracing ..." > /dev/console
/opt/DTT/Bin/iosnoop -Deg > "$outputfile" 2> /dev/console &
# Wait for iosnoop to actually initialize
sleep 10
else
echo "Unable to enable I/O Tracing" > /dev/console
echo "Must have a mountable Solaris root slice on harddisk" > /dev/console
echo "to hold trace output" > /dev/console
fi
fi
...
mount -F tmpfs -o size=32m swap /var/log
/opt/DTT/Bin/opensnoop -eg > /var/log/opensnoop.log &
svcadm milestone all
#!/usr/sbin/dtrace -Cs
#pragma D option quiet
/* I need process pid, his forks and life time */
proc:::create
{
printf("<fork ppid=%d cpid=%d execname=%s time=%d />\n",
pid,args[0]->pr_pid,execname,`lbolt*10/ `hz);
}
proc:::exec-success
{
printf("<process pid=%d execname=%s time=%d />\n",
pid,execname,`lbolt*10/ `hz);
}
proc:::exit
{
printf("<end pid=%d execname=%s time=%d />\n",
pid, execname,`lbolt*10/ `hz);
}
dtrace -AFs /boot/boot.d
reboot
dtrace -ae -o bootlog
dtrace -A
CPU FUNCTION
0 | exec_common:exec-success <process pid=1 execname=init time=63 />
0 | cfork:create <fork ppid=1 cpid=4 execname=init time=66 />
0 | exec_common:exec-success <process pid=4 execname=ksh93 time=67 />
0 | exec_common:exec-success <process pid=4 execname=autopush time=87 />
0 | proc_exit:exit <end pid=4 execname=autopush time=92 />
0 | cfork:create <fork ppid=1 cpid=5 execname=init time=92 />
0 | exec_common:exec-success <process pid=5 execname=ksh93 time=92 />
0 | exec_common:exec-success <process pid=5 execname=soconfig time=94 />
...
bootchart.py bootlog
In illumos, if you need to determine the interface which was used for booting via PXE then it's possible to use "boot-mac" pro...