1 |
Hi Fellows, |
2 |
|
3 |
This is a trivial patch for kernel-2.eclass to support Prefix. Does it |
4 |
look good to be commited? |
5 |
|
6 |
Thanks, |
7 |
Benda |
8 |
|
9 |
Bug: 478436 |
10 |
--- kernel-2.eclass 2016-02-17 22:46:25.235543840 +0900 |
11 |
+++ kernel-2.eclass 2016-05-24 01:14:22.246809021 +0900 |
12 |
@@ -539,8 +522,8 @@ |
13 |
#============================================================== |
14 |
kernel_header_destdir() { |
15 |
[[ ${CTARGET} == ${CHOST} ]] \ |
16 |
- && echo /usr/include \ |
17 |
- || echo /usr/${CTARGET}/usr/include |
18 |
+ && echo "${EPREFIX}"/usr/include \ |
19 |
+ || echo "${EPREFIX}"/usr/${CTARGET}/usr/include |
20 |
} |
21 |
|
22 |
cross_pre_c_headers() { |
23 |
@@ -667,7 +650,7 @@ |
24 |
|
25 |
# autoconf.h isnt generated unless it already exists. plus, we have |
26 |
# no guarantee that any headers are installed on the system... |
27 |
- [[ -f ${ROOT}/usr/include/linux/autoconf.h ]] \ |
28 |
+ [[ -f ${EROOT}/usr/include/linux/autoconf.h ]] \ |
29 |
|| touch include/linux/autoconf.h |
30 |
|
31 |
# if K_DEFCONFIG isn't set, force to "defconfig" |
32 |
@@ -741,15 +724,15 @@ |
33 |
# Do not use "linux/*" as that can cause problems with very long |
34 |
# $S values where the cmdline to cp is too long |
35 |
pushd "${S}" >/dev/null |
36 |
- dodir ${ddir}/linux |
37 |
+ dodir ${ddir#${EPREFIX}}/linux |
38 |
cp -pPR "${S}"/include/linux "${D}"/${ddir}/ || die |
39 |
rm -rf "${D}"/${ddir}/linux/modules |
40 |
|
41 |
- dodir ${ddir}/asm |
42 |
- cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm |
43 |
+ dodir ${ddir#${EPREFIX}}/asm |
44 |
+ cp -pPR "${S}"/include/asm/* "${ED}"/${ddir}/asm |
45 |
|
46 |
if kernel_is 2 6 ; then |
47 |
- dodir ${ddir}/asm-generic |
48 |
+ dodir ${ddir#${EPREFIX}}/asm-generic |
49 |
cp -pPR "${S}"/include/asm-generic/* "${D}"/${ddir}/asm-generic |
50 |
fi |
51 |
|
52 |
@@ -784,7 +767,7 @@ |
53 |
> "${S}"/patches.txt |
54 |
fi |
55 |
|
56 |
- mv ${WORKDIR}/linux* "${D}"/usr/src |
57 |
+ mv ${WORKDIR}/linux* "${ED}"/usr/src |
58 |
|
59 |
if [[ -n "${UNIPATCH_DOCS}" ]] ; then |
60 |
for i in ${UNIPATCH_DOCS}; do |
61 |
@@ -819,22 +799,22 @@ |
62 |
|
63 |
# if we are to forcably symlink, delete it if it already exists first. |
64 |
if [[ ${K_SYMLINK} > 0 ]]; then |
65 |
- [[ -h ${ROOT}usr/src/linux ]] && rm ${ROOT}usr/src/linux |
66 |
+ [[ -h ${EROOT}usr/src/linux ]] && rm ${EROOT}usr/src/linux |
67 |
MAKELINK=1 |
68 |
fi |
69 |
|
70 |
# if the link doesnt exist, lets create it |
71 |
- [[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1 |
72 |
+ [[ ! -h ${EROOT}usr/src/linux ]] && MAKELINK=1 |
73 |
|
74 |
if [[ ${MAKELINK} == 1 ]]; then |
75 |
- cd "${ROOT}"usr/src |
76 |
+ cd "${EROOT}"usr/src |
77 |
ln -sf linux-${KV_FULL} linux |
78 |
cd ${OLDPWD} |
79 |
fi |
80 |
|
81 |
# Don't forget to make directory for sysfs |
82 |
- [[ ! -d ${ROOT}sys ]] && kernel_is 2 6 && mkdir ${ROOT}sys |
83 |
+ [[ ! -d ${EROOT}sys ]] && kernel_is 2 6 && mkdir ${EROOT}sys |
84 |
|
85 |
echo |
86 |
elog "If you are upgrading from a previous kernel, you may be interested" |
87 |
elog "in the following document:" |
88 |
@@ -1353,11 +1310,11 @@ |
89 |
[[ ${ETYPE} == headers ]] && return 0 |
90 |
|
91 |
# If there isn't anything left behind, then don't complain. |
92 |
- [[ -e ${ROOT}usr/src/linux-${KV_FULL} ]] || return 0 |
93 |
+ [[ -e ${EROOT}usr/src/linux-${KV_FULL} ]] || return 0 |
94 |
echo |
95 |
ewarn "Note: Even though you have successfully unmerged " |
96 |
ewarn "your kernel package, directories in kernel source location: " |
97 |
- ewarn "${ROOT}usr/src/linux-${KV_FULL}" |
98 |
+ ewarn "${EROOT}usr/src/linux-${KV_FULL}" |
99 |
ewarn "with modified files will remain behind. By design, package managers" |
100 |
ewarn "will not remove these modified files and the directories they reside in." |
101 |
echo |