A few corrections to the previous diff, sorry
Index: Makefile.octeon
===================================================================
RCS file: /cvs/src/sys/arch/octeon/conf/Makefile.octeon,v
retrieving revision 1.49
diff -u -p -r1.49 Makefile.octeon
--- Makefile.octeon 9 Feb 2018 03:59:15 -0000 1.49
+++ Makefile.octeon 20 May 2019 21:50:55 -0000
@@ -28,6 +28,14 @@ S!= cd ../../../..; pwd
_machdir?= $S/arch/${_mach}
_archdir?= $S/arch/${_arch}
+# as long as there is no boot program which loads from ufs,
+# we must copy any kernels to the FAT filesystem where the
+# manufacturer provided finds it
+# this script assumes a valid partition and filesystem exist
+
+BOOTROOTDIR?= /mnt/
+BOOTROOTDEV?= /dev/sd0i
+
INCLUDES= -nostdinc -I$S -I${.OBJDIR} -I$S/arch
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP
CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \
@@ -139,6 +147,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* \
gap.link ld.script lorder makegap.sh param.c
+ [[ -z ${BOOTROOTDIR} ]] || umount -f ${BOOTROOtDEV}
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
@@ -154,14 +163,28 @@ context.o cp0access.o exception.o locore
lcore_access.o lcore_ddb.o lcore_float.o tlbhandler.o: assym.h
mips64r2.o: assym.h
-hardlink-obsd:
+hardlink-obsd: mount_bootroot
[[ ! -f /bsd ]] || cmp -s bsd /bsd || ln -f /bsd /obsd
+ [[ -z ${BOOTROOTDIR} && ! -f ${BOOTROOTDIR}/bsd ]] || \
+ cmp -s bsd ${BOOTROOTDIR}/bsd || \
+ ln -f ${BOOTROOTDIR}/bsd ${BOOTROOTDIR}/obsd
-newinstall:
+newinstall: mount_bootroot
umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
sha256 -h /var/db/kernel.SHA256 /bsd
+ [[ -z ${BOOTROOTDIR} ]] || \
+ cp /bsd ${BOOTROOTDIR}/nbsd && \
+ mv ${BOOTROOTDIR}/nbsd ${BOOTROOTDIR}/bsd
+
+mount_bootroot:
+ [[ -z ${BOOTROOTDIR} ]] || \
+ mount ${BOOTROOTDEV} /mnt
+
+umount_bootroot:
+ [[ -z ${BOOTROOTDIR} ]] || \
+ umount -f ${BOOTROOTDEV}
-install: update-link hardlink-obsd newinstall
+install: update-link hardlink-obsd newinstall umount_bootroot
# pull in the dependency information
.ifnmake clean