From 2a6a28023bdfe127be68ac605f9a026a82884c80 Mon Sep 17 00:00:00 2001 From: Peter Oberparleiter Date: Tue, 5 Dec 2017 15:40:23 +0100 Subject: [PATCH 1/4] zdev: Enable running chzdev from unknown root devices When a persistent device configuration is changed, chzdev tries to find out if it needs to perform additional steps to make this change persistent. If this check fails, for example because the root device is located on a RAM-disk, or on a device type not managed by chzdev, the tool reports an error and exits with non-zero exit code: chzdev: Could not determine device that provides / or chzdev: Could not determine device that provides loop0 This behavior unnecessarily restricts chzdev from being used in scripted environments like an installation initial RAM-disk. Fix this by removing the non-zero exit code and moving the message to verbose output mode only. Signed-off-by: Peter Oberparleiter Signed-off-by: Michael Holzheu --- zdev/src/root.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zdev/src/root.c b/zdev/src/root.c index 7f0d39f..668bdbd 100644 --- a/zdev/src/root.c +++ b/zdev/src/root.c @@ -35,9 +35,14 @@ exit_code_t root_check(void) /* Get list of devices that provide the root device. */ selected = selected_dev_list_new(); rc = select_by_path(NULL, selected, config_active, scope_mandatory, - NULL, NULL, PATH_ROOT, err_print); - if (rc) + NULL, NULL, PATH_ROOT, err_ignore); + if (rc) { + /* Running from an unknown root device is not an error. */ + verb("Note: Could not determine if root device configuration " + "needs to be updated\n"); + rc = 0; goto out; + } /* Determine if any of the devices or device types has been modified. */ mod = strlist_new(); -- 2.13.6