2
0
mirror of git://github.com/lxc/lxc synced 2025-08-29 11:42:00 +00:00

10668 Commits

Author SHA1 Message Date
Christian Brauner
30538e7aed
build: use dummy config data
to avoid having to rely on newer meson features.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:43 +02:00
Christian Brauner
3af1349c96
build: expand default_options
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:43 +02:00
Christian Brauner
1655468806
build: add commands
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:42 +02:00
Christian Brauner
bf7c10133a
build: split netns_ifaddrs into separate sources
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:41 +02:00
Christian Brauner
ef5f183fe8
hooks: use cloexec everywhere
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:40 +02:00
Christian Brauner
4e0454beae
build: fix tools build
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:39 +02:00
Christian Brauner
7f8803d9ad
build: fix hook program build
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:38 +02:00
Stéphane Graber
3a7151efcb
Don't include internal headers in external library headers
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-10-14 17:28:38 +02:00
Christian Brauner
5604622347
tools: use correct include for Android
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:37 +02:00
Christian Brauner
d1f36b7709
build: support lto
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:36 +02:00
Christian Brauner
ecfbb95329
cgroups: fix declarations and headers
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:35 +02:00
Christian Brauner
2bb4d9658d
network: fix integer comparisons
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:35 +02:00
Christian Brauner
70c8f1c0d7
build: ensure all relevant calls are checked for availability at build time
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:34 +02:00
Christian Brauner
c7734ae9aa
build: show more detailed information
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:33 +02:00
Christian Brauner
ac09b96fa2
build: record meson version
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:32 +02:00
Christian Brauner
81d8affcda
build: use correct minimal meson version requirement
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:31 +02:00
Christian Brauner
ab4538b1bc
build: remove pointless prefixdir validation
Meson will handle this internall and treat a non-absolute path as an
error.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:30 +02:00
Christian Brauner
ae92922b48
tests: fix config file tests
Link: https://bugs.launchpad.net/bugs/1943441
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:28:02 +02:00
Christian Brauner
d5f993841b
log: fix cross-compilation with %m modifier
Fixes: #3961
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:32 +02:00
Christian Brauner
a32fc8b4da
build: set more variables and print summary
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:31 +02:00
Christian Brauner
73eb5ccc55
build: add more global config variables
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:31 +02:00
Christian Brauner
c077362de8
build: set diagnostic colours directly in default_options
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:30 +02:00
Christian Brauner
6bd2736a9d
build: add single option directly to static library
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:29 +02:00
Christian Brauner
0dc89e238b
build: remove unneeded variables
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:28 +02:00
Christian Brauner
a42aa8f4ec
build: use common dependencies variable
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:27 +02:00
Christian Brauner
1065db8524
build: libdir and bindir are the default for shared libraries and executables
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:27 +02:00
Christian Brauner
78eb5fac2d
build: set find_library('libcap', require : false)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:26 +02:00
Christian Brauner
70107a07f5
build: -fPIC and -shared are handled automatically
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:25 +02:00
Christian Brauner
9d9d3c5af2
build: use dependency() where possible
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:24 +02:00
Christian Brauner
d14f5bf2b6
build: set as-needed in default_options
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:23 +02:00
Christian Brauner
7e2724b2a8
build: set pie in default_options
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:22 +02:00
Edênis Freindorfer Azevedo
505922727b
Fix lxc-cgroup smart completion.
Also make bash function more readable for itself.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:22 +02:00
Edênis Freindorfer Azevedo
e8aa72eafd
Refactor __lxc_check_name_present().
Print name of container found, if any.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:21 +02:00
Edênis Freindorfer Azevedo
22975ebb06
Check completion for prefixes names.
If a name is a prefix of another word available for completion, adjust
to show all words with given prefix.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:20 +02:00
Edênis Freindorfer Azevedo
b9227d8bc9
Add __lxc_cgroup_state_object().
Support cgroup state-object completion values for `lxc-cgroup`.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:19 +02:00
Edênis Freindorfer Azevedo
508d880864
Update _lxc_usernsexec.
Not really much can be done for this function, as `-m` requires an ID
mapping that has to be manually input, since it will use
`/etc/sub{g,u}id` if not specified.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:18 +02:00
Edênis Freindorfer Azevedo
0c454f7721
Add completion for lxc-copy param --fssize.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:17 +02:00
Edênis Freindorfer Azevedo
0f97c7c721
Add __lxc_get_selinux_contexts().
List SElinux contexts available. Not clear if this could be only for
root or if normal user with `sudo` is also supported.

Using `Fedora34` for basic testing.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:17 +02:00
Edênis Freindorfer Azevedo
1a357f5f89
Refactor __lxc_groups() to __lxc_get_groups().
Make code logic be more clear to what it is being done.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:16 +02:00
Edênis Freindorfer Azevedo
fbdba650a2
Another round of more bash-like syntax.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:15 +02:00
Edênis Freindorfer Azevedo
eaeec61d2b
Fix lxc-create completion.
Do not append a name of an existing container.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:14 +02:00
Edênis Freindorfer Azevedo
1a5ba64b06
Add support for comma as a completion word.
For `lxc-ls --groups` and `lxc-autostart --groups`.
Support leading comma, trailing comma, embedded double comma.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:13 +02:00
Edênis Freindorfer Azevedo
a93a4a6748
Refactor __lxc_piped_args.
Use bash functions for common array operations. Keep code logic somewhat
easy to read for bug hunting.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:12 +02:00
Edênis Freindorfer Azevedo
289b75c8b3
Fix lxc-snapshot completion.
For options `-r,--restore` and `-d,--destroy`, we need the container
name to create the list of completion values.

Therefore, it is needed to scan the current command line to check if
there is a container name available.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:11 +02:00
Edênis Freindorfer Azevedo
0b7480790a
Use more bash-like syntax.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:11 +02:00
Edênis Freindorfer Azevedo
8fa0b91a43
Add support for container composed names.
When a container name has whitespace in it
(e.g. created by `lxc-create -t download -n "arch linux"` ),
the completion for other commands should be able to work by adding a
backslash to escape it.

Although it may be interesting to support names between quotes, this
would probably means to have to add quotes to all names. Might not be
interesting just due to an edge case.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:10 +02:00
Edênis Freindorfer Azevedo
c942fad901
Add completion output for lxc-ls --fancy-format.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:09 +02:00
Edênis Freindorfer Azevedo
2afe512391
Improve name completion handling.
Use regex to handle short option `-n`, since short options can be
combined (e.g. `-nd`) as long as at max one requires an argument.

Also consider the case when the arg for the long option is not given
together with `--name=`.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:08 +02:00
Edênis Freindorfer Azevedo
ea35c37f0d
Add compopt call to __lxc_piped_args.
On pair with how other functions do it. Also, be smarter about adding
whitespace when there are no more completions available for the
parameter.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:07 +02:00
Edênis Freindorfer Azevedo
c0e3a76278
Use --running instead of --active.
Commands block if container is frozen.

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-10-14 17:26:05 +02:00