UPDATE: Developing with multiple BEs in OpenSolaris

Following up on Bart's comment, you can certainly use -R to perform the same operation... Not sure why I didn't think that could be used for pkg set-authority, but it can..

Funny since I use -R for my custom opensolaris builds..

root@unknown:~# df -lk
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0d0s0       491522  367690   74680    84%    /
/devices                   0       0       0     0%    /devices
/dev                       0       0       0     0%    /dev
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                  767856     336  767520     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
sharefs                    0       0       0     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap3.so.1
                      491522  367690   74680    84%    /lib/libc.so.1
fd                         0       0       0     0%    /dev/fd
swap                  767520       0  767520     0%    /tmp
swap                  767536      16  767520     1%    /var/run
root@unknown:~# pkg list | wc -l
      65
root@unknown:~# ps -ef
     UID   PID  PPID   C    STIME TTY         TIME CMD
    root     0     0   0 06:52:45 ?           0:01 sched
    root     1     0   0 06:52:46 ?           0:00 /sbin/init
    root     2     0   0 06:52:46 ?           0:00 pageout
    root     3     0   0 06:52:46 ?           0:00 fsflush
    root     7     1   0 06:52:47 ?           0:02 /lib/svc/bin/svc.startd
    root     9     1   0 06:52:47 ?           0:27 /lib/svc/bin/svc.configd
    root   549     1   0 10:58:06 ?           0:00 /usr/lib/inet/inetd start
    root   201     1   0 06:53:19 ?           0:00 devfsadmd
  daemon   293     1   0 06:53:40 ?           0:00 /lib/crypto/kcfd
   dladm    15     1   0 06:52:48 ?           0:00 /sbin/dlmgmtd
    root   298     1   0 06:53:44 ?           0:00 /usr/lib/picl/picld
    root   198     1   0 06:53:19 ?           0:00 /usr/lib/sysevent/syseventd
    root   554   552   0 10:58:06 ?           0:00 /usr/lib/saf/ttymon
    root   552     7   0 10:58:06 ?           0:00 /usr/lib/saf/sac -t 300
    root   580     1   0 10:58:08 ?           0:00 /usr/lib/ssh/sshd
  daemon   525     1   0 06:57:48 ?           0:00 /usr/sbin/rpcbind
    root   544     1   0 10:58:03 ?           0:00 /usr/sbin/nscd
    root   512     1   0 06:56:07 ?           0:00 /sbin/dhcpagent
    root   553     1   0 10:58:06 ?           0:00 /usr/lib/utmpd
    root   571     7   0 10:58:08 console     0:00 -bash
    root   376     1   0 06:53:54 ?           0:00 /usr/sbin/cron
    root   667   571   0 11:03:32 console     0:00 ps -ef
    root   567     1   0 10:58:08 ?           0:00 /usr/sbin/syslogd
root@unknown:~#
Anyway, here is the sequence using a -R.. This works for 99.x% of the cases.. But I would expect to fail for the same cases lu will.. i.e. say you need a new version update_drv, etc. For those cases the chroot will get you through it with some skilled sequencing.. Of course, the chroot approach can have it's own set of problems :-)
beadm create snv109
beadm mount snv109 /mnt
pkg -R /mnt set-authority -O http://pkg.opensolaris.org/dev opensolaris.org
pkg -R /mnt refresh
pkg -R /mnt install SUNWipkg
pkg -R /mnt install entire@0.5.11-0.109
bootadm update-archive -R /mnt
beadm umount snv109
beadm activate snv109
Comments:

This is the script I use to perform image-updates on my own system:

#!/usr/bin/bash
BE_NAME=$1

if [ -z $BE_NAME ]; then
echo "You must specify a name for the new boot environment."
exit 1
fi

BUILD=`uname -v | sed -e s/snv_// -e s/[a-z]//g`
pfexec pkg -R / refresh
pfexec pkg -R / install --no-refresh -v SUNWipkg@0.5.11-0.${BUILD}
pfexec pkg -R / install --no-refresh -v entire@0.5.11-0.${BUILD}

pfexec beadm create $BE_NAME && \\
pfexec mkdir /tmp/mnt$$ && \\
pfexec beadm mount $BE_NAME /tmp/mnt$$ && \\
time pfexec pkg -R /tmp/mnt$$ image-update --no-refresh -v
pfexec beadm unmount $BE_NAME
pfexec beadm activate $BE_NAME

Posted by Shawn Walker on March 12, 2009 at 03:26 PM EDT #

By the way, I think you meant:

pkg -R /mnt install SUNWipkg

instead of:

pkg -R /mnt SUNWipkg

Also, the explicit refresh you have isn't needed as the pkg system automatically performs a refresh whenever you execute an install or image-update command unless you specify --no-refresh.

Posted by Shawn Walker on March 12, 2009 at 03:28 PM EDT #

Post a Comment:
Comments are closed for this entry.
About

mrj

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today