While experimenting with PkgBase and makefs(8) -t zfs VM-IMAGES, I inadvertently left a devfs mount in the directory that would become the rootfs image using the soon-to-be-replaced release engineering VM-IMAGE tools in /usr/src/release Surprisingly, makefs(8) is devfs(8)-friendly: 'makefs -s 1g img.raw /dev' Calculated size of `img.raw': 1073741824 bytes, 423 inodes Extent size set to 32768 density reduced from 2538397 to 8192 img.raw: 1024.0MB (2097152 sectors) block size 32768, fragment size 4096 using 2 cylinder groups of 626.00MB, 20032 blks, 80128 inodes. super-block backups (for fsck -b #) at: 64, 1282112 Populating `img.raw' Image `img.raw' complete However mounting devfs(8) on /tmp/test/devfs and making an image of the parent directory /tmp/test results in: 'makefs -t zfs -s 1g -B little -o 'poolname=foo' img.raw /tmp/test/dev' Assertion failed: (cur->type == S_IFREG || cur->type == S_IFDIR || cur->type == S_IFLNK), function fsnode_foreach, file /home/pkgbuild/worktrees/releng/14.2/usr.sbin/makefs/zfs/fs.c, line 190. Abort trap (core dumped) The goal is not necessarily the ability to create a disk image containing devfs(8), but rather to not core dump or provide the user a warning as appropriate. Tested on 14.2-RELEASE and I can provide the core file if this cannot be reproduced.
*** Bug 283888 has been marked as a duplicate of this bug. ***
There's no real way for makefs to handle device nodes except to skip them or create dummy files. I think printing a warning and skipping is probably the more useful behaviour.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ce878284318e71217d8d8f43f7d590b6c338d3aa commit ce878284318e71217d8d8f43f7d590b6c338d3aa Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2025-01-07 14:31:02 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2025-01-07 14:32:20 +0000 makefs: Handle special file types when creating a zpool Previously, anything other than a regular file, directory or symlink would cause makefs to exit with an assertion failure. Make it a bit more resilient to user error: print a warning and skip the file. Add a regression test wherein we create an image from a devfs mount. PR: 283583 MFC after: 2 weeks usr.sbin/makefs/tests/makefs_zfs_tests.sh | 22 +++++++++++++++++ usr.sbin/makefs/zfs/fs.c | 39 +++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 7 deletions(-)
THANK YOU!!!