summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1999-01-26 04:13:03 +0000
committerjkh <jkh@FreeBSD.org>1999-01-26 04:13:03 +0000
commit894f767f8025399cb24aae12ef2844503148988b (patch)
tree780697ac5bf226ee922c8ffca8e4dca488995db3 /tools
parentd4b046f17676f0e87b2a32e715ba3abd7dbeece5 (diff)
downloadFreeBSD-src-894f767f8025399cb24aae12ef2844503148988b.zip
FreeBSD-src-894f767f8025399cb24aae12ef2844503148988b.tar.gz
1. Properly chflags libraries before moving (otherwise they don't).
2. Add my helper script for upgrades; not enabled yet.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tools/upgrade/doupgrade.sh78
-rwxr-xr-xtools/tools/upgrade/move_aout_libs.sh5
2 files changed, 82 insertions, 1 deletions
diff --git a/tools/tools/upgrade/doupgrade.sh b/tools/tools/upgrade/doupgrade.sh
new file mode 100755
index 0000000..df15840
--- /dev/null
+++ b/tools/tools/upgrade/doupgrade.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+# Simple helper script for upgrade target.
+
+# Expects MACHINE to be passed in with the environment, the "pass number"
+# as the first argument the name of the file to leave its droppings in
+# as the second. CURDIR is also passed in the environment from ${.CURDIR}
+
+PASS=$1
+CONF=$2
+
+cd ${CURDIR}/sys/${MACHINE}/conf
+
+# Create kernel configuration file for pass #1
+if [ $PASS -eq 1 ]; then
+ echo "The following files are in ${CURDIR}/sys/${MACHINE}/conf:"; echo
+ ls -C
+ echo; echo -n "Which config file do you wish to use? [GENERIC] "
+ read answer
+ if [ -z "${answer}" ]; then
+ KERN=GENERIC
+ else
+ KERN="${answer}"
+ fi
+ if [ ! -f ${KERN} ]; then
+ KERN=GENERIC
+ fi
+ if [ ! -f ${KERN}.bkup ]; then
+ cp ${KERN} ${KERN}.bkup
+ fi
+ sed -e 's/^device.*sc0.*$/ \
+controller atkbdc0 at isa? port IO_KBD tty \
+device atkbd0 at isa? tty irq 1 \
+device vga0 at isa? port ? conflicts \
+device sc0 at isa? tty \
+pseudo-device splash \
+/' -e 's/sd\([0-9]\)/da\1/' -e 's/st\([0-9]\)/sa\1/' < ${KERN}.bkup > ${KERN}
+
+ if [ -r /dev/wd0a ]; then
+ ROOTDEV=wd0
+ else
+ ROOTDEV=sd0
+ fi
+ echo -n "What is your boot device (e.g. wd0 or sd0)? [${ROOTDEV}] "
+ read answer
+ if [ -n "${answer}" ]; then
+ ROOTDEV="${answer}"
+ fi
+ echo "KERNEL=${KERN}" > ${CONF}
+ echo "ROOTDEV=${ROOTDEV}" >> ${CONF}
+ if ! file /kernel | grep -q ELF; then
+ echo "NEWBOOT=YES" >> ${CONF}
+ fi
+fi
+
+# Build and install kernel as pass #2
+if [ $PASS -eq 2 -a -f ${CONF} ]; then
+ . ${CONF}
+ if [ "x${NEWBOOT}" = "xYES" ]; then
+ echo "--------------------------------------------------------------"
+ echo " Installing new boot blocks"
+ echo "--------------------------------------------------------------"
+ if [ ! -f /boot/loader ]; then
+ (cd ${CURDIR}/lib/libstand; make obj; make -B depend all install)
+ (cd ${CURDIR}/sys/boot; make obj; make -B depend all install)
+ fi
+ if ! disklabel -B ${ROOTDEV}; then
+ echo "Installation of new boot blocks failed! Please correct"
+ echo "this manually BEFORE you reboot your system!"
+ exit 1
+ fi
+ fi
+ echo "--------------------------------------------------------------"
+ echo " Building an elf kernel for ${KERNEL} using the new tools"
+ echo "--------------------------------------------------------------"
+ config -r ${KERNEL}
+ cd ${CURDIR}/sys/compile/${KERNEL} && make -B depend -DFORCE all install
+fi
diff --git a/tools/tools/upgrade/move_aout_libs.sh b/tools/tools/upgrade/move_aout_libs.sh
index 1a1b906..87e20ba 100755
--- a/tools/tools/upgrade/move_aout_libs.sh
+++ b/tools/tools/upgrade/move_aout_libs.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: move_aout_libs.sh,v 1.1 1998/09/09 05:28:18 jb Exp $
+# $Id: move_aout_libs.sh,v 1.2 1998/09/16 17:42:53 phk Exp $
#
# Search for a.out libraries and move them to an aout subdirectory of
# the elf library directory.
@@ -50,6 +50,7 @@ move_file ( )
done
if test $answer = "y"; then
echo Deleting $file
+ chflags noschg $file
rm $file
else
echo "You need to move $file out of $dir because that's an elf directory"
@@ -62,6 +63,7 @@ move_file ( )
done
if test $answer = "y"; then
echo Overwriting $dir/aout/$fname with $file
+ chflags noschg $file
mv $file $dir/aout/$fname
ldconfig -R
else
@@ -70,6 +72,7 @@ move_file ( )
fi
else
echo Move $fname from $dir to $dir/aout
+ chflags noschg $file
mv $file $dir/aout/$fname
ldconfig -R
fi
OpenPOWER on IntegriCloud