container-guest-tools: Create /var/log/journal
journald will automatically log to this folder if it exists. Create it
so journald logs to disk instead of in-memory only.
BUG=chromium:1105367
TEST=Build, copy deb into Crostini, run it, check folder is created
Change-Id: I1f2114a52ca28afc436e1a0ce005f16182feeede
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/containers/cros-container-guest-tools/+/2303130
Reviewed-by: Fergus Dall <sidereal@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Munro <davidmunro@google.com>
Auto-Submit: David Munro <davidmunro@google.com>
diff --git a/cros-debs/BUILD b/cros-debs/BUILD
index 0eb7dfb..8ad8ab0 100644
--- a/cros-debs/BUILD
+++ b/cros-debs/BUILD
@@ -4,6 +4,7 @@
load(":copy_debs.bzl", "copy_debs_to_folder")
+# Packages which are the same across different Debian versions.
filegroup(
name = "cros-debs-common",
srcs = [
@@ -12,6 +13,7 @@
"//cros-garcon:deb",
"//cros-guest-tools:deb",
"//cros-host-fonts:deb",
+ "//cros-logging:deb",
"//cros-notificationd:deb",
"//cros-pulse-config:deb",
"//cros-sftp:deb",
diff --git a/cros-guest-tools/BUILD b/cros-guest-tools/BUILD
index 76e0039..8de93d7 100644
--- a/cros-guest-tools/BUILD
+++ b/cros-guest-tools/BUILD
@@ -29,6 +29,7 @@
"bzip2",
"cros-apt-config",
"cros-gpu",
+ "cros-logging",
"cros-pulse-config",
"cros-sommelier-config",
"cros-sudo-config",
@@ -55,6 +56,6 @@
"xz-utils",
],
section = "misc",
- version = "0.28",
+ version = "0.29",
visibility = ["//cros-debs:__pkg__"],
)
diff --git a/cros-logging/00-create-logs-dir.conf b/cros-logging/00-create-logs-dir.conf
new file mode 100644
index 0000000..14f4f19
--- /dev/null
+++ b/cros-logging/00-create-logs-dir.conf
@@ -0,0 +1,6 @@
+# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+#Type Path Mode User Group Age Argument
+d /var/log/journal 0755 root root - -
diff --git a/cros-logging/BUILD b/cros-logging/BUILD
new file mode 100644
index 0000000..462541b
--- /dev/null
+++ b/cros-logging/BUILD
@@ -0,0 +1,35 @@
+# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_deb", "pkg_tar")
+
+pkg_tar(
+ name = "cros-logging-config",
+ srcs = ["00-create-logs-dir.conf"],
+ mode = "0644",
+ package_dir = "/etc/tmpfiles.d/",
+ strip_prefix = "/cros-logging",
+)
+
+pkg_tar(
+ name = "debian-data",
+ extension = "tar.gz",
+ deps = [
+ ":cros-logging-config",
+ ],
+)
+
+pkg_deb(
+ name = "deb",
+ architecture = "all",
+ conffiles_file = "conffiles",
+ data = ":debian-data",
+ description_file = "deb-description",
+ homepage = "https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/vm_tools/",
+ maintainer = "The Chromium OS Authors <chromium-os-dev@chromium.org>",
+ package = "cros-logging",
+ section = "misc",
+ version = "0.1",
+ visibility = ["//cros-debs:__pkg__"],
+)
diff --git a/cros-logging/conffiles b/cros-logging/conffiles
new file mode 100644
index 0000000..e01c1cd
--- /dev/null
+++ b/cros-logging/conffiles
@@ -0,0 +1 @@
+/etc/tmpfiles.d/00-create-logs-dir.conf
diff --git a/cros-logging/deb-description b/cros-logging/deb-description
new file mode 100644
index 0000000..13bec1d
--- /dev/null
+++ b/cros-logging/deb-description
@@ -0,0 +1,4 @@
+Journald config for Chromium OS integration
+This package installs configuration for logging integration
+with Chrome OS so e.g. filing feedback reports can collect error logs from
+within the container.