blob: 483015a0670252f47e2f3ff450f5dc0dd6470de6 (
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
|
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: nick
# Purpose: override of kernel-2.eclass for the linux-libre kernel
#
inherit kernel-2
EXPORT_FUNCTIONS src_unpack
DEBLOB_CHECK="deblob-check"
KERNEL_URI="http://www.linux-libre.fsfla.org/pub/linux-libre/releases/${PV}-libre/linux-${PV}-libre.tar.bz2"
DEBLOB_URI="http://www.linux-libre.fsfla.org/pub/linux-libre/releases/${PV}-libre/${DEBLOB_CHECK}"
check_for_blobs() {
# usage: check_for_blobs name_of_variable_containing_paths_to_check
# we want the name of a variable (not just its contents)
# so can unset it if blobs are found
[[ -z "${!1}" ]] && return 1
sh ${DISTDIR}/${DEBLOB_CHECK} ${!1}
if [ $? -ne 0 ]; then
ewarn "Warning: A file in ${1} appears to contain blobs."
ewarn "Disabling ${1} for now."
eval "${1}=''"
ewarn "Please report this to http://bugs.gentoo.org/266157"
return 1
fi
return 0
}
kernel-libre_src_unpack() {
# kernel revision patches included in tarball
UNIPATCH_LIST_DEFAULT=""
if [ -n ${UNIPATCH_LIST_GENPATCHES} || -n ${UNIPATCH_LIST} ]; then
echo "Checking all patches are clean of blobs"
check_for_blobs "UNIPATCH_LIST_GENPATCHES"
check_for_blobs "UNIPATCH_LIST"
fi
# universal_unpack expects a different kernel tarball name
expected_tarball=${DISTDIR}/linux-${OKV}.tar.bz2
# temporarily move any preexisting kernel tarball
moved_tarball=${expected_tarball}-original
[[ -f $expected_tarball ]] && \
mv $expected_tarball $moved_tarball
ln -sf ${DISTDIR}/linux-${OKV}-libre.tar.bz2 $expected_tarball
kernel-2_src_unpack
rm $expected_tarball
# put any preexisting tarball back in its original location
[[ -f $moved_tarball ]] && \
mv $moved_tarball $expected_tarball
}
|