summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2019-08-04 08:53:15 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2019-08-04 08:53:15 +0000
commitc0bd79a2d4bd06f202f76db77e02da77e0b8dd3c (patch)
tree2ae44457e419c0e09f84a911fea8b8320e8b93de /sys
parentebc80647731ac69011fa992ce898e26be8004481 (diff)
Revise the way how the octeon bootloader is built. The original
approach was not right, and there is still room for improvement. OK deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/octeon/stand/Makefile4
-rw-r--r--sys/arch/octeon/stand/boot/Makefile40
-rw-r--r--sys/arch/octeon/stand/rdboot/Makefile10
3 files changed, 36 insertions, 18 deletions
diff --git a/sys/arch/octeon/stand/Makefile b/sys/arch/octeon/stand/Makefile
index cead237a45e..498bd2809c6 100644
--- a/sys/arch/octeon/stand/Makefile
+++ b/sys/arch/octeon/stand/Makefile
@@ -1,5 +1,5 @@
-# $OpenBSD: Makefile,v 1.3 2019/07/28 15:45:30 visa Exp $
+# $OpenBSD: Makefile,v 1.4 2019/08/04 08:53:14 visa Exp $
-SUBDIR += rdboot
+SUBDIR+= rdboot boot
.include <bsd.subdir.mk>
diff --git a/sys/arch/octeon/stand/boot/Makefile b/sys/arch/octeon/stand/boot/Makefile
index b7c65b98eb7..3840392d503 100644
--- a/sys/arch/octeon/stand/boot/Makefile
+++ b/sys/arch/octeon/stand/boot/Makefile
@@ -1,17 +1,39 @@
-# $OpenBSD: Makefile,v 1.5 2016/11/02 19:07:39 jasper Exp $
+# $OpenBSD: Makefile,v 1.6 2019/08/04 08:53:14 visa Exp $
NOMAN=
#MAN= boot.8
.if ${MACHINE} == "octeon"
-PROG= boot
-.include "${.CURDIR}/Makefile.inc"
-.else
-NOPROG=
-.endif
+all: bsd rdboot
+
+bsd:
+ cd ${.CURDIR}/../../compile/BOOT && \
+ ${MAKE} config && ${MAKE} clean && ${MAKE}
+ cp -p ${.CURDIR}/../../compile/BOOT/obj/bsd bsd
+
+rdboot:
+ cp -p ${.CURDIR}/../rdboot/obj/rdboot rdboot
+ strip rdboot
+
+mr.fs: rdboot
+ rm -rf $@.d
+ install -d -o root -g wheel $@.d/dev
+ install -d -o root -g wheel $@.d/mnt
+ install -d -o root -g wheel $@.d/sbin
+ install -o ${BINOWN} -g ${BINGRP} -m 555 rdboot $@.d/sbin/init
+ cd $@.d/dev && sh ${DESTDIR}/dev/MAKEDEV boot
+ makefs -o disklabel=rdboot,minfree=0,density=1024 $@ $@.d
-CFLAGS+=-fno-pie -DCONSPEED=115200
-AFLAGS+=-fno-pie
-LDFLAGS+=-nopie -znorelro
+boot: bsd mr.fs
+ cp bsd boot
+ rdsetroot boot mr.fs
+
+realinstall: boot
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 boot ${DESTDIR}/usr/mdec
+
+clean:
+ rm -f boot bsd mr.fs rdboot
+ rm -rf mr.fs.d
+.endif
.include <bsd.prog.mk>
diff --git a/sys/arch/octeon/stand/rdboot/Makefile b/sys/arch/octeon/stand/rdboot/Makefile
index c6d3e966a9b..d05ba7a267b 100644
--- a/sys/arch/octeon/stand/rdboot/Makefile
+++ b/sys/arch/octeon/stand/rdboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.2 2019/07/28 15:45:30 visa Exp $
+# $OpenBSD: Makefile,v 1.3 2019/08/04 08:53:14 visa Exp $
NOMAN=
@@ -7,14 +7,10 @@ PROG= rdboot
SRCS= cmd.c disk.c rdboot.c vars.c
LDADD+= -lutil
LDSTATIC+= -static
-
-realinstall:
- cd ${.CURDIR}/../../../../../distrib/octeon/boot && ${MAKE} bsd.rd
- ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/../../../../../distrib/octeon/boot/obj/bsd.rd \
- ${DESTDIR}/usr/mdec/boot
.else
NOPROG=
.endif
+install:
+
.include <bsd.prog.mk>