summaryrefslogtreecommitdiff
path: root/core/efibootmgr/efibootmgr-tilt_slashes-func.patch
blob: ce857bb3c0b240df5b5979a04e9522a3b065df82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
index 236365a..9883961 100644
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -803,6 +803,7 @@ usage()
 	printf("\t-V | --version          return version and exit\n");
 	printf("\t-w | --write-signature  write unique sig to MBR if needed\n");
 	printf("\t-@ | --append-binary-args file  append extra args from file (use \"-\" for stdin)\n");
+	printf("\t   | --help             show help/usage\n");
 }
 
 static void
@@ -863,6 +864,7 @@ parse_opts(int argc, char **argv)
 			{"version",                no_argument, 0, 'V'},
 			{"write-signature",        no_argument, 0, 'w'},
 			{"append-binary-args", required_argument, 0, '@'},
+			{"help",                   no_argument, 0,   2},
 			{0, 0, 0, 0}
 		};
 
@@ -1014,6 +1016,10 @@ parse_opts(int argc, char **argv)
 			opts.write_signature = 1;
 			break;
 
+		case 2:
+			usage();
+			exit(1);
+
 		default:
 			usage();
 			exit(1);
diff --git a/src/lib/efi.c b/src/lib/efi.c
index a4ce5cf..8ef8be8 100644
--- a/src/lib/efi.c
+++ b/src/lib/efi.c
@@ -70,6 +70,16 @@ efi_guid_unparse(efi_guid_t *guid, char *out)
         return out;
 }
 
+char *
+tilt_slashes(char *s)
+{
+	char *p;
+	for (p = s; *p; p++)
+		if (*p == '/')
+			*p = '\\';
+	return s;
+}
+
 void
 set_fs_kernel_calls()
 {
@@ -535,7 +545,7 @@ char *make_disk_load_option(char *p, char *disk)
 				     signature,
 				     mbr_type, signature_type);
 
-    efichar_from_char(os_loader_path, opts.loader, sizeof(os_loader_path));
+    efichar_from_char(os_loader_path, tilt_slashes(opts.loader), sizeof(os_loader_path));
     p += make_file_path_device_path (p, os_loader_path);
     p += make_end_device_path       (p);