summaryrefslogtreecommitdiff
path: root/release/scripts
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>2006-03-08 18:03:10 +0000
committercvs2svn <cvs2svn@FreeBSD.org>2006-03-08 18:03:10 +0000
commit90645b6d16e6bc34778591198c13d241d5fa252a (patch)
tree3facd6a5d08ed6d944231fa25835a4a71e3a2061 /release/scripts
parent390c7cf2c352462db7d7769f5b23cb5107fc1fba (diff)
Notes
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/kernels-install.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/release/scripts/kernels-install.sh b/release/scripts/kernels-install.sh
new file mode 100644
index 000000000000..47d91a7d4c6d
--- /dev/null
+++ b/release/scripts/kernels-install.sh
@@ -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