summaryrefslogtreecommitdiff
path: root/eclass/kernel-install.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-07-08 15:03:58 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-07-08 15:03:58 +0100
commit814f4cf860e299a046b649eaee5463427984c09c (patch)
tree74c45f097899310e599dad6b8df5b63e0f085bc0 /eclass/kernel-install.eclass
parent7f0ccc917c7abe6223784c703d86cd14755691fb (diff)
gentoo resync : 08.07.2021
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
}