]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - release/scripts/kernels-install.sh
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / release / scripts / kernels-install.sh
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 if [ "`id -u`" != "0" ]; then
7         echo "Sorry, this must be done as root."
8         exit 1
9 fi
10 if [ $# -lt 1 ]; then
11         echo "You must specify which kernel to extract."
12         exit 1
13 fi
14
15 CONFIG=$1
16 BOOT=${DESTDIR}/boot
17 KERNEL=$BOOT/$CONFIG
18
19 if [ -d $KERNEL ]; then
20         echo "You are about to extract the $CONFIG kernel distribution into $KERNEL - are you SURE"
21         echo -n "you want to do this over your installed system (y/n)? "
22         read ans 
23 else
24         # new installation; do not prompt
25         ans=y
26 fi
27 if [ "$ans" = "y" ]; then
28         if [ -d $KERNEL ]; then
29                 sav=$KERNEL.sav
30                 if [ -d $sav ]; then
31                         # XXX remove stuff w/o a prompt
32                         echo "Removing existing $sav"
33                         rm -rf $sav
34                 fi
35                 echo "Saving existing $KERNEL as $sav"
36                 mv $KERNEL $sav
37         fi
38         # translate per Makefile:doTARBALL XXX are we sure to have tr?
39         tn=`echo ${CONFIG} | tr 'A-Z' 'a-z'`
40         cat $tn.?? | tar --unlink -xpzf - -C $BOOT
41 else
42         echo "Installation of $CONFIG kernel distribution not done." 
43 fi