Add tagline.
This commit is contained in:
parent
d166e58dc8
commit
fe87b61a33
|
@ -34,6 +34,7 @@ static const char* KernelInfo(const char* req)
|
||||||
{
|
{
|
||||||
if ( strcmp(req, "name") == 0 ) { return BRAND_KERNEL_NAME; }
|
if ( strcmp(req, "name") == 0 ) { return BRAND_KERNEL_NAME; }
|
||||||
if ( strcmp(req, "version") == 0 ) { return VERSIONSTR; }
|
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, "builddate") == 0 ) { return __DATE__; }
|
||||||
if ( strcmp(req, "buildtime") == 0 ) { return __TIME__; }
|
if ( strcmp(req, "buildtime") == 0 ) { return __TIME__; }
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
|
|
|
@ -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
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -32,6 +32,9 @@
|
||||||
/* The name of the kernel. */
|
/* The name of the kernel. */
|
||||||
#define BRAND_KERNEL_NAME "Sortix"
|
#define BRAND_KERNEL_NAME "Sortix"
|
||||||
|
|
||||||
|
/* The tagline of this release. */
|
||||||
|
#define BRAND_RELEASE_TAGLINE "\"Self-Hosting & Installable\""
|
||||||
|
|
||||||
/* Ascii version of the maxsi logo. */
|
/* Ascii version of the maxsi logo. */
|
||||||
#define BRAND_MAXSI \
|
#define BRAND_MAXSI \
|
||||||
" _ \n" \
|
" _ \n" \
|
||||||
|
|
|
@ -34,6 +34,7 @@ struct utsname
|
||||||
char nodename[_UTSNAME_LENGTH];
|
char nodename[_UTSNAME_LENGTH];
|
||||||
char release[_UTSNAME_LENGTH];
|
char release[_UTSNAME_LENGTH];
|
||||||
char version[_UTSNAME_LENGTH];
|
char version[_UTSNAME_LENGTH];
|
||||||
|
char tagline[_UTSNAME_LENGTH];
|
||||||
char machine[_UTSNAME_LENGTH];
|
char machine[_UTSNAME_LENGTH];
|
||||||
char processor[_UTSNAME_LENGTH];
|
char processor[_UTSNAME_LENGTH];
|
||||||
char hwplatform[_UTSNAME_LENGTH];
|
char hwplatform[_UTSNAME_LENGTH];
|
||||||
|
|
|
@ -55,6 +55,8 @@ int uname(struct utsname* name)
|
||||||
strlcpy(name->nodename, "unknown", sizeof(name->nodename));
|
strlcpy(name->nodename, "unknown", sizeof(name->nodename));
|
||||||
if ( kernelinfo("version", name->release, sizeof(name->release)) != 0 )
|
if ( kernelinfo("version", name->release, sizeof(name->release)) != 0 )
|
||||||
strlcpy(name->release, "unknown", sizeof(name->release));
|
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 )
|
if ( kernelinfo("builddate", name->version, sizeof(name->version)) != 0 )
|
||||||
strlcpy(name->version, "unknown", sizeof(name->version));
|
strlcpy(name->version, "unknown", sizeof(name->version));
|
||||||
strlcpy(name->machine, machine, sizeof(name->machine));
|
strlcpy(name->machine, machine, sizeof(name->machine));
|
||||||
|
|
|
@ -32,6 +32,7 @@ static const int PRINT_KERNELNAME = 1 << 0;
|
||||||
static const int PRINT_NODENAME = 1 << 1;
|
static const int PRINT_NODENAME = 1 << 1;
|
||||||
static const int PRINT_KERNELREL = 1 << 2;
|
static const int PRINT_KERNELREL = 1 << 2;
|
||||||
static const int PRINT_KERNELVER = 1 << 3;
|
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_MACHINE = 1 << 5;
|
||||||
static const int PRINT_PROCESSOR = 1 << 6;
|
static const int PRINT_PROCESSOR = 1 << 6;
|
||||||
static const int PRINT_HWPLATFORM = 1 << 7;
|
static const int PRINT_HWPLATFORM = 1 << 7;
|
||||||
|
@ -92,6 +93,7 @@ int main(int argc, char* argv[])
|
||||||
case 's': flags |= PRINT_KERNELNAME; break;
|
case 's': flags |= PRINT_KERNELNAME; break;
|
||||||
case 'n': flags |= PRINT_NODENAME; break;
|
case 'n': flags |= PRINT_NODENAME; break;
|
||||||
case 'r': flags |= PRINT_KERNELREL; break;
|
case 'r': flags |= PRINT_KERNELREL; break;
|
||||||
|
case 't': flags |= PRINT_TAGLINE; break;
|
||||||
case 'v': flags |= PRINT_KERNELVER; break;
|
case 'v': flags |= PRINT_KERNELVER; break;
|
||||||
case 'm': flags |= PRINT_MACHINE; break;
|
case 'm': flags |= PRINT_MACHINE; break;
|
||||||
case 'p': flags |= PRINT_PROCESSOR; break;
|
case 'p': flags |= PRINT_PROCESSOR; break;
|
||||||
|
@ -111,6 +113,8 @@ int main(int argc, char* argv[])
|
||||||
flags |= PRINT_KERNELREL;
|
flags |= PRINT_KERNELREL;
|
||||||
else if ( !strcmp(arg, "--kernel-version") )
|
else if ( !strcmp(arg, "--kernel-version") )
|
||||||
flags |= PRINT_KERNELVER;
|
flags |= PRINT_KERNELVER;
|
||||||
|
else if ( !strcmp(arg, "--tagline") )
|
||||||
|
flags |= PRINT_TAGLINE;
|
||||||
else if ( !strcmp(arg, "--machine") )
|
else if ( !strcmp(arg, "--machine") )
|
||||||
flags |= PRINT_MACHINE;
|
flags |= PRINT_MACHINE;
|
||||||
else if ( !strcmp(arg, "--processor") )
|
else if ( !strcmp(arg, "--processor") )
|
||||||
|
@ -148,6 +152,8 @@ int main(int argc, char* argv[])
|
||||||
DoPrint(utsname.nodename);
|
DoPrint(utsname.nodename);
|
||||||
if ( flags & PRINT_KERNELREL )
|
if ( flags & PRINT_KERNELREL )
|
||||||
DoPrint(utsname.release);
|
DoPrint(utsname.release);
|
||||||
|
if ( flags & PRINT_TAGLINE )
|
||||||
|
DoPrint(utsname.tagline);
|
||||||
if ( flags & PRINT_KERNELVER )
|
if ( flags & PRINT_KERNELVER )
|
||||||
DoPrint(utsname.version);
|
DoPrint(utsname.version);
|
||||||
if ( flags & PRINT_MACHINE )
|
if ( flags & PRINT_MACHINE )
|
||||||
|
|
Loading…
Reference in New Issue