NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/59985: makefs(8): way to flag files in spec missing from fs



>Number:         59985
>Category:       bin
>Synopsis:       makefs(8): way to flag files in spec missing from fs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 08 17:50:00 +0000 2026
>Originator:     Taylor R Campbell
>Release:        
>Organization:
The MakeBSD Filesystemation
>Environment:
>Description:

        If the mtree specfile lists a file, but it's not in the input
        directory, makefs(8) will create an empty file in its place:

     -F mtree-specfile
           Use mtree-specfile as an mtree(8) `specfile' specification.
...
           In the opposite case (where a specfile entry does not have an entry
           in the underlying file system) the following occurs: If the
           specfile entry is marked optional, the specfile entry is ignored.
           Otherwise, the entry will be created in the image, and it is
           necessary to specify at least the following parameters in the
...
           used.  Missing regular file entries will be created as zero-length
           files.

	While this may be useful for, e.g., populating device nodes
	from a portable context that may not allow device nodes in the
	input directory, it's a little troublesome for regular files: a
	manually crafted specfile might have a typo, and the result
	will be (a) the wrongly spelled name will manifest as an empty
	file, while (b) the rightly spelled name will missing, all
	without a hint of warning from makefs(8).

	It would be nice if there were a way to request that makefs(8)
	verify regular files listed in the mtree specfile exist in the
	input directory, or else make the operation fail.

>How-To-Repeat:

	$ mkdir foo
	$ echo hello > foo/bar
	$ echo world > foo/quux
	$ cat >foo/.mtree <<EOF
	. type=dir
	./baz type=file uname=root gname=wheel mode=0644
	./quux type=file uname=root gname=wheel mode=0644
	EOF
	$ makefs -F foo/.mtree -s 1m foo.img foo
	Calculated size of `foo.img': 1048576 bytes, 6 inodes
	Extent size set to 8192
	foo.img: 1.0MB (2048 sectors) block size 8192, fragment size 1024
		using 1 cylinder groups of 1.00MB, 128 blks, 64 inodes.
	super-block backups (for fsck -b #) at:
	 32,
	Populating `foo.img'
	Image `foo.img' complete
	$ 

>Fix:

	- Maybe another command line option to makefs(8)?
	- Maybe some syntax or tag or option in mtree specfiles?



Home | Main Index | Thread Index | Old Index