[systemd-commits] 5 commits - .gitignore src/binfmt src/cryptsetup src/hostname src/journal src/linux src/locale src/readahead src/systemd src/timedate src/vconsole

Lennart Poettering lennart at kemper.freedesktop.org
Thu Jan 5 07:29:29 PST 2012


 .gitignore                |    2 +-
 src/binfmt/Makefile       |    1 +
 src/cryptsetup/Makefile   |    1 +
 src/hostname/Makefile     |    1 +
 src/journal/journalctl.c  |   45 +++++++++++++++++++++++++++++++++++++++++++--
 src/linux/Makefile        |    1 +
 src/locale/Makefile       |    1 +
 src/readahead/Makefile    |    1 +
 src/systemd/Makefile      |    1 +
 src/systemd/sd-journal.h  |    2 +-
 src/systemd/sd-messages.h |   31 +++++++++++++++++++++++++++++++
 src/timedate/Makefile     |    1 +
 src/vconsole/Makefile     |    1 +
 13 files changed, 85 insertions(+), 4 deletions(-)

New commits:
commit 2f9dec073b6557401804aae180eab744a8b1a3cc
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 5 16:29:21 2012 +0100

    build-sys: add stub makefiles to subdirs

diff --git a/src/binfmt/Makefile b/src/binfmt/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/binfmt/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/cryptsetup/Makefile b/src/cryptsetup/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/cryptsetup/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/hostname/Makefile b/src/hostname/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/hostname/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/linux/Makefile b/src/linux/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/linux/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/locale/Makefile b/src/locale/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/locale/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/readahead/Makefile b/src/readahead/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/readahead/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/systemd/Makefile b/src/systemd/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/systemd/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/timedate/Makefile b/src/timedate/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/timedate/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/vconsole/Makefile b/src/vconsole/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/vconsole/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file

commit 8665a387937ad667309077f4a1d211bf318d7f95
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 5 16:28:43 2012 +0100

    journal: fix include in sd-journal.h

diff --git a/src/systemd/sd-journal.h b/src/systemd/sd-journal.h
index 87da17d..d1fb149 100644
--- a/src/systemd/sd-journal.h
+++ b/src/systemd/sd-journal.h
@@ -27,7 +27,7 @@
 #include <stdarg.h>
 #include <sys/uio.h>
 
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
 
 /* TODO:
  *

commit dcd5f1020c36cddb9e250c01df057b9b5e5447b0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 5 16:28:33 2012 +0100

    git: only ignore toplevel systemd file

diff --git a/.gitignore b/.gitignore
index b0dacac..8daf8f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,7 +61,7 @@ test-ns
 test-loopback
 systemd-cgroups-agent
 systemd-initctl
-systemd
+/systemd
 test-engine
 test-job-type
 systemd-stdout-syslog-bridge

commit 55ee336cdcb57efe2ef9a4152f5b9e1063ec1a06
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 5 16:28:17 2012 +0100

    journalctl: add --new-id switch to generate a new 128Bit id

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 2e708e9..914dd8d 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -44,6 +44,7 @@ static bool arg_show_all = false;
 static bool arg_no_pager = false;
 static int arg_lines = -1;
 static bool arg_no_tail = false;
+static bool arg_new_id = false;
 
 static int help(void) {
 
@@ -56,7 +57,8 @@ static int help(void) {
                "  -f --follow         Follow journal\n"
                "  -n --lines=INTEGER  Journal entries to show\n"
                "     --no-tail        Show all lines, even in follow mode\n"
-               "  -o --output=STRING  Change journal output mode (short, verbose, export, json)\n",
+               "  -o --output=STRING  Change journal output mode (short, verbose, export, json)\n"
+               "     --new-id         Generate a new 128 Bit id\n",
                program_invocation_short_name);
 
         return 0;
@@ -67,7 +69,8 @@ static int parse_argv(int argc, char *argv[]) {
         enum {
                 ARG_VERSION = 0x100,
                 ARG_NO_PAGER,
-                ARG_NO_TAIL
+                ARG_NO_TAIL,
+                ARG_NEW_ID
         };
 
         static const struct option options[] = {
@@ -79,6 +82,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "all",       no_argument,       NULL, 'a'           },
                 { "lines",     required_argument, NULL, 'n'           },
                 { "no-tail",   no_argument,       NULL, ARG_NO_TAIL   },
+                { "new-id",    no_argument,       NULL, ARG_NEW_ID    },
                 { NULL,        0,                 NULL, 0             }
         };
 
@@ -134,6 +138,10 @@ static int parse_argv(int argc, char *argv[]) {
                         arg_no_tail = true;
                         break;
 
+                case ARG_NEW_ID:
+                        arg_new_id = true;
+                        break;
+
                 case '?':
                         return -EINVAL;
 
@@ -149,6 +157,34 @@ static int parse_argv(int argc, char *argv[]) {
         return 1;
 }
 
+static int generate_new_id(void) {
+        sd_id128_t id;
+        int r;
+        unsigned i;
+
+        r = sd_id128_randomize(&id);
+        if (r < 0) {
+                log_error("Failed to generate ID: %s", strerror(-r));
+                return r;
+        }
+
+        printf("As string:\n"
+               SD_ID128_FORMAT_STR "\n\n"
+               "As UUID:\n"
+               "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n\n"
+               "As macro:\n"
+              "#define MESSAGE_XYZ SD_ID128_MAKE(",
+               SD_ID128_FORMAT_VAL(id),
+               SD_ID128_FORMAT_VAL(id));
+
+        for (i = 0; i < 16; i++)
+                printf("%02x%s", id.bytes[i], i != 15 ? "," : "");
+
+        fputs(")\n", stdout);
+
+        return 0;
+}
+
 int main(int argc, char *argv[]) {
         int r, i, fd;
         sd_journal *j = NULL;
@@ -162,6 +198,11 @@ int main(int argc, char *argv[]) {
         if (r <= 0)
                 goto finish;
 
+        if (arg_new_id) {
+                r = generate_new_id();
+                goto finish;
+        }
+
         r = sd_journal_open(&j, 0);
         if (r < 0) {
                 log_error("Failed to open journal: %s", strerror(-r));

commit ea41a8a973a7b9f628d93fa501131dfc2f6cc024
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 5 16:27:38 2012 +0100

    journal: add missing sd-messages.h

diff --git a/src/systemd/sd-messages.h b/src/systemd/sd-messages.h
new file mode 100644
index 0000000..8e52d95
--- /dev/null
+++ b/src/systemd/sd-messages.h
@@ -0,0 +1,31 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#ifndef foosdmessageshfoo
+#define foosdmessageshfoo
+
+/***
+  This file is part of systemd.
+
+  Copyright 2012 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <systemd/sd-id128.h>
+
+#define SD_MESSAGE_JOURNAL_START   SD_ID128_MAKE(f7,73,79,a8,49,0b,40,8b,be,5f,69,40,50,5a,77,7b)
+#define SD_MESSAGE_JOURNAL_STOP    SD_ID128_MAKE(d9,3f,b3,c9,c2,4d,45,1a,97,ce,a6,15,ce,59,c0,0b)
+#define SD_MESSAGE_JOURNAL_DROPPED SD_ID128_MAKE(a5,96,d6,fe,7b,fa,49,94,82,8e,72,30,9e,95,d6,1e)
+
+#endif



More information about the systemd-commits mailing list