From ae889bf24871cac4e24753130500d55b62b5c953 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 8 Nov 2010 23:23:25 +0100 Subject: [PATCH] installer: Ignore the exit status of two grep commands. These commands may just find nothing which is okay in these cases. So don't interpret their exit status 1 as failure. Reported-by: lentferj --- usr.sbin/installer/dfuibe_installer/fn_configure.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/installer/dfuibe_installer/fn_configure.c b/usr.sbin/installer/dfuibe_installer/fn_configure.c index 3478be5a84..dcb8114484 100644 --- a/usr.sbin/installer/dfuibe_installer/fn_configure.c +++ b/usr.sbin/installer/dfuibe_installer/fn_configure.c @@ -1316,6 +1316,7 @@ mount_target_system(struct i_fn_args *a) { FILE *crypttab, *fstab; struct commands *cmds; + struct command *cmd; struct subpartition *a_subpart; char name[256], device[256], mtpt[256], fstype[256], options[256]; char *filename, line[256]; @@ -1358,24 +1359,26 @@ mount_target_system(struct i_fn_args *a) a->os_root, subpartition_get_device_name(a_subpart), a->os_root, a->cfg_root); - command_add(cmds, + cmd = command_add(cmds, "%s%s -f %st2;" "%s%s \"^[^#]\" %s%s/etc/crypttab >%st2", a->os_root, cmd_name(a, "RM"), a->tmp, a->os_root, cmd_name(a, "GREP"), a->os_root, a->cfg_root, a->tmp); + command_set_failure_mode(cmd, COMMAND_FAILURE_IGNORE); } else { command_add(cmds, "%s%s %sdev/%s %sboot", a->os_root, cmd_name(a, "MOUNT"), a->os_root, subpartition_get_device_name(a_subpart), a->os_root); - command_add(cmds, + cmd = command_add(cmds, "%s%s -f %st2;" "%s%s \"^vfs\\.root\\.realroot=\" %sboot/loader.conf >%st2", a->os_root, cmd_name(a, "RM"), a->tmp, a->os_root, cmd_name(a, "GREP"), a->os_root, a->tmp); + command_set_failure_mode(cmd, COMMAND_FAILURE_IGNORE); } if (!commands_execute(a, cmds)) { commands_free(cmds); -- 2.41.0