]> git.ozlabs.org Git - petitboot/blobdiff - discover/platform-powerpc.c
discover/powerpc: Fix sysparams base path
[petitboot] / discover / platform-powerpc.c
index 4eb28057c9fb6c7513a05c315cda8599c71cdc7c..1e7c8284eed3b5e1c2d0a431022b76d43b3fab15 100644 (file)
@@ -16,7 +16,7 @@
 #include "platform.h"
 
 static const char *partition = "common";
-static const char *sysparams_dir = "/sys/firmware/opal/sysparams";
+static const char *sysparams_dir = "/sys/firmware/opal/sysparams/";
 
 struct param {
        char                    *name;
@@ -540,16 +540,24 @@ static int read_bootdev_sysparam(const char *name, uint8_t *val)
        strcat(path, name);
 
        fd = open(path, O_RDONLY);
-       if (fd < 0)
+       if (fd < 0) {
+               pb_debug("powerpc: can't access sysparam %s\n",
+                               name);
                return -1;
+       }
 
        rc = read(fd, buf, sizeof(buf));
 
        close(fd);
 
        /* bootdev definitions should only be one byte in size */
-       if (rc != 1)
+       if (rc != 1) {
+               pb_debug("powerpc: sysparam %s read returned %d\n",
+                               name, rc);
                return -1;
+       }
+
+       pb_debug("powerpc: sysparam %s: 0x%02x\n", name, buf[0]);
 
        switch (buf[0]) {
        default: