Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 08 Jul 2021 00:09:05
Message-Id: 1625702898.9f21085d6393371fd90f3f0debb87fdd5df8c5ef.gyakovlev@gentoo
1 commit: 9f21085d6393371fd90f3f0debb87fdd5df8c5ef
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 7 09:45:45 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 8 00:08:18 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f21085d
7
8 kernel-install.eclass: print uname() info after test
9
10 Closes: https://github.com/gentoo/gentoo/pull/21549
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 eclass/kernel-install.eclass | 15 ++++++++++++++-
14 1 file changed, 14 insertions(+), 1 deletion(-)
15
16 diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
17 index 4914a756281..e6b9cbe45c0 100644
18 --- a/eclass/kernel-install.eclass
19 +++ b/eclass/kernel-install.eclass
20 @@ -184,13 +184,26 @@ kernel-install_create_init() {
21
22 cat <<-_EOF_ >"${T}/init.c" || die
23 #include <stdio.h>
24 + #include <sys/utsname.h>
25 +
26 int main() {
27 + struct utsname u;
28 + int ret = uname(&u);
29 + if (ret != 0) {
30 + printf("uname() failed, but that's fine\n");
31 + }
32 + else {
33 + // Booted: Linux 5.10.47 ppc64le #1 SMP Fri Jul 2 12:55:24 PDT 2021
34 + printf("Booted: %s %s %s %s\n", u.sysname, u.release,
35 + u.machine, u.version);
36 + }
37 +
38 printf("Hello, World!\n");
39 return 0;
40 }
41 _EOF_
42
43 - $(tc-getBUILD_CC) -Os -static "${T}/init.c" -o "${output}" || die
44 + $(tc-getBUILD_CC) -Os -static "${T}/init.c" -o "${output}" || die
45 $(tc-getBUILD_STRIP) "${output}" || die
46 }