-/* $OpenBSD: macppc_installboot.c,v 1.5 2022/08/31 20:52:15 krw Exp $ */
+/* $OpenBSD: macppc_installboot.c,v 1.6 2022/09/03 15:46:20 kn Exp $ */
/*
* Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
void
md_init(void)
{
+ stages = 1;
+ stage1 = "/usr/mdec/ofwboot";
}
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 /ofwboot path");
goto umount;
}
- src = fileprefix(root, "/usr/mdec/ofwboot");
- 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);
}