Gentoo Archives: gentoo-commits

From: "Jorge Manuel B. S. Vicetto" <jmbsvicetto@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/jmbsvicetto:master commit in: sys-kernel/infra-kernel-sources/, sys-kernel/infra-kernel/
Date: Sun, 29 Jun 2014 14:42:24
Message-Id: 1404052721.1c8b4d6d89a5bb9a94568f37293a2db594a5824f.jmbsvicetto@gentoo
1 commit: 1c8b4d6d89a5bb9a94568f37293a2db594a5824f
2 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 29 14:38:41 2014 +0000
4 Commit: Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 29 14:38:41 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/jmbsvicetto.git;a=commit;h=1c8b4d6d
7
8 Bump kernel version and update SRC_URI.
9
10 Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>
11
12 ---
13 .../infra-kernel-sources-3.15.2.ebuild | 164 +++++++++++++++++++++
14 .../infra-kernel/infra-kernel-3.13.6-r3.ebuild | 5 +-
15 ...3.13.6-r3.ebuild => infra-kernel-3.15.2.ebuild} | 5 +-
16 3 files changed, 172 insertions(+), 2 deletions(-)
17
18 diff --git a/sys-kernel/infra-kernel-sources/infra-kernel-sources-3.15.2.ebuild b/sys-kernel/infra-kernel-sources/infra-kernel-sources-3.15.2.ebuild
19 new file mode 100644
20 index 0000000..623b2f9
21 --- /dev/null
22 +++ b/sys-kernel/infra-kernel-sources/infra-kernel-sources-3.15.2.ebuild
23 @@ -0,0 +1,164 @@
24 +# Copyright 1999-2014 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +# $Header: $
27 +
28 +EAPI=5
29 +inherit flag-o-matic
30 +
31 +KERNEL_SOURCES="hardened-sources"
32 +KERNEL_NAME="hardened"
33 +KERNEL_PV="$PV"
34 +KERNEL_REVISION="$PR"
35 +INFRA_SUFFIX="infra27"
36 +use amd64 && KARCH="x86_64"
37 +use x86 && KARCH="x86"
38 +
39 +KERNEL_PVR="${KERNEL_PV}-${KERNEL_REVISION}"
40 +KERNEL_PF="${KERNEL_SOURCES}-${KERNEL_PVR}"
41 +
42 +KERNEL_DIR="linux-${KERNEL_PV}-${KERNEL_NAME}-${KERNEL_REVISION}"
43 +BINPKG_PVR="${PVR}-${INFRA_SUFFIX}"
44 +BINPKG_KERNEL="${PN/-sources/}-kernel-${KARCH}-${BINPKG_PVR}.tbz2"
45 +BINPKG_MODULES="${PN/-sources/}-modules-${KARCH}-${BINPKG_PVR}.tbz2"
46 +KERNEL_CONFIG="${FILESDIR}"/${KERNEL_PF}-${KARCH}-${INFRA_SUFFIX}.config
47 +
48 +BUILD_DIR="/home/upload-kernel/"
49 +
50 +DESCRIPTION="Package to build kernel + initramfs for Gentoo infra boxes"
51 +HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Infrastructure"
52 +IUSE=""
53 +
54 +LICENSE="GPL-2"
55 +SLOT="0"
56 +KEYWORDS="~amd64 ~x86"
57 +
58 +DEPEND="
59 + sys-apps/fakeroot
60 + sys-fs/lvm2
61 + >=sys-kernel/genkernel-3.4.49.1
62 + =sys-kernel/${KERNEL_PF}"
63 +RDEPEND=""
64 +
65 +S="${WORKDIR}"
66 +
67 +pkg_setup() {
68 + [ -d /usr/src/${KERNEL_DIR} ] || die "kernel dir /usr/src/${KERNEL_DIR} missing"
69 + [ -f ${KERNEL_CONFIG} ] || die "${KERNEL_CONFIG} missing"
70 + # we need to be using flags that will result in binaries working on all infra systems
71 + strip-flags
72 + filter-flags -march=* -mtune=* -mcpu=* -frecord-gcc-switches
73 + use amd64 && append-flags -march=x86-64 -mtune=generic
74 + use x86 && append-flags -march=pentium3 -mtune=generic
75 +}
76 +
77 +src_unpack() {
78 + mkdir -p "${T}"/{cache,tmp,kernel-output}
79 +}
80 +
81 +src_prepare() {
82 + # copy the kernel sources, this is potentially large, but nothing we can do.
83 + # if it's dirty, the build will fail
84 + # symlinks do not work either
85 + mkdir -p "${S}"/usr/src
86 + cp -a "/usr/src/${KERNEL_DIR}" "${S}"/usr/src || die
87 + cd "${S}"/usr/src/${KERNEL_DIR}
88 + _ARCH="$ARCH"
89 + unset ARCH
90 + emake mrproper || die "Failed to cleanup"
91 + export ARCH=$_ARCH
92 +}
93 +
94 +# This deliberately runs a very sterile genkernel
95 +# that IGNORES the system /etc/genkernel.conf
96 +# so that we get more reproducable builds
97 +# almost all the options are easy with this except GK_SHARE
98 +# fakeroot is here because genkernel uses mknod still
99 +# which fails as non-root
100 +genkernel_sterile() {
101 + _DISTDIR="${DISTDIR}"
102 + # the parsing of --config seems to be broken in v3.4.44.2
103 + #--config="${emptyconfig}" \
104 + emptyconfig="${T}"/empty
105 + touch "${emptyconfig}"
106 + CMD_GK_CONFIG="${emptyconfig}" \
107 + GK_SHARE="${ROOT}"/usr/share/genkernel \
108 + DISTDIR="${ROOT}"//usr/share/genkernel/distfiles \
109 + CFLAGS="${CFLAGS}" \
110 + CXXFLAGS="${CXXFLAGS}" \
111 + fakeroot genkernel \
112 + --loglevel=1 \
113 + --no-menuconfig \
114 + --no-gconfig \
115 + --no-xconfig \
116 + --no-save-config \
117 + --oldconfig \
118 + --no-clean \
119 + --no-mrproper \
120 + --no-symlink \
121 + --no-mountboot \
122 + --no-lvm \
123 + --no-mdadm \
124 + --no-dmraid \
125 + --no-multipath \
126 + --no-iscsi \
127 + --no-disklabel \
128 + --no-luks \
129 + --no-gpg \
130 + --no-busybox \
131 + --no-postclear \
132 + --no-install \
133 + --no-zfs \
134 + --no-keymap \
135 + --no-e2fsprogs \
136 + --no-unionfs \
137 + --no-netboot \
138 + --compress-initramfs \
139 + --ramdisk-modules \
140 + --no-debug-cleanup \
141 + "$@"
142 +}
143 +
144 +src_compile() {
145 +
146 + addpredict "/etc/kernels"
147 + addpredict "/dev"
148 +
149 + # call genkernel to build the kernel + initramfs
150 + genkernel_sterile \
151 + --loglevel=5 \
152 + --logfile="${T}"/genkernel.log \
153 + --cachedir="${T}"/cache \
154 + --tempdir="${T}"/tmp \
155 + \
156 + --makeopts="${MAKEOPTS}" \
157 + --kerneldir="/usr/src/${KERNEL_DIR}" \
158 + --kernel-outputdir="${T}/kernel-output" \
159 + --kernel-config="${KERNEL_CONFIG}" \
160 + --module-prefix="${T}" \
161 + \
162 + --lvm \
163 + --disklabel \
164 + --busybox \
165 + --e2fsprogs \
166 + --mdadm --mdadm-config="${FILESDIR}/mdadm.conf-1.0" \
167 + \
168 + --minkernpackage="${T}"/${BINPKG_KERNEL} \
169 + --modulespackage="${T}"/${BINPKG_MODULES} \
170 + \
171 + all \
172 + || die "genkernel failed"
173 +}
174 +
175 +src_install() {
176 + return 0
177 +}
178 +
179 +pkg_preinst() {
180 + # copy the built kernel + initramfs
181 + mkdir -p "${BUILD_DIR}"
182 + cp -f "${T}"/${BINPKG_KERNEL} "${BUILD_DIR}" || die "Failed to copy kernel package"
183 + cp -f "${T}"/${BINPKG_MODULES} "${BUILD_DIR}" || die "Failed to copy module package"
184 + einfo "${BINPKG_KERNEL} and ${BINPKG_MODULES} are in ${BUILD_DIR}"
185 + # mirror the packages
186 + # scp ...
187 +}
188
189 diff --git a/sys-kernel/infra-kernel/infra-kernel-3.13.6-r3.ebuild b/sys-kernel/infra-kernel/infra-kernel-3.13.6-r3.ebuild
190 index 1fabd15..f0e2f2d 100644
191 --- a/sys-kernel/infra-kernel/infra-kernel-3.13.6-r3.ebuild
192 +++ b/sys-kernel/infra-kernel/infra-kernel-3.13.6-r3.ebuild
193 @@ -27,7 +27,10 @@ KERNEL_BIN="kernel-${KARCH}-${CUSTOM_VERSION}"
194 INITRAMFS_BIN="initramfs-${KARCH}-${CUSTOM_VERSION}"
195 SYSTEMMAP_BIN="System.map-${KARCH}-${CUSTOM_VERSION}"
196
197 -SRC_URI="${KERNEL_URI} ${MODULES_URI}"
198 +SRC_URI="
199 + amd64? ( ${KERNEL_URI//--/-x86_64-} ${MODULES_URI//--/-x86_64-} )
200 + x86? ( ${KERNEL_URI//--/-x86-} ${MODULES_URI//--/-x86-} )
201 +"
202 DESCRIPTION="Package to install kernel + initramfs for Gentoo infra boxes"
203 HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Infrastructure"
204 IUSE=""
205
206 diff --git a/sys-kernel/infra-kernel/infra-kernel-3.13.6-r3.ebuild b/sys-kernel/infra-kernel/infra-kernel-3.15.2.ebuild
207 similarity index 91%
208 copy from sys-kernel/infra-kernel/infra-kernel-3.13.6-r3.ebuild
209 copy to sys-kernel/infra-kernel/infra-kernel-3.15.2.ebuild
210 index 1fabd15..f0e2f2d 100644
211 --- a/sys-kernel/infra-kernel/infra-kernel-3.13.6-r3.ebuild
212 +++ b/sys-kernel/infra-kernel/infra-kernel-3.15.2.ebuild
213 @@ -27,7 +27,10 @@ KERNEL_BIN="kernel-${KARCH}-${CUSTOM_VERSION}"
214 INITRAMFS_BIN="initramfs-${KARCH}-${CUSTOM_VERSION}"
215 SYSTEMMAP_BIN="System.map-${KARCH}-${CUSTOM_VERSION}"
216
217 -SRC_URI="${KERNEL_URI} ${MODULES_URI}"
218 +SRC_URI="
219 + amd64? ( ${KERNEL_URI//--/-x86_64-} ${MODULES_URI//--/-x86_64-} )
220 + x86? ( ${KERNEL_URI//--/-x86-} ${MODULES_URI//--/-x86-} )
221 +"
222 DESCRIPTION="Package to install kernel + initramfs for Gentoo infra boxes"
223 HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Infrastructure"
224 IUSE=""