Display version on start and allow --version to work
This commit is contained in:
parent
eb20d7d786
commit
81715c3159
@ -30,6 +30,9 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const char copyright[] = "Copyright (c) 2007 Gentoo Foundation\n"
|
||||||
|
"Copyright (c) 2007 Roy Marples";
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -30,6 +30,9 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const char copyright[] = "Copyright (c) 2007 Gentoo Foundation\n"
|
||||||
|
"Copyright (c) 2007 Roy Marples";
|
||||||
|
|
||||||
#include "librc.h"
|
#include "librc.h"
|
||||||
|
|
||||||
/* usecs to wait while we poll the fifo */
|
/* usecs to wait while we poll the fifo */
|
||||||
|
15
src/rc.c
15
src/rc.c
@ -35,6 +35,9 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const char copyright[] = "Copyright (c) 2007 Gentoo Foundation\n"
|
||||||
|
"Copyright (c) 2007 Roy Marples";
|
||||||
|
|
||||||
#define APPLET "rc"
|
#define APPLET "rc"
|
||||||
|
|
||||||
#define SYSLOG_NAMES
|
#define SYSLOG_NAMES
|
||||||
@ -68,6 +71,8 @@
|
|||||||
#include "rc-plugin.h"
|
#include "rc-plugin.h"
|
||||||
#include "strlist.h"
|
#include "strlist.h"
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
#define INITSH RC_LIBDIR "/sh/init.sh"
|
#define INITSH RC_LIBDIR "/sh/init.sh"
|
||||||
#define INITEARLYSH RC_LIBDIR "/sh/init-early.sh"
|
#define INITEARLYSH RC_LIBDIR "/sh/init-early.sh"
|
||||||
#define HALTSH RC_INITDIR "/halt.sh"
|
#define HALTSH RC_INITDIR "/halt.sh"
|
||||||
@ -796,6 +801,11 @@ int main (int argc, char **argv)
|
|||||||
if (! applet)
|
if (! applet)
|
||||||
eerrorx ("arguments required");
|
eerrorx ("arguments required");
|
||||||
|
|
||||||
|
if (argc > 1 && (strcmp (argv[1], "--version") == 0)) {
|
||||||
|
printf ("%s (Open RC) version " VERSION "\n", applet);
|
||||||
|
exit (EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
/* These used to be programs in their own right, so we shouldn't
|
/* These used to be programs in their own right, so we shouldn't
|
||||||
* touch argc or argv for them */
|
* touch argc or argv for them */
|
||||||
if (strcmp (applet, "fstabinfo") == 0)
|
if (strcmp (applet, "fstabinfo") == 0)
|
||||||
@ -968,8 +978,9 @@ int main (int argc, char **argv)
|
|||||||
run_script (INITEARLYSH);
|
run_script (INITEARLYSH);
|
||||||
|
|
||||||
uname (&uts);
|
uname (&uts);
|
||||||
printf (" %sOpenRC%s is starting up\n",
|
printf (" %sOpenRC %s" VERSION "%s is starting up\n",
|
||||||
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_NORMAL));
|
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_BRACKET),
|
||||||
|
ecolor (ECOLOR_NORMAL));
|
||||||
|
|
||||||
if (rc_env_bool ("RC_INTERACTIVE"))
|
if (rc_env_bool ("RC_INTERACTIVE"))
|
||||||
printf ("Press %sI%s to enter interactive boot mode\n\n",
|
printf ("Press %sI%s to enter interactive boot mode\n\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user