Die meisten Entwickler nutzen den Android-Emulator ja wahrscheinlich dafür, selbst entwickelte Programme komfortabel zu testen. Es gibt aber auch noch einen weiteren interessanten Einsatzzweck, den Gaby Becker in einem Blog-Beitrag beschrieben hat.

Es geht hierbei um die Möglichkeit, über den Android Market Apps im Emulator zu installieren und diese dann sowohl lokal zu nutzen oder für Präsentationen zu nutzen.

Gaby Becker: Präsentieren mit dem Emulator

 

OpenSolaris uses Sendmail as default Mail Transfer Agent (MTA) which seems to be designed as a admin-hell. I prefer Postfix with it’s easy to read config files.

As the package repository of OpenSolaris doesn’t provide a current Postfix, this HowTo explains a way to build Postfix from source and install it on your OpenSolaris system.

Basics

First step is to install/get a working GCC (preferred version >4.3). One possibility is to follow my Guide about GCC-4 on OpenSolaris or to use the package repository. In addition you will need gnu-make and wget.

root@test:~# pkg install gcc-43 wget nano developer/build/gnu-make

               Packages to install:    18
           Create boot environment:    No
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                18/18   3121/3121    71.5/71.5

PHASE                                        ACTIONS
Install Phase                              4183/4183

PHASE                                          ITEMS
Package State Update Phase                     18/18
Image State Update Phase                         2/2

root@test:~# PATH=/usr/bin:/usr/gcc/4.3/bin:$PATH

Preparations

Since the build environment is now set up, you can download the current postfix source release.

root@test:~# wget http://de.postfix.org/ftpmirror/official/postfix-2.8.5.tar.gz

--2011-10-04 22:38:09--  http://de.postfix.org/ftpmirror/official/postfix-2.8.5.tar.gz
Resolving de.postfix.org (de.postfix.org)... 141.42.206.35
Connecting to de.postfix.org (de.postfix.org)|141.42.206.35|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3647010 (3.5M) [application/x-gzip]
Saving to: `postfix-2.8.5.tar.gz'

100%[======================================>] 3,647,010    700K/s   in 5.6s    =

2011-10-04 22:38:15 (632 KB/s) - `postfix-2.8.5.tar.gz' saved [3647010/3647010]

root@test:~# tar xf postfix-2.8.5.tar.gz
root@test:~# cd postfix-2.8.5

One of the postfix scripts has an error and tries to use NIS and NIS+ with OpenSolaris which will result in a build-fail.

To fix it, remove the lines “#define HAS_NIS” and “#define HAS_NISPLUS” (line 403 and 404) from src/util/sys_defs.h or apply this path:

--- src/util/sys_defs.h.bak     Thu Jun 16 00:36:37 2011
+++ src/util/sys_defs.h Tue Oct  4 22:39:49 2011
@@ -400,8 +400,6 @@
 #define HAS_DBM
 #define DEF_DB_TYPE    "dbm"
 #define ALIAS_DB_MAP   "dbm:/etc/mail/aliases"
-#define HAS_NIS
-#define HAS_NISPLUS
 #define USE_SYS_SOCKIO_H               /* Solaris 2.5, changed sys/ioctl.h */
 #define GETTIMEOFDAY(t)        gettimeofday(t)
 #define ROOT_PATH      "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"

Building

Now you can start building Postfix.

root@test:~/postfix-2.8.5# gmake makefiles CCARGS='-DUSE_TLS \
 -lssl -lcrypto -DUSE_SASL_AUTH \
 -DUSE_CYRUS_SASL -I/usr/include/sasl' \
 AUXLIBS="-L/usr/lib -lsasl -lssl -lcrypto"

