From lippmann wiki
Jump to: navigation, search


notes for building resflash for octeon (edgerouter lite). Octeon resflash images require a custom kernel. Resflash loads this into a fat partition, and the kernel needs to know where to find the root partition.

If you want to avoid cross compiling (I did), first do a basic install of openbsd per here. Be sure to include the comp set. Then mount /usr/src on external storage (to avoid unnecessary compile related iops to usb)like nfs. Then run below script to create the kernel:

Here's the build instructions:

export DESTDIR=/usr/dest RELEASEDIR=/usr/release MACHINE='octeon' NCPU=1 MYKERNEL=GENERIC DATEARG='+%H:%M:%S' part=d 
chown build:wobj ${RELEASEDIR}
echo "$(date "${DATEARG}") ${0}: ----- Building bsd.${part} -----"
cd /usr/src/sys/arch/${MACHINE}/conf
sed "/^config.*bsd/s/config.*/config bsd root on sd0${part} swap on sd0b/" \
sed "/^include.*GENERIC/s/GENERIC/GENERIC.${part}/" GENERIC.MP > \
config ${MYKERNEL}.${part}
rm GENERIC.${part} GENERIC.MP.${part}
cd ../compile/${MYKERNEL}.${part}
make -j ${NCPU}
cp obj/bsd ${RELEASEDIR}/bsd.${part}
cd ..
rm -rf ${MYKERNEL}.${part}
rm -rf /usr/obj/sys/arch/${MACHINE}/compile/${MYKERNEL}.${part}
cksum -a sha256 -b bsd.d >> SHA256.bsd.d

Now extract the distribution octeon sets from the matching release to /usr/release and you should be able to run and create a working image for resflash. Be sure to run from an octeon system as well. Partitions created by on a differernt architecture are not mountable from an octeon system.