1 |
commit: ad07bf36d1bd2721b63b52e120f6d361bb95ea50 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 1 20:23:16 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 1 22:00:33 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad07bf36 |
7 |
|
8 |
sys-kernel/vanilla-kernel-bin: Bump to 5.4.7 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-kernel/vanilla-kernel-bin/Manifest | 2 + |
13 |
.../vanilla-kernel-bin-5.4.7.ebuild | 174 +++++++++++++++++++++ |
14 |
2 files changed, 176 insertions(+) |
15 |
|
16 |
diff --git a/sys-kernel/vanilla-kernel-bin/Manifest b/sys-kernel/vanilla-kernel-bin/Manifest |
17 |
index f02625fd229..a5340a12b78 100644 |
18 |
--- a/sys-kernel/vanilla-kernel-bin/Manifest |
19 |
+++ b/sys-kernel/vanilla-kernel-bin/Manifest |
20 |
@@ -2,3 +2,5 @@ DIST tinycorelinux-10.1-amd64.qcow2 16842752 BLAKE2B e013e76503c335739a9623c0901 |
21 |
DIST tinycorelinux-10.1-x86.qcow2 14876672 BLAKE2B 3c760eb7438b13261e52ecfaa33a53649ced95f1ab40aae52134b8cdc31a16d7aa0d6a6dd716e268ed148e9d77a10b7c700b141b61d70c82d271ffe88e8e2a3c SHA512 9964538dc42f232a11949f74b61d46422ea5da3bdc253a217119bd0b8a750c40fd2da0b07157067be9ac0226472614f210a1248114df0d331df390979867a895 |
22 |
DIST vanilla-kernel-5.4.6-r1-1.amd64.xpak 89795144 BLAKE2B cca6e78f991cc79165a528d95fa1202b6f99dcf763f890609a0bf3e273cb81e786e39365a89e14282b75e259aa298b7349ee2868ef8437faae400475ad7e1c42 SHA512 de609b831db05c42350fe57e3248be3208c190ff99082088b5d2a1d69ec54734784f8143befbfd397deb9446228781ba25c1e50ecc020a651f6beda30be6ba97 |
23 |
DIST vanilla-kernel-5.4.6-r1-1.x86.xpak 81308308 BLAKE2B f499c5a8e65d3754fd0e1ba65a2dfa7eb4fa9b8cbdf5e5957186dc40b1c5572dd66433284529b0ca93b7a3073103243d5f45ad8749ca891b1f86d838cbf363be SHA512 f8334097566ce8b1852ec65a5205221a2bb5193fc638756e87f6da2199cde1d1e73f85f9dd60679fccd18be11055c37da873b92a0e209775e7a9926f6ae94134 |
24 |
+DIST vanilla-kernel-5.4.7-1.amd64.xpak 67980060 BLAKE2B 6bff3c16edc33dc65eedc55290d83cd26bf23bcf70addff39f43ba0d2fe9a678bc8bd2ba259802c95032132dce14e6866f15c30d66c4be23d82b88fa7e33d2f1 SHA512 edad0f70a46d2398702beeed442a84818d9d34cbd057372ad1175e7c2d944d59f6c5dbe2731658ed4c74eb66ffc3dd542b2589b1e776095c457b6347872d3dc4 |
25 |
+DIST vanilla-kernel-5.4.7-1.x86.xpak 59512079 BLAKE2B be8b611d164cb0e17fc9232eebdd642ea3e7926acf0c8628dde6bfe4de9d5600fca8f33aeba039bffce574926d7f1dff5bfa9910ed42553fa168e6104207fa13 SHA512 9d2a59824f7ce0cd01ea5aced3a95c4e2ac44ca4ad82cf5997987f9b0df730650cb8c8c5a83476084e427af345ad4d5515eb996dd2db5d5c7fa21c0eb1d8871e |
26 |
|
27 |
diff --git a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..c7f50b935aa |
30 |
--- /dev/null |
31 |
+++ b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild |
32 |
@@ -0,0 +1,174 @@ |
33 |
+# Copyright 2019-2020 Gentoo Authors |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI=7 |
37 |
+ |
38 |
+inherit mount-boot |
39 |
+ |
40 |
+MY_P=vanilla-kernel-${PV}-1 |
41 |
+TCL_VER=10.1 |
42 |
+DESCRIPTION="Pre-built vanilla Linux kernel" |
43 |
+HOMEPAGE="https://www.kernel.org/" |
44 |
+SRC_URI=" |
45 |
+ amd64? ( |
46 |
+ https://dev.gentoo.org/~mgorny/binpkg/amd64/kernel/sys-kernel/vanilla-kernel/${MY_P}.xpak |
47 |
+ -> ${MY_P}.amd64.xpak |
48 |
+ test? ( |
49 |
+ https://dev.gentoo.org/~mgorny/dist/tinycorelinux-${TCL_VER}-amd64.qcow2 |
50 |
+ ) |
51 |
+ ) |
52 |
+ x86? ( |
53 |
+ https://dev.gentoo.org/~mgorny/binpkg/x86/kernel/sys-kernel/vanilla-kernel/${MY_P}.xpak |
54 |
+ -> ${MY_P}.x86.xpak |
55 |
+ test? ( |
56 |
+ https://dev.gentoo.org/~mgorny/dist/tinycorelinux-${TCL_VER}-x86.qcow2 |
57 |
+ ) |
58 |
+ )" |
59 |
+S=${WORKDIR} |
60 |
+ |
61 |
+LICENSE="GPL-2" |
62 |
+SLOT="${PV}" |
63 |
+KEYWORDS="~amd64 ~x86" |
64 |
+IUSE="+initramfs test" |
65 |
+RESTRICT="!test? ( test ) test? ( userpriv )" |
66 |
+ |
67 |
+# install-DEPEND actually |
68 |
+# note: we need installkernel with initramfs support! |
69 |
+RDEPEND=" |
70 |
+ || ( |
71 |
+ sys-kernel/installkernel-gentoo |
72 |
+ sys-kernel/installkernel-systemd-boot |
73 |
+ ) |
74 |
+ initramfs? ( >=sys-kernel/dracut-049-r2 ) |
75 |
+ !sys-kernel/vanilla-kernel:${SLOT}" |
76 |
+BDEPEND=" |
77 |
+ test? ( |
78 |
+ dev-tcltk/expect |
79 |
+ sys-kernel/dracut |
80 |
+ amd64? ( app-emulation/qemu[qemu_softmmu_targets_x86_64] ) |
81 |
+ x86? ( app-emulation/qemu[qemu_softmmu_targets_i386] ) |
82 |
+ )" |
83 |
+ |
84 |
+QA_PREBUILT='*' |
85 |
+ |
86 |
+pkg_pretend() { |
87 |
+ mount-boot_pkg_pretend |
88 |
+ |
89 |
+ ewarn "This is an experimental package. The built kernel and/or initramfs" |
90 |
+ ewarn "may not work at all or fail with your bootloader configuration. Please" |
91 |
+ ewarn "make sure to keep a backup kernel available before testing it." |
92 |
+} |
93 |
+ |
94 |
+src_unpack() { |
95 |
+ ebegin "Unpacking ${MY_P}.${ARCH}.xpak" |
96 |
+ tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak") |
97 |
+ eend ${?} || die "Unpacking ${MY_P} failed" |
98 |
+} |
99 |
+ |
100 |
+src_test() { |
101 |
+ local image_arch=${ARCH} |
102 |
+ local qemu_arch=$(usex amd64 x86_64 i386) |
103 |
+ |
104 |
+ dracut \ |
105 |
+ --conf /dev/null \ |
106 |
+ --confdir /dev/null \ |
107 |
+ --no-hostonly \ |
108 |
+ --kmoddir "lib/modules/${PV}" \ |
109 |
+ "${T}/initrd" "${PV}" || die |
110 |
+ cp "${DISTDIR}/tinycorelinux-${TCL_VER}-${image_arch}.qcow2" \ |
111 |
+ "${T}/fs.qcow2" || die |
112 |
+ |
113 |
+ cd "${T}" || die |
114 |
+ cat > run.sh <<-EOF || die |
115 |
+ #!/bin/sh |
116 |
+ exec qemu-system-${qemu_arch} \ |
117 |
+ -m 256M \ |
118 |
+ -display none \ |
119 |
+ -no-reboot \ |
120 |
+ -kernel '${WORKDIR}/usr/src/linux-${PV}/bzImage' \ |
121 |
+ -initrd '${T}/initrd' \ |
122 |
+ -serial mon:stdio \ |
123 |
+ -hda '${T}/fs.qcow2' \ |
124 |
+ -append 'root=/dev/sda console=ttyS0,115200n8' |
125 |
+ EOF |
126 |
+ chmod +x run.sh || die |
127 |
+ # TODO: initramfs does not let core finish starting on some systems, |
128 |
+ # figure out how to make it better at that |
129 |
+ expect - <<-EOF || die "Booting kernel failed" |
130 |
+ set timeout 900 |
131 |
+ spawn ./run.sh |
132 |
+ expect { |
133 |
+ "Kernel panic" { |
134 |
+ send_error "\n* Kernel panic" |
135 |
+ exit 1 |
136 |
+ } |
137 |
+ "Entering emergency mode" { |
138 |
+ send_error "\n* Initramfs failed to start the system" |
139 |
+ exit 1 |
140 |
+ } |
141 |
+ "Core 10.1" { |
142 |
+ send_error "\n* Booted to login" |
143 |
+ exit 0 |
144 |
+ } |
145 |
+ timeout { |
146 |
+ send_error "\n* Kernel boot timed out" |
147 |
+ exit 2 |
148 |
+ } |
149 |
+ } |
150 |
+ EOF |
151 |
+} |
152 |
+ |
153 |
+src_install() { |
154 |
+ mv * "${ED}" || die |
155 |
+} |
156 |
+ |
157 |
+pkg_preinst() { |
158 |
+ : |
159 |
+} |
160 |
+ |
161 |
+pkg_postinst() { |
162 |
+ if [[ -z ${ROOT} ]]; then |
163 |
+ mount-boot_pkg_preinst |
164 |
+ |
165 |
+ if use initramfs; then |
166 |
+ ebegin "Building initramfs via dracut" |
167 |
+ # putting it alongside kernel image as 'initrd' makes |
168 |
+ # kernel-install happier |
169 |
+ dracut --force "${EROOT}/usr/src/linux-${PV}/initrd" "${PV}" |
170 |
+ eend ${?} || die "Building initramfs failed" |
171 |
+ fi |
172 |
+ |
173 |
+ ebegin "Installing the kernel via installkernel" |
174 |
+ # note: .config is taken relatively to System.map; |
175 |
+ # initrd relatively to bzImage |
176 |
+ installkernel "${PV}" \ |
177 |
+ "${EROOT}/usr/src/linux-${PV}/bzImage" \ |
178 |
+ "${EROOT}/usr/src/linux-${PV}/System.map" |
179 |
+ eend ${?} || die "Installing the kernel failed" |
180 |
+ fi |
181 |
+ |
182 |
+ local symlink_target=$(readlink "${EROOT}"/usr/src/linux) |
183 |
+ local symlink_ver=${symlink_target#linux-} |
184 |
+ if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]] |
185 |
+ then |
186 |
+ local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver} |
187 |
+ # if the current target is either being replaced, or still |
188 |
+ # installed (probably depclean candidate), update the symlink |
189 |
+ if has "${symlink_ver}" ${REPLACING_VERSIONS} || |
190 |
+ has_version -r "~${symlink_pkg}" |
191 |
+ then |
192 |
+ ebegin "Updating /usr/src/linux symlink" |
193 |
+ ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux |
194 |
+ eend ${?} |
195 |
+ fi |
196 |
+ fi |
197 |
+} |
198 |
+ |
199 |
+pkg_prerm() { |
200 |
+ : |
201 |
+} |
202 |
+ |
203 |
+pkg_postrm() { |
204 |
+ rm -f "${EROOT}/usr/src/linux-${PV}/initrd" && |
205 |
+ rmdir --ignore-fail-on-non-empty "${EROOT}/usr/src/linux-${PV}" |
206 |
+} |