summaryrefslogtreecommitdiffstats
path: root/src/kernel-install/kernel-install.c
diff options
context:
space:
mode:
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>2024-01-10 11:56:36 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-01-10 13:40:35 +0100
commit398760c84a4995a0e699b9c991a2ba9e65dd1bdc (patch)
tree1a8895b98285af31aa8c6318e7b7daa62f94964c /src/kernel-install/kernel-install.c
parenttest-network: add test case for MACAddress=none in .netdev and MACAddressPoli... (diff)
downloadsystemd-398760c84a4995a0e699b9c991a2ba9e65dd1bdc.tar.xz
systemd-398760c84a4995a0e699b9c991a2ba9e65dd1bdc.zip
kernel-install: clarify what is currently supported with --root and --image
`list` and `add-all` ignore `--root` or `--image`, working on the running system instead. Also improve the error message if `--image` is used.
Diffstat (limited to '')
-rw-r--r--src/kernel-install/kernel-install.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/kernel-install/kernel-install.c b/src/kernel-install/kernel-install.c
index 1cf0fa28f4..d33a3ddf2f 100644
--- a/src/kernel-install/kernel-install.c
+++ b/src/kernel-install/kernel-install.c
@@ -1182,7 +1182,7 @@ static int verb_add(int argc, char *argv[], void *userdata) {
assert(argv);
if (arg_root)
- return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "'add' does not support --root=.");
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "'add' does not support --root= or --image=.");
if (bypass())
return 0;
@@ -1221,6 +1221,9 @@ static int verb_add_all(int argc, char *argv[], void *userdata) {
assert(argv);
+ if (arg_root)
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "'add-all' does not support --root= or --image=.");
+
if (bypass())
return 0;
@@ -1309,7 +1312,7 @@ static int verb_remove(int argc, char *argv[], void *userdata) {
assert(argv);
if (arg_root)
- return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "'remove' does not support --root=.");
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "'remove' does not support --root= or --image=.");
if (argc > 2)
log_debug("Too many arguments specified. 'kernel-install remove' takes only kernel version. "
@@ -1450,6 +1453,9 @@ static int verb_list(int argc, char *argv[], void *userdata) {
_cleanup_close_ int fd = -EBADF;
int r;
+ if (arg_root)
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "'list' does not support --root= or --image=.");
+
fd = open("/usr/lib/modules", O_DIRECTORY|O_RDONLY|O_CLOEXEC);
if (fd < 0)
return log_error_errno(fd, "Failed to open /usr/lib/modules/: %m");