zfsboot insists on /boot.config being >=512 bytes to not be "invalid
format"
Johny Mattsson
johny-freebsd at earthmagic.org
Sat Oct 10 11:28:28 UTC 2009
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) {
More information about the freebsd-current
mailing list