-/* $OpenBSD: octeon_installboot.c,v 1.7 2022/09/14 16:43:00 kn Exp $ */
+/* $OpenBSD: octeon_installboot.c,v 1.8 2022/09/27 11:42:16 kn Exp $ */
/*
* Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
void
md_init(void)
{
+ stages = 1;
+ stage1 = "/usr/mdec/boot";
}
void
struct msdosfs_args args;
char cmd[60];
char dst[PATH_MAX];
- char *src;
- size_t mntlen, pathlen, srclen;
+ size_t mntlen, pathlen;
int rslt;
- src = NULL;
-
/* Create directory for temporary mount point. */
strlcpy(dst, "/tmp/installboot.XXXXXXXXXX", sizeof(dst));
if (mkdtemp(dst) == NULL)
warn("unable to build /boot path");
goto umount;
}
- src = fileprefix(root, "/usr/mdec/boot");
- if (src == NULL) {
- rslt = -1;
- goto umount;
- }
- srclen = strlen(src);
if (verbose)
fprintf(stderr, "%s %s to %s\n",
- (nowrite ? "would copy" : "copying"), src, dst);
+ (nowrite ? "would copy" : "copying"), stage1, dst);
if (!nowrite) {
- rslt = filecopy(src, dst);
+ rslt = filecopy(stage1, dst);
if (rslt == -1)
goto umount;
}
if (rmdir(dst) == -1)
err(1, "rmdir('%s') failed", dst);
- free(src);
-
if (rslt == -1)
exit(1);
}