2001-01-31 22:58:39 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
2001-04-08 23:09:21 +00:00
|
|
|
|
2003-02-01 22:12:50 +00:00
|
|
|
set -ex
|
1996-01-08 22:13:50 +00:00
|
|
|
|
1996-01-21 17:24:54 +00:00
|
|
|
export BLOCKSIZE=512
|
1996-01-08 22:13:50 +00:00
|
|
|
|
2003-03-20 23:46:22 +00:00
|
|
|
MACHINE=${1:+"-m $1"}; shift
|
1999-01-05 03:44:08 +00:00
|
|
|
FSIMG=$1; shift
|
1996-01-08 22:13:50 +00:00
|
|
|
RD=$1 ; shift
|
|
|
|
MNT=$1 ; shift
|
|
|
|
FSSIZE=$1 ; shift
|
|
|
|
FSPROTO=$1 ; shift
|
|
|
|
FSINODE=$1 ; shift
|
|
|
|
FSLABEL=$1 ; shift
|
|
|
|
|
2002-11-04 00:50:01 +00:00
|
|
|
#
|
|
|
|
# We don't have any bootblocks on ia64. Note that -B implies -r,
|
|
|
|
# so we have to specifically specify -r when we don't have -B.
|
|
|
|
# disklabel fails otherwise.
|
|
|
|
#
|
2003-02-01 22:12:50 +00:00
|
|
|
if [ -f "${RD}/trees/base/boot/boot" ]; then
|
2003-03-20 23:46:22 +00:00
|
|
|
BOOT="-B -b ${RD}/trees/base/boot/boot"
|
2003-02-01 22:12:50 +00:00
|
|
|
elif [ -f "${RD}/trees/base/boot/boot1" ]; then
|
2003-03-20 23:46:22 +00:00
|
|
|
BOOT="-B -b ${RD}/trees/base/boot/boot1"
|
2003-02-01 22:12:50 +00:00
|
|
|
if [ -f "${RD}/trees/base/boot/boot2" ]; then
|
2003-03-20 23:46:22 +00:00
|
|
|
BOOT="${BOOT} -s ${RD}/trees/base/boot/boot2"
|
2003-02-01 22:12:50 +00:00
|
|
|
fi
|
2002-11-04 00:50:01 +00:00
|
|
|
else
|
2003-03-20 23:46:22 +00:00
|
|
|
BOOT="-r"
|
2002-11-04 00:50:01 +00:00
|
|
|
fi
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
|
1996-01-21 17:24:54 +00:00
|
|
|
deadlock=20
|
|
|
|
|
2001-11-15 07:27:25 +00:00
|
|
|
dofs_vn () {
|
|
|
|
if [ "x$VNDEVICE" = "x" ] ; then
|
|
|
|
VNDEVICE=vn0
|
|
|
|
fi
|
|
|
|
u=`expr $VNDEVICE : 'vn\([0-9]*\)' || true`
|
|
|
|
VNDEVICE=vnn$u
|
|
|
|
|
|
|
|
rm -f /dev/*vnn*
|
|
|
|
mknod /dev/rvnn${u} c 43 `expr 65538 + $u '*' 8`
|
|
|
|
mknod /dev/rvnn${u}c c 43 `expr 2 + $u '*' 8`
|
|
|
|
mknod /dev/vnn${u} b 15 `expr 65538 + $u '*' 8`
|
|
|
|
mknod /dev/vnn${u}c b 15 `expr 2 + $u '*' 8`
|
|
|
|
|
|
|
|
while true
|
|
|
|
do
|
|
|
|
rm -f ${FSIMG}
|
|
|
|
|
|
|
|
umount /dev/${VNDEVICE} 2>/dev/null || true
|
|
|
|
umount ${MNT} 2>/dev/null || true
|
|
|
|
vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
|
|
|
|
|
|
|
|
dd of=${FSIMG} if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null
|
|
|
|
|
|
|
|
vnconfig -s labels -c /dev/r${VNDEVICE} ${FSIMG}
|
2003-03-31 12:29:31 +00:00
|
|
|
|
|
|
|
trap "umount ${MNT}; vnconfig -u /dev/r${VNDEVICE}" EXIT
|
|
|
|
|
2003-03-20 23:46:22 +00:00
|
|
|
disklabel -w ${BOOT} ${VNDEVICE} ${FSLABEL}
|
2003-02-26 10:51:28 +00:00
|
|
|
newfs -i ${FSINODE} -o space -m 0 /dev/r${VNDEVICE}c
|
2001-11-15 07:27:25 +00:00
|
|
|
|
|
|
|
mount /dev/${VNDEVICE}c ${MNT}
|
|
|
|
|
|
|
|
if [ -d ${FSPROTO} ]; then
|
|
|
|
(set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT})
|
|
|
|
else
|
|
|
|
cp -p ${FSPROTO} ${MNT}
|
|
|
|
fi
|
|
|
|
|
|
|
|
df -ki ${MNT}
|
|
|
|
|
|
|
|
set `df -ki ${MNT} | tail -1`
|
|
|
|
|
|
|
|
echo "*** Filesystem is ${FSSIZE} K, $4 left"
|
|
|
|
echo "*** ${FSINODE} bytes/inode, $7 left"
|
|
|
|
break;
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -f /dev/*vnn*
|
|
|
|
}
|
|
|
|
|
|
|
|
dofs_md () {
|
|
|
|
while true
|
|
|
|
do
|
1999-01-05 03:44:08 +00:00
|
|
|
rm -f ${FSIMG}
|
1996-01-08 22:13:50 +00:00
|
|
|
|
2001-01-31 22:58:39 +00:00
|
|
|
if [ "x${MDDEVICE}" != "x" ] ; then
|
|
|
|
umount /dev/${MDDEVICE} 2>/dev/null || true
|
|
|
|
umount ${MNT} 2>/dev/null || true
|
|
|
|
mdconfig -d -u ${MDDEVICE} 2>/dev/null || true
|
|
|
|
fi
|
1996-01-08 22:13:50 +00:00
|
|
|
|
1999-01-05 03:44:08 +00:00
|
|
|
dd of=${FSIMG} if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null
|
1996-01-08 22:13:50 +00:00
|
|
|
|
2001-01-31 22:58:39 +00:00
|
|
|
MDDEVICE=`mdconfig -a -t vnode -f ${FSIMG}`
|
|
|
|
if [ ! -c /dev/${MDDEVICE} ] ; then
|
2003-02-01 22:12:50 +00:00
|
|
|
echo "No /dev/$MDDEVICE" 1>&2
|
|
|
|
exit 1
|
2001-01-31 22:58:39 +00:00
|
|
|
fi
|
2003-03-31 12:29:31 +00:00
|
|
|
|
|
|
|
trap "umount ${MNT}; mdconfig -d -u ${MDDEVICE}" EXIT
|
|
|
|
|
2003-03-20 23:46:22 +00:00
|
|
|
disklabel ${MACHINE} -w ${BOOT} ${MDDEVICE} ${FSLABEL}
|
2001-11-20 20:06:21 +00:00
|
|
|
newfs -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE}c
|
1996-01-08 22:13:50 +00:00
|
|
|
|
2001-01-31 22:58:39 +00:00
|
|
|
mount /dev/${MDDEVICE}c ${MNT}
|
1996-01-08 22:13:50 +00:00
|
|
|
|
1998-12-06 04:06:39 +00:00
|
|
|
if [ -d ${FSPROTO} ]; then
|
|
|
|
(set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT})
|
|
|
|
else
|
|
|
|
cp -p ${FSPROTO} ${MNT}
|
|
|
|
fi
|
1996-01-08 22:13:50 +00:00
|
|
|
|
1999-01-12 22:12:12 +00:00
|
|
|
df -ki ${MNT}
|
1996-11-27 22:52:34 +00:00
|
|
|
|
1999-01-12 22:12:12 +00:00
|
|
|
set `df -ki ${MNT} | tail -1`
|
1996-01-08 22:13:50 +00:00
|
|
|
|
2000-11-05 22:49:15 +00:00
|
|
|
echo "*** Filesystem is ${FSSIZE} K, $4 left"
|
|
|
|
echo "*** ${FSINODE} bytes/inode, $7 left"
|
1996-01-08 22:13:50 +00:00
|
|
|
break;
|
2001-11-15 07:27:25 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
case `uname -r` in
|
2001-11-16 03:01:50 +00:00
|
|
|
[1-4].*)
|
|
|
|
dofs_vn
|
2001-11-15 07:27:25 +00:00
|
|
|
;;
|
|
|
|
*)
|
2001-11-16 03:01:50 +00:00
|
|
|
dofs_md
|
2001-11-15 07:27:25 +00:00
|
|
|
;;
|
|
|
|
esac
|