Yet another magic symlinks implementation

Pawel Worach pawel.worach at gmail.com
Mon Nov 6 01:12:00 UTC 2006


Mike Meyer wrote:
> In <454C55BD.000003.22283 at webmail11.yandex.ru>, Andrey V. Elsukov <bu7cher at yandex.ru> typed:
>> Hi, All!
>>
>> I've ported NetBSD magic symlinks implementation to FreeBSD.
>> The description of magiclinks can been found here:
>> http://www.daemon-systems.org/man/symlink.7.html
> 
> This kind of thing has been showing up in Unix variants for a couple
> of decades, but none have have ever caught on. Can you provide some
> examples of what this is being used for?
> 

An interesting use for this is found in an commercial embedded platform 
where a system image is selected with a @sys variable symlink. This is 
used for live upgrades (and fast backouts or test boots) of the platform 
where a new image is extracted from a .tgz to /image/$new_version and 
the @sys variable is likely updated by the boot loader for the next boot.

# ls -l /usr
lrwxr-xr-x  1 root  wheel  8 Oct  3 13:32 /usr -> @sys/usr
# cd /usr
# pwd
/image/OS-VERSION-BUILD-ID/usr

Here a sysctl/kenv variable defines the @sys link target
kern:@sys = image/OS-VERSION-BUILD-ID

Regards
-- 
Pawel


More information about the freebsd-hackers mailing list