diff options
author | Lawrence Chan <element103@gmail.com> | 2019-06-07 00:46:41 -0500 |
---|---|---|
committer | Lawrence Chan <element103@gmail.com> | 2019-06-14 17:42:05 -0500 |
commit | 6ea12e302877f7ce1b77d3dafc4d0aa51839840c (patch) | |
tree | 577af2735d0243fd38c2abd129d8aa3358b950e8 /libpod/runtime.go | |
parent | 185b413e3d10ba001c4d1670a50dad77507154d7 (diff) | |
download | podman-6ea12e302877f7ce1b77d3dafc4d0aa51839840c.tar.gz podman-6ea12e302877f7ce1b77d3dafc4d0aa51839840c.tar.bz2 podman-6ea12e302877f7ce1b77d3dafc4d0aa51839840c.zip |
Improve DESTDIR/PREFIX/ETCDIR handling
- PREFIX is now passed saved in the binary at build-time so that default
paths match installation paths.
- ETCDIR is also overridable in a similar way.
- DESTDIR is now applied on top of PREFIX for install/uninstall steps.
Previously, a DESTDIR=/foo PREFIX=/bar make would install into /bar,
rather than /foo/bar.
Signed-off-by: Lawrence Chan <element103@gmail.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 24bb5f61c..c2a387083 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -42,11 +42,13 @@ const ( SQLiteStateStore RuntimeStateStore = iota // BoltDBStateStore is a state backed by a BoltDB database BoltDBStateStore RuntimeStateStore = iota +) +var ( // SeccompDefaultPath defines the default seccomp path - SeccompDefaultPath = "/usr/share/containers/seccomp.json" + SeccompDefaultPath = installPrefix + "/share/containers/seccomp.json" // SeccompOverridePath if this exists it overrides the default seccomp path - SeccompOverridePath = "/etc/crio/seccomp.json" + SeccompOverridePath = etcDir + "/crio/seccomp.json" // ConfigPath is the path to the libpod configuration file // This file is loaded to replace the builtin default config before @@ -54,11 +56,11 @@ const ( // If it is not present, the builtin default config is used instead // This path can be overridden when the runtime is created by using // NewRuntimeFromConfig() instead of NewRuntime() - ConfigPath = "/usr/share/containers/libpod.conf" + ConfigPath = installPrefix + "/share/containers/libpod.conf" // OverrideConfigPath is the path to an override for the default libpod // configuration file. If OverrideConfigPath exists, it will be used in // place of the configuration file pointed to by ConfigPath. - OverrideConfigPath = "/etc/containers/libpod.conf" + OverrideConfigPath = etcDir + "/containers/libpod.conf" // DefaultInfraImage to use for infra container DefaultInfraImage = "k8s.gcr.io/pause:3.1" @@ -300,7 +302,7 @@ func defaultRuntimeConfig() (RuntimeConfig, error) { TmpDir: "", MaxLogSize: -1, NoPivotRoot: false, - CNIConfigDir: "/etc/cni/net.d/", + CNIConfigDir: etcDir + "/cni/net.d/", CNIPluginDir: []string{"/usr/libexec/cni", "/usr/lib/cni", "/usr/local/lib/cni", "/opt/cni/bin"}, InfraCommand: DefaultInfraCommand, InfraImage: DefaultInfraImage, |