1 | #!/bin/sh
|
---|
2 | #
|
---|
3 | # innotek VirtualBox Solaris Guest Additions package creation script.
|
---|
4 | # Usage:
|
---|
5 | # makespackage.sh $(PATH_TARGET)/install packagename
|
---|
6 | #
|
---|
7 | # Copyright (C) 2008 innotek GmbH
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | if [ -z "$2" ]; then
|
---|
19 | echo "Usage: $0 installdir packagename"
|
---|
20 | exit 1
|
---|
21 | fi
|
---|
22 |
|
---|
23 | cd "$1"
|
---|
24 | echo 'i pkginfo=./vboxguest.pkginfo' > prototype
|
---|
25 | echo 'i postinstall=./postinstall.sh' >> prototype
|
---|
26 | echo 'i preremove=./preremove.sh' >> prototype
|
---|
27 | find . -print | /usr/sfw/bin/ggrep -v -E 'prototype|makepackage.sh|vboxguest.pkginfo|postinstall.sh|preremove.sh' | pkgproto >> prototype
|
---|
28 |
|
---|
29 | /usr/bin/awk 'NF == 6 { $5 = "root"; $6 = "bin" } { print }' prototype > prototype2
|
---|
30 | /usr/bin/awk 'NF == 6 { $3 = "opt/VirtualBoxAdditions/"$3"="$3 } { print }' prototype2 > prototype
|
---|
31 |
|
---|
32 | # install the kernel module to the right place (for now only 32-bit guests)
|
---|
33 | /usr/bin/awk 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest" { $3 = "platform/i86pc/kernel/drv/vboxguest=vboxguest" } { print }' prototype > prototype2
|
---|
34 | /usr/bin/awk 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxguest.conf=vboxguest.conf" { $3 = "platform/i86pc/kernel/drv/vboxguest.conf=vboxguest.conf" } { print }' prototype2 > prototype
|
---|
35 |
|
---|
36 | # install the vboxclient daemon
|
---|
37 | /usr/bin/awk 'NF == 6 && $3 == "opt/VirtualBoxAdditions/1099.vboxclient=1099.vboxclient" { $3 = "usr/dt/config/Xsession.d/1099.vboxclient=1099.vboxclient" } { print }' prototype > prototype2
|
---|
38 |
|
---|
39 | #install the timesync daemon
|
---|
40 | /usr/bin/awk 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxservice.xml=vboxservice.xml" { $3 = "/var/svc/manifest/system/virtualbox/vboxservice.xml=vboxservice.xml" } { print }' prototype2 > prototype
|
---|
41 |
|
---|
42 | rm prototype2
|
---|
43 | pkgmk -o -r .
|
---|
44 | pkgtrans -s -o /var/spool/pkg `pwd`/$2 INNOvboxguest
|
---|
45 | rm -rf /var/spool/pkg/INNOvboxguest
|
---|
46 |
|
---|