MRW
http://piratenpartei.ch

Piratenpartei Zürich
PC 85-112704-0

Der Politnetz Auftritt von Marc Wäckerlin Im Politnetz unterstützen

Marcs Computerblog

kUbuntu 11.10 Oneiric Ocelot kmail Migration fails

Upgrading kmail to kmail2 always fails when migrating from kUbuntu 11.04 to 11.10. The instruction is to manually run kmail-migrator --interactive, — but that fails too and returns: «Migration of kmailrc has already run, not running it again».

Solution: First remove the files generated by the migrator:

rm .kde/share/config/kmail2rc
rm -r .kde/share/apps/kmail2
rm .kde/share/config/kmail-migratorrc
kmail-migrator --interactive

Then the migration starts.

Next start of kmail, I am again asked for migration, here I skipped. Then kMail aborts with error message, that I had no read/write access to my mail folder; «In KMail ist ein schwerwiegender Fehler aufgetreten. Das Programm wird beendet. ie Fehlermeldung lautet: Sie haben keine Lese-/Schreibrechte für Ihren Posteingangsordner.» («KMail encountered a fatal error and will terminate now. The error was: You do not have read/write permission to your inbox folder.»)

The path in akonadi is wrong.

Solution:

  • Hit Alt+F2 (or open the K-Menu), enter aknonadi and select «Akonadi Console»(«Akonadi Einrichtung»)
  • Look for «KMail-Folder» («KMail-Ordner») and edit it.
  • You see the message: «Error opening /home/user/Mail/cur; this folder is missing» — the subdirectory cur only exists in some subfolders of mail
  • Either change the path to a subdirectory or better delete the entry «KMail-Folder»

Then kmail starts.

Bootstrap openSUSE into Chroot

Bootstrapping a running openSUSE into a chroot was simpler than I thought:

  1. Just get the basic RPMs for glibc, bash, rpm and zypper including all dependencies.
  2. Unpack them into a chroot-path using cpio
  3. Tweak the minimal system in /etc, add root to /etc/passwd and copy resolv.conf for internet access
  4. bind /dev from the real system to the chroot
  5. Chroot into that minimal installation and install all the RPM packages once again, this time correctly using rpm; that fixes the RPM database and runs the necessary scripts
  6. Add an archive to zypper
  7. Done, now chroot to the path and install whatever you need using zypper

Here's my bash script that I run on Ubuntu to bootstrap a basic openSUSE 11.4 from scratch:

#! /bin/bash -e
 
function error() {
    echo "**** ERROR aborted. Status of last operation: $?"
    if mount | grep -q ${ROOT}/dev; then
        echo "cleanup ${ROOT}/dev"
        sudo umount ${ROOT}/dev
    fi
    exit 1
}
trap error HUP INT QUIT TERM ERR
 
################################################################################
# CONFIGURATION you can overwrite any of the variables when you start the script
# e.g. HW="x86_64 noarch" VERSION=11.4 sudo susebootstrap.sh
 