(echo "# Do not edit -- this file documents how Postfix was built for your machine.";
>makedefs.tmp
set +e; if cmp makedefs.tmp conf/makedefs.out; then rm makedefs.tmp; \
...

root@test:~/postfix-2.8.5# gmake

gmake -f Makefile.in MAKELEVEL= Makefiles
(echo "# Do not edit -- this file documents how Postfix was built for your machine.";
>makedefs.tmp
...

If you didn’t get an error, you can now check if libsasl was linked correctly:

root@test:~/postfix-2.8.5# ldd ./bin/postconf

        libsasl.so.1 =>  /usr/lib/libsasl.so.1
        libssl.so.0.9.8 =>       /lib/libssl.so.0.9.8
        libcrypto.so.0.9.8 =>    /lib/libcrypto.so.0.9.8
        libresolv.so.2 =>        /lib/libresolv.so.2
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libmd.so.1 =>    /lib/libmd.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libm.so.2 =>     /lib/libm.so.2

Create a OpenSolaris Package

There is a cool script available which takes the compiled Postfix sources and builds a OpenSolaris package with all required settings (e.g. users, service-definitions).

You can find the script on Ihsan Dogan’s website: http://ihsan.dogan.ch/postfix/

Directlink: http://ihsan.dogan.ch/postfix/downloads/makePostfixPkg.sh

root@test:~/postfix-2.8.5# wget http://ihsan.dogan.ch/postfix/downloads/makePostfixPkg.sh

--2011-10-04 22:42:35--  http://ihsan.dogan.ch/postfix/downloads/makePostfixPkg.sh
Resolving ihsan.dogan.ch (ihsan.dogan.ch)... 82.220.5.55
Connecting to ihsan.dogan.ch (ihsan.dogan.ch)|82.220.5.55|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21030 (21K) [application/x-sh]
Saving to: `makePostfixPkg.sh'

100%[======================================>] 21,030      --.-K/s   in 0.1s

2011-10-04 22:42:35 (205 KB/s) - `makePostfixPkg.sh' saved [21030/21030]

root@test:~/postfix-2.8.5# chmod +x makePostfixPkg.sh
root@test:~/postfix-2.8.5# ./makePostfixPkg.sh
...

This will result in a file named CNDpostfix-2.8.5,REV=111005-SunOS5.11-i386.pkg

Install Postfix

If you have a installed Sendmail, you need to remove it before the installation of postfix:

root@test:~/postfix-2.8.5# pkg uninstall sendmail

Now you can use pkgadd to install the package:

root@test:~/postfix-2.8.5# pkgadd -d CNDpostfix-2.8.5\,REV\=111005-SunOS5.11-i386.pkg

The following packages are available:
  1  CNDpostfix     Postfix MTA
                    (i386) 2.8.5r0.4.0,REV=111005

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: a

Processing package instance  from

Postfix MTA(i386) 2.8.5r0.4.0,REV=111005
http://www.postfix.org/ packaged by Ihsan Dogan
...

The final step is to configure your Postfix and activate it afterwards.

root@test:~/postfix-2.8.5# svcadm enable svc:/network/postfix:default
root@test:~/postfix-2.8.5# svcs -vx postfix
svc:/network/postfix:default (Postfix SMTP Server)
 State: online since Tue Oct  4 22:46:29 2011
   See: man -M /usr/share/man -s 1 postfix
   See: http://www.postfix.org/documentation.html
   See: /var/svc/log/network-postfix:default.log
Impact: None.

On September 14th 2011 the OpenIndiana Project announced the next development release of OpenIndiana (Build 151a). That’s a good reason to upgrade your system and it’s Zones.

The common way to upgrade your OpenIndiana System is to run the following command.

root@test:~# pkg image-update
                Packages to remove:     2
               Packages to install:    13
                Packages to update:   115
           Create boot environment:   Yes
...

This will result in a new snapshot on your disk and a new entry in the boot menu.

If you try to perform an Upgrade of a Zone this way, it will fail with the message:

pkg: Unable to clone the current boot environment.

Therefor the upgrade process has to be triggered from the global zone. Let’s say you want to upgrade the Zone “test” with the ZFS dataset under “/zones/test“. The Zone currently runs OpenIndiana Build 148 as we can see after the login:

root@global:~# zlogin test
[Connected to zone 'test' pts/2]
Last login: Wed Oct  4 22:32:48 on pts/2
OpenIndiana     SunOS 5.11      oi_148  November 2010

To perform the upgrade, we should halt the zone first.

root@global:~# zoneadm -z test halt
root@global:~# pkg -R /zones/test/root image-update -v
                Packages to remove:     2
               Packages to install:     13
                Packages to update:     115
           Create boot environment:     No
               Services to restart:     2
              Rebuild boot archive:     No
Changed fmris:
pkg://openindiana.org/runtime/perl-584@5.8.4,5.11-0.148:20101122T085618Z -> None
pkg://openindiana.org/runtime/perl-584/extra@5.8.4,5.11-0.148:20101122T085622Z -> None
...

If everything work fine, you should see this message:

DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                              130/130 15260/15260  106.7/106.7

PHASE                                        ACTIONS
Removal Phase                              4253/4253
Install Phase                            16931/16931
Update Phase                               5112/5112

PHASE                                          ITEMS
Package State Update Phase                   245/245
Package Cache Update Phase                   117/117
Image State Update Phase                         2/2

---------------------------------------------------------------------------
NOTE: Please review release notes posted at:

http://wiki.openindiana.org/oi/oi_151a+Release+Notes

---------------------------------------------------------------------------

root@global:~#

Now it’s time to restart your zone and check it’s status.

root@global:~# zoneadm -z test boot
root@global:~# zlogin test
[Connected to zone 'test' pts/2]
Last login: Wed Oct  4 23:10:48 on pts/2
OpenIndiana (powered by illumos)    SunOS 5.11    oi_151a    September 2011
root@test:~#

As you can see, the Zone now runs OpenIndiana Build 151a