setup: tilt slashes
authorKay Sievers <kay@vrfy.org>
Sun, 10 Mar 2013 19:23:59 +0000 (20:23 +0100)
committerKay Sievers <kay@vrfy.org>
Sun, 10 Mar 2013 19:23:59 +0000 (20:23 +0100)
src/setup/efivars.c
src/setup/efivars.h
src/setup/setup.c

index 61d729c..783ecc8 100644 (file)
@@ -268,7 +268,7 @@ static void id128_to_efi_guid(const uint8_t *bytes, void *guid) {
         memcpy(uuid->u4, bytes+8, sizeof(uuid->u4));
 }
 
-static char *tilt_backslashes(char *s) {
+char *tilt_backslashes(char *s) {
         char *p;
 
         for (p = s; *p; p++)
@@ -278,7 +278,7 @@ static char *tilt_backslashes(char *s) {
         return s;
 }
 
-static uint16_t *tilt_slashes(uint16_t *s) {
+uint16_t *tilt_slashes(uint16_t *s) {
         uint16_t *p;
 
         for (p = s; *p; p++)
index acf5a57..97cb3d5 100644 (file)
@@ -50,3 +50,5 @@ int efi_get_boot_order(uint16_t **order);
 int efi_set_boot_order(uint16_t *order, size_t n);
 
 char *utf16_to_utf8(const void *s, size_t length);
+char *tilt_backslashes(char *s);
+uint16_t *tilt_slashes(uint16_t *s);
index ceb4a54..865afce 100644 (file)
@@ -404,7 +404,7 @@ static int print_efi_option(uint16_t id) {
 
         r = efi_get_boot_option(id, &title, partition, &path);
         if (r < 0) {
-                fprintf(stderr, "Failed to read EFI boot entry Boot%04X.\n", id);
+                fprintf(stderr, "Failed to read EFI boot entry Boot%04X: %s.\n", id, strerror(-r));
                 goto finish;
         }
 
@@ -416,9 +416,9 @@ static int print_efi_option(uint16_t id) {
                         partition[0], partition[1], partition[2], partition[3], partition[4], partition[5], partition[6], partition[7],
                         partition[8], partition[9], partition[10], partition[11], partition[12], partition[13], partition[14], partition[15]);
         }
-        printf("\n");
 
 finish:
+        printf("\n");
         free(title);
         free(path);
         return r;
@@ -448,6 +448,7 @@ static int status_variables(void) {
 
                 r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderImageIdentifier", &s);
                 if (r == 0) {
+                        tilt_backslashes(s);
                         printf("     Loader: %s\n", s);
                         free(s);
                 }