summaryrefslogtreecommitdiffstats
path: root/runall.sh
blob: cf0ef10fa3f3b55fa1c8ea34fd0085c8ff24809e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/sh

# Start from the root of the spdx directory which needs to
# be outside of the kernel tree.

# Hand in the path to the Kernel tree
export LINUXDIR=`realpath $1`
SPDXDIR=`pwd`

# Step 1
#
# Fixup the following files which have been omitted in the first
# sweep:
#
# Build files
# Files which have only a MODULE_LICENSE() entry
# Files which have only a EXPORT_SYMBOL() entry
#
# Scan the tree
cd $LINUXDIR
git rebase --abort
git checkout master
$SPDXDIR/scan $SPDXDIR/step1
cd $SPDXDIR

# Create the patches for build files
cd step1/build
./genmake.sh
cd $SPDXDIR

# Create the patches for modules-only
cd step1/modules-only
./genmod.sh
cd $SPDXDIR

# Create the patches for export symbol only
cd step1/export-symbol
./genexp.sh
cd $SPDXDIR

# Go and apply the mess
cd $LINUXDIR

git branch -D step1
git checkout -b step1

rm patches
ln -s $SPDXDIR/step1/build/patches patches
git quiltimport
rm patches
ln -s $SPDXDIR/step1/modules-only/patches patches
git quiltimport
rm patches
ln -s $SPDXDIR/step1/export-symbol/patches patches
git quiltimport
rm patches
cd $SPDXDIR

# Step 2
#
# Handle the first round of GPLV2-only/or-later which do not have SPDX and no
# other license and no conflicts.
#
# Re-scan the tree
cd $LINUXDIR
$SPDXDIR/scan $SPDXDIR/step2
cd $SPDXDIR

cd step2
./checkrules.sh
./genreplace.sh
cd $SPDXDIR

cd $LINUXDIR

git branch -D step2
git checkout -b step2

rm patches
ln -s $SPDXDIR/step2/patches patches
git quiltimport
rm patches
cd $SPDXDIR

# Step 3
#
# Handle the OpenIB mess
#
# Re-scan the tree
cd $LINUXDIR
$SPDXDIR/scan $SPDXDIR/step3
cd $SPDXDIR

cd step3
./checkrules.sh
./genreplace.sh
cd $SPDXDIR

cd $LINUXDIR

git branch -D step3
git checkout -b step3

rm patches
ln -s $SPDXDIR/step3/patches patches
git quiltimport
rm patches
cd $SPDXDIR

#
# More fun to come
#
# Re-scan the tree
cd $LINUXDIR
$SPDXDIR/scan $SPDXDIR/step4
cd $SPDXDIR