aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2024-01-25 01:47:36 +0000
committerEd Maste <emaste@FreeBSD.org>2024-03-22 18:42:59 +0000
commit8e402178193f7b273a956b864d8d8b288ce62ee7 (patch)
tree058abadbf1cf78b7fe94d6edef9f3fd5b1ac69e0
parenta323dd42bcacdcd6b710fb90ba6691c6ce60cd3d (diff)
downloadsrc-8e402178193f7b273a956b864d8d8b288ce62ee7.tar.gz
src-8e402178193f7b273a956b864d8d8b288ce62ee7.zip
makefs: warn that ffs sectorsize other than 512 may not work
newfs always sets sectorsize to DEV_BSIZE (512) and derives some other values based on the number of 512-byte sectors per real sector. Similar logic is required in makefs. Until that happens, emit a warning that the image may be incorrect. PR: 276571 (cherry picked from commit 176b9e0d724b4c1a24d2c46a1256381784f04edc)
-rw-r--r--usr.sbin/makefs/ffs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c
index 597379cc1a4c..97c1d6ccefda 100644
--- a/usr.sbin/makefs/ffs.c
+++ b/usr.sbin/makefs/ffs.c
@@ -340,6 +340,9 @@ ffs_validate(const char *dir, fsnode *root, fsinfo_t *fsopts)
/* set FFS defaults */
if (fsopts->sectorsize == -1)
fsopts->sectorsize = DFL_SECSIZE;
+ if (fsopts->sectorsize != DFL_SECSIZE)
+ warnx("sectorsize %d may produce nonfunctional image",
+ fsopts->sectorsize);
if (ffs_opts->fsize == -1)
ffs_opts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize);
if (ffs_opts->bsize == -1)