VirtualBox

source: vbox/trunk/src/VBox/Installer/freebsd/postinstall.sh@ 81624

Last change on this file since 81624 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#!/bin/sh
2## @file
3#
4# VirtualBox postinstall script for FreeBSD.
5#
6
7#
8# Copyright (C) 2007-2019 Oracle Corporation
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18
19PATH_TMP="/tmp"
20PATH_TMP_MODS="$PATH_TMP/vbox_mods"
21PATH_INST="/usr/local/lib/virtualbox"
22PATH_KERN_SRC="/usr/src/sys"
23FILE_VBOXDRV="$PATH_INST/vboxdrv.tar.gz"
24
25
26if [ ! -f $PATH_KERN_SRC/Makefile ]; then
27 echo "Kernel sources are not installed. Please install them and reinstall VirtualBox"
28 exit 1
29fi
30
31echo "Compiling kernel modules, please wait..."
32
33# Create temporary directory
34mkdir -p $PATH_TMP_MODS
35
36# Unpack archive
37tar -C $PATH_TMP_MODS -xf $FILE_VBOXDRV
38
39# Compile
40cd $PATH_TMP_MODS
41make
42
43# Check if we succeeded
44if [ $? != 0 ]; then
45 echo "Compiling kernel modules failed."
46 cd ..
47 rm -rf $PATH_TMP_MODS
48 exit 1
49fi
50
51# Copy the modules to /boot/kernel
52echo "Installing kernel modules to /boot/kernel, please wait..."
53cp $PATH_TMP_MODS/vboxdrv.ko /boot/kernel
54cp $PATH_TMP_MODS/vboxnetflt.ko /boot/kernel
55cp $PATH_TMP_MODS/vboxnetadp.ko /boot/kernel
56kldxref -R /boot
57
58# Load them now, unloading old modules
59make load
60
61if [ $? != 0 ]; then
62 echo "Loading kernel modules failed"
63 cd ..
64 rm -rf $PATH_TMP_MODS
65 exit 1
66fi
67
68echo "Kernel modules successfully installed."
69echo "To load them on every boot put them into /boot/loader.conf"
70
71# Cleanup
72cd ..
73rm -rf $PATH_TMP_MODS
74
75exit 0
76
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