VirtualBox

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

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

Solaris host,guest installer: Removed some unnecessary checks.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 2.8 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
23
24if test -z "$2"; then
25 echo "Usage: $0 installdir packagename"
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
48echo 'e sed /etc/devlink.tab ? ? ?' >> prototype
49find . -print | $MY_GGREP -v -E 'prototype|makepackage.sh|vboxguest.pkginfo|postinstall.sh|preremove.sh|vboxguest.space' | pkgproto >> prototype
50
51# don't grok for the sed class files
52$MY_AWK 'NF == 6 && $2 == "none" { $5 = "root"; $6 = "bin" } { print }' prototype > prototype2
53$MY_AWK 'NF == 6 && $2 == "none" { $3 = "opt/VirtualBoxAdditions/"$3"="$3 } { print }' prototype2 > prototype
54
55# install the kernel module to the right place (for now only 32-bit guests)
56$MY_AWK 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest" { $3 = "platform/i86pc/kernel/drv/vboxguest=vboxguest" } { print }' prototype > prototype2
57$MY_AWK 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxguest.conf=vboxguest.conf" { $3 = "platform/i86pc/kernel/drv/vboxguest.conf=vboxguest.conf" } { print }' prototype2 > prototype
58
59# install the timesync SMF service
60$MY_AWK 'NF == 6 && $3 == "opt/VirtualBoxAdditions/vboxservice.xml=vboxservice.xml" { $3 = "/var/svc/manifest/system/virtualbox/vboxservice.xml=vboxservice.xml" } { print }' prototype2 > prototype
61
62rm prototype2
63
64# explicitly set timestamp to shutup warning
65VBOXPKG_TIMESTAMP=vboxguest`date '+%Y%m%d%H%M%S'`
66
67# create the package instance
68pkgmk -p $VBOXPKG_TIMESTAMP -o -r .
69
70# translate into package datastream
71pkgtrans -s -o /var/spool/pkg `pwd`/$2 "$MY_PKGNAME"
72
73rm -rf "/var/spool/pkg/$MY_PKGNAME"
74exit $?
75
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