Skip to content
Newer
Older
100755 491 lines (411 sloc) 18.6 KB
7c374f2 @chilicuil apply sh guideline: https://github.com/chilicuil/learn/blob/master/sh…
authored
1 #!/bin/sh
aeade16 kernel-ck-ubuntu: update to 3.8.x, push requests to keep it at the ed…
chilicuil authored
2 #http://viajemotu.wordpress.com/2012/08/13/kernel-ck-for-ubuntu-precise/
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
3 #https://github.com/chilicuil/learn/blob/master/sh/is/kernel-ck-ubuntu
2483c59 added scripts:
chilicuil authored
4
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
5 # $ time sh kernel-ck-ubuntu
2483c59 added scripts:
chilicuil authored
6
7 #####################################
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
8 #kernel version base
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
9 kernel="3.15"
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
10 #kernel specific version
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
11 patchkernel="3.15.5"
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
12 #BFQ patch
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
13 bfq="3.15.0-v7r5"
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
14 #CK patch
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
15 patchck="3.15-ck1"
2483c59 added scripts:
chilicuil authored
16 #####################################
17
d98170c @chilicuil update functions
authored
18 ################################################################################
19 ############DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU'RE DOING#################
20 ################################################################################
2483c59 added scripts:
chilicuil authored
21
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
22 trap _cleanup SIGINT SIGTERM #trap ctrl-c
23
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
24 #/tmp partition could have noexec
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
25 tmp_path="${HOME}/.tmp/kernel-ck-ubuntu-${patchkernel}"
26 curr_path="${PWD}"
d98170c @chilicuil update functions
authored
27 apps_default="kernel-package gcc-4.6 libncurses5 libncurses5-dev build-essential
28 patch fakeroot bc"
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
29
7c374f2 @chilicuil apply sh guideline: https://github.com/chilicuil/learn/blob/master/sh…
authored
30 cl="$(printf "%s\\n" "$(($(grep -c processor /proc/cpuinfo) + 1))")"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
31 vbfq="$(printf "%s" "${bfq}" | cut -d'-' -f2)"
32 ckk="$(printf "%s" "${patchck}" | cut -d'-' -f2)"
33 arqt="$(dpkg --print-architecture)"
2483c59 added scripts:
chilicuil authored
34
221ddd7 @chilicuil minimize function syntax
authored
35 _printfl() {
b0756d3 @chilicuil apply updated sh guidelines
authored
36 _printfl__max_len="80"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
37 if [ -n "${1}" ]; then
b0756d3 @chilicuil apply updated sh guidelines
authored
38 _printfl__word_len="$((${#1} + 2))"
39 _printfl__sub="$((${_printfl__max_len} - ${_printfl__word_len}))"
40 _printfl__half="$((${_printfl__sub} / 2))"
41 _printfl__other_half="$((${_printfl__sub} - ${_printfl__half}))"
d98170c @chilicuil update functions
authored
42 printf "%b" "\033[1m" #white strong
b0756d3 @chilicuil apply updated sh guidelines
authored
43 printf '%*s' "${_printfl__half}" '' | tr ' ' -
d98170c @chilicuil update functions
authored
44 printf "%b" "\033[7m" #white background
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
45 printf " %s " "${1}"
d98170c @chilicuil update functions
authored
46 printf "%b" "\033[0m\033[1m" #white strong
b0756d3 @chilicuil apply updated sh guidelines
authored
47 printf '%*s' "${_printfl__other_half}" '' | tr ' ' -
d98170c @chilicuil update functions
authored
48 printf "%b" "\033[0m" #back to normal
49 printf "\\n"
50 else
51 printf "%b" "\033[1m" #white strong
b0756d3 @chilicuil apply updated sh guidelines
authored
52 printf '%*s' "${_printfl__max_len}" '' | tr ' ' -
d98170c @chilicuil update functions
authored
53 printf "%b" "\033[0m" #back to normal
54 printf "\\n"
55 fi
56 }
57
221ddd7 @chilicuil minimize function syntax
authored
58 _printfs() {
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
59 [ -z "${1}" ] && return 1
60 printf "%s\\n" "[+] ${*}"
d98170c @chilicuil update functions
authored
61 }
62
221ddd7 @chilicuil minimize function syntax
authored
63 _die() {
d13bbd4 @chilicuil general cleanup
authored
64 [ -z "${1}"] && return 1
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
65 printf "%b\\n" "[-] Error: ${*}"
c1b9def @chilicuil new 3.13.7 version
authored
66 exit 1
67 }
68
221ddd7 @chilicuil minimize function syntax
authored
69 _header() {
2483c59 added scripts:
chilicuil authored
70 clear
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
71 _printfl "Kernel ck builder (${patchkernel})"
d98170c @chilicuil update functions
authored
72 printf "%b\\n" "\033[1m Updates:\033[0m https://github.com/chilicuil/learn/blob/master/sh/is/kernel-ck-ubuntu"
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
73 printf "%b\\n" "\033[1m Patches:\033[0m -bfq, -ck"
d98170c @chilicuil update functions
authored
74 printf "%b\\n" "\033[1m Config:\033[0m http://repo-ck.com/"
75 _printfl "Current configuration: edit the script to change it"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
76 printf "%s\\n" " build path: ${tmp_path}"
77 printf "%s\\n" " kernel: ${patchkernel}"
78 printf "%s\\n" " -bfq patchset: ${bfq}"
79 printf "%s\\n" " -ck patchset: ${patchck}"
80 printf "%s\\n" " sufix: ${ckk}"
81 printf "%s\\n" " arch: ${arqt}"
82 printf "%s\\n" " concurrency level: ${cl}"
d98170c @chilicuil update functions
authored
83 _printfl
2483c59 added scripts:
chilicuil authored
84 }
85
221ddd7 @chilicuil minimize function syntax
authored
86 _cmd() {
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
87 [ -z "${1}" ] && return 0
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
88
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
89 printf "%s " " $ ${@}"
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
90 printf "%s\\n"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
91 eval "${@}" 2>&1 >/tmp/kernel-ck-ubuntu.error
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
92
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
93 status="${?}"
94 [ X"${status}" != X"0" ] && { \
95 cat /tmp/kernel-ck-ubuntu.error; \
96 exit "${status}"; } || return
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
97 }
98
221ddd7 @chilicuil minimize function syntax
authored
99 _cmdsudo() {
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
100 [ -z "${1}" ] && return 0
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
101
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
102 printf "%s " " $ sudo ${@}"
103 printf "%s\\n" "${sudopwd}" | ${sudocmd} ${@} 2>&1 >/tmp/kernel-ck-ubuntu.error
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
104
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
105 status="${?}"
106 [ X"${status}" != X"0" ] && { \
107 cat /tmp/kernel-ck-ubuntu.error; \
108 exit "${status}"; } || return
3ba58d7 clean up
chilicuil authored
109 }
110
221ddd7 @chilicuil minimize function syntax
authored
111 _animcui() {
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
112 [ -z "${1}" ] && { printf "%5s\n" ""; return 1; }
d98170c @chilicuil update functions
authored
113
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
114 if ! printf "%s" "$(pidof "${1}")" | grep "[0-9].*" >/dev/null; then
d98170c @chilicuil update functions
authored
115 printf "%5s\n" ""
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
116 return 1;
d98170c @chilicuil update functions
authored
117 fi
2483c59 added scripts:
chilicuil authored
118
b0756d3 @chilicuil apply updated sh guidelines
authored
119 _animcui__animation_state="1"
d98170c @chilicuil update functions
authored
120
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
121 if [ ! "$(ps -p "$(pidof "${1}")" -o comm= 2>/dev/null)" ]; then
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
122 printf "%5s\n" ""
d98170c @chilicuil update functions
authored
123 return 1
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
124 fi
125
d98170c @chilicuil update functions
authored
126 printf "%5s" ""
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
127
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
128 while [ "$(ps -p "$(pidof "${1}")" -o comm= 2>/dev/null)" ]; do
8011332 @chilicuil cleanup, echo -> printf
authored
129 printf "%b" "\b\b\b\b\b"
b0756d3 @chilicuil apply updated sh guidelines
authored
130 case "${_animcui__animation_state}" in
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
131 1) printf "%s" '\o@o\'
b0756d3 @chilicuil apply updated sh guidelines
authored
132 _animcui__animation_state="2" ;;
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
133 2) printf "%s" '|o@o|'
b0756d3 @chilicuil apply updated sh guidelines
authored
134 _animcui__animation_state="3" ;;
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
135 3) printf "%s" '/o@o/'
b0756d3 @chilicuil apply updated sh guidelines
authored
136 _animcui__animation_state="4" ;;
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
137 4) printf "%s" '|o@o|'
b0756d3 @chilicuil apply updated sh guidelines
authored
138 _animcui__animation_state="1" ;;
2483c59 added scripts:
chilicuil authored
139 esac
140 sleep 1
141 done
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
142 printf "%b" "\b\b\b\b\b" && printf "%5s\n" ""
2483c59 added scripts:
chilicuil authored
143 }
144
221ddd7 @chilicuil minimize function syntax
authored
145 _getroot() {
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
146 if [ ! X"${LOGNAME}" = X"root" ]; then
147 printf "%s\\n" "Detecting user ${LOGNAME} (non-root) ..."
8011332 @chilicuil cleanup, echo -> printf
authored
148 printf "%s\\n" "Checking if sudo is available ..."
2483c59 added scripts:
chilicuil authored
149
d98170c @chilicuil update functions
authored
150 if command -v "sudo" >/dev/null 2>&1; then
2483c59 added scripts:
chilicuil authored
151 sudo -K
d98170c @chilicuil update functions
authored
152
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
153 if [ -n "${sudopwd}" ]; then
d98170c @chilicuil update functions
authored
154 # password check
b0756d3 @chilicuil apply updated sh guidelines
authored
155 _getroot__test="$(printf "%s\\n" "${sudopwd}" | sudo -S ls 2>&1)"
156 _getroot__status="${?}"
157 _getroot__not_allowed="$(printf "%s" "${_getroot__test}" | \
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
158 grep -i "sudoers")"
d98170c @chilicuil update functions
authored
159
b0756d3 @chilicuil apply updated sh guidelines
authored
160 if [ -n "${_getroot__not_allowed}" ]; then
d98170c @chilicuil update functions
authored
161 printf "%s %s\\n" "You're not allowed to use sudo," \
162 "get in contact with your local administrator"
163 exit
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
164 fi
d98170c @chilicuil update functions
authored
165
b0756d3 @chilicuil apply updated sh guidelines
authored
166 if [ X"${_getroot__status}" != X"0" ]; then
d98170c @chilicuil update functions
authored
167 sudopwd=""
168 printf "%s\\n" "Incorrect preseed password"
169 exit
170 else
171 sudocmd="sudo -S"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
172 fi
d98170c @chilicuil update functions
authored
173 printf "%s\\n" " - all set ..."
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
174 return
2483c59 added scripts:
chilicuil authored
175 fi
d98170c @chilicuil update functions
authored
176
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
177 i=0 ; while [ "${i}" -lt "3" ]; do
7c374f2 @chilicuil apply sh guideline: https://github.com/chilicuil/learn/blob/master/sh…
authored
178 i="$((${i} + 1))"
d98170c @chilicuil update functions
authored
179 printf "%s" " - enter sudo password: "
2483c59 added scripts:
chilicuil authored
180 stty -echo
181 read sudopwd
182 stty echo
183
184 # password check
b0756d3 @chilicuil apply updated sh guidelines
authored
185 _getroot__test="$(printf "%s\\n" "${sudopwd}" | sudo -S ls 2>&1)"
186 _getroot__status="${?}"
187 _getroot__not_allowed="$(printf "%s" "${_getroot__test}" | \
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
188 grep -i "sudoers")"
d98170c @chilicuil update functions
authored
189
b0756d3 @chilicuil apply updated sh guidelines
authored
190 if [ -n "${_getroot__not_allowed}" ]; then
d98170c @chilicuil update functions
authored
191 printf "\\n%s %s\\n" "You're not allowed to use sudo," \
192 "get in contact with your local administrator"
c2d4455 updated to 3.7.1
chilicuil authored
193 exit
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
194 fi
c2d4455 updated to 3.7.1
chilicuil authored
195
d98170c @chilicuil update functions
authored
196 printf "\\n"
b0756d3 @chilicuil apply updated sh guidelines
authored
197 if [ X"${_getroot__status}" != X"0" ]; then
2483c59 added scripts:
chilicuil authored
198 sudopwd=""
d98170c @chilicuil update functions
authored
199 else
200 sudocmd="sudo -S"
201 break
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
202 fi
2483c59 added scripts:
chilicuil authored
203 done
204
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
205 if [ -z "${sudopwd}" ]; then
d98170c @chilicuil update functions
authored
206 printf "%s\\n" "Failed authentication"
207 exit
208 fi
2483c59 added scripts:
chilicuil authored
209 else
d98170c @chilicuil update functions
authored
210 printf "%s %s\\n" "You're not root and sudo isn't available." \
211 "Please run this script as root!"
3ba58d7 clean up
chilicuil authored
212 exit
2483c59 added scripts:
chilicuil authored
213 fi
214 fi
215 }
216
221ddd7 @chilicuil minimize function syntax
authored
217 _cleanup() {
2483c59 added scripts:
chilicuil authored
218 stty echo
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
219 printf "\\n"
d98170c @chilicuil update functions
authored
220 _printfl "Cleanup"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
221 _printfs "deleting files at ${tmp_path} ..."
222 #printf "%s\\n" "${sudopwd}" | ${sudocmd} rm -v "${tmp_path}"/patch*
223 #printf "%s\\n" "${sudopwd}" | ${sudocmd} rm -v "${tmp_path}"/*.patch
224 printf "%s\\n" "${sudopwd}" | _cmd ${sudocmd} rm -rf "${tmp_path}/linux-${patchkernel}-${ckk}"
225
226 #printf "%s\\n" "${sudopwd}" | ${sudocmd} mount -o remount /tmp
227 #rm -rf "${tmp_path}" 2>/dev/null
228 [ -z "${1}" ] && exit
2483c59 added scripts:
chilicuil authored
229 }
230
221ddd7 @chilicuil minimize function syntax
authored
231 _waitfor() {
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
232 [ -z "${1}" ] && return 1
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
233
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
234 printf "%s " " $ ${@} ..."
235 ${@} > /dev/null 2>&1 &
6c5ca95 verify it actually uses bfs+bfq, fix sudo & amd64 issues
chilicuil authored
236 sleep 1s
2483c59 added scripts:
chilicuil authored
237
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
238 _animcui "${1}"
3ba58d7 clean up
chilicuil authored
239 }
2483c59 added scripts:
chilicuil authored
240
221ddd7 @chilicuil minimize function syntax
authored
241 _waitforsudo() {
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
242 [ -z "${1}" ] && return 1
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
243
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
244 printf "%s " " $ sudo ${@} ..."
245 printf "%s\\n" "${sudopwd}" | ${sudocmd} ${*} >/dev/null 2>&1 &
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
246 sleep 1s
247
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
248 if [ X"${1}" = X"DEBIAN_FRONTEND=noninteractive" ]; then
249 _animcui "${2}"
d98170c @chilicuil update functions
authored
250 else
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
251 _animcui "${1}"
d98170c @chilicuil update functions
authored
252 fi
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
253 }
254
99c3369 kernel-ck-ubuntu: cleaner output, hopefull didn't broke anything
Javier Lopez authored
255 _header
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
256 _getroot
2483c59 added scripts:
chilicuil authored
257
d98170c @chilicuil update functions
authored
258 _printfl "Fixing dependencies"
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
259 _waitforsudo apt-get update
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
260 _waitforsudo apt-get install --no-install-recommends -y ${apps_default}
2483c59 added scripts:
chilicuil authored
261
262
d98170c @chilicuil update functions
authored
263 _printfl "Downloading archives"
264 _printfs "downloading main vanilla kernel tree ..."
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
265 _cmd mkdir -p "${tmp_path}"
266 _cmd cd "${tmp_path}"
267 _waitfor wget --no-check-certificate -N http://www.kernel.org/pub/linux/kernel/v3.x/linux-"${kernel}".tar.gz
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
268 [ ! -f linux-"${kernel}".tar.gz ] && _die "couldn't get http://www.kernel.org/pub/linux/kernel/v3.x/linux-${kernel}.tar.gz"
2483c59 added scripts:
chilicuil authored
269
d98170c @chilicuil update functions
authored
270 _printfs "downloading mainstream patches ..."
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
271 _waitfor wget --no-check-certificate -N http://www.kernel.org/pub/linux/kernel/v3.x/patch-"${patchkernel}".gz
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
272 [ ! -f patch-"${patchkernel}".gz ] && _die "couldn't get http://www.kernel.org/pub/linux/kernel/v3.x/patch-${patchkernel}.gz"
2483c59 added scripts:
chilicuil authored
273
d98170c @chilicuil update functions
authored
274 _printfs "downloading -ck patches ..."
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
275 _waitfor wget -N "http://ck.kolivas.org/patches/3.0/${kernel}/${patchck}/patch-${patchck}.bz2"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
276 [ ! -f patch-"${patchck}".bz2 ] && _die "couldn't get http://ck.kolivas.org/patches/3.0/${kernel}/${patchck}/patch-${patchck}.bz2"
2483c59 added scripts:
chilicuil authored
277
d98170c @chilicuil update functions
authored
278 _printfs "downloading bfq patches ..."
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
279 _waitfor wget -N "http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${bfq}/0001-block-cgroups-kconfig-build-bits-for-BFQ-${vbfq}-${kernel}.patch"
280 [ ! -f "0001-block-cgroups-kconfig-build-bits-for-BFQ-${vbfq}-${kernel}.patch" ] && \
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
281 _die "couldn't get http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${bfq}/0001-block-cgroups-kconfig-build-bits-for-BFQ-${vbfq}-${kernel}.patch"
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
282 _waitfor wget -N "http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${bfq}/0002-block-introduce-the-BFQ-${vbfq}-I-O-sched-for-${kernel}.patch"
283 [ ! -f "0002-block-introduce-the-BFQ-${vbfq}-I-O-sched-for-${kernel}.patch" ] && \
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
284 _die "couldn't get http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${bfq}/0002-block-introduce-the-BFQ-${vbfq}-I-O-sched-for-${kernel}.patch"
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
285 _waitfor wget -N "http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${bfq}/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-${vbfq}-for-${kernel}.0.patch"
286 [ ! -f "0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-${vbfq}-for-${kernel}.0.patch" ] && \
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
287 _die "couldn't get http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${bfq}/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-${vbfq}-for-${kernel}.0.patch"
2483c59 added scripts:
chilicuil authored
288
d98170c @chilicuil update functions
authored
289 _printfl "Applying patches"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
290 _printfs "uncompresing kernel to ${tmp_path}/linux-${kernel}/ ..."
291 if [ ! -d "/${tmp_path}/linux-${kernel}/" ]; then
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
292 _waitfor tar zxf "${tmp_path}/linux-${kernel}.tar.gz"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
293 [ ! -d "${tmp_path}/linux-${kernel}" ] && _die "couldn't unpack ${tmp_path}/linux-${kernel}.tar.gz"
2483c59 added scripts:
chilicuil authored
294 fi
295
d98170c @chilicuil update functions
authored
296 _printfs "uncompresing patches ..."
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
297 _waitfor gunzip patch-"${patchkernel}".gz; [ ! -f patch-"${patchkernel}" ] && _die "couldn't unpack patch-${patchkernel}.gz"
298 _waitfor bunzip2 patch-"${patchck}".bz2; [ ! -f patch-"${patchck}" ] && _die "couldn't unpack patch-${patchck}.bz2"
2483c59 added scripts:
chilicuil authored
299
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
300 _printfs "moving to ${tmp_path}/linux-${patchkernel}-${ckk}"
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
301 _waitfor rm -rf "linux-${patchkernel}-${ckk}"
302 _waitfor cp -R -- linux-"${kernel}" "linux-${patchkernel}-${ckk}"
303 _cmd cd "linux-${patchkernel}-${ckk}"
2483c59 added scripts:
chilicuil authored
304
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
305 _printfs "applying patches ..."
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
306 _cmd "patch -p1 < ../patch-${patchkernel}"
307 _cmd "patch -p1 < ../patch-${patchck}"
308 _cmd "patch -p1 < ../0001-block-cgroups-kconfig-build-bits-for-BFQ-${vbfq}-${kernel}.patch"
309 _cmd "patch -p1 < ../0002-block-introduce-the-BFQ-${vbfq}-I-O-sched-for-${kernel}.patch"
310 _cmd "patch -p1 < ../0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-${vbfq}-for-${kernel}.0.patch"
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
311
d98170c @chilicuil update functions
authored
312 _printfl "Configuring kernel"
313 _printfs "downloading optimized config from http://repo-ck.com ... "
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
314 #_waitfor wget "http://liquorix.net/sources/${kernel}/config.${arqt}"
315 ##TODO 05-11-2013 20:30 >> liquorix.net current configuration breaks -ck kernel
316 # starting in >= 3.10, check from time to time if it can be reused
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
317
318 #for now use config mirrored from http://repo-ck.com/
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
319 _waitfor wget "http://javier.io/mirror/${kernel}/config.${arqt}"
b8a73a5 @chilicuil make shell scripts pipe aware
authored
320 _cmd cp -- "config.${arqt}" .config
2483c59 added scripts:
chilicuil authored
321
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
322 ##tmp fix for bug #663474, disable lguest hypervisor, http://lguest.ozlabs.org/lguest.txt
323 ##http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=663474
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
324 if [ X"${arqt}" = X"i386" ]; then
1cee9c9 @chilicuil kernel-ck-ubuntu: update for 3.9
authored
325 sed -i "/CONFIG_LGUEST_GUEST/d" .config
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
326 sed -i "/CONFIG_LGUEST/d" .config
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
327 elif [ X"${arqt}" = X"amd64" ]; then
6c5ca95 verify it actually uses bfs+bfq, fix sudo & amd64 issues
chilicuil authored
328 if [ ! -d ./arch/amd64 ]; then
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
329 cd arch >/dev/null 2>&1
330 ln -s x86 amd64 >/dev/null 2>&1
331 cd - >/dev/null 2>&1
6c5ca95 verify it actually uses bfs+bfq, fix sudo & amd64 issues
chilicuil authored
332 fi
248cd95 workaround for bug #663474 in debian
chilicuil authored
333 fi
334
d98170c @chilicuil update functions
authored
335 _printfs "making sure BFS and BFQ are enabled in config ..."
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
336 sed -i "/CONFIG_SCHED_CFS=y/d" .config
337 sed -i -e "s/# CONFIG_SCHED_BFS is not set/CONFIG_SCHED_BFS=y/g" \
338 -i -e "s/# CONFIG_IOSCHED_BFQ is not set/CONFIG_IOSCHED_BFQ=y/g" \
339 -i -e "s/CONFIG_DEFAULT_CFQ=y/# CONFIG_DEFAULT_CFQ is not set/g" \
340 -i -e "s/CONFIG_DEFAULT_DEADLINE=y/# CONFIG_DEFAULT_DEADLINE is not set/g" \
341 -i -e "s/CONFIG_DEFAULT_NOOP=y/# CONFIG_DEFAULT_NOOP is not set/g" \
342 -i -e "s/CONFIG_DEFAULT_IOSCHED="cfq"/CONFIG_DEFAULT_IOSCHED="bfq"/g" \
343 -i -e "s/CONFIG_DEFAULT_IOSCHED="deadline"/CONFIG_DEFAULT_IOSCHED="bfq"/g" \
344 -i -e "s/CONFIG_DEFAULT_IOSCHED="noop"/CONFIG_DEFAULT_IOSCHED="bfq"/g" \
345 -i -e "s/# CONFIG_DEFAULT_BFQ is not set/CONFIG_DEFAULT_BFQ=y/g" .config
346
347 _printfs "making sure CONFIG_HZ is set to 1000, better performance + fixes in resume|suspending issues"
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
348 sed -i -e 's/^CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' \
ecdd79f @chilicuil sh/is/kernel-ck-ubuntu: update to 3.11.7-ck1
authored
349 -i -e 's/^# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' \
350 -i -e 's/^CONFIG_HZ=300/CONFIG_HZ=1000/' .config
2483c59 added scripts:
chilicuil authored
351
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
352 #Avoid stackprotector http://www.spinics.net/lists/linux-kbuild/msg08964.html
353 #not available in ubuntu precise gcc (4.6.3)
354 _printfs "making sure CONFIG_CC_STACKPROTECTOR_STRONG is disabled, allow compilation in old gcc versions ..."
355 sed -i -e 's/^CONFIG_CC_STACKPROTECTOR_STRONG=y/# CONFIG_CC_STACKPROTECTOR_STRONG is not set/' \
356 -i -e 's/^# CONFIG_CC_STACKPROTECTOR_NONE is not set/CONFIG_CC_STACKPROTECTOR_NONE=y/' .config
357
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
358 _printfs "removing double -ck suffix ..."
359 sed -i -e 's/CONFIG_LOCALVERSION="-ck"/# CONFIG_LOCALVERSION="-ck"/' .config
360
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
361 ##############
362 #extra patches
363 ##############
364
365 #a lot of shit made it to 3.14.x =/
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
366 #_printfs "setting back FSID to 1, http://www.spinics.net/lists/kernel/msg1716924.html"
367 #sed -i 's/static int unnamed_dev_start = 0/static int unnamed_dev_start = 1/' ./fs/super.c
368
369 #_printfs "disable usb autosuspend for intel btusb, http://www.spinics.net/lists/kernel/msg1716461.html"
370 #sed -i "/usb_enable_autosuspend(data->udev);/d" ./drivers/bluetooth/btusb.c
371
372 #_printfs "fix Xorg crash for i810 chipset, http://lkml.kernel.org/g/533D01BD.1010200@googlemail.com"
373 #cat > ../kernfs-fix-removed-error-check.patch << EOF
374 #diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
375 #index 8034706..e01ea4a 100644
376 #--- a/fs/kernfs/file.c
377 #+++ b/fs/kernfs/file.c
378 #@@ -484,6 +484,8 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
379
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
380 #ops = kernfs_ops(of->kn);
381 #rc = ops->mmap(of, vma);
382 #+ if (rc)
383 #+ goto out_put;
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
384
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
385 #/*
386 #* PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()
387 #EOF
388 #_cmd "patch -p1 < ../kernfs-fix-removed-error-check.patch"
389
390
391 #_printfs "fix saa7134 video, https://bugzilla.kernel.org/show_bug.cgi?id=73361"
392 #cat > ../fix-saa7134.patch << EOF
393 #--- a/drivers/media/pci/saa7134/saa7134-video.c
394 #+++ a/drivers/media/pci/saa7134/saa7134-video.c
395 #@@ -1243,6 +1243,7 @@ static int video_release(struct file *file)
396 #videobuf_streamoff(&dev->cap);
397 #res_free(dev, fh, RESOURCE_VIDEO);
398 #videobuf_mmap_free(&dev->cap);
399 #+ INIT_LIST_HEAD(&dev->cap.stream);
400 #}
401 #if (dev->cap.read_buf) {
402 #buffer_release(&dev->cap, dev->cap.read_buf);
403 #@@ -1254,6 +1255,7 @@ static int video_release(struct file *file)
404 #videobuf_stop(&dev->vbi);
405 #res_free(dev, fh, RESOURCE_VBI);
406 #videobuf_mmap_free(&dev->vbi);
407 #+ INIT_LIST_HEAD(&dev->vbi.stream);
408 #}
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
409
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
410 #/* ts-capture will not work in planar mode, so turn it off Hac: 04.05*/
411 #@@ -1987,17 +1989,12 @@ int saa7134_streamoff(struct file *file, void *priv,
412 #enum v4l2_buf_type type)
413 #{
414 #struct saa7134_dev *dev = video_drvdata(file);
415 #- int err;
416 #int res = saa7134_resource(file);
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
417
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
418 #if (res != RESOURCE_EMPRESS)
419 #pm_qos_remove_request(&dev->qos_request);
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
420
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
421 #- err = videobuf_streamoff(saa7134_queue(file));
422 #- if (err < 0)
423 #- return err;
424 #- res_free(dev, priv, res);
425 #- return 0;
426 #+ return videobuf_streamoff(saa7134_queue(file));
427 #}
428 #EXPORT_SYMBOL_GPL(saa7134_streamoff);
429
430 #EOF
431 #_cmd "patch -p1 < ../fix-saa7134.patch"
432
433 #_printfs "Back port and refine validation of the XSDT root table, https://bugzilla.kernel.org/show_bug.cgi?id=73911"
434 #cat > ../fix-xsdt-validation.patch << EOF
435 #@@ -, +, @@
436 #acpi_tb_parse_root_table().
437 #Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
438 #Subject: ACPICA: Back port and refine validation of the XSDT root table.
439 #---
440 #drivers/acpi/acpica/tbutils.c | 6 ++++--
441 #1 file changed, 4 insertions(+), 2 deletions(-)
442 #--- a/drivers/acpi/acpica/tbutils.c
443 #+++ a/drivers/acpi/acpica/tbutils.c
444 #@@ -461,6 +461,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
445 #u32 table_count;
446 #struct acpi_table_header *table;
447 #acpi_physical_address address;
448 #+ acpi_physical_address rsdt_address;
449 #u32 length;
450 #u8 *table_entry;
451 #acpi_status status;
452 #@@ -488,11 +489,13 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
453 #* as per the ACPI specification.
454 #*/
455 #address = (acpi_physical_address) rsdp->xsdt_physical_address;
456 #+ rsdt_address = (acpi_physical_address) rsdp->rsdt_physical_address;
457 #table_entry_size = ACPI_XSDT_ENTRY_SIZE;
458 #} else {
459 #/* Root table is an RSDT (32-bit physical addresses) */
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
460
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
461 #address = (acpi_physical_address) rsdp->rsdt_physical_address;
462 #+ rsdt_address = address;
463 #table_entry_size = ACPI_RSDT_ENTRY_SIZE;
464 #}
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
465
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
466 #@@ -515,8 +518,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
467
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
468 #/* Fall back to the RSDT */
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
469
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
470 #- address =
471 #- (acpi_physical_address) rsdp->rsdt_physical_address;
472 #+ address = rsdt_address;
473 #table_entry_size = ACPI_RSDT_ENTRY_SIZE;
474 #}
475 #}
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
476
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
477 #EOF
478 #_cmd "patch -p1 < ../fix-xsdt-validation.patch"
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
479
d98170c @chilicuil update functions
authored
480 _printfl "Compiling kernel"
481 _printfs "running make-kpkg ..."
a76bf6f @chilicuil apply guideline: https://github.com/chilicuil/learn/blob/master/sh/gu…
authored
482 CONCURRENCY_LEVEL="${cl}"
bd78635 @chilicuil kernel-ck-ubuntu: bash -> sh transition
authored
483 printf "\\n" | _cmd fakeroot make-kpkg --initrd kernel_image kernel_headers modules_image
2483c59 added scripts:
chilicuil authored
484
d98170c @chilicuil update functions
authored
485 _printfl "DONE"
486 _printfs "copying debs files ..."
e6e45f6 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.14.4
authored
487 _cmd cp -- ../linux-*.deb "${curr_path}"
d98170c @chilicuil update functions
authored
488 _printfs "you may want to install the generated packages and reboot your system, run: $ sudo dpkg -i linux-*.deb"
489 _printfs "have fun ^_^!"
6fc19e4 @chilicuil sh/is/kernel-ck-ubuntu: update to 3.15.5
authored
490
Something went wrong with that request. Please try again.