Lines Matching refs:path
151 static int load_xbc_file(const char *path, char **buf)
156 fd = open(path, O_RDONLY);
281 static int show_xbc(const char *path, bool list)
287 ret = stat(path, &st);
290 pr_err("Failed to stat %s: %d\n", path, ret);
294 fd = open(path, O_RDONLY);
297 pr_err("Failed to open initrd %s: %d\n", path, ret);
309 ret = load_xbc_file(path, &buf);
328 static int delete_xbc(const char *path)
334 fd = open(path, O_RDWR);
337 pr_err("Failed to open initrd %s: %d\n", path, ret);
360 static int apply_xbc(const char *path, const char *xbc_path)
394 printf("Apply %s to %s\n", xbc_path, path);
405 ret = delete_xbc(path);
413 fd = open(path, O_RDWR | O_APPEND);
416 pr_err("Failed to open %s: %d\n", path, ret);
420 /* TODO: Ensure the @path is initramfs/initrd image */
423 pr_err("Failed to get the size of %s\n", path);
468 pr_err("The initrd %s may be corrupted. Recommend to rebuild.\n", path);
488 char *path = NULL;
520 path = argv[optind];
523 return apply_xbc(path, apply);
525 return delete_xbc(path);
527 return show_xbc(path, list);