I have modified the kernel in order to fix a bug (related to storage driver for hyper-v), and I have to verify it through a fresh installation. I modified the release/generate-release.sh to build my local copy of FreeBSD 10.2. But it takes quite long time and failed at installworld:
The following is my modications. I did 3 modifications:
Code:
install: hcsecd.conf and /home/honzhan/10.2/10.2.0/etc/bluetooth/hcsecd.conf are the same file.
- The script accepts only 1 argument: the customized src folder instead of svn repository.
- Remove ${CHROOTDIR}/usr/src to ${CHROOTDIR}
- Use parallel build
make -j8
make installworld
? I don't think I need to installworld for build ISO image.
Code:
--- generate-release.sh 2015-12-28 14:52:08.071568000 +0800
+++ my-generate-release.sh 2016-01-12 19:12:46.745939000 +0800
@@ -46,11 +46,11 @@
usage()
{
- echo "Usage: $0 svn-branch[@revision] scratch-dir" 2>&1
+ echo "Usage: $0 scratch-dir" 2>&1
exit 1
}
-if [ $# -lt 2 ]; then
+if [ $# -lt 1 ]; then
usage
fi
@@ -60,12 +60,12 @@ fi
: ${SVNROOTPORTS:=${SVNROOTBASE}/ports}
: ${SVNROOT:=${SVNROOTSRC}} # for backward compatibility
: ${SVN_CMD:=/usr/local/bin/svn}
-BRANCHSRC=$1
+#BRANCHSRC=$1
: ${BRANCHDOC:=head}
: ${BRANCHPORTS:=head}
: ${WORLD_FLAGS:=${MAKE_FLAGS}}
: ${KERNEL_FLAGS:=${MAKE_FLAGS}}
-: ${CHROOTDIR:=$2}
+: ${CHROOTDIR:=$1}
if [ ! -r "${CHROOTDIR}" ]; then
echo "${CHROOTDIR}: scratch dir not found."
@@ -83,10 +83,10 @@ case ${TARGET_ARCH} in
esac
SETENV="env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin"
CROSSENV="${SETENV_TARGET} ${SETENV_TARGET_ARCH}"
-WMAKE="make -C /usr/src ${WORLD_FLAGS}"
+WMAKE="make -j8 -C /usr/src ${WORLD_FLAGS}"
NWMAKE="${WMAKE} __MAKE_CONF=/dev/null SRCCONF=/dev/null"
-KMAKE="make -C /usr/src ${KERNEL_FLAGS}"
-RMAKE="make -C /usr/src/release"
+KMAKE="make -j8 -C /usr/src ${KERNEL_FLAGS}"
+RMAKE="make -j8 -C /usr/src/release"
if [ $(id -u) -ne 0 ]; then
echo "Needs to be run as root."
@@ -95,13 +95,13 @@ fi
set -e # Everything must succeed
-mkdir -p ${CHROOTDIR}/usr/src
-${SVN_CMD} co ${SVNROOT}/${BRANCHSRC} ${CHROOTDIR}/usr/src
-${SVN_CMD} co ${SVNROOTDOC}/${BRANCHDOC} ${CHROOTDIR}/usr/doc
-${SVN_CMD} co ${SVNROOTPORTS}/${BRANCHPORTS} ${CHROOTDIR}/usr/ports
+#mkdir -p ${CHROOTDIR}/usr/src
+#${SVN_CMD} co ${SVNROOT}/${BRANCHSRC} ${CHROOTDIR}/usr/src
+#${SVN_CMD} co ${SVNROOTDOC}/${BRANCHDOC} ${CHROOTDIR}/usr/doc
+#${SVN_CMD} co ${SVNROOTPORTS}/${BRANCHPORTS} ${CHROOTDIR}/usr/ports
-${SETENV} ${NWMAKE} -C ${CHROOTDIR}/usr/src ${WORLD_FLAGS} buildworld
-${SETENV} ${NWMAKE} -C ${CHROOTDIR}/usr/src installworld distribution DESTDIR=${CHROOTDIR}
+${SETENV} ${NWMAKE} -C ${CHROOTDIR} ${WORLD_FLAGS} buildworld
+${SETENV} ${NWMAKE} -C ${CHROOTDIR} installworld distribution DESTDIR=${CHROOTDIR}
mount -t devfs devfs ${CHROOTDIR}/dev
trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit
Last edited by a moderator: