From 69c4acfcdc7121bc0d4f5386910545f4caf134f2 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Sat, 23 Apr 2016 19:11:08 -0400 Subject: [PATCH 1/1] Tweaked refind-mkdefault return values for some error conditions. --- docs/man/refind-mkdefault.8 | 6 ++++++ refind-mkdefault | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/man/refind-mkdefault.8 b/docs/man/refind-mkdefault.8 index e8ae0c5..3ac2dde 100644 --- a/docs/man/refind-mkdefault.8 +++ b/docs/man/refind-mkdefault.8 @@ -99,6 +99,12 @@ a buggy EFI or badly damaged NVRAM contents. No rEFInd entry could be found in the list of boot options, and so no changes were made to the boot order list. +.TP +.B 4 +The script could not run because of OS issues -- the OS was not Linux, +the \fIefibootmgr\fR utility was not available, or the script was not run +as \fIroot\fR. + .SH "LIMITATIONS" .TP diff --git a/refind-mkdefault b/refind-mkdefault index 39d7ef7..a48ac5d 100755 --- a/refind-mkdefault +++ b/refind-mkdefault @@ -172,13 +172,13 @@ def main(): if sys.platform != "linux": print("This program is useful only under Linux; exiting!") - return(1) + return(4) if shutil.which("efibootmgr") is None: print("The efibootmgr utility is not installed; exiting!") - return(1) + return(4) if not os.geteuid() == 0: print("This program must be run as root (or via sudo); exiting!") - return(1) + return(4) retval = 0 boot_entries, boot_order = discover_data() -- 2.39.2