diff --git a/kernel/kernelinfo.cpp b/kernel/kernelinfo.cpp index be43a415..545da963 100644 --- a/kernel/kernelinfo.cpp +++ b/kernel/kernelinfo.cpp @@ -34,6 +34,7 @@ static const char* KernelInfo(const char* req) { if ( strcmp(req, "name") == 0 ) { return BRAND_KERNEL_NAME; } if ( strcmp(req, "version") == 0 ) { return VERSIONSTR; } + if ( strcmp(req, "tagline") == 0 ) { return BRAND_RELEASE_TAGLINE; } if ( strcmp(req, "builddate") == 0 ) { return __DATE__; } if ( strcmp(req, "buildtime") == 0 ) { return __TIME__; } #if defined(__i386__) || defined(__x86_64__) diff --git a/libc/include/brand.h b/libc/include/brand.h index 21983a85..960c98d9 100644 --- a/libc/include/brand.h +++ b/libc/include/brand.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014 Jonas 'Sortie' Termansen. + * Copyright (c) 2013, 2014, 2015 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -32,6 +32,9 @@ /* The name of the kernel. */ #define BRAND_KERNEL_NAME "Sortix" +/* The tagline of this release. */ +#define BRAND_RELEASE_TAGLINE "\"Self-Hosting & Installable\"" + /* Ascii version of the maxsi logo. */ #define BRAND_MAXSI \ " _ \n" \ diff --git a/libc/include/sys/utsname.h b/libc/include/sys/utsname.h index 22d824cc..50c8c79d 100644 --- a/libc/include/sys/utsname.h +++ b/libc/include/sys/utsname.h @@ -34,6 +34,7 @@ struct utsname char nodename[_UTSNAME_LENGTH]; char release[_UTSNAME_LENGTH]; char version[_UTSNAME_LENGTH]; + char tagline[_UTSNAME_LENGTH]; char machine[_UTSNAME_LENGTH]; char processor[_UTSNAME_LENGTH]; char hwplatform[_UTSNAME_LENGTH]; diff --git a/libc/sys/utsname/uname.c b/libc/sys/utsname/uname.c index 30fe8ce1..2c62d596 100644 --- a/libc/sys/utsname/uname.c +++ b/libc/sys/utsname/uname.c @@ -55,6 +55,8 @@ int uname(struct utsname* name) strlcpy(name->nodename, "unknown", sizeof(name->nodename)); if ( kernelinfo("version", name->release, sizeof(name->release)) != 0 ) strlcpy(name->release, "unknown", sizeof(name->release)); + if ( kernelinfo("tagline", name->tagline, sizeof(name->tagline)) != 0 ) + strlcpy(name->tagline, "unknown", sizeof(name->tagline)); if ( kernelinfo("builddate", name->version, sizeof(name->version)) != 0 ) strlcpy(name->version, "unknown", sizeof(name->version)); strlcpy(name->machine, machine, sizeof(name->machine)); diff --git a/utils/uname.c b/utils/uname.c index 86252295..64813ad9 100644 --- a/utils/uname.c +++ b/utils/uname.c @@ -32,6 +32,7 @@ static const int PRINT_KERNELNAME = 1 << 0; static const int PRINT_NODENAME = 1 << 1; static const int PRINT_KERNELREL = 1 << 2; static const int PRINT_KERNELVER = 1 << 3; +static const int PRINT_TAGLINE = 1 << 4; static const int PRINT_MACHINE = 1 << 5; static const int PRINT_PROCESSOR = 1 << 6; static const int PRINT_HWPLATFORM = 1 << 7; @@ -92,6 +93,7 @@ int main(int argc, char* argv[]) case 's': flags |= PRINT_KERNELNAME; break; case 'n': flags |= PRINT_NODENAME; break; case 'r': flags |= PRINT_KERNELREL; break; + case 't': flags |= PRINT_TAGLINE; break; case 'v': flags |= PRINT_KERNELVER; break; case 'm': flags |= PRINT_MACHINE; break; case 'p': flags |= PRINT_PROCESSOR; break; @@ -111,6 +113,8 @@ int main(int argc, char* argv[]) flags |= PRINT_KERNELREL; else if ( !strcmp(arg, "--kernel-version") ) flags |= PRINT_KERNELVER; + else if ( !strcmp(arg, "--tagline") ) + flags |= PRINT_TAGLINE; else if ( !strcmp(arg, "--machine") ) flags |= PRINT_MACHINE; else if ( !strcmp(arg, "--processor") ) @@ -148,6 +152,8 @@ int main(int argc, char* argv[]) DoPrint(utsname.nodename); if ( flags & PRINT_KERNELREL ) DoPrint(utsname.release); + if ( flags & PRINT_TAGLINE ) + DoPrint(utsname.tagline); if ( flags & PRINT_KERNELVER ) DoPrint(utsname.version); if ( flags & PRINT_MACHINE )