-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkernel.clean
More file actions
165 lines (126 loc) · 3.99 KB
/
Copy pathkernel.clean
File metadata and controls
165 lines (126 loc) · 3.99 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
make a clean build for linux kernel
1: generate the defconfig
-- config from from rpm extract files. not from x86/configs/
2: clean unused files
-- rm arch subdirectory except x86
-- remove Documentation from root Makefile
rm Documentation except Makefile
-- rm readme etc.
-- rm .gitignore
mv .gitignore 11
find . -name ".gitignore" | xargs rm -f
mv 11 .gitignore
3: git init / git add / git commit /git clean -dfx
4: make menuconfig
-- remove firmware
-- remove sound
-- remove virtualization
-- remove drivers
-- new .config to x86_64_defconfig
5: make
make V=1 2>&1 | tee v1.log
mkdir tmp
mv v1.log tmp
git add tmp
6: get .cmd
find . -name "*.cmd" >> 11
while read f; do cat $f >> allcmd; done < 11
vim allcmd: sort -u
mv allcmd tmp/
mv System.map tmp/
git ci -m "allcmd System.map"
7: cfile:
v1.log -- cfile
%v/\.c/d
grep -o "[^[:space:]]\+\.c" cfile > cfile1
sort -u
vim edit particular cases
- rm -Wp,-MD,
- rm /.c
- rm .mod.c
while read f; do realpath $f >> cfile2 ; done < cfile1
from cfile1 --> c.single.retain
while read f; do find . -name $f ; done < tmp/c.single.retain
while read f; do find . -name $f ; done < tmp/c.single.retain >> tmp/c.single.retain2
grep -o " [^[:space:]]\+\.c\>" allcmd
8: sfile:
v1.log -- sfile
%v/\.S/d
grep -o "[^[:space:]]\+\.S" sfile > sfile1
sort -u
vim edit particular cases
- rm -Wp,-MD,
- rm /.S
while read f ; do realpath $f >> tmp/sfile2 ; done < tmp/sfile1
mv sfile2 s.retain
grep -o " [^[:space:]]\+\.S\>" allcmd
9: hfile:
grep -o "[^[:space:]]\+\.h" allcmd >> hfile
sort -u
h.single
h.slash -- vim edit particular case
- rm -Wp,-MD,
- rm /usr/include
while read f ; do realpath $f >> tmp/h.slash2 ; done < tmp/h.slash
-- edit h.slash2, split into single and slash also
-- single named 11,
while read f ; do find . -name $f >> tmp/22 ; done < tmp/11
h.single
while read f ; do find include/ -name $f >> tmp/h.single2 ; done < tmp/h.single
merge 22 h.single2 into h.single3
mv h.slash2 and h.single3 into h.retain
10: find dirs
no firmware samples scripts tools usr
11: rm c s h file
find arch block crypto drivers fs include init ipc kernel lib mm net security sound usr virt -name "*.c" >> call
find arch block crypto drivers fs include init ipc kernel lib mm net security sound usr virt -name "*.S" >> sall
find arch block crypto drivers fs include init ipc kernel lib mm net security sound usr virt -name "*.h" >> hall
call -- sort -u
c.retain -- sort -u
comm -13 c.retain call > c.rm
while read f ; do git rm $f ; done < tmp/c.rm
comm -13 s.retain sall > s.rm
while read f ; do git rm $f ; done < tmp/s.rm
comm -13 h.retain hall > h.rm
while read f ; do git rm $f ; done < tmp/h.rm
12:
comm -23 c.retain call > tmp/compiletoc
comm -23 s.retain sall > tmp/compiletos
comm -23 h.retain hall > tmp/compiletoh
13:recover c files s files
cpsrc.sh
#!/bin/bash
if [ $# -ne 2 ] ; then
echo "copy subdirectory half_file"
exit 1
fi
subdir=$1
halffile=$2
cp -u /home/douglas/lxsrc/src693/${subdir}/${halffile}* /home/douglas/lxsrc/linux310108/${subdir}/
# grep -A1 "fatal error:" ../log1
14:
gitadd.sh
# find . -maxdepth ${depth} -mindepth ${depth} -type d -not -path "./.git/*" > ${tmpdir}
# files=$(find ${d} -not -name "Kconfig" -a -not -name "Kbuild" -a -not -name "Makefile")
#!/bin/bash
sed -n 'H; ${x; s/\n/ /g; p;};' ../ddd > ../ddd2
git add `cat ../ddd2`
rm -f ../ddd ../ddd2
15:
# download link
http://vault.centos.org/7.4.1708/updates/Source/SPackages/kernel-3.10.0-693.17.1.el7.src.rpm
16:
# for depth in `seq 2 9`; do echo $depth; find . -maxdepth ${depth} -mindepth ${depth} -type d -not -path "./.git/*" > tmp_${depth}; done
#!/bin/bash
i=9
while [ $i -gt 1 ] ; do
if [ -s "tmp_$i" ] ; then
while read d ; do
files=$(find ${d} -not -name "Kconfig" -a -not -name "Kbuild" -a -not -name "Makefile")
if [ "x$files" == "x${d}" ] ; then
git rm -r ${d}
fi
done < tmp_$i
fi
i=$((i-1))
done