Date: Tue, 15 Oct 2002 02:35:46 +0000 (GMT) From: Daniel Flickinger <attila@hun.org> To: Steve Kargl <sgk@troutmask.apl.washington.edu> Cc: Kris Kennaway <kris@obsecurity.org>, FreeBSD 5.0-CURRENT <current@freebsd.org> Subject: Re: [AGAIN] ./usr.sbin/sysinstall/makedevs.c problem Message-ID: <20021015023546.in9343125@hun.org> In-Reply-To: <20021014052411.GA11722@troutmask.apl.washington.edu> References: <20021013191535.ND7D66190@hun.org> <20021014011949.qdTj11904@hun.org> <20021014034139.HeM817047@hun.org> <20021014040129.GC29903@xor.obsecurity.org> <20021014045110.GA11554@troutmask.apl.washington.edu> <20021014051058.GA32699@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
A stale .depend file is anathema... as I said:
the whole issue begs the question as to why 'make
buildworld', which normally cleans up before it
takes off, does not handle this for an update, and
it does on the rest of the 3000+ other executables?
IOW, there is no reason that orphaned .depend should be
left, or not updated, etc, in ./usr.sbin/sysinstall as a
new buildworld comes through. buildworld has always
literally done a complete recompile and link of the
system files.
'make buildworld' used to go down through the Makefile
chain at initiation with the objective of cleaning, with
whatever it takes; for this purpose, each sub-Makefile
is required to specify what it takes to be clean.
'sysinstall' may be an isolated case --or it may be that
others have not surfaced.
Send: Sun, 13 Oct 2002 22:00:58 -0700 by Steve Kargl
+ What are your EXACT steps for building?.
Since I have enough horsepower (Tyan 2642 SMP 1.2G with
160MB/s 10,000 RPM SCSIs) an extra minute to really
flush the tree is irrelevant, I modified my world and
kernel script files accordingly to leave even less
margin of error.
The scripts follow.
Note that I modify sys/conf/newvers.sh so that you can
insert the date of the source code slice in the kernel
ID line for vers.c, rather than just inserting the date
when built which is rather meaningless (the system will
show today's date on a kernel that is years old; it
doesn't discriminate).
Obviously, you could blow away the date code prompts
and use generic file names for each stage.
-------- buildworld --------
#!/bin/bash
#
# 'buildworld' shell command
#
# rev 2a09 1600 attila
TFLG="-j 4 -k -s"
TDEF="NO_WERROR=YES COMPAT4X=YES TARGET_ARCH=i386 __MAKE_CONF=/dev/null"
TOUT="NOGAMES=YES NO_FORTRAN=YES NO_SENDMAIL=YES NO_MAILWRAPPER=YES NOUUCP=YES"
process() {
make -j 16 -k -s cleandir >/dev/null 2>&1
make -j 16 -k -s cleandepend >/dev/null 2>&1
date >${CDATE}.installincludes.${RDATE} 2>&1
make -k -s $TDEF installincludes >${CDATE}.installincludes.${RDATE} 2>&1
date >${CDATE}.buildworld.${RDATE} 2>&1
make $TFLG $TDEF $TOUT buildworld >${CDATE}.buildworld.${RDATE}
}
read -p "Enter current date code as \"ymdd.hhmm\": " CDATE
if [ -z "${CDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 3
fi
read -p "Enter release date code as \"ymdd.hhmm\": " RDATE
if [ -z "${RDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 4
fi
process &
-------- installworld --------
#!/bin/bash
#
# 'installworld' shell command
#
TFLG="-j 4 -k -s"
TDEF="NO_WERROR=YES TARGET_ARCH=i386 __MAKE_CONF=/dev/null"
TOUT="NOGAMES=YES NO_FORTRAN=YES NO_SENDMAIL=YES NO_MAILWRAPPER=YES NOGAMES=YES NOUUCP=YES"
cleanup() {
rm -rf ${DESTDIR}/usr/include.old
mv -f ${DESTDIR}/usr/include ${DESTDIR}/usr/include.old
chflags -R noschg ${DESTDIR}/usr/lib
if [ ! -d ${DESTDIR}/usr/lib/old ]; then
mkdir ${DESTDIR}/usr/lib/old
fi
if [ ! -d ${DESTDIR}/usr/lib/compat ]; then
mkdir ${DESTDIR}/usr/lib/compat
fi
mv -f ${DESTDIR}/usr/lib/lib*.so.* ${DESTDIR}/usr/lib/compat
mv -f ${DESTDIR}/usr/lib/*.o ${DESTDIR}/usr/lib/old
mv -f ${DESTDIR}/usr/lib/lib*.a ${DESTDIR}/usr/lib/old
mv -f ${DESTDIR}/usr/lib/lib*.so ${DESTDIR}/usr/lib/old
}
# waste sendmail
stomp() {
cd ${DESTDIR}/usr/libexec
rm -f sendmail/*
cd ${DESTDIR}/usr/bin
rm -f mailq newaliases
ln -s ${DESTDIR}/usr/sbin/sendmail mailq
ln -s ${DESTDIR}/usr/sbin/sendmail newaliases
cd ${DESTDIR}/usr/sbin
rm -f sendmail mailwrapper
ln -s postmail sendmail
}
process() {
cleanup >${CDATE}.installworld.${RDATE} 2>&1
make $TFLG $TDEF $TOUT installworld >>${CDATE}.installworld.${RDATE} 2>&1
stomp >>${CDATE}.installworld.${RDATE} 2>&1
}
read -p "Enter current date code as \"ymdd.hhmm\": " CDATE
if [ -z "${CDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 3
fi
read -p "Enter release date code as \"ymdd.hhmm\": " RDATE
if [ -z "${RDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 4
fi
read -p "Enter non-standard destination directory or RET: " DTARGET
if [ -s "${DTARGET}" ] ; then
export DESTDIR=${DTARGET}
fi
process &
-------- buildkernel --------
#!/bin/bash
#
# 'buildkernel' shell command
#
# rev 2a09 1600 attila
TFLGS="-j 4 -k -s"
TDEFS="NO_WERROR=YES COMPAT4X=YES TARGET_ARCH=i386 __MAKE_CONF=/dev/null"
TKERN="KERNCONF=hun KERNEL=hun INSTKERNNAME=kernel"
cleanup() {
cd /usr/obj/usr/src/sys/hun
cwd=`pwd`
base=`basename $cwd`
echo "cleaning kernel: $cwd"
if [ "X${base}" = "Xhun" ] ; then
mv -f version .version
find * -type d -exec rm -rf {} \;
rm -f *
mv -f .version version
fi
}
process() {
make $TFLGS $TDEFS $TKERN buildkernel >>${CDATE}.buildkernel.${RDATE} 2>&1
}
read -p "Enter current date code as \"ymdd.hhmm\": " CDATE
if [ -z "${CDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 3
fi
read -p "Enter release date code as \"ymdd.hhmm\": " RDATE
if [ -z "${RDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 4
fi
export SDATE=""
read -p "Enter date for MOTD as \"dd mmm yyyy hhmm GMT\": " SDATE
if [ -z "${SDATE}" ] ; then
printf "! date required: enter date in format \"10 Oct 2002 1200 GMT\"\n"
exit 5
fi
dchk=`grep SDATE sys/conf/newvers.sh | sed -n 's/.*SDATE.*/SDATE/p'`
if [ "X${dchk}" != "XSDATE" ]; then
patch < .date-patch >${1}.buildkernel.${2} 2>&1
fi
cleanup && process &
-------- installkernel --------
#!/bin/bash
#
# attila
#
# 'installkernel' shell command
# rev 2a09 1600 attila
TFLGS="-k -s"
TDEFS="TARGET_ARCH=i386 __MAKE_CONF=/dev/null"
TKERN="KERNCONF=hun KERNEL=hun INSTKERNNAME=kernel"
process() {
make $TFLGS $TDEFS $TKERN installkernel >${CDATE}.installkernel.${RDATE} 2>&1
}
read -p "Enter current date code as \"ymdd.hhmm\": " CDATE
if [ -z "${CDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 3
fi
read -p "Enter release date code as \"ymdd.hhmm\": " RDATE
if [ -z "${RDATE}" ] ; then
printf "! date required: enter date in format \"ymdd.hhmm\"\n"
exit 4
fi
process &
-------- patch file --------
*** sys/conf/newvers.sh.orig Fri Mar 2 16:52:13 2001
--- sys/conf/newvers.sh Mon Oct 7 23:13:41 2002
***************
*** 85,91 ****
fi
touch version
! v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
cat << EOF > vers.c
$COPYRIGHT
char sccspad[32 - 4 /* sizeof(sccs) */] = { '\\0' };
--- 85,91 ----
fi
touch version
! v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=${SDATE}
cat << EOF > vers.c
$COPYRIGHT
char sccspad[32 - 4 /* sizeof(sccs) */] = { '\\0' };
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021015023546.in9343125>
