svn commit: r314693 - head/usr.sbin/rmt

Baptiste Daroussin bapt at freebsd.org
Sun Mar 5 16:54:34 UTC 2017


On Sun, Mar 05, 2017 at 08:26:32AM -0800, Rodney W. Grimes wrote:
> Moved thread to -hackers for a quick discussion.
> 
> > On Sun, Mar 05, 2017 at 05:19:28AM -0800, Rodney W. Grimes wrote:
> > > -- Start of PGP signed section.
> > > > On Sun, Mar 05, 2017 at 04:09:18AM +0000, Rodney W. Grimes wrote:
> > > > > Author: rgrimes
> > > > > Date: Sun Mar  5 04:09:18 2017
> > > > > New Revision: 314693
> > > > > URL: https://svnweb.freebsd.org/changeset/base/314693
> > > > > 
> > > > > Log:
> > > > >   Change /etc/rmt symlink from absolute to relative path,
> > > > >   correcting the mistake made in r6499
> > > > >   
> > > > >   Approved by:	grehan
> > > > >   MFC after:	1 week
> > > > > 
> > > > > Modified:
> > > > >   head/usr.sbin/rmt/Makefile
> > > > > 
> > > > > Modified: head/usr.sbin/rmt/Makefile
> > > > > ==============================================================================
> > > > > --- head/usr.sbin/rmt/Makefile	Sun Mar  5 04:02:47 2017	(r314692)
> > > > > +++ head/usr.sbin/rmt/Makefile	Sun Mar  5 04:09:18 2017	(r314693)
> > > > > @@ -7,6 +7,6 @@ MAN=	rmt.8
> > > > >  # called from /usr/src/etc/Makefile
> > > > >  etc-rmt:
> > > > >  	rm -f ${DESTDIR}/etc/rmt
> > > > > -	ln -s ${BINDIR}/rmt ${DESTDIR}/etc/rmt
> > > > > +	ln -s ..${BINDIR}/rmt ${DESTDIR}/etc/rmt
> > > > 
> > > > I think this should be ${INSTALL_RSYMLINK} ${BINDIR}/rmt ${DESTDIR}/etc/rmt
> > > 
> > > find /usr/src | xargs grep INSTALL_RSYM
> > > (no results)
> > > 
> > > Sorry, no prior work does this, perhaps once I get done sweeping the
> > > absolutes out of the tree (about 10 or 15 IIRC) a pass can be made to
> > > sweep all ln -s out and propage this internal bsd.lib.mk function out
> > > to the rest of the source tree?
> > 
> > There is also no Makefiles that do ls -sf directly beside that one.
> Unless I have missed a commit:
> ./crypto/openssh/contrib/cygwin/Makefile:       cd $(DESTDIR)$(mandir)/man1 && ln -s ssh.1.gz slogin.1.gz
This is withing contrib hence not used to build

> ./usr.sbin/sendmail/Makefile:   ln -sf ${.ALLSRC} ${.TARGET}
This is different this is a built time

> ./usr.sbin/rmt/Makefile:        ln -s ${BINDIR}/rmt ${DESTDIR}/etc/rmt

This one is the one we are speaking about :)
> ...
> A summary is there are 50 instances of ln -sf,  28 other variants of ln -s,
> and 5 ln -fs.  I did not search for other permutaions of ln and s f options.
> 
> 
> > INSTALL_RSYMLINK has exactly be done to be use everywhere it is needed. (I wrote
> > it for that exact reason :))
> 
> Wonderful!!  I'll investigate a sweep to finish implementing this tree wide
> in my spare time....  I notice that SYMLINKS= is hard coded to use
> INSTALL_SYMLINKS so that can't be used to fix some of these.
> How would you propose I proceed in that area??

Thank you
> 
> And investigation into using INSTALL_RSYMLINK in SYMLINKS= should be done,
> I can not think of a reason when you DONT  want a relative link installed,
> but I may be missing some new odd use for symlinks by the FreeBSD base
> system.

Actually when I implemented INSTALL_RSYMLINK the goal I was targetting was
having all the library built in a way we have by default a usable sysroot.

Then I planned to sweep on all other use cases but somehow never did it.

> > > 
> > > find /usr/share/mk/ | xargs grep INSTALL_RSYM
> > > /usr/share/mk/bsd.own.mk:INSTALL_RSYMLINK?=     ${INSTALL} ${RSYMLINK}
> > > /usr/share/mk/bsd.lib.mk:       ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
> > > /usr/share/mk/bsd.lib.mk:       ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
> > > /usr/share/mk/bsd.lib.mk:       ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
> > > /usr/share/mk/bsd.lib.mk:       ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
> > > 
> > > This is called from within bsd.lib.mk only, do we want to use this for
> > > all symbolics links in the source tree?  If so I would of though the
> > > person adding this functionality to the .mk files would of made
> > > a tree sweeping looking for that and making those changes as well.
> > 
> > When I did it only bsd.lib.mk was using it iirc
> 
> And that appears to still be the case.
> 
> > > > The rm -f before can then be removed, the symlink will be relative and the
> > > > METALOG will be respected 
> > > 
> > > METALOG?  The only documentation I can find on this seems to be part of
> > > src/tootls/tools/makeroot.8.
> > > 
> > > It appears that something in Makefile.inc uses it and there are references
> > > to it in etc/Makefile.
> > > 
> > > Where is this METALOG documented?  
> > 
> > It is really badly documented and should be :( it is a mtree file that is
> > generated when built is done via -DNO_ROOT for the purpose of being able to
> > generate disk with makefs as a user
> > 
> > I have reused it for packaging base.
> > 
> > This was designed IIRC by adrian and brooks iirc.
> > 
> > Embedded people relies a lot on it.
> > Everything not going though the install(1) command is not tracked that is why
> > this is an issue.
> 
> I guess then that these 83 things I have found are not so important to them?

Having an embedded system using /etc/rmt is probably something you don't find
often :)

That said, it is very import for packaging base.
> 
> Lets take this to -hackers, discuss it where it should be, and get it fixed.

Best regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20170305/9e021414/attachment.sig>


More information about the freebsd-hackers mailing list