NetBSD-Bugs archive

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

Re: port-atari/40316: "df: not found" printed while MAKEDEV allruns on NetBSD Atari install



The following reply was made to PR port-atari/40316; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-atari/40316: "df: not found" printed while MAKEDEV
        allruns on NetBSD Atari install
Date: Sat, 3 Jan 2009 12:01:34 +0200

 On Sat, 03 Jan 2009, Izumi Tsutsui wrote:
 > >  +         case "$({ LC_ALL=C mount -u -o nosuchoption . ; } 2>&1)" in
 > >  +         *mount_fdesc*)  nofdesc=false;;
 > >            *)              nofdesc=true;;
 > >            esac
 > 
 > Shouldn't it be "mount -u -o nosuchoption fd", rather than "." ?
 > i.e. shouldn't a mount point for mount_fdesc be /dev/fd, not /dev?
 
 The mount_fdesc(8) man page doesn't have an example, but I thought that
 common usage was something like:
 
        mount -t fdesc -o union fdesc /dev
 
 The fdesc file system supplies the following top-level directory entries:
 
 dr-xr-xr-x  2 root  wheel   512 Jan  1 23:17 fd
 lr-xr-xr-x  1 root  wheel     4 Jan  1 23:17 stderr -> fd/2
 lr-xr-xr-x  1 root  wheel     4 Jan  1 23:17 stdin -> fd/0
 lr-xr-xr-x  1 root  wheel     4 Jan  1 23:17 stdout -> fd/1
 crw-rw-rw-  1 root  wheel  1, 0 Jan  1 23:17 tty
 
 If you mounted it on /dev/fd, then you would get things like
 /dev/fd/fd/0 and /dev/fd/stdin instead of /dev/fd/0 and /dev/stdin.
 
 > Isn't it simpler to check output of mount(8) with no option?
 > ---
 > # mount | grep "^fdesc on `pwd`/fd "
 > fdesc on /dev/fd type fdesc (local)
 
 Then you have to worry about whether the output from pwd is identical to
 the corresponding output from mount (e.g. if a directory got renamed, or
 in the presence of chroots or symlinks), and whether any characters in
 the directory name need to be quoted to protect them from grep or the
 shell.
 
 > Anyway, sysinst.fs for atari seems to have some free space
 > so adding df(1) into it might be safer for netbsd-5 branch
 > because changes against MAKEDEV.tmpl affects all ports
 > and crossbuild environments.
 
 Then you have to check whether any other ports also need df to be added
 to their install file systems.
 
 If you are afraid of having MAKEDEV.tmpl revision 1.118 pulled up, then
 the simplest change for netbsd-5 (assuming that none of the ports mounts
 fdesc during installation) is simply to ignore the stderr output from df
 like this:
 
 --- MAKEDEV.tmpl        29 Nov 2008 20:44:51 -0000      1.113.2.5
 +++ MAKEDEV.tmpl        3 Jan 2009 09:53:09 -0000
 @@ -479,7 +479,7 @@
 
         # Check if we have fdesc mounted
         if [ -d fd ]; then
 -               case "$(df fd)" in
 +               case "$(nooutput -2 df fd)" in
                 *fdesc*)        nofdesc=false;;
                 *)              nofdesc=true;;
                 esac
 
 --apb (Alan Barrett)
 


Home | Main Index | Thread Index | Old Index