/dev/null & zero inside chroot for make release

Kostik Belousov kostikbel at gmail.com
Mon May 17 10:26:41 UTC 2010


On Mon, May 17, 2010 at 12:20:07PM +0200, Bernd Walter wrote:
> On Sat, May 15, 2010 at 05:32:41PM +0200, Tjado M?cke wrote:
> > 
> > > Thanks for trying to help :-)  But this is in Wrong.
> > > Line 4 on that page:
> > > 	Last updated: 2005-08-11
> > > 5 years later, FreeBSD-8.0 has via ls -l /dev/null
> > > crw-rw-rw-  1 root  wheel    0,  31 May 15 14:17 /dev/null
> > > so both major & minor numbers have changed, command now would be
> > > 	mknod dev/null c 0 31
> > > which I already posted in my original Thu, 13 May 2010 19:44:58 +0200
> > > as having tried, but not good enough.
> > >
> > > As I posted Fri, 14 May 2010 21:59:23 +0200 (but you may not have
> > > seen when you posted)
> > >
> > >   
> > 
> > Hm... i did this on 7.2 because chrooted scponly shell with WinSCP
> > support needs it. In this case it works...
> > But I'm wrong because the dev/null with my nod numbers doesn't work
> > correctly and WinSCP looks only if this file is there :D
> 
> On my 7.0-stable I have:
> [192]cicely7> ls -al /dev/null
> crw-rw-rw-  1 root  wheel    0,  14 May 17 12:11 /dev/null
> 
> You may very well have you HDD under 2,2 and having any innocent program
> writing it's output to it...
> Fortunately it takes many devnodes until 2,2 is getting used.

For very long time, the following two statements are true:
- char devices only have magic property of being a door to the device
  drivers when living on devfs mount point. Character devices on UFS or
  any other non-devfs mounts do not provide access to the physical devices.
- major and minor numbers of devfs nodes, as displayed by ls, are not
  persistent across reboot.

mknod on devfs is only useful to unhide the rm'ed node.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20100517/af328667/attachment.pgp


More information about the freebsd-hackers mailing list