NetBSD Problem Report #60008
From www@netbsd.org Sun Feb 15 20:50:50 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "R13" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 8264D1A9239
for <gnats-bugs@gnats.NetBSD.org>; Sun, 15 Feb 2026 20:50:50 +0000 (UTC)
Message-Id: <20260215205049.524061A923C@mollari.NetBSD.org>
Date: Sun, 15 Feb 2026 20:50:49 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: MAKEDEV should let caller say whether mount_fdesc is used
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>
>Number: 60008
>Category: toolchain
>Synopsis: MAKEDEV should let caller say whether mount_fdesc is used
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Feb 15 20:55:00 +0000 2026
>Originator: Taylor R Campbell
>Release: current, 11, 10, 9, ...
>Organization:
The MetaFD Foundation, Inc.
>Environment:
>Description:
The MAKEDEV script examines whether the working directory has
fdescfs mounted, but this doesn't make sense when running it at
build-time to create images with, e.g.,
src/embedded/utils/mkimage:
516 # Set fdesc_mounted=true if the fdesc file system is mounted
517 # on the current directory (typically "/dev").
518 # Later, this will be used to suppress creation of device nodes
519 # that are supplied by the fdesc file system.
520 #
521 fdesc_mounted=false
522 if [ -d fd ]; then
523 # Parse the output from "mount -u -o nosuchoption .".
524 # We don't parse the output from df(1) because that's
525 # less likely to be available on install media.
526 #
527 # If the current directory is a mount point for the
528 # fdesc file system, then the expected output (whether
529 # or not the current user is root) is:
530 # mount_fdesc: -o suchoption: option not supported.
531 #
532 # If the current directory is not a mount point, then
533 # the expected output is:
534 # mount: .: unknown special file or file system.
535 #
536 # If we are not running on NetBSD, or mount(8) is not
537 # found, then we should get some other error message.
538 #
539 case "$({ LC_ALL=C mount -u -o nosuchoption . ; } 2>&1)" in
540 *mount_fdesc*) fdesc_mounted=true ;;
541 esac
542 fi
https://nxr.netbsd.org/xref/src/etc/MAKEDEV.tmpl?r=1.238#516
MAKEDEV does this in order to make some decisions about which
device nodes to create:
960 std)
...
973 if ! $fdesc_mounted; then
974 mkdev tty c %ctty_chr% 0 666
975 mkdev stdin c %filedesc_chr% 0 666
976 mkdev stdout c %filedesc_chr% 1 666
977 mkdev stderr c %filedesc_chr% 2 666
978 fi
https://nxr.netbsd.org/xref/src/etc/MAKEDEV.tmpl?r=1.238#960
1158 fd)
1159 if ! $fdesc_mounted; then
1160 # Create the "fd" subdirectory, and devices "fd/0" to "fd/63"
1161 makedir fd 755
1162 n=0
1163 while [ $n -lt 64 ]
1164 do
1165 mkdev fd/$n c %filedesc_chr% $n 666
1166 n=$(($n + 1))
1167 done
1168 fi
https://nxr.netbsd.org/xref/src/etc/MAKEDEV.tmpl?r=1.238#1158
>How-To-Repeat:
Try to build an image with mkimage that is appropriate for
having fdescfs mounted.
>Fix:
These decisions should be configurable by a command-line option
so they can be independent of whatever file systems are mounted
at build-time.
While it may not exactly hurt for the extra device nodes to
exist on disk even if fdescfs will later be mounted over them
(other than costing a few dozen inodes), the behaviour of
MAKEDEV as a build-time tool should not depend on mounted file
systems and should be controllable by command-line options.
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.