summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2015-11-30 17:34:57 +0000
committerjsing <jsing@openbsd.org>2015-11-30 17:34:57 +0000
commit68507eda2cc24accb255379e21357c63fc315e2d (patch)
tree038e56759b9e49b9aa678747b1f4da7b56def194 /usr.sbin/installboot
parentchange Xrs from now-defunct db(3) to dbopen(3); this wasn;t a (diff)
downloadwireguard-openbsd-68507eda2cc24accb255379e21357c63fc315e2d.tar.xz
wireguard-openbsd-68507eda2cc24accb255379e21357c63fc315e2d.zip
Revert the sync -> fsync conversion (at least for the time being) - there
is a good chance that this is causing the 'No blocks to load' errors that various people have encountered.
Diffstat (limited to 'usr.sbin/installboot')
-rw-r--r--usr.sbin/installboot/i386_installboot.c8
-rw-r--r--usr.sbin/installboot/landisk_installboot.c5
-rw-r--r--usr.sbin/installboot/sparc64_installboot.c5
-rw-r--r--usr.sbin/installboot/vax_installboot.c5
4 files changed, 14 insertions, 9 deletions
diff --git a/usr.sbin/installboot/i386_installboot.c b/usr.sbin/installboot/i386_installboot.c
index b18def5828c..6e60504d60e 100644
--- a/usr.sbin/installboot/i386_installboot.c
+++ b/usr.sbin/installboot/i386_installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i386_installboot.c,v 1.17 2015/11/26 19:03:10 deraadt Exp $ */
+/* $OpenBSD: i386_installboot.c,v 1.18 2015/11/30 17:34:57 jsing Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -180,7 +180,8 @@ write_bootblocks(int devfd, char *dev, struct disklabel *dl)
pbr_set_symbols(stage1, blkstore, pbr_symbols);
if (!nowrite) {
- fsync(devfd); sleep(1);
+ /* Sync filesystems (to clean in-memory superblock?). */
+ sync(); sleep(1);
}
/*
@@ -637,7 +638,8 @@ getbootparams(char *boot, int devfd, struct disklabel *dl)
* to be able to load it later.
*/
- fsync(devfd); sleep(1);
+ /* Make sure the (probably new) boot file is on disk. */
+ sync(); sleep(1);
if ((fd = open(boot, O_RDONLY)) < 0)
err(1, "open: %s", boot);
diff --git a/usr.sbin/installboot/landisk_installboot.c b/usr.sbin/installboot/landisk_installboot.c
index 30df58a107a..42fb022a5a0 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.6 2015/11/26 19:03:10 deraadt Exp $ */
+/* $OpenBSD: landisk_installboot.c,v 1.7 2015/11/30 17:34:57 jsing Exp $ */
/*
* Copyright (c) 2013 Joel Sing <jsing@openbsd.org>
@@ -40,7 +40,8 @@ md_loadboot(void)
void
md_installboot(int devfd, char *dev)
{
- fsync(devfd);
+ /* XXX - is this necessary? */
+ sync();
bootldr = fileprefix(root, bootldr);
if (bootldr == NULL)
diff --git a/usr.sbin/installboot/sparc64_installboot.c b/usr.sbin/installboot/sparc64_installboot.c
index 85f37e1f370..bea18878dd0 100644
--- a/usr.sbin/installboot/sparc64_installboot.c
+++ b/usr.sbin/installboot/sparc64_installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sparc64_installboot.c,v 1.5 2015/11/26 19:03:10 deraadt Exp $ */
+/* $OpenBSD: sparc64_installboot.c,v 1.6 2015/11/30 17:34:57 jsing Exp $ */
/*
* Copyright (c) 2012, 2013 Joel Sing <jsing@openbsd.org>
@@ -92,7 +92,8 @@ md_loadboot(void)
void
md_installboot(int devfd, char *dev)
{
- fsync(devfd);
+ /* XXX - is this necessary? */
+ sync();
bootldr = fileprefix(root, bootldr);
if (bootldr == NULL)
diff --git a/usr.sbin/installboot/vax_installboot.c b/usr.sbin/installboot/vax_installboot.c
index 2914d230dc4..1f1ab061991 100644
--- a/usr.sbin/installboot/vax_installboot.c
+++ b/usr.sbin/installboot/vax_installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vax_installboot.c,v 1.3 2015/11/26 19:03:10 deraadt Exp $ */
+/* $OpenBSD: vax_installboot.c,v 1.4 2015/11/30 17:34:57 jsing Exp $ */
/*
* Copyright (c) 2013 Joel Sing <jsing@openbsd.org>
@@ -40,7 +40,8 @@ md_loadboot(void)
void
md_installboot(int devfd, char *dev)
{
- fsync(devfd);
+ /* XXX - is this necessary? */
+ sync();
bootldr = fileprefix(root, bootldr);
if (bootldr == NULL)