]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - ubuntu/vbox-update
cfg80211: prevent speculation on cfg80211_classify8021d() return
[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 # Fix up KERN_DIR to point at the kernel source tree
41 for make in vbox/*/Makefile.include.header
42 do
43 sed -i -e 's/^KERN_DIR := .*$/KERN_DIR := $(srctree)/' $make
44 done
45
46 # We're now using the vboxvideo module in drivers/staging, so disable
47 # the version that was imported.
48 sed -i -e 's: vboxvideo/::' vbox/Makefile
49
50 # Reduce the version of the in-kernel module just slightly so it
51 # will not clash with the dkms package.
52 for version in vbox/*/version-generated.h
53 do
54 sed -i -e 's/_Ubuntu"/_KernelUbuntu"/' $version
55 done
56
57 # Record the version number and nominal source.
58 {
59 echo "Source: http://ports.ubuntu.com/pool/multiverse/v/virtualbox/virtualbox-guest-dkms_${ver}_all.deb"
60 echo "Version: $ver"
61 } >vbox/BOM
62
63 git add vbox
64 {
65 echo "UBUNTU: ubuntu: vbox -- update to $ver"
66 } | git commit -s -F -