Once upon a time, Arjan van de Ven <arjan(a)infradead.org> said:
On Tue, 2006-01-31 at 20:48 -0500, Dave Jones wrote:
> > Another though: why the "find | while ; do hardlink"? You should
just
> > be able to do:
> >
> > if [ -x /usr/sbin/hardlink ] ; then
> > /usr/sbin/hardlink /usr/src/kernels/*FC*
> > fi
> >
> > The post script is forking hardlink over 5000 times as well as causing
> > thousands of repeated directory lookups by find and the shell (that
> > hardlink then has to do anyway), instead of just letting one run of
> > hardlink do its job (it should recurse just fine).
>
> I've often wondered why it was written that way too.
> Arjan, do you recall?
if you have too many kernels, the direct commandline approach overflows
the maximum length.
The current script has exactly the same problem then:
if [ -x /usr/sbin/hardlink ] ; then
pushd /usr/src/kernels/2.6.15-1.1884_FC5-i686 > /dev/null
/usr/bin/find . -type f | while read f; do hardlink -c /usr/src/kernels/*FC*/$f $f ;
done
popd > /dev/null
fi
The "*FC*" bit is in there as well; there is no difference with what I
posted above.
If you want to avoid wildcards, just do:
if [ -x /usr/sbin/hardlink ] ; then
/usr/sbin/hardlink /usr/src/kernels
fi
and let anyone that installs their own kernel source under there get
hardlinked as well.
--
Chris Adams <cmadams(a)hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.