Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jul 1998 06:15:21 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        shigio@wafu.netgate.net (Shigio Yamaguchi)
Cc:        sbabkin@dcn.att.com, shigio@wafu.netgate.net, hackers@FreeBSD.ORG
Subject:   Re: Improvemnet of ln(1).
Message-ID:  <199807150615.XAA06392@usr06.primenet.com>
In-Reply-To: <199807141528.IAA18558@hub.freebsd.org> from "Shigio Yamaguchi" at Jul 15, 98 00:29:33 am

next in thread | previous in thread | raw e-mail | index | archive | help
> Do you mean a symbolic link including root directory is useless?
> You are right. My example was bad.
> 
> How about this example?
> 
> 	% ln -sr /usr/src/sys/kern/tty.c /usr/obj/usr/src/sys/kern/tty.c
> 	% ls -l !$
> 	lrwxrwxrwx  1 shigio  bin  33 Jul 14 23:56 /usr/obj/usr/src/sys/kern/tty.c ->
> 				../../../../../src/sys/kern/tty.c
> 
> This symbolic link is solved in the '/usr' subdirectory. So, you can mount
> /usr file system at any point.

#!/bin/sh
#
# A script that needs to make non-existant absolute symlinks
#

TARGET=$1
if test "x$1" = "x"
then
	echo "usage: mkbuild <target>" >&2
	exit 1
fi

cd /
# copy in the kernel so ps will work...
cp kernel ${TARGET}
# copy in the rest of the stuff to make the environment minimally functional
cp -R bin ${TARGET}
cp -R dev ${TARGET}
cp -R etc ${TARGET}
cp -R usr ${TARGET}
cd b
cp -R newsrc ${TARGET}/usr
cd ..
ln -s /usr/lib ${TARGET}/lib
# make a non-existant link to the newsrc kernel sources..
ln -s /usr/newsrc/sys /sys
# now enter into the isolated developement environment...
chroot ${TARGET} /bin/sh
exit 0



					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807150615.XAA06392>