#include <uci.h>
#include <uci_blob.h>
-#include <libubox/ulog.h>
+#include <libubox/avl-cmp.h>
+#include <libubox/blobmsg_json.h>
#include <libubox/list.h>
+#include <libubox/ulog.h>
+#include <libubox/utils.h>
#include <libubox/vlist.h>
-#include <libubox/blobmsg_json.h>
-#include <libubox/avl-cmp.h>
#include <libubus.h>
#include "probe.h"
return 0;
}
-static void mkdir_p(char *dir)
-{
- char *l = strrchr(dir, '/');
-
- if (l) {
- *l = '\0';
- mkdir_p(dir);
- *l = '/';
- mkdir(dir, 0755);
- }
-}
-
static void check_filesystem(struct probe_info *pr)
{
pid_t pid;
if (check_fs)
check_filesystem(pr);
- mkdir_p(target);
+ mkdir_p(target, 0755);
if (!lstat(target, &st) && S_ISLNK(st.st_mode))
unlink(target);
snprintf(tag, sizeof(tag), "%s/etc", path);
if (stat(tag, &s))
- mkdir_p(tag);
+ mkdir_p(tag, 0755);
snprintf(tag, sizeof(tag), "%s/etc/.extroot-uuid", path);
if (stat(tag, &s)) {
if (m->overlay)
path = overlay;
- mkdir_p(path);
+ mkdir_p(path, 0755);
if (check_fs)
check_filesystem(pr);
* Mount MTD part and try extroot (using
* /etc/config/fstab from that partition)
*/
- mkdir_p(cfg);
+ mkdir_p(cfg, 0755);
if (!mount(blkdev_path, cfg, "jffs2", MS_NOATIME, NULL)) {
err = mount_extroot(cfg);
umount2(cfg, MNT_DETACH);
char cfg[] = "/tmp/ubifs_cfg";
/* Mount volume and try extroot (using fstab from that vol) */
- mkdir_p(cfg);
+ mkdir_p(cfg, 0755);
if (!mount(blkdev_path, cfg, "ubifs", MS_NOATIME, NULL)) {
err = mount_extroot(cfg);
umount2(cfg, MNT_DETACH);