VirtualBox

source: vbox/trunk/src/VBox/Additions/solaris/Installer/makepackage.sh@ 9748

Last change on this file since 9748 was 9748, checked in by vboxsync, 17 years ago

Solaris additions installer: 64-bit changes.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1#!/bin/sh
2# Sun xVM VirtualBox
3# VirtualBox Solaris Guest Additions package creation script.
4#
5# Copyright (C) 2008 Sun Microsystems, Inc.
6#
7# This file is part of VirtualBox Open Source Edition (OSE), as
8# available from http://www.virtualbox.org. This file is free software;
9# you can redistribute it and/or modify it under the terms of the GNU
10# General Public License (GPL) as published by the Free Software
11# Foundation, in version 2 as it comes in the "COPYING" file of the
12# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14#
15# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
16# Clara, CA 95054 USA or visit http://www.sun.com if you need
17# additional information or have any questions.
18#
19
20#
21# Usage:
22# makespackage.sh $(PATH_TARGET)/install packagename $(KBUILD_TARGET_ARCH)
23
24if test -z "$3"; then
25 echo "Usage: $0 installdir packagename x86|amd64"
26 exit 1
27fi
28
29MY_PKGNAME=SUNWvboxguest
30MY_GGREP=/usr/sfw/bin/ggrep
31MY_AWK=/usr/bin/awk
32
33# check for GNU grep we use which might not ship with all Solaris
34if test ! -f "$MY_GGREP" && test ! -h "$MY_GGREP"; then
35 echo "## GNU grep not found in $MY_GGREP."
36 exit 1
37fi
38
39# bail out on non-zero exit status
40set -e
41
42# prepare file list
43cd "$1"
44echo 'i pkginfo=./vboxguest.pkginfo' > prototype
45echo 'i postinstall=./postinstall.sh' >> prototype
46echo 'i preremove=./preremove.sh' >> prototype
47echo 'i space=./vboxguest.space' >> prototype
48if test -f "./vboxguest.copyright"; then
49 echo 'i copyright=./vboxguest.copyright' >> prototype
50fi
51echo 'e sed /etc/devlink.tab ? ? ?' >> prototype
52find . -print | $MY_GGREP -v -E 'prototype|makepackage.sh|vboxguest.pkginfo|postinstall.sh|preremove.sh|vboxguest.space|vboxguest.copyright' | pkgproto >> prototype
53
54# don't grok for the sed class files
55$MY_AWK 'NF == 6 && $2 == "none" { $5 = "root"; $6 = "bin" } { print }' prototype > prototype2
56$MY_AWK 'NF == 6 && $2 == "none" { $3 = "opt/VirtualBoxAdditions/"$3"="$3 } { print }' prototype2 > prototype
57
58# install the kernel module to the right place
59if test "$3" = "x86"; then
60 $MY_AWK 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest" { $3 = "platform/i86pc/kernel/drv/vboxguest=vboxguest"; $6 = "sys" } { print }' prototype > prototype2
61else
62 $MY_AWK 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest" { $3 = "platform/i86pc/kernel/drv/amd64/vboxguest=vboxguest"; $6 = "sys" } { print }' prototype > prototype2
63fi
64$MY_AWK 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxguest.conf=vboxguest.conf" { $3 = "platform/i86pc/kernel/drv/vboxguest.conf=vboxguest.conf" } { print }' prototype2 > prototype
65
66# install the timesync SMF service
67$MY_AWK 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxservice.xml=vboxservice.xml" { $3 = "/var/svc/manifest/system/virtualbox/vboxservice.xml=vboxservice.xml" } { print }' prototype2 > prototype
68
69rm prototype2
70
71# explicitly set timestamp to shutup warning
72VBOXPKG_TIMESTAMP=vboxguest`date '+%Y%m%d%H%M%S'`
73
74# create the package instance
75pkgmk -p $VBOXPKG_TIMESTAMP -o -r .
76
77# translate into package datastream
78pkgtrans -s -o /var/spool/pkg `pwd`/$2 "$MY_PKGNAME"
79
80rm -rf "/var/spool/pkg/$MY_PKGNAME"
81exit $?
82
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette