Page MenuHomeFreeBSD
Paste P474

riscv64 image build script
ActivePublic

Authored by swills on Jan 17 2021, 7:04 PM.
Tags
None
Referenced Files
F15445522: riscv64 image build script
Jan 17 2021, 7:04 PM
Subscribers
None
#!/bin/sh
set -x
set -e
IMAGE_NAME=riscv.img
BUILDER_JFLAG=10
TARGET=riscv
TARGET_ARCH=riscv64
BASE_DIR=$(dirname $(realpath "$0"))
JOB_BASE=$(realpath ${BASE_DIR})
export MAKEOBJDIRPREFIX=${BASE_DIR}/obj
export DESTDIR=${BASE_DIR}/dest
MAKECONF=${MAKECONF:-/dev/null}
SRCCONF=${SRCCONF:-/dev/null}
buildworld="yes"
cd ${BASE_DIR}/src
if [ "${buildworld}" == "yes" ]; then
rm -fr ${MAKEOBJDIRPREFIX}
rm -fr ${DESTDIR}
make -j ${BUILDER_JFLAG} \
-DNO_CLEAN \
TARGET=${TARGET} \
TARGET_ARCH=${TARGET_ARCH} \
buildworld
make -j ${BUILDER_JFLAG} \
TARGET=${TARGET} \
TARGET_ARCH=${TARGET_ARCH} \
-DNO_CLEAN \
-DNO_ROOT \
-DDB_FROM_SRC \
DESTDIR=${DESTDIR} \
installworld
make -j ${BUILDER_JFLAG} \
TARGET=${TARGET} \
TARGET_ARCH=${TARGET_ARCH} \
-DNO_CLEAN \
-DNO_ROOT \
DESTDIR=${DESTDIR} \
distribution
fi
cp ${JOB_BASE}/RISCVTEST ${JOB_BASE}/src/sys/riscv/conf/RISCVTEST
make -j ${BUILDER_JFLAG} \
-DNO_CLEAN \
TARGET=${TARGET} \
TARGET_ARCH=${TARGET_ARCH} \
KERNCONF=RISCVTEST \
WITHOUT_FORMAT_EXTENSIONS=yes \
buildkernel
make -j ${BUILDER_JFLAG} \
TARGET=${TARGET} \
TARGET_ARCH=${TARGET_ARCH} \
KERNCONF=RISCVTEST \
WITHOUT_FORMAT_EXTENSIONS=yes \
-DNO_CLEAN \
-DNO_ROOT \
-DDB_FROM_SRC \
DESTDIR=${DESTDIR} \
installkernel
if [ "${buildworld}" == "yes" || true ]; then
dd if=/dev/random of=${DESTDIR}/boot/entropy bs=4k count=1
cp ${JOB_BASE}/fstab ${DESTDIR}/etc/
echo "./etc/fstab type=file uname=root gname=wheel mode=0644 size=`stat -f \"%z\" ${DESTDIR}/etc/fstab` tags=package=utilities,config" >> ${DESTDIR}/METALOG
cp ${JOB_BASE}/rc.conf ${DESTDIR}/etc/
echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644 size=`stat -f \"%z\" ${DESTDIR}/etc/rc.conf` tags=package=utilities,config" >> ${DESTDIR}/METALOG
./tools/tools/makeroot/makeroot.sh -s 32g ${IMAGE_NAME} ${DESTDIR}
mv ${IMAGE_NAME} ${JOB_BASE}
fi
cd ..

Event Timeline

swills created this object in space S1 Global.