summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2021-07-07 02:45:45 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-07-07 17:08:18 -0700
commit9f21085d6393371fd90f3f0debb87fdd5df8c5ef (patch)
treeed771004a25a2dd0a24d2a85d55c341f589cc638 /eclass/kernel-install.eclass
parentmedia-plugins/kodi-inputstream-ffmpegdirect: 1.21.6 version bump (diff)
downloadgentoo-9f21085d6393371fd90f3f0debb87fdd5df8c5ef.tar.gz
gentoo-9f21085d6393371fd90f3f0debb87fdd5df8c5ef.tar.bz2
gentoo-9f21085d6393371fd90f3f0debb87fdd5df8c5ef.zip
kernel-install.eclass: print uname() info after test
Closes: https://github.com/gentoo/gentoo/pull/21549 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r--eclass/kernel-install.eclass15
1 files changed, 14 insertions, 1 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 4914a7562813..e6b9cbe45c0e 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -184,13 +184,26 @@ kernel-install_create_init() {
cat <<-_EOF_ >"${T}/init.c" || die
#include <stdio.h>
+ #include <sys/utsname.h>
+
int main() {
+ struct utsname u;
+ int ret = uname(&u);
+ if (ret != 0) {
+ printf("uname() failed, but that's fine\n");
+ }
+ else {
+ // Booted: Linux 5.10.47 ppc64le #1 SMP Fri Jul 2 12:55:24 PDT 2021
+ printf("Booted: %s %s %s %s\n", u.sysname, u.release,
+ u.machine, u.version);
+ }
+
printf("Hello, World!\n");
return 0;
}
_EOF_
- $(tc-getBUILD_CC) -Os -static "${T}/init.c" -o "${output}" || die
+ $(tc-getBUILD_CC) -Os -static "${T}/init.c" -o "${output}" || die
$(tc-getBUILD_STRIP) "${output}" || die
}