-# $OpenBSD: Makefile.alpha,v 1.101 2017/06/13 16:40:00 deraadt Exp $
+# $OpenBSD: Makefile.alpha,v 1.102 2017/06/22 16:01:45 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0x00000000
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0x00 > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore.o: ${_machdir}/${_mach}/locore.s assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.amd64,v 1.84 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.amd64,v 1.85 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0xcccccccc
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xcc > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
locore.o mutex.o vector.o copy.o spl.o: assym.h
mptramp.o acpi_wakecode.o vmm_support.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.arm64,v 1.14 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.arm64,v 1.15 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
sed -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \
-e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' > ld.script
+gapdummy.o:
+ echo 'const char gapdummy;' > gapdummy.c
+ ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@
+
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh gapdummy.o
+ sh makegap.sh 0xd4d4d4d4 gapdummy.o
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xd4 > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
vectors.o cpuswitch.o exception.o bcopy_page.o irq_dispatch.o support.o: assym.h
locore.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.armv7,v 1.27 2017/06/14 13:12:49 patrick Exp $
+# $OpenBSD: Makefile.armv7,v 1.28 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
-e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' \
-e 's/(KERNEL_BASE_phys)/(KERNEL_BASE_virt)/' > ld.script
+gapdummy.o:
+ echo 'const char gapdummy;' > gapdummy.c
+ ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@
+
+makegap.sh: Makefile $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh gapdummy.o
+ sh makegap.sh 0xd4d4d4d4 gapdummy.o
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xd4 > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
vectors.o cpuswitch7.o exception.o bcopy_page.o irq_dispatch.o: assym.h
${_mach}_start.o locore.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.hppa,v 1.95 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.hppa,v 1.96 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0x00000000 # BREAK 0,0 -> trap
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xcc > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
locore.o: ${_machdir}/${_mach}/locore.S assym.h
fpemu.o spcopy.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.i386,v 1.110 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.i386,v 1.111 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0xcccccccc
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xcc > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
locore.o mutex.o in_cksum.o mptramp.o: assym.h
kvm86call.o acpi_wakecode.o vmm_support.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.landisk,v 1.67 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.landisk,v 1.68 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0xc3c3c3c3
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xc3 > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
locore0.o: ${_machdir}/${_mach}/locore0.S assym.h
locore_subr.o vectors.o in_cksum.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.loongson,v 1.60 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.loongson,v 1.61 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+gapdummy.o:
+ echo 'const char gapdummy;' > gapdummy.c
+ ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@
+
+makegap.sh: Makefile $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh gapdummy.o
+ sh makegap.sh 0xefefefef gapdummy.o
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile $S/conf/makegap.sh
- umask 007; sh $S/conf/makegap.sh 0xef > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
lcore_access.o lcore_ddb.o lcore_float.o tlbhandler.o: assym.h
pmon32.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.macppc,v 1.83 2017/06/13 01:44:27 deraadt Exp $
+# $OpenBSD: Makefile.macppc,v 1.84 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0xcccccccc # XXX choose a trap instruction
+
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0xcc > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
locore.o: ${_machdir}/${_mach}/locore.S assym.h
mutex.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.octeon,v 1.36 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.octeon,v 1.37 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+gapdummy.o:
+ echo 'const char gapdummy;' > gapdummy.c
+ ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@
+
+makegap.sh: Makefile $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh gapdummy.o
+ sh makegap.sh 0xefefefef gapdummy.o
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile $S/conf/makegap.sh
- umask 007; sh $S/conf/makegap.sh 0xef > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
lcore_access.o lcore_ddb.o lcore_float.o tlbhandler.o: assym.h
mips64r2.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.sgi,v 1.84 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.sgi,v 1.85 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+gapdummy.o:
+ echo 'const char gapdummy;' > gapdummy.c
+ ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@
+
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh gapdummy.o
+ sh makegap.sh 0xefefefef gapdummy.o
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile $S/conf/makegap.sh
- umask 007; sh $S/conf/makegap.sh 0xef > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
tlb_tfp.o tlbhandler.o: assym.h
cache_tfp_subr.o ip30_nmi.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
-# $OpenBSD: Makefile.sparc64,v 1.87 2017/06/13 16:40:01 deraadt Exp $
+# $OpenBSD: Makefile.sparc64,v 1.88 2017/06/22 16:01:48 deraadt Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
%LOAD
-newbsd:
- ${SYSTEM_LD_HEAD}
- ${SYSTEM_LD} swapgeneric.o
- ${SYSTEM_LD_TAIL}
- mv -f newbsd bsd
-
# cc's -MD puts the source and output paths in the dependency file;
# since those are temp files here we need to fix it up. It also
# puts the file in /tmp, so we use -MF to put it in the current
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
+gap.o: Makefile makegap.sh
+ sh makegap.sh 0x00000000
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-gap.S: ${SYSTEM_SWAP_DEP} Makefile
- umask 007; sh $S/conf/makegap.sh 0x00 > gap.S
-
-gap.o: gap.S
- umask 007; ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c gap.S
-
clean:
rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
- gap.S lorder param.c
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
locore.o: ${_machdir}/${_mach}/locore.s assym.h
hvcall.o in_cksum.o mutex.o: assym.h
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
+newinstall:
cmp -s bsd /bsd || ln -f /bsd /obsd
- umask 077; cp bsd /nbsd
- mv /nbsd /bsd
-.endif
+ umask 077 && cp bsd /nbsd && mv /nbsd /bsd && \
+ sha256 -h /var/db/kernel.SHA256 /bsd
+
+install: update-link newinstall
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
#!/bin/sh -
-PADBYTE=$1
-
-cat << __EOF__
-#include <machine/param.h>
-#include <machine/asm.h>
-
- .text
- .balign PAGE_SIZE, $PADBYTE
- .space $RANDOM, $PADBYTE
- .balign PAGE_SIZE, $PADBYTE
-
- .globl endboot
-endboot:
- .space PAGE_SIZE, $PADBYTE
- .space $RANDOM % PAGE_SIZE, $PADBYTE
- .balign 16, $PADBYTE
-
- /*
- * Randomly bias future data, bss, and rodata objects,
- * does not help for objects in locore0.S though
- */
- .data
- .space $RANDOM % PAGE_SIZE, $PADBYTE
-
- .section .bss
- .space $RANDOM % PAGE_SIZE
-
- .section .rodata
- .space $RANDOM % PAGE_SIZE, $PADBYTE
+umask 007
+
+PAGE_SIZE=`sysctl -n hw.pagesize`
+PAD=$1
+GAPDUMMY=$2
+
+RANDOM1=$((RANDOM % (3 * PAGE_SIZE)))
+RANDOM2=$((RANDOM % PAGE_SIZE))
+RANDOM3=$((RANDOM % PAGE_SIZE))
+RANDOM4=$((RANDOM % PAGE_SIZE))
+RANDOM5=$((RANDOM % PAGE_SIZE))
+
+cat > gap.link << __EOF__
+
+PHDRS {
+ text PT_LOAD FILEHDR PHDRS;
+ rodata PT_LOAD;
+ data PT_LOAD;
+ bss PT_LOAD;
+}
+
+SECTIONS {
+ .text : ALIGN($PAGE_SIZE) {
+ LONG($PAD);
+ . += $RANDOM1;
+ . = ALIGN($PAGE_SIZE);
+ endboot = .;
+ PROVIDE (endboot = .);
+ . = ALIGN($PAGE_SIZE);
+ . += $RANDOM2;
+ . = ALIGN(16);
+ *(.text .text.*)
+ } :text =$PAD
+
+ .rodata : {
+ LONG($PAD);
+ . += $RANDOM3;
+ . = ALIGN(16);
+ *(.rodata .rodata.*)
+ } :rodata =$PAD
+
+ .data : {
+ LONG($PAD);
+ . = . + $RANDOM4; /* fragment of page */
+ . = ALIGN(16);
+ *(.data .data.*)
+ } :data =$PAD
+
+ .bss : {
+ . = . + $RANDOM5; /* fragment of page */
+ . = ALIGN(16);
+ *(.bss .bss.*)
+ } :bss
+
+ note.ABI-tag 0 : { *(.note.ABI-tag) }
+ .MIPS.options : { *(.MIPS.options) }
+}
__EOF__
+
+ld -r gap.link $GAPDUMMY -o gap.o