1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00
freebsd/release/scripts/kernels-install.sh
Ruslan Ermilov 710989358e Stop cutting the tarball names to eight symbols. This makes
it possible to e.g. distribute kernels with config names larger
than eight symbols, without the clash.  Previousy, LALALALA
and LALALALA-SMP would be the same tarball.  (I think this
comes from the old days where tarballs were put on the MS-DOS
formatted diskettes.)

MFC after:	3 days
2006-09-08 19:54:37 +00:00

44 lines
951 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
if [ "`id -u`" != "0" ]; then
echo "Sorry, this must be done as root."
exit 1
fi
if [ $# -lt 1 ]; then
echo "You must specify which kernel to extract."
exit 1
fi
CONFIG=$1
BOOT=${DESTDIR}/boot
KERNEL=$BOOT/$CONFIG
if [ -d $KERNEL ]; then
echo "You are about to extract the $CONFIG kernel distribution into $KERNEL - are you SURE"
echo -n "you want to do this over your installed system (y/n)? "
read ans
else
# new installation; do not prompt
ans=y
fi
if [ "$ans" = "y" ]; then
if [ -d $KERNEL ]; then
sav=$KERNEL.sav
if [ -d $sav ]; then
# XXX remove stuff w/o a prompt
echo "Removing existing $sav"
rm -rf $sav
fi
echo "Saving existing $KERNEL as $sav"
mv $KERNEL $sav
fi
# translate per Makefile:doTARBALL XXX are we sure to have tr?
tn=`echo ${CONFIG} | tr 'A-Z' 'a-z'`
cat $tn.?? | tar --unlink -xpzf - -C $BOOT
else
echo "Installation of $CONFIG kernel distribution not done."
fi