Add tuxonice to 2.6.31
[gentoo-overlay-ibormuth.git] / sys-kernel / nogo-sources / nogo-sources-2.6.31.ebuild
Commit [+]AuthorDateLineData
1d08bd48
IB
Ingo Bormuth2009-08-25 19:58:09 +02001# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: $
4
5ETYPE="sources"
6inherit kernel-2
7detect_version
8detect_arch
9
10#------------------------------------------------------------------------
11
12K_WANT_GENPATCHES="base extras"
13K_GENPATCHES_OKV="${OKV}"
c869919a Ingo Bormuth2009-09-11 08:48:17 +020014K_GENPATCHES_VER="1"
1d08bd48
IB
Ingo Bormuth2009-08-25 19:58:09 +020015
16TUXONICE_OKV="${OKV}"
17TUXONICE_VER="3.0.1"
18#TUXONICE_PATCH="tuxonice-${TUXONICE_VER}-for-${TUXONICE_OKV}.patch.bz2"
37d8f146 Ingo Bormuth2009-09-13 23:40:06 +020019TUXONICE_PATCH="current-tuxonice-for-2.6.31.patch-20090911-v1.bz2"
1d08bd48 Ingo Bormuth2009-08-25 19:58:09 +020020
c869919a Ingo Bormuth2009-09-11 08:48:17 +020021REISER4_OKV="2.6.30" #${OKV}"
1d08bd48
IB
Ingo Bormuth2009-08-25 19:58:09 +020022REISER4_VER=""
23REISER4_PATCH="reiser4-for-${REISER4_OKV}${REISER4_VER}.patch.bz2"
24
25ATOP_OKV="2.6.28"
26ATOP_VER=""
27ATOP_PATCH="atoppatch-kernel-${ATOP_OKV}${ATOP_VER}.tar.gz"
28
29#------------------------------------------------------------------------
30
31KEYWORDS="" #~amd64 ~x86"
1d08bd48
IB
Ingo Bormuth2009-08-25 19:58:09 +020032use reiset4 && die "No Reiser4e support yet for this version."
33use atop && die "No ATop support yet for this version."
34
35IUSE="atop currentconfig oneslot reiser4 toshiba-acpi tuxonice"
36
37use oneslot && SLOT="0"
38
39DESCRIPTION="Kernel, optionally with atop, genpatches, reiser4, tuxonice, toshiba-acpi."
40
41HOMEPAGE="http://www.kernel.org
42 ATOP: http://www.atcomputing.nl/Tools/atop
43 GENPATCHES: http://dev.gentoo.org/~dsd/genpatches
44 REISER4: http://www.kernel.org/pub/linux/kernel/people/edward/reiser4
45 TOSHIBA-ACPI: http://memebeam.org/toys/ExperimentalToshibaAcpiDriver
46 TUXONICE: http://www.tuxonice.net"
47
48SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}
49 atop? ( http://www.atcomputing.nl/Tools/atop/packages/${ATOP_PATCH} )
50 reiser4? ( mirror://kernel/linux/kernel/people/edward/reiser4/reiser4-for-2.6/${REISER4_PATCH} )
51 tuxonice? ( http://www.tuxonice.net/downloads/all/${TUXONICE_PATCH} )"
52
53RDEPEND="${RDEPEND}
54 tuxonice? ( >=sys-apps/tuxonice-userui-0.7.3
55 ( || ( sys-power/hibernate-script sys-power/pm-utils ) ) )
56 reiser4? ( >=sys-fs/reiser4progs-1.0.6 )
57 atop? ( sys-process/atop )"
58
59UNIPATCH_STRICTORDER="yes"
60UNIPATCH_LIST=""
61
62if use tuxonice
63then
64 if [[ ${#TUXONICE_VER} -lt 30 ]] # official or local patch generated from git ?
65 then
66 UNIPATCH_LIST="${UNIPATCH_LIST} ${DISTDIR}/${TUXONICE_PATCH}"
67 else
68 UNIPATCH_LIST="${UNIPATCH_LIST} ${FILESDIR}/${TUXONICE_PATCH}"
69 fi
70fi
71
72if use reiser4
73then
74 UNIPATCH_LIST="${UNIPATCH_LIST}
75 ${DISTDIR}/${REISER4_PATCH}"
76fi
77
78if use toshiba-acpi
79then
80 UNIPATCH_LIST="${UNIPATCH_LIST}
81 ${FILESDIR}/linux-2.6.29-toshiba_acpi.patch"
82fi
83
84src_unpack() {
85 kernel-2_src_unpack
86 cd "${S}"
87
88 # Due to stupid naming atop patches don't work with unipatch
89 if use atop && [ -e "${DISTDIR}/${ATOP_PATCH}" ]
90 then
91 echo "Atop Patch:"
92 ( ( ( tar -xzOf "${DISTDIR}/${ATOP_PATCH}" --exclude "README*" \
93 || die "${ATOP_PATCH} is invalid (not yet available ?)" \
94 ) | patch -p1 \
95 ) || die "${ATOP_PATCH} failed (old version ?)"
96 )
97 echo "Fix Atop:"
98 patch -p1 < "${FILESDIR}/linux-2.6.29-atop_fix.patch" || die "Fix Atop Failed."
99
100 fi
101
102 # Copy current config from /proc
103 if use currentconfig ; then
104 if [ -e "/usr/src/linux-${KV_FULL}/.config" ]; then
105 ewarn "Kernel config file already exist."
106 ewarn "I will NOT overwrite that."
107 else
108 echo "Copying kernel config file."
109 zcat /proc/config > .config || ewarn "Can't copy /proc/config"
110 fi
111 fi
112}
113
114nogo_info() {
115 if use ${1}
116 then
117 einfo " + ${1} (${2})"
118 else
119 einfo " - ${1}"
120 fi
121}
122
123pkg_postinst() {
124 kernel-2_pkg_postinst
125 echo
126 ewarn "========"
127 ewarn "WARNING:"
128 ewarn "========"
129 ewarn
130 ewarn "This is an experimental kernel version."
131 echo
132 einfo "Features:"
133 echo
134 nogo_info atop "${ATOP_PATCH}"
135 nogo_info reiser4 "${REISER4_PATCH}"
136 nogo_info tuxonice "${TUXONICE_PATCH}"
137 nogo_info toshiba-acpi "local"
138 echo
139 ewarn "Do NOT ask for official gentoo support."
140 ewarn "I am BY NO MEANS responsible for breaking your system."
141 ewarn "ALWAYS keep a second stable and bootable kernel apart in your boot manager."
142}
143