do_Module.symvers revision f09a1da19ed1e839e72fcc72d68b9ae12abf83ed
c04c59898d189a1cec4f3de89f60da653358762evboxsync#!/bin/sh
c04c59898d189a1cec4f3de89f60da653358762evboxsync
c04c59898d189a1cec4f3de89f60da653358762evboxsync#
c04c59898d189a1cec4f3de89f60da653358762evboxsync# This script is used when building kernel modules from DKMS. I don't
c04c59898d189a1cec4f3de89f60da653358762evboxsync# know how to solve the problem of inter-module dependencies better.
c04c59898d189a1cec4f3de89f60da653358762evboxsync#
c04c59898d189a1cec4f3de89f60da653358762evboxsync# Copyright (C) 2008 Oracle Corporation
c04c59898d189a1cec4f3de89f60da653358762evboxsync#
f09a1da19ed1e839e72fcc72d68b9ae12abf83edvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
f09a1da19ed1e839e72fcc72d68b9ae12abf83edvboxsync# available from http://www.virtualbox.org. This file is free software;
f09a1da19ed1e839e72fcc72d68b9ae12abf83edvboxsync# you can redistribute it and/or modify it under the terms of the GNU
f09a1da19ed1e839e72fcc72d68b9ae12abf83edvboxsync# General Public License (GPL) as published by the Free Software
f09a1da19ed1e839e72fcc72d68b9ae12abf83edvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
f09a1da19ed1e839e72fcc72d68b9ae12abf83edvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f09a1da19ed1e839e72fcc72d68b9ae12abf83edvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c04c59898d189a1cec4f3de89f60da653358762evboxsync#
c04c59898d189a1cec4f3de89f60da653358762evboxsync
c04c59898d189a1cec4f3de89f60da653358762evboxsyncSYMFILE="/tmp/$1-Module.symvers"
c04c59898d189a1cec4f3de89f60da653358762evboxsynccase "$2" in
c04c59898d189a1cec4f3de89f60da653358762evboxsync save)
c04c59898d189a1cec4f3de89f60da653358762evboxsync if [ -f "$3" ]; then
c04c59898d189a1cec4f3de89f60da653358762evboxsync cp "$3" "$SYMFILE"
c04c59898d189a1cec4f3de89f60da653358762evboxsync fi
c04c59898d189a1cec4f3de89f60da653358762evboxsync ;;
c04c59898d189a1cec4f3de89f60da653358762evboxsync restore)
c04c59898d189a1cec4f3de89f60da653358762evboxsync if [ -f "$SYMFILE" ]; then
c04c59898d189a1cec4f3de89f60da653358762evboxsync cp "$SYMFILE" "$3"
c04c59898d189a1cec4f3de89f60da653358762evboxsync fi
c04c59898d189a1cec4f3de89f60da653358762evboxsync ;;
c04c59898d189a1cec4f3de89f60da653358762evboxsync *)
c04c59898d189a1cec4f3de89f60da653358762evboxsync echo "Usage: <modname> save|restore <location of Module.symvers>"
c04c59898d189a1cec4f3de89f60da653358762evboxsync ;;
c04c59898d189a1cec4f3de89f60da653358762evboxsyncesac