setup: use gummibootlibdir
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Sat, 9 Mar 2013 18:19:57 +0000 (19:19 +0100)
committerKay Sievers <kay@vrfy.org>
Sat, 9 Mar 2013 19:14:52 +0000 (20:14 +0100)
Makefile.am
src/setup/setup.c

index d3d3a04..1e21c40 100644 (file)
@@ -46,6 +46,7 @@ gummiboot_CFLAGS = \
        $(AM_CFLAGS) \
        -Wno-unused-parameter -D_GNU_SOURCE \
        -DMACHINE_TYPE_NAME=\"$(MACHINE_TYPE_NAME)\" \
+       -DGUMMIBOOTLIBDIR=\"$(gummibootlibdir)\" \
        $(BLKID_CFLAGS)
 
 gummiboot_LDADD = \
index b804138..c5eb9d8 100644 (file)
@@ -740,7 +740,7 @@ static int copy_one_file(const char *esp_path, const char *name, bool force) {
         char *p = NULL, *q = NULL, *v = NULL;
         int r;
 
-        if (asprintf(&p, "/usr/lib/gummiboot/%s", name) < 0) {
+        if (asprintf(&p, GUMMIBOOTLIBDIR "/%s", name) < 0) {
                 fprintf(stderr, "Out of memory.\n");
                 r = -ENOMEM;
                 goto finish;
@@ -795,9 +795,9 @@ static int install_binaries(const char *esp_path, bool force) {
                         return r;
         }
 
-        d = opendir("/usr/lib/gummiboot");
+        d = opendir(GUMMIBOOTLIBDIR);
         if (!d) {
-                fprintf(stderr, "Failed to open /usr/lib/gummiboot: %m\n");
+                fprintf(stderr, "Failed to open "GUMMIBOOTLIBDIR": %m\n");
                 return -errno;
         }