1. Properly chflags libraries before moving (otherwise they don't).

2. Add my helper script for upgrades; not enabled yet.
This commit is contained in:
Jordan K. Hubbard 1999-01-26 04:13:03 +00:00
parent 1427370d8f
commit 8573fbf238
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43215
2 changed files with 82 additions and 1 deletions

View File

@ -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

View File

@ -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