mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
kernel install script (missed in previous commit)
This commit is contained in:
parent
9fe7600bbe
commit
5211d26f0b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=156437
43
release/scripts/kernels-install.sh
Normal file
43
release/scripts/kernels-install.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/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+cut?
|
||||
tn=`echo ${CONFIG} | tr 'A-Z' 'a-z' | cut -c1-8`
|
||||
cat $tn.?? | tar --unlink -xpzf - -C ${DESTDIR:-/}
|
||||
else
|
||||
echo "Installation of $CONFIG kernel distribution not done."
|
||||
fi
|
Loading…
Reference in New Issue
Block a user