X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=lib%2Fsystem%2Fsystem.c;h=89790ba47932b3e94ee96a814eaf4adb2fa19212;hb=c8afffc32546c3cd72d5d229081211b8e9efe9ee;hp=0253ac8778e32242bf055d2a3eadbcede4ba1920;hpb=2e97d0eea0d8a480877a1aabb4c67ad1aad59ed1;p=petitboot diff --git a/lib/system/system.c b/lib/system/system.c index 0253ac8..89790ba 100644 --- a/lib/system/system.c +++ b/lib/system/system.c @@ -28,6 +28,14 @@ const struct pb_system_apps pb_system_apps = { .wget = HOST_PROG_WGET, .ip = HOST_PROG_IP, .udhcpc = HOST_PROG_UDHCPC, + .udhcpc6 = HOST_PROG_UDHCPC6, + .vgscan = HOST_PROG_VGSCAN, + .vgchange = HOST_PROG_VGCHANGE, + .pb_plugin = HOST_PROG_PB_PLUGIN, + .pb_exec = HOST_PROG_PB_EXEC, + .sh = HOST_PROG_SH, + .scsi_rescan = HOST_PROG_SCSI_RESCAN, + .dmidecode = HOST_PROG_DMIDECODE, }; #ifndef TFTP_TYPE @@ -39,8 +47,8 @@ enum tftp_type tftp_type = TFTP_TYPE; int pb_mkdir_recursive(const char *dir) { struct stat statbuf; + int rc, mode = 0755; char *str, *sep; - int mode = 0755; if (!*dir) return 0; @@ -57,6 +65,8 @@ int pb_mkdir_recursive(const char *dir) str = talloc_strdup(NULL, dir); sep = strchr(*str == '/' ? str + 1 : str, '/'); + rc = 0; + while (1) { /* terminate the path at sep */ @@ -65,7 +75,8 @@ int pb_mkdir_recursive(const char *dir) if (mkdir(str, mode) && errno != EEXIST) { pb_log("mkdir(%s): %s\n", str, strerror(errno)); - return -1; + rc = -1; + break; } if (!sep) @@ -78,7 +89,7 @@ int pb_mkdir_recursive(const char *dir) talloc_free(str); - return 0; + return rc; } int pb_rmdir_recursive(const char *base, const char *dir)