]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - ubuntu/vbox-update
UBUNTU: [Packaging] virtualbox -- reduce in kernel module versions
[mirror_ubuntu-bionic-kernel.git] / ubuntu / vbox-update
1 #!/bin/bash
2 #
3 # vbox-update <dkms top level>
4
5 #
6 # NOTE: update vbox/BOM if you get the source from anywhere other than
7 # the archive.
8 #
9 # To update:
10 # TMP=$HOME/tmp
11 # wget -O $TMP/virtualbox-guest-dkms.deb http://ports.ubuntu.com/pool/multiverse/v/virtualbox/virtualbox-guest-dkms_4.3.22-dfsg-1_all.deb
12 # dpkg-deb -R $TMP/virtualbox-guest-dkms.deb $TMP/virtualbox-guest-update
13 # vbox-update $TMP/virtualbox-guest-update
14 #
15 # To test build:
16 # fakeroot debian/rules prepare-generic
17 # make O=debian/build/build-generic/ ubuntu/vbox/vboxguest/vboxguest.ko ubuntu/vbox/vboxvideo/vboxvideo.ko ubuntu/vbox/vboxsf/vboxsf.ko
18 #
19
20 if [ "$#" -ne 1 ]; then
21 echo "Usage: $0 <unpacked vbox dkms guest directory>" 1>&2
22 exit 1
23 fi
24 vbox="$1"
25
26 # Update vbox ...
27 git rm -rf vbox
28 mkdir vbox
29 cp -rp "$vbox/usr/src/"*/* vbox
30
31 # Work out what version this represents.
32 ver=`awk '($1 == "Version:") { print $2 }' <"$vbox/DEBIAN/control"`
33
34 # Fix up the KBUILD_EXTMOD as we are not building externally.
35 for make in vbox/*/Makefile
36 do
37 sed -i -e '1iKBUILD_EXTMOD=${srctree}/ubuntu/vbox' $make
38 done
39
40 # We're now using the vboxvideo module in drivers/staging, so disable
41 # the version that was imported.
42 sed -i -e 's: vboxvideo/::' vbox/Makefile
43
44 # Reduce the version of the in-kernel module just slightly so it
45 # will not clash with the dkms package.
46 for version in vbox/*/version-generated.h
47 do
48 sed -i -e 's/_Ubuntu"/_KernelUbuntu"/' $version
49 done
50
51 # Record the version number and nominal source.
52 {
53 echo "Source: http://ports.ubuntu.com/pool/multiverse/v/virtualbox/virtualbox-guest-dkms_${ver}_all.deb"
54 echo "Version: $ver"
55 } >vbox/BOM
56
57 git add vbox
58 {
59 echo "UBUNTU: ubuntu: vbox -- update to $ver"
60 } | git commit -s -F -