# Setup OS sources
#
# VERSION: see http://download.opensuse.org/distribution/
VERSION=${VERSION:-"openSUSE-current"}
#
# HW: list of hardware subdirs in openSUSE, e.g. "x86_64 noarch"
HW=(${HW:-i686 i586 noarch})
#
# URL: where to download RPM packages from
URL=${URL:-http://download.opensuse.org/distribution/${VERSION}/repo/oss/suse}
 
# Setup installation pathes
#
# BASE: Base path to the chroots on your system
BASE=${BASE:-/var/chroot}
#
# OS: name of the OS, used for chroot pathname
OS=${OS:-opensuse}
#
# ROOT: Full path to the chroot directory
ROOT=${ROOT:-${BASE}/${OS}-${VERSION}-${HW[0]}}
#
# PACKAGES: Where to store package lists path+filename-prefix
PACKAGES=${PACKAGES:-${ROOT}/var/tmp/packages}
#
# RPMDIR: Where to store downloaded RPMs, relative to ${ROOT}
RPMDIR=${RPMDIR:-/var/tmp/rpms}
 
# Setup base packages and dependencies to install
#
# Dependencies, found out by try and error using "rpm -i"
GLIBCDEPS="filesystem"
BASHDEPS="libreadline6 libncurses5 terminfo-base"
RPMDEPS="libpopt0 liblua5_1 libselinux1 libcap2 libacl libbz2 zlib     \
         libelf1 liblzma5 libattr insserv sed fillup coreutils grep    \
         diffutils permissions perl info pam libpcre0 perl-base gdbm   \
         libzio libaudit1 libcrack2 libdb file cracklib libxcrypt      \
         cracklib-dict-full"
ZYPPERDEPS="procps libzypp libaugeas libgcc libstdc++ satsolver-tools  \
            util-linux libcurl4 libopenssl1 libexpat libproxy1 libxml2 \
            krb5 libidn libldap libssh2 libmodman libgconf libglib     \
            libcom_err2 keyutils-libs cyrus-sasl gpg2 libudev gzip     \
            bzip2 pwdutils pinentry dirmngr libadns libassuan          \
            libgcrypt libgpg-error libksba libpth libusb pam-modules   \
            libnscd libblkid libmount libuuid1 openssl                 \
            update-alternatives glib2-branding-openSUSE"
#
# RPMS: Base packages to install including dependencies from above
RPMS=${RPMS:-bash glibc rpm zypper $GLIBCDEPS $BASHDEPS $RPMDEPS $ZYPPERDEPS}
################################################################################
 
 
################################################################################
# Main Part
################################################################################
# 1. Download basic RPMs for glibc, bash, rpm, zypper and all dependencies
# 2. Unpack them into a chroot-path using cpio
# 3. Tweak the minimal system in /etc
# 4. Bind /dev from the real system to the chroot
# 5. Properly install all the RPM packages within chroot
# 6. Add an archive to zypper and setup hardware architecture
# 7. Done, now chroot to the path and install whatever you need using zypper
################################################################################
 
echo "Install ${OS} ${VERSION} for ${HW[0]} in ${ROOT}"
 
################################################################################
# Preparation of path for chroot and RPMs
test -d ${ROOT}${RPMDIR} || mkdir -p ${ROOT}${RPMDIR}
################################################################################
 
################################################################################
# For all hardware subdirs, get a list of available RPMs from internet
# stored in files ${PACKAGES}.<HARDWARE>
for h in ${HW[*]}; do
    wget -q -O - ${URL}/${h} 2>/dev/null \
        | sed -n 's/.*<a href="\(.*\.'${h}'\.rpm\)">.*/\1/p' \
        > ${PACKAGES}.${h}
done
################################################################################
 
################################################################################
# 1. Download basic RPMs for glibc, bash, rpm, zypper and all dependencies
 
# We know the logical package names, find matching RPM files on server
# PKGS: Will be filled with a list of RPM files to download and install
PKGS=""
for p in $RPMS; do # for all packages to instaöö
    for h in ${HW[*]}; do # for all available hardware subdirectories
        # find all packages that match the package we're looking for
        # but without "-devel" oder "-doc" packages
        if [ "${h}" = "x86_64" ]; then
            # in 64bit package lists, there are also 32bit compatibility
            # packages
            # we filter them out, we want a plain 64bit installation
            PKG=$(egrep '^'${p//+/\\+}'[-0-9_][-0-9_]' "${PACKAGES}.${h}" \
                | egrep -v -- '-devel-|32bit|-doc-' | sort)
        else
            # same as above, without filtering 32bit
            PKG=$(egrep '^'${p//+/\\+}'[-0-9_][-0-9_]' "${PACKAGES}.${h}" \
                | egrep -v -- '-devel-|-doc-' | sort)
        fi
        if [ -n "$PKG" ]; then # We've found at least one matching package
            for p2 in $PKG; do # for all RPM packages  we found
                # if not yet downloaded, download it now
                echo "   ... download $p2"
                test -f ${ROOT}${RPMDIR}/$p2 || \
                    wget -q -O ${ROOT}${RPMDIR}/$p2 ${URL}/${h}/$p2
                # append RPMs to the list of RPM files to install
                PKGS="$PKGS ${ROOT}${RPMDIR}/$p2"
            done
            break # take the first, no need to further scan hardware directories
        fi
    done
done
################################################################################
 
################################################################################
# 2. Unpack them into a chroot-path using cpio
 
# Extract all downloaded RPMS in the chroot directory
cd ${ROOT}
for p in $PKGS; do # for all downloaded RPM packages
    # just extract the file structure withing the RPM without running
    # pre-/post-install scripts
    # this is necessary for a minimal basic system to chroot in
    echo "   ... unpack $p"
    rpm2cpio $p | sudo cpio -dim --quiet
done
cd -
################################################################################
 
################################################################################
# 3. Tweak the minimal system in /etc
echo "   ... setup system"
 
# Do some system setup tweaks
#
# Create minimal /etc/passwd with user "root"
sudo bash -c "echo 'root:x:0:0:root:/root:/bin/bash' > ${ROOT}/etc/passwd"
#
# copy /etc/resolv.conf into chroot to be able to access internet
sudo cp /etc/resolv.conf ${ROOT}/etc/
 
################################################################################
# 4. Bind /dev from the real system to the chroot
 
# rebind host's /dev into chroot to be able to access hardware within chroot
# NOTE: this step must be repeated (or use "schroot")
sudo mount -o bind /dev ${ROOT}/dev
 
################################################################################
# 5. Properly install all the RPM packages within chroot
 
# now chroot into the newe system and call RPM on all donwloaded RPMs for
# a proper installation that executes triggers and maintains RPM database
echo "   ... install all RPMs"
sudo chroot ${ROOT} rpm -i ${RPMDIR}/*.rpm 2> /dev/null
 
################################################################################
# 6. Add an archive to zypper and setup hardware architecture
# add installation source as zypper repository
echo "   ... setup zypper"
sudo chroot ${ROOT} zypper -q ar ${URL} repo-oss
#
# setup hardware architecture in zypper, necessary if not same as in host
sudo perl -pi \
    -e 's#^\#? *arch = .*$#arch = '${HW[0]}'#g' \
    ${ROOT}/etc/zypp/zypp.conf
################################################################################
 
################################################################################
# Done - use your chroot, install more packages with zypper
################################################################################
 
################################################################################
# 7. Done, now chroot to the path and install whatever you need using ''zypper'
# on opensuse, install some basic packages
echo "   ... install more basic packages"
sudo chroot ${ROOT} zypper -q install aaa_base openSUSE-release
################################################################################
 
################################################################################
################################################################################
# cleanup: umount /dev
# NOTE: you must bind it again, if you want to chroot (or use "schroot")
echo "   ... cleanup"
sudo umount ${ROOT}/dev
################################################################################
 
echo "**** SUCCESS done."
echo
echo "########################################################################"
echo "Use your new chroot:"
echo " > sudo mount -o bind /dev ${ROOT}/dev"
echo " > sudo chroot ${ROOT}"
echo "   > [... work in your chroot, use zypper to install packages ...]"
echo "   > exit"
echo " > sudo umount ${ROOT}/dev"
echo "########################################################################"
echo "IMPORTANT NOTE:"
echo "  Don't forget to umount /dev and other binds before you remove"
echo "  the directory ${ROOT},"
echo "  or you'll loose"
echo "########################################################################"

Why Bootstrap an OS into a Chroot

The chroot helps you build openSUSE RPMs with the correct dependencies on another host system. Fo example I build openSUSE RPMs on Ubuntu within a chroot.

Why not use «mach» or «mock»

There are tools named mach and its unfriendly fork mock to make a chroot of a rpm-based distribution to build rpm packages inside a chroot. My only problem was, the're quite complex and did not work out of the box.- mock is not maintained in Ubuntu and has been dropped, while the packache mach in Ubuntu only provides old SuSE and Fedora releases, up to SuSE 9, but now when writing these lines, openSUSE 11.4 is the current release. So not useful for me and too complex to fix. That's why I started from scratch.

Fedora

The same trick should work on Fedora. I'll try this later and change the script so that Fedora will be supported too.

Working in the Chroot

This is an example session how I checkout and build my project within the chroot environment. I already calles sudo susebootstrap.sh which installed to /var/chroot/opensuse-openSUSE-current-i686:

> sudo mount -o bind /dev /var/chroot/opensuse-openSUSE-current-i686/dev
> sudo chroot /var/chroot/opensuse-openSUSE-current-i686

Now I am working within the chroot. Leave it ith extit or key ctrl+d. Don't forget to call sudo umount /var/chroot/opensuse-openSUSE-current-i686/dev when you finished.

Now I checkout and compile a project within the chroot:

> cd /var/tmp/
> zypper install subversion
> svn co https://dev.marc.waeckerlin.org/svn/libxml-cxx/trunk libxml-cxx
> cd libxml-cxx
> zypper install libcppunit-devel gcc-c++ doxygen graphviz texlive automake autoconf libtool make
> ./bootstrap.sh
> ./configure
> make
> make install

Example Installation Run

When I call the script, I get the following output:

> sudo susebootstrap.sh
Install opensuse openSUSE-current for i686 in /var/chroot/opensuse-openSUSE-current-i686
   ... download bash-4.1-20.25.1.i586.rpm
   ... download glibc-2.11.3-12.15.1.i686.rpm
   ... download rpm-4.8.0-27.1.i586.rpm
   ... download zypper-1.5.3-3.2.i586.rpm
   ... download filesystem-11.4-11.14.1.i586.rpm
   ... download libreadline6-6.1-18.25.1.i586.rpm
   ... download libncurses5-5.7-14.1.i586.rpm
   ... download terminfo-base-5.7-14.1.i586.rpm
   ... download libpopt0-1.16-4.1.i586.rpm
   ... download liblua5_1-5.1.4-18.3.i586.rpm
   ... download libselinux1-2.0.91-10.11.i586.rpm
   ... download libcap2-2.19-8.1.i586.rpm
   ... download libacl-2.2.48-12.1.i586.rpm
   ... download libbz2-1-1.0.6-6.11.i586.rpm
   ... download zlib-1.2.5-8.1.i586.rpm
   ... download libelf1-0.149-2.7.i586.rpm
   ... download liblzma5-5.0.0-13.1.i586.rpm
   ... download libattr-2.4.44-11.1.i586.rpm
   ... download insserv-1.14.0-20.21.1.i586.rpm
   ... download sed-4.2.1-2.1.i586.rpm
   ... download fillup-1.42-254.1.i586.rpm
   ... download coreutils-8.9-4.1.i586.rpm
   ... download grep-2.7-3.1.i586.rpm
   ... download diffutils-3.0-2.1.i586.rpm
   ... download permissions-2011.02.14.0908-2.1.i586.rpm
   ... download perl-5.12.3-11.14.1.i586.rpm
   ... download info-4.13a-14.1.i586.rpm
   ... download pam-1.1.3-4.7.1.i586.rpm
   ... download libpcre0-8.10-4.1.i586.rpm
   ... download perl-base-5.12.3-11.14.1.i586.rpm
   ... download gdbm-1.8.3-384.1.i586.rpm
   ... download libzio-0.99-11.1.i586.rpm
   ... download libaudit1-2.0.5-5.8.1.i586.rpm
   ... download libcrack2-2.8.18-6.1.i586.rpm
   ... download libdb-4_5-4.5.20-108.3.i586.rpm
   ... download libdb-4_8-4.8.30-2.4.i586.rpm
   ... download file-5.04-10.1.i586.rpm
   ... download cracklib-2.8.18-6.1.i586.rpm
   ... download libxcrypt-3.0.3-8.1.i586.rpm
   ... download cracklib-dict-full-2.8.12-50.1.i586.rpm
   ... download procps-3.2.8-26.4.i586.rpm
   ... download libzypp-8.12.1-3.3.i586.rpm
   ... download libaugeas0-0.7.4-3.1.i586.rpm
   ... download libgcc45-4.5.1_20101208-9.8.i586.rpm
   ... download libstdc++33-3.3.3-27.4.i586.rpm
   ... download libstdc++45-4.5.1_20101208-9.8.i586.rpm
   ... download satsolver-tools-0.16.1-4.7.1.i586.rpm
   ... download util-linux-2.19-3.6.1.i586.rpm
   ... download libcurl4-7.21.2-9.1.i586.rpm
   ... download libopenssl1_0_0-1.0.0c-17.1.i586.rpm
   ... download libexpat0-1.95.8-110.1.i586.rpm
   ... download libexpat1-2.0.1-101.1.i586.rpm
   ... download libproxy1-0.4.6-6.9.1.i586.rpm
   ... download libxml2-2.7.8-15.1.i586.rpm
   ... download krb5-1.8.3-15.1.i586.rpm
   ... download libidn-1.15-7.1.i586.rpm
   ... download libldap-2_4-2-2.4.23-10.1.i586.rpm
   ... download libssh2-1-1.2.7-3.1.i586.rpm
   ... download libmodman1-2.0.1-3.1.i586.rpm
   ... download libglib-2_0-0-2.28.0-3.6.1.i586.rpm
   ... download libcom_err2-1.41.14-5.1.i586.rpm
   ... download keyutils-libs-1.3-4.1.i586.rpm
   ... download cyrus-sasl-2.1.23-15.1.i586.rpm
   ... download gpg2-2.0.16-7.1.i586.rpm
   ... download libudev0-166-5.1.i586.rpm
   ... download gzip-1.4-4.11.i586.rpm
   ... download bzip2-1.0.6-6.11.i586.rpm
   ... download pwdutils-3.2.14-3.1.i586.rpm
   ... download pinentry-0.8.0-8.1.i586.rpm
   ... download dirmngr-1.1.0-4.1.i586.rpm
   ... download libadns1-1.4-86.1.i586.rpm
   ... download libassuan0-2.0.1-4.1.i586.rpm
   ... download libgcrypt11-1.4.6-3.1.i586.rpm
   ... download libgpg-error0-1.9-4.1.i586.rpm
   ... download libksba-1.1.0-4.1.i586.rpm
   ... download libpth20-2.0.7-124.1.i586.rpm
   ... download libusb-0_1-4-0.1.13-9.1.i586.rpm
   ... download libusb-1_0-0-1.0.8-4.1.i586.rpm
   ... download pam-modules-11.4-2.1.i586.rpm
   ... download libnscd-2.0.2-118.1.i586.rpm
   ... download libblkid1-2.19-3.6.1.i586.rpm
   ... download libmount1-2.19-3.6.1.i586.rpm
   ... download libuuid1-2.19-3.6.1.i586.rpm
   ... download openssl-1.0.0c-17.1.i586.rpm
   ... download update-alternatives-1.14.19-30.33.1.noarch.rpm
   ... download glib2-branding-openSUSE-11.4-4.2.noarch.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/bash-4.1-20.25.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/glibc-2.11.3-12.15.1.i686.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/rpm-4.8.0-27.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/zypper-1.5.3-3.2.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/filesystem-11.4-11.14.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libreadline6-6.1-18.25.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libncurses5-5.7-14.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/terminfo-base-5.7-14.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libpopt0-1.16-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/liblua5_1-5.1.4-18.3.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libselinux1-2.0.91-10.11.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libcap2-2.19-8.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libacl-2.2.48-12.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libbz2-1-1.0.6-6.11.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/zlib-1.2.5-8.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libelf1-0.149-2.7.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/liblzma5-5.0.0-13.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libattr-2.4.44-11.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/insserv-1.14.0-20.21.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/sed-4.2.1-2.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/fillup-1.42-254.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/coreutils-8.9-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/grep-2.7-3.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/diffutils-3.0-2.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/permissions-2011.02.14.0908-2.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/perl-5.12.3-11.14.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/info-4.13a-14.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/pam-1.1.3-4.7.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libpcre0-8.10-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/perl-base-5.12.3-11.14.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/gdbm-1.8.3-384.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libzio-0.99-11.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libaudit1-2.0.5-5.8.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libcrack2-2.8.18-6.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libdb-4_5-4.5.20-108.3.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libdb-4_8-4.8.30-2.4.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/file-5.04-10.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/cracklib-2.8.18-6.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libxcrypt-3.0.3-8.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/cracklib-dict-full-2.8.12-50.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/procps-3.2.8-26.4.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libzypp-8.12.1-3.3.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libaugeas0-0.7.4-3.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libgcc45-4.5.1_20101208-9.8.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libstdc++33-3.3.3-27.4.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libstdc++45-4.5.1_20101208-9.8.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/satsolver-tools-0.16.1-4.7.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/util-linux-2.19-3.6.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libcurl4-7.21.2-9.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libopenssl1_0_0-1.0.0c-17.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libexpat0-1.95.8-110.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libexpat1-2.0.1-101.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libproxy1-0.4.6-6.9.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libxml2-2.7.8-15.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/krb5-1.8.3-15.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libidn-1.15-7.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libldap-2_4-2-2.4.23-10.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libssh2-1-1.2.7-3.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libmodman1-2.0.1-3.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libglib-2_0-0-2.28.0-3.6.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libcom_err2-1.41.14-5.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/keyutils-libs-1.3-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/cyrus-sasl-2.1.23-15.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/gpg2-2.0.16-7.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libudev0-166-5.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/gzip-1.4-4.11.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/bzip2-1.0.6-6.11.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/pwdutils-3.2.14-3.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/pinentry-0.8.0-8.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/dirmngr-1.1.0-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libadns1-1.4-86.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libassuan0-2.0.1-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libgcrypt11-1.4.6-3.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libgpg-error0-1.9-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libksba-1.1.0-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libpth20-2.0.7-124.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libusb-0_1-4-0.1.13-9.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libusb-1_0-0-1.0.8-4.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/pam-modules-11.4-2.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libnscd-2.0.2-118.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libblkid1-2.19-3.6.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libmount1-2.19-3.6.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/libuuid1-2.19-3.6.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/openssl-1.0.0c-17.1.i586.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/update-alternatives-1.14.19-30.33.1.noarch.rpm
   ... unpack /var/chroot/opensuse-openSUSE-current-i686/var/tmp/rpms/glib2-branding-openSUSE-11.4-4.2.noarch.rpm
/home/marc/tmp/clean
   ... setup system
   ... install all RPMs
Updating /etc/sysconfig/security...
Updating /etc/sysconfig/services...
   ... setup zypper
   ... install more basic packages
 
New repository or package signing key received:
Key ID: B88B2FD43DBDC284
Key Name: openSUSE Project Signing Key <opensuse@opensuse.org>
Key Fingerprint: 22C07BA534178CD02EFE22AAB88B2FD43DBDC284
Key Created: Wed May  5 15:01:33 2010
Key Expires: Sun May  4 15:01:33 2014
Repository: repo-oss
 
Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): 
The following NEW packages are going to be installed:
  aaa_base aaa_base-extras bundle-lang-common-ar cpio cron cronie dbus-1 findutils gawk iproute2 iptables klogd libcap-ng0 login logrotate mingetty ncurses-utils net-tools netcfg openSUSE-release openSUSE-release-ftp pkg-config postfix psmisc sysconfig sysvinit-tools udev 
 
The following recommended packages were automatically selected:
  aaa_base-extras bundle-lang-common-ar cron logrotate net-tools netcfg postfix udev 
 
The following packages are suggested, but will not be installed:
  java-1_6_0-openjdk mysql-community-server mysql-community-server-client 
 
27 new packages to install.
Overall download size: 4.6 MiB. After the operation, additional 13.7 MiB will be used.
Continue? [y/n/?] (y):    ... cleanup
**** SUCCESS done.
 
########################################################################
Use your new chroot:
 > sudo mount -o bind /dev /var/chroot/opensuse-openSUSE-current-i686/dev
 > sudo chroot /var/chroot/opensuse-openSUSE-current-i686
   > [... work in your chroot, use zypper to install packages ...]
   > exit
 > sudo umount /var/chroot/opensuse-openSUSE-current-i686/dev
########################################################################
IMPORTANT NOTE:
  Don't forget to umount /dev and other binds before you remove
  the directory /var/chroot/opensuse-openSUSE-current-i686,
  or you'll loose
########################################################################

Add New Harddisk To Encrypted Logical Volume

I have a HP ProLiant N36L, which offers 4 slots for harddisk. I bought it with the built in 250G Harddisk and an additional 2TB drive (I strongly recommend special 7dx24h server harddisk for servers that are alwys up; cheaper harddisks crash after a year).

I set it up with a 500MB /boot partition (formatted with ext2, then I merged the remaining space /dev/sda2 of the 250GB harddisk with the full second 2TB harddisk /dev/sdb1 using the logical volume manager LVM2. The I encrypted thus huge logical volume with dmcrypt and formatted with xfs. I configured this in the installer of the Ubuntu alternate-, respectively server installer.

Then I had to add a next 2TB disk. Of course, I want to do this without destroying the data; not because I have no backup, but because restoring 2TB of lasts days. My shock was, other than during installation, there's no LVM2-GUI that prevents me from hacking into the command line. So I had to find out the commands to manually add the space of the new disk. It was quite simple.

  1. Add new Harddisk: First, shut down the system (if it does not support hotplugging), turn out the computer and add the new disk, then restart.
    Here it is the third disk, so it's /dev/sdc. After boot, login as root and start …
  2. Use fdisk to init partition table and setup a primary partition /dev/sdc1 with id 8e
  3. Create physical volume: pvcreate /dev/sdc1
  4. Look for the name of the volume group with vgdisplay; in my case, it's named big
  5. Extend the volume group by the new harddisk: vgextend big /dev/sdc1
  6. Look for the name of the logical volume within the volume group with lvdisplay; in my case, it's also named big
  7. Extend the logical volume by the new harddisk: lvextend /dev/big/big /dev/sdc1
  8. Get the name of the mounted encrypted filesystem in /dev/mapper by calling mount; in my case, it's /dev/mapper/big-big_crypt
  9. Resize the encrypted filesystem to the new dimension: cryptsetup resize big-big_crypt
  10. Expand the filesystem, here it's xfs, so I use xfs_growfs, otherwise use resize2fs for ext2, ext3, ext4 or resize_reiserfs for reiserfs.
  11. That's it. resized a running system, no reboot necessary. df -h / now shows that my filesystem now has a bit less than 4TB. Before, it was a bit less than 2TB (yes, a «2TB» harddisk is much smaller than 2TB, that's part of the day-to-day ceating).

OpenSSL für Windows/MinGW unter Linux CrossCompilieren

Better Solution: Create the DLLs

OpenSSL 1.0.0d

Apply patch openssl-1.0.0d-configure.patch to file Configure in openssl-1.0.0d, then call config with apropriate cross-compile options and call make and make install:

cd openssl-1.0.0d
patch -p1 < openssl-1.0.0d-configure.patch
./config --cross-compile-prefix=i586-mingw32msvc- --prefix=/opt/local/i586-mingw32msvc shared mingw
make
sudo make install

Details of the Patch

Remove "die"-Line

Without the patch, you first drop into the error message:

> ./config --cross-compile-prefix=i586-mingw32msvc- --prefix=/tmp/openssl shared mingw
Operating system: x86_64-whatever-linux2
Configuring for linux-x86_64
target already defined - linux-x86_64 (offending arg: mingw)

That's why the die-line is commented out.

Change Link Arguments

According to http://wagner.pp.ru/~vitus/articles/openssl-mingw.html, symbols are not exported by default, that's why there is need for adding -Wl,–export-all -shared.

Just get a build environment for Linux (without applications nor DLLs)

OpenSSL 1.0.0c, 1.0.0d

  1. ./config --cross-compile-prefix=i586-mingw32msvc- --prefix=/opt/local/i586-mingw32msvc mingw:gcc
  2. Edit Makefile, search line DIRS=, remove the following directrories: apps test tools
  3. make
  4. sudo make install

OpenSSL 1.0.0a

For OpenSSL Version 1.0.0a, it's quite better now:

  1. ./config --cross-compile-prefix=i586-mingw32msvc- --prefix=/opt/local/i586-mingw32msvc mingw:gcc
  2. edit file engines/e_capi.c and add below #include <wincrypt.h> (line 73):
    /* additional definitions required for e_capi.c  */
     
    typedef struct _PUBKEY {
         DWORD magic ;
         DWORD bitlen ;
    } DSSPUBKEY ;
    #define CERT_STORE_PROV_SYSTEM_A            ((LPCSTR) 9)
    #define CERT_STORE_READONLY_FLAG                        0x00008000
  3. make && make install
  4. → linking fails!

See also: http://www.mail-archive.com/openssl-users@openssl.org/msg60703.html

OpenSSL 0.9.8k

With older OpenSSL Version 0.9.8k:

  1. Edit Configure, remove or comment out line: $IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin" && !is_msys());
  2. ./config --prefix=/opt/local/i586-mingw32msvc mingw:i586-mingw32msvc-gcc
  3. Edit Makefile, search line DIRS=, remove the following directrories: apps test tools
  4. Correct all ar commands: perl -pi -e 's#=ar #=i586-mingw32msvc-ar #g' $(find -name Makefile)
  5. make
  6. sudo make install

Reason:

  1. Remove $IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin" && !is_msys()); from Configure because of this compile time error message:
    "Windows builds (PLATFORM=mingw) use mk1mf.pl-created Makefiles"
  2. Remove directories apps test tools because they cannot be linked and they are not necessary to cross-compile windows programs that need the openssl library. Error message if not removed is:
    ../libssl.a: could not read symbols: Archive has no index; run ranlib to add one
    respectively after the ar correction, the eerormessages are because of missing windows libraries in the form of:
    ../libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x35e): undefined reference to `_WSAGetLastError@0
  3. Fixing the ar command fixes this error message: libssl.a: could not read symbols: Archive has no index; run ranlib to add one

CrossCompile Qt for Windows MinGW on Linux

Tested with Qt 4.7.1.

  1. Patch MinGW (know Problem with Debian package)
  2. Patch and compile Qt

Patch MinGW

If get the fopllowing errr message during compile:

/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libstdc++.a(stubs.o):(.text+0x160): multiple definition of `_powf'
./.obj/debug-shared/SVGLength.o:SVGLength.cpp:(.text$powf[_powf]+0x0): first defined here

Then powf ist double-defined and should be removed from the stdc++-library.

Run once after installing or upgrading the MinGW Debian / Ubuntu packages:

sudo i586-mingw32msvc-ar -d /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libstdc++.a stubs.o

Patch Qt

Get and unpack qt-everywhere-opensource-src-4.7.1 from http://qt.nokia.com

diff -ru qt-everywhere-opensource-src-4.7.1//mkspecs/win32-g++/qmake.conf qt-everywhere-opensource-src-4.7.1-win32//mkspecs/win32-g++/qmake.conf
--- qt-everywhere-opensource-src-4.7.1//mkspecs/win32-g++/qmake.conf	2011-02-07 10:46:01.395271865 +0100
+++ qt-everywhere-opensource-src-4.7.1-win32//mkspecs/win32-g++/qmake.conf	2011-02-10 09:58:01.942577519 +0100
@@ -6,7 +6,8 @@
 
 MAKEFILE_GENERATOR	= MINGW
 TEMPLATE		= app
-CONFIG			+= qt warn_on release link_prl copy_dir_files debug_and_release debug_and_release_target precompile_header
+CONFIG			+= qt warn_off release link_prl copy_dir_files precompile_header
+CONFIG                  += rtti exceptions
 QT			+= core gui
 DEFINES			+= UNICODE QT_LARGEFILE_SUPPORT
 QMAKE_COMPILER_DEFINES  += __GNUC__ WIN32
@@ -14,7 +15,7 @@
 QMAKE_EXT_OBJ           = .o
 QMAKE_EXT_RES           = _res.o
 
-QMAKE_CC		= gcc
+QMAKE_CC		= i586-mingw32msvc-gcc
 QMAKE_LEX		= flex
 QMAKE_LEXFLAGS		=
 QMAKE_YACC		= byacc
@@ -27,7 +28,7 @@
 QMAKE_CFLAGS_DEBUG	= -g
 QMAKE_CFLAGS_YACC	= -Wno-unused -Wno-parentheses
 
-QMAKE_CXX		= g++
+QMAKE_CXX		= i586-mingw32msvc-g++
 QMAKE_CXXFLAGS		= $$QMAKE_CFLAGS
 QMAKE_CXXFLAGS_DEPS	= $$QMAKE_CFLAGS_DEPS
 QMAKE_CXXFLAGS_WARN_ON	= $$QMAKE_CFLAGS_WARN_ON
@@ -41,7 +42,10 @@
 QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
 QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
 
-QMAKE_INCDIR		=
+#INCLUDEPATH             += /usr/i586-mingw32msvc/include
+#INCLUDEPATH             += /opt/local/i586-mingw32msvc/include
+QMAKE_INCDIR            = /opt/local/i586-mingw32msvc/include
+QMAKE_LIBDIR            = /opt/local/i586-mingw32msvc/lib
 QMAKE_INCDIR_QT		= $$[QT_INSTALL_HEADERS]
 QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
 
@@ -50,8 +54,8 @@
 QMAKE_RUN_CXX		= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
 QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 
-QMAKE_LINK		= g++
-QMAKE_LINK_C		= gcc
+QMAKE_LINK		= i586-mingw32msvc-g++
+QMAKE_LINK_C		= i586-mingw32msvc-gcc
 QMAKE_LFLAGS		= -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
 QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
 QMAKE_LFLAGS_EXCEPTIONS_OFF =
@@ -76,32 +80,32 @@
     MINGW_IN_SHELL      = 1
 	QMAKE_DIR_SEP		= /
 	QMAKE_QMAKE		~= s,\\\\,/,
-	QMAKE_COPY		= cp
-	QMAKE_COPY_DIR		= xcopy /s /q /y /i
+	QMAKE_COPY		= cp -r
+	QMAKE_COPY_DIR		= cp -r
 	QMAKE_MOVE		= mv
 	QMAKE_DEL_FILE		= rm
-	QMAKE_MKDIR		= mkdir
+	QMAKE_MKDIR		= mkdir -p
 	QMAKE_DEL_DIR		= rmdir
     QMAKE_CHK_DIR_EXISTS = test -d
 } else {
-	QMAKE_COPY		= copy /y
-	QMAKE_COPY_DIR		= xcopy /s /q /y /i
-	QMAKE_MOVE		= move
-	QMAKE_DEL_FILE		= del
-	QMAKE_MKDIR		= mkdir
+	QMAKE_COPY		= cp -r
+	QMAKE_COPY_DIR		= cp -fr
+	QMAKE_MOVE		= mv
+	QMAKE_DEL_FILE		= rm -r
+	QMAKE_MKDIR		= mkdir -p
 	QMAKE_DEL_DIR		= rmdir
-    QMAKE_CHK_DIR_EXISTS	= if not exist
+    QMAKE_CHK_DIR_EXISTS	= test -d
 }
 
-QMAKE_MOC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
-QMAKE_UIC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
-QMAKE_IDC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
+QMAKE_MOC		= $$[QT_INSTALL_BINS]/moc
+QMAKE_UIC		= $$[QT_INSTALL_BINS]/uic
+QMAKE_IDC		= $$[QT_INSTALL_BINS]/idc
 
 QMAKE_IDL		= midl
-QMAKE_LIB		= ar -ru
-QMAKE_RC		= windres
+QMAKE_LIB		= i586-mingw32msvc-ar -ru
+QMAKE_RC		= i586-mingw32msvc-windres
 QMAKE_ZIP		= zip -r -9
 
-QMAKE_STRIP		= strip
+QMAKE_STRIP		= i586-mingw32msvc-strip
 QMAKE_STRIPFLAGS_LIB 	+= --strip-unneeded
 load(qt_config)
diff -ru qt-everywhere-opensource-src-4.7.1//src/corelib/codecs/codecs.pri qt-everywhere-opensource-src-4.7.1-win32//src/corelib/codecs/codecs.pri
--- qt-everywhere-opensource-src-4.7.1//src/corelib/codecs/codecs.pri	2011-02-07 10:48:52.396759040 +0100
+++ qt-everywhere-opensource-src-4.7.1-win32//src/corelib/codecs/codecs.pri	2011-02-07 10:53:54.182322572 +0100
@@ -19,7 +19,7 @@
 	codecs/qutfcodec.cpp \
 	codecs/qtextcodecplugin.cpp
 
-unix {
+#unix {
 	SOURCES += codecs/qfontlaocodec.cpp
 
         contains(QT_CONFIG,iconv) {
@@ -55,5 +55,5 @@
                         ../plugins/codecs/tw/qbig5codec.cpp \
                         ../plugins/codecs/jp/qfontjpcodec.cpp
         }
-}
+#}
 symbian:LIBS += -lcharconv
diff -ru qt-everywhere-opensource-src-4.7.1//src/corelib/tools/qlocale.cpp qt-everywhere-opensource-src-4.7.1-win32//src/corelib/tools/qlocale.cpp
--- qt-everywhere-opensource-src-4.7.1//src/corelib/tools/qlocale.cpp	2011-02-07 10:48:53.546970826 +0100
+++ qt-everywhere-opensource-src-4.7.1-win32//src/corelib/tools/qlocale.cpp	2011-02-07 10:55:03.155020600 +0100
@@ -6624,18 +6624,18 @@
 {
     // Some values of the floating-point control word can cause _qdtoa to crash with an underflow.
     // We set a safe value here.
-#ifdef Q_OS_WIN
-    _clear87();
-    unsigned int oldbits = _control87(0, 0);
-#ifndef MCW_EM
-#    ifdef _MCW_EM
-#        define MCW_EM _MCW_EM
-#    else
-#        define MCW_EM 0x0008001F
-#    endif
-#endif
-    _control87(MCW_EM, MCW_EM);
-#endif
+// #ifdef Q_OS_WIN
+//     _clear87();
+//     unsigned int oldbits = _control87(0, 0);
+// #ifndef MCW_EM
+// #    ifdef _MCW_EM
+// #        define MCW_EM _MCW_EM
+// #    else
+// #        define MCW_EM 0x0008001F
+// #    endif
+// #endif
+//     _control87(MCW_EM, MCW_EM);
+// #endif
 
 #if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
     fenv_t envp;
@@ -6644,14 +6644,14 @@
 
     char *s = _qdtoa(d, mode, ndigits, decpt, sign, rve, resultp);
 
-#ifdef Q_OS_WIN
-    _clear87();
-#ifndef _M_X64
-    _control87(oldbits, 0xFFFFF);
-#else
-    _control87(oldbits, _MCW_EM|_MCW_DN|_MCW_RC);
-#endif //_M_X64
-#endif //Q_OS_WIN
+// #ifdef Q_OS_WIN
+//     _clear87();
+// #ifndef _M_X64
+//     _control87(oldbits, 0xFFFFF);
+// #else
+//     _control87(oldbits, _MCW_EM|_MCW_DN|_MCW_RC);
+// #endif //_M_X64
+// #endif //Q_OS_WIN
 
 #if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
     fesetenv(&envp);

Configure and Compile Qt

(echo yes | \
  ./configure -xplatform win32-g++ \
              -prefix /usr/local/trolltech/qt-mingw32 \
              -opensource \
              -no-phonon \
              -nomake examples \
              -nomake demos \
              -nomake docs \
              -nomake tools \
              -no-qt3support \
              -little-endian \
              -host-little-endian \
              -openssl \
              -system-zlib \
              -release)
make
sudo make install