Resflash: Difference between revisions

From lippmann wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
notes for building [https://stable.rcesoftware.com/resflash/ resflash] for octeon ([https://www.ui.com/edgemax/edgerouter-lite/ 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.  
notes for building [https://stable.rcesoftware.com/resflash/ resflash] for octeon ([https://www.ui.com/edgemax/edgerouter-lite/ 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 [https://https.www.google.com.tedunangst.com/flak/post/OpenBSD-on-ERL here]. Be sure to include the comp set.
If you want to avoid cross compiling (I did), first do a basic install of openbsd on your octeon system (edgerouter) per [https://https.www.google.com.tedunangst.com/flak/post/OpenBSD-on-ERL here]. Be sure to include the comp set.


example setlist:
example setlist:

Revision as of 02:05, 3 May 2019

Building

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 on your octeon system (edgerouter) per here. Be sure to include the comp set.

example setlist:

   [X] bsd           [X] base65.tgz    [ ] game65.tgz    [ ] xfont65.tgz
   [X] bsd.mp        [X] comp65.tgz    [ ] xbase65.tgz   [ ] xserv65.tgz
   [ ] bsd.rd        [ ] man65.tgz     [ ] xshare65.tgz


change fstab, make sure it's noatime and softdep (less iops to your usb stick, make it live longer) , e.g. below:

create a user to do the building.

useradd exampleuser
user mod -G wsrc exampleuser

Then mount /usr/src on external storage (to avoid unnecessary compile related iops to usb), like nfs. Doing wxallowed because later on we may be compiling stuff with python or other tools that require wx.

mount -o wxallowed nas:/volume1/ports /usr/ports

Get the (6.5 in this example) stable source:

su - exampleuser
cd /usr
cvs -qd anoncvs@anoncvs.ca.openbsd.org:/cvs checkout -rOPENBSD_6_5 -P src

Then run below script to create the kernel:

#!/bin/ksh
export DESTDIR=/usr/dest RELEASEDIR=/usr/release MACHINE='octeon' NCPU=1 MYKERNEL=GENERIC DATEARG='+%H:%M:%S' part=d 
mkdir ${RELEASEDIR}
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/" \
GENERIC > GENERIC.${part}
sed "/^include.*GENERIC/s/GENERIC/GENERIC.${part}/" GENERIC.MP > \
GENERIC.MP.${part}
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}
cd ${RELEASEDIR}
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 build_resflash.sh and create a working image for resflash. Be sure to run build_resflash.sh from an octeon system as well. Partitions created by build_resflash.sh on a different architecture are not mountable from an octeon system.

running