VirtualBox

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

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

Solaris/additions: backed out combined installer for now.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 3.4 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
29VBOX_PKGNAME=SUNWvboxguest
30VBOX_AWK=/usr/bin/awk
31VBOX_GGREP=/usr/sfw/bin/ggrep
32VBOX_AWK=/usr/bin/awk
33
34# check for GNU grep we use which might not ship with all Solaris
35if test ! -f "$VBOX_GGREP" && test ! -h "$VBOX_GGREP"; then
36 echo "## GNU grep not found in $VBOX_GGREP."
37 exit 1
38fi
39
40# bail out on non-zero exit status
41set -e
42
43# Fixup filelist using awk, the parameters must be in awk syntax
44# params: filename condition action
45filelist_fixup()
46{
47 "$VBOX_AWK" 'NF == 6 && '"$2"' { '"$3"' } { print }' "$1" > "tmp-$1"
48 mv -f "tmp-$1" "$1"
49}
50
51# prepare file list
52cd "$1"
53echo 'i pkginfo=./vboxguest.pkginfo' > prototype
54echo 'i postinstall=./postinstall.sh' >> prototype
55echo 'i preremove=./preremove.sh' >> prototype
56echo 'i space=./vboxguest.space' >> prototype
57if test -f "./vboxguest.copyright"; then
58 echo 'i copyright=./vboxguest.copyright' >> prototype
59fi
60echo 'e sed /etc/devlink.tab ? ? ?' >> prototype
61find . -print | $VBOX_GGREP -v -E 'prototype|makepackage.sh|vboxguest.pkginfo|postinstall.sh|preremove.sh|vboxguest.space|vboxguest.copyright' | pkgproto >> prototype
62
63# don't grok for the sed class files
64filelist_fixup prototype '$2 == "none"' '$5 = "root"; $6 = "bin"'
65filelist_fixup prototype '$2 == "none"' '$3 = "opt/VirtualBoxAdditions/"$3"="$3'
66
67# install kernel module in the right place
68if test "3" = "x86"; then
69 filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest"' '$3 = "platform/i86pc/kernel/drv/vboxguest=vboxguest"; $6="sys"'
70else
71 filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxguest=vboxguest"' '$3 = "platform/i86pc/kernel/drv/amd64/vboxguest=vboxguest"; $6="sys"'
72fi
73
74# kernel module config file
75filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxguest.conf=vboxguest.conf"' '$3 = "platform/i86pc/kernel/drv/vboxguest.conf=vboxguest.conf"'
76
77filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/vboxservice.xml=vboxservice.xml"' '$3 = "var/svc/manifest/system/virtualbox/vboxservice.xml=vboxservice.xml"'
78echo " --- start of prototype ---"
79cat prototype
80echo " --- end of prototype --- "
81
82# explicitly set timestamp to shutup warning
83VBOXPKG_TIMESTAMP=vboxguest`date '+%Y%m%d%H%M%S'`
84
85# create the package instance
86pkgmk -p $VBOXPKG_TIMESTAMP -o -r .
87
88# translate into package datastream
89pkgtrans -s -o /var/spool/pkg `pwd`/$2 "$VBOX_PKGNAME"
90
91rm -rf "/var/spool/pkg/$VBOX_PKGNAME"
92exit $?
93
Note: See TracBrowser for help on using the repository browser.

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