Subject: Re: kern/1781: 'magic' symbolic link expansion
To: None <gnats-bugs@NetBSD.ORG, cgd@NetBSD.ORG>
From: John Kohl <>
List: netbsd-bugs
Date: 11/23/1995 09:21:43
>>>>> "CGD" == Chris G Demetriou <cgd@NetBSD.ORG> writes:

CGD> 	Expansion of 'special' strings in symlinks into system-specific
CGD> 	values is a very useful feature in some situations, like:

CGD> 		(2) when trying to mount root from a CD-ROM that
CGD> 		    contains binaries for several architectures.

CGD> 	NetBSD currently has no such facility, and, because of the
CGD> 	problems with doing multiple-architecture CD-ROMs, it arguably
CGD> 	should.  I've implemented solution that enables "magic"
CGD> 	symlink expansion on a per-file system basis.  They are enabled
CGD> 	by mounting a file system with the 'magiclinks' mount option,
CGD> 	which sets the MNT_MAGICLINKS mount flag.

The CD-ROM issue might be handled by using the special name feature in
the Rock Ridge specification which allows for a component of a symlink
target pathname to be replaced by the "hostname".

On the face of it, this seems like quite a silly feature: how can you
predict anything useful about the end-user's machine's name when you
create a RRIP CD-ROM?  (About the only thing you could hope for is that
a hostname-relative symlink to someplace _else_ in the mounted file
system hierarchy might make some sense).

If you replace "hostname" with "machine executable format name", then
this magic symlink component becomes much more useful.

(RRIP also a neat construct for volume-relative symlinks that magically
point to some path rooted at the CD-ROM moint point)

Another alternative would be to provide alternate volume descriptors on
the CD-ROM, tweak the mount code a bit to find a "best" match among
them, and then provide separate name spaces for each of the
architectures (sharing the file storage for shared files, of course).