Skip to content

HTTPS clone URL

Subversion checkout URL

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