Re: Why from there? A rethink...

Riley Williams (rhw@bigfoot.com)
Fri, 15 May 1998 05:35:39 +0100 (BST)


Hi Albert.

>> 1. The full kernel source tarball DOES need to include the kernel
>> version number to prevent problems caused by old files that are
>> still lying round. This is the point that I was addressing in my
>> earlier plea.

> The version number is already included! See below...

>> Naturally, if somebody upgraded by installing the patches rather than
>> by grabbing a new kernel source tree tarball, they would be able to

> You ought to grab the bzip2 patch files to save bandwidth.
> If enough people do that, maybe the gzip files can be removed.

I provide a mirror of the Linux kernel tarballs and patches on the
JANET network that links UK academic institutions together because the
SunSite-UK mirror (also on JANET) just gets too busy to be reliable
during the day, and I only mirror the bz2 versions. So far, nobody has
been inconvenienced by that fact...

If you want to check this mirror out, have a look at...

Q> ftp://ftp.mirrors.ml.org/mirrors/Linux/Kernel/

>> I therefore repeat my plea: PLEASE PLEASE PLEASE use the FULL version
>> numbered base directory name in the full source tarballs. It would
>> also be appreciated if you could include the relevant symlink from
>> ./linux to ./linux-?.?.? to update that as well, but that isn't so
>> important...

> First draft (not tested) of a solution:

NOT good - amend it as shown and it should be OK though...

> #!/bin/sh
> #
> # Run this script in /usr/src/ to properly unpack a new Linux kernel.
> # Give it the archive name as an argument. Note that it is much better
> # to use patches, unless you get more than 15 versions behind.
> #
cd /usr/src
if [ -L linux ]; then
rm -f linux
else
mv linux linux-old.$RANDOM
fi
> BN=`basename $1 .tar.bz2`
> bunzip2 -cd $1 | tar xf -
> mv linux $BN
> ln -s $BN linux

Your "rm -fr linux" assumes that linux is indeed a SymLink and, whilst
it should be, the assumption just isn't safe. The modified version
will rename it, using a random number as the last part of the new
name, if such is not the case...

In addition, it's usually better to include any assumptions about the
current directory in the shellscript itself, hence my adding the
"cd /usr/src" above the if statement. This won't cause any problems
since the above will be started in a new shell, so won't affect your
current directory in the current shell...

I have to admit that the "basename" command is one I'd overlooked, but
given the above script, the situation should be much easier to
handle...

Best wishes from Riley.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu