Fix handling of the 'custom' directory symlink.

Properly abstract the PicoBSD build directory instead of depending too much
on pwd's and relative paths.

Submitted by:	 John Baldwin <jobaldwi@vt.edu>
This commit is contained in:
Doug White 1999-10-11 20:52:50 +00:00
parent 645682fd40
commit 5c52794973
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52141
2 changed files with 14 additions and 9 deletions

View file

@ -33,6 +33,10 @@ set -e
. ../Version
# support symbolically linked custom directory
BUILDDIR=`pwd`
export BUILDDIR
# assign default values to variables.
set_defaults() {
TYPE=${TYPE:-dial} # PicoBSD type (isp, router, net, custom, ...
@ -90,7 +94,7 @@ main() {
# Build the kernel, if necessary
echo ""
echo "-> Checking if we have to build the PICOBSD kernel..."
(cd ../${TYPE}; make -f ../build/Makefile.conf )
(cd ../${TYPE}; make -f ${BUILDDIR}/Makefile.conf )
echo ""
./stage1
@ -122,6 +126,7 @@ check_for_old_custom() {
CUSTOMLINK=`ls -l ../custom | awk -F\> '{ print $2 }' | awk '{ print $1 }'`
if dialog --title "Custom directory setup" --yesno "A custom configuration\n ${CUSTOMLINK}\nalready exists. Would you like to use it?" 7 50 ; then
KEEP_CUSTOM=yes
CUST_DIR=${CUSTOMLINK}
else
KEEP_CUSTOM=no
fi
@ -337,7 +342,7 @@ WARNING: the contents of the floppy will be permanently erased!\n\
\n\
Your options:\n\
* ^C or [Cancel] to abort,\n\
* Enter to install \"${FILENAME}\",\n\
* Enter to install \"picobsd.bin\",\n\
* name of other file to install.\n\
" 20 70 2> ${RISU}
if [ "$?" = "0" ]; then

View file

@ -92,7 +92,7 @@ fi
MFS_RC=floppy.tree/etc/mfs.rc
if [ ! -f ${MFS_RC} ] ; then # no private version. use generic mfs.rc
MFS_RC=../${MFS_RC}
MFS_RC=${BUILDDIR}/../${MFS_RC}
fi
if [ "${INIT}" = "oinit" ] ; then
cat ${MFS_RC} | sed -e "s/@VER@/${VER}/g" > /mnt/etc/oinit.rc
@ -101,7 +101,7 @@ else
if [ -f floppy.tree/etc/mfs.login.conf ] ; then
cp floppy.tree/etc/mfs.login.conf /mnt/etc/login.conf
else
cp ../floppy.tree/etc/mfs.login.conf /mnt/etc/login.conf
cp ${BUILDDIR}/../floppy.tree/etc/mfs.login.conf /mnt/etc/login.conf
fi
cat lang/README.${LANGUAGE} | sed -e "s/@VER@/${VER}/g" > /mnt/README
fi
@ -178,7 +178,7 @@ mount /dev/vn0c /mnt
echo "-> Populating floppy filesystem..."
### copy floppy tree excluding private files.
excl=../${TYPE}/floppy.tree.exclude
excl=${BUILDDIR}/../${TYPE}/floppy.tree.exclude
if [ -f ${excl} ] ; then
excl="--exclude-from ${excl}"
echo "Exclude following files from ${excl}:\n==="
@ -187,17 +187,17 @@ if [ -f ${excl} ] ; then
else
excl=""
fi
(cd ../floppy.tree ; tar -cf - ${excl} . ) | (cd /mnt ; tar xvf - )
(cd ${BUILDDIR}/../floppy.tree ; tar -cf - ${excl} . ) | (cd /mnt ; tar xvf - )
if [ -d ../${TYPE}/floppy.tree ] ; then
if [ -d ${BUILDDIR}/../${TYPE}/floppy.tree ] ; then
echo "-> update with private files:"
(cd ../${TYPE}/floppy.tree ; tar cf - . ) | (cd /mnt ; tar xvf - )
(cd ${BUILDDIR}/../${TYPE}/floppy.tree ; tar cf - . ) | (cd /mnt ; tar xvf - )
fi
files="hosts motd"
echo "-> Copying language dependent files: ${files} -> /mnt/etc ..."
for i in ${files} ; do
cat ../${TYPE}/lang/${i}.${LANGUAGE} | \
cat ${BUILDDIR}/../${TYPE}/lang/${i}.${LANGUAGE} | \
sed -e "s/@VER@/${VER}/g" > /mnt/etc/${i}
done