Date: Sat, 10 Oct 2009 22:28:25 +1100 From: Johny Mattsson <johny-freebsd@earthmagic.org> To: freebsd-current@freebsd.org Subject: zfsboot insists on /boot.config being >=512 bytes to not be "invalid format" Message-ID: <4AD06FD9.20206@earthmagic.org>
index | next in thread | raw e-mail
Hi all,
Just came across a tiny annoyance on 8.0-RC1-p1 - when booting off a zfs
root and using a /boot.config file, zfsboot prints "Invalid format"
unless /boot.config is at least 512 bytes. Everything still works, so
this is a cosmetic/user-friendliness bug only.
Looking at /sys/boot/i386/zfsboot/zfsboot.c, this appears to stem from
xfsread() being used to load in /boot.config, and xfsread() wants to be
able to read in a full buffer. Switching to using plain zfs_read()
should fix it. Below is a one-liner patch to do so.
Cheers,
/Johny
--- zfsboot.c.orig 2009-10-10 22:04:29.464823028 +1100
+++ zfsboot.c 2009-10-10 22:05:06.766834831 +1100
@@ -609,7 +609,7 @@
if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) {
off = 0;
- xfsread(&dn, &off, cmd, sizeof(cmd));
+ zfs_read(spa, &dn, &off, cmd, sizeof(cmd));
}
if (*cmd) {
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AD06FD9.20206>
