summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2015-10-05 04:30:36 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2015-10-05 04:30:36 +0000
commit0f9b1ecd7fa04e528ac93d213a506ec2c1a4ba96 (patch)
treefce52062761be7d66e64bd7a7d37ff6b71df6216
parentdc9956b180175f02471eaff1c76340fc27b774f4 (diff)
Copy the stage2 file to / in md_installboot().
-rw-r--r--usr.sbin/installboot/landisk_installboot.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/installboot/landisk_installboot.c b/usr.sbin/installboot/landisk_installboot.c
index 2f3fde47327..3783c9325c3 100644
--- a/usr.sbin/installboot/landisk_installboot.c
+++ b/usr.sbin/installboot/landisk_installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: landisk_installboot.c,v 1.1 2014/01/19 02:58:50 jsing Exp $ */
+/* $OpenBSD: landisk_installboot.c,v 1.2 2015/10/05 04:30:35 miod Exp $ */
/*
* Copyright (c) 2013 Joel Sing <jsing@openbsd.org>
@@ -18,12 +18,16 @@
#include "installboot.h"
+char *bootldr;
+
void
md_init(void)
{
stages = 2;
stage1 = "/usr/mdec/xxboot";
- stage2 = "/boot";
+ stage2 = "/usr/mdec/boot";
+
+ bootldr = "/boot";
}
void
@@ -34,5 +38,13 @@ md_loadboot(void)
void
md_installboot(int devfd, char *dev)
{
+ /* XXX - is this necessary? */
+ sync();
+
+ bootldr = fileprefix(root, bootldr);
+ if (!nowrite)
+ filecopy(stage2, bootldr);
+
+ /* Write bootblock into the superblock. */
bootstrap(devfd, dev, stage1);
}