Lines Matching refs:path
132 static int load_xbc_file(const char *path, char **buf)
137 fd = open(path, O_RDONLY);
262 static int show_xbc(const char *path, bool list)
268 ret = stat(path, &st);
271 pr_err("Failed to stat %s: %d\n", path, ret);
275 fd = open(path, O_RDONLY);
278 pr_err("Failed to open initrd %s: %d\n", path, ret);
290 ret = load_xbc_file(path, &buf);
309 static int delete_xbc(const char *path)
315 fd = open(path, O_RDWR);
318 pr_err("Failed to open initrd %s: %d\n", path, ret);
341 static int apply_xbc(const char *path, const char *xbc_path)
375 printf("Apply %s to %s\n", xbc_path, path);
385 ret = delete_xbc(path);
393 fd = open(path, O_RDWR | O_APPEND);
396 pr_err("Failed to open %s: %d\n", path, ret);
400 /* TODO: Ensure the @path is initramfs/initrd image */
403 pr_err("Failed to get the size of %s\n", path);
448 pr_err("The initrd %s may be corrupted. Recommend to rebuild.\n", path);
468 char *path = NULL;
500 path = argv[optind];
503 return apply_xbc(path, apply);
505 return delete_xbc(path);
507 return show_xbc(path, list);