2006-03-08 18:03:09 +00:00
|
|
|
#!/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
|
2006-08-28 08:06:21 +00:00
|
|
|
BOOT=${DESTDIR}/boot
|
2006-03-08 18:03:09 +00:00
|
|
|
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
|
2006-09-08 19:54:37 +00:00
|
|
|
# translate per Makefile:doTARBALL XXX are we sure to have tr?
|
|
|
|
tn=`echo ${CONFIG} | tr 'A-Z' 'a-z'`
|
2006-03-21 15:49:03 +00:00
|
|
|
cat $tn.?? | tar --unlink -xpzf - -C $BOOT
|
2006-03-08 18:03:09 +00:00
|
|
|
else
|
|
|
|
echo "Installation of $CONFIG kernel distribution not done."
|
|
|
|
fi
|