We've had the linkkit components in the tree for a while, but it has
taken nearly 20 rounds between rpe/tb/myself to get the last few bits
finished. So that the link kit is cleanly used at reboot, but also
fits in with the practices kernel developers follow.
Here are the remaining pieces.
1) gap.o is now created using a ld.script. gap.link is created with a
shell script. There is a horrible dance required with gapdummy.o
on some architectures, because binutils input language isn't expressive
enough to create .o files with the correct ABI, so by linking it
against a dummy .o with the right ABI, it gains the correct ABI.
2) The trap instructions acting as FILL in the gap have been expanded
to 4-bytes, since some linker variations do a strange thing of packing
2 bytes at a time in some sections.
3) The Makefile.* files were getting too nastily divergent, so config(8)
now helps by creating the various bits..
4) the install target has been cleaned up, so that we can reuse it for
the relink case...
5) If you "make install" a kernel, the link kit is updated. Any generic.tgz
file is deleted, since the compile dir is newer.
6) At snapshot buid time however, it is more convenient to install a
generic.tgz file.
7) /etc/rc knows how to handle either of these two cases at boot. It uses
the targets "newbsd" and "newinstall", which specifically avoid relying
on src code targets and only use .o file targets.
(config(8) was modified because reaching this point on multiple
architectures was EXCEEEDINGLY PAINFUL. I am desperately trying to
avoid Makefile.* divergence)
So how does this work in action?
1. install.
-> kernels will relink each time
2. upgrade
-> even if it was disabled, kernels will relink each time again
3. make build, reboot without new kernel
-> kernel is rebuild using older link kit
4. make a snapshot, reboot
-> a compile.tgz is installed.
-> at boot, linkkit extracted from compile.tgz, rebuilds next time
5. developer compiles kernel, and uses install target
# make
...
# make install
-> kernel installed, /var/db/kernel.SHA256 updated
-> linkkit is updated along with kernel install
6. developer compiles kernel, and uses "cp obj/bsd /bsd"
-> at reboot time, /var/db/kernel.SHA256 *mismatches*, and no
relink occurs
7. developer wants to head back to regular build
-> use step 5
This is in snapshots, and I will probably commit it soon. Undecided if
it is worth extracting pieces.
Future work should be to see if we can build a fresh kernel at
install/upgrade time, for that "every computer is unique" feel.
Index: sys/conf/makegap.sh
===================================================================
RCS file: /cvs/src/sys/conf/makegap.sh,v
retrieving revision 1.7
diff -u -p -u -r1.7 makegap.sh
--- sys/conf/makegap.sh 5 Jun 2017 17:47:33 -0000 1.7
+++ sys/conf/makegap.sh 21 Jun 2017 16:12:42 -0000
@@ -1,32 +1,62 @@
#!/bin/sh -
-PADBYTE=$1
+umask 007
-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
+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);
+ . += 1 + $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
Index: sys/arch/alpha/conf/Makefile.alpha
===================================================================
RCS file: /cvs/src/sys/arch/alpha/conf/Makefile.alpha,v
retrieving revision 1.101
diff -u -p -u -r1.101 Makefile.alpha
--- sys/arch/alpha/conf/Makefile.alpha 13 Jun 2017 16:40:00 -0000 1.101
+++ sys/arch/alpha/conf/Makefile.alpha 21 Jun 2017 16:40:07 -0000
@@ -93,12 +93,6 @@ LINKFLAGS+= -S
%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
@@ -127,19 +121,19 @@ ioconf.o: ioconf.c
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
@@ -154,16 +148,12 @@ db_structinfo.h: $S/ddb/db_structinfo.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})
Index: sys/arch/amd64/conf/Makefile.amd64
===================================================================
RCS file: /cvs/src/sys/arch/amd64/conf/Makefile.amd64,v
retrieving revision 1.84
diff -u -p -u -r1.84 Makefile.amd64
--- sys/arch/amd64/conf/Makefile.amd64 13 Jun 2017 16:40:01 -0000 1.84
+++ sys/arch/amd64/conf/Makefile.amd64 21 Jun 2017 16:40:05 -0000
@@ -96,12 +96,6 @@ LINKFLAGS+= -S
%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
@@ -130,19 +124,19 @@ ioconf.o: ioconf.c
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
@@ -158,16 +152,12 @@ locore0.o: ${_machdir}/${_mach}/locore0.
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})
Index: sys/arch/arm64/conf/Makefile.arm64
===================================================================
RCS file: /cvs/src/sys/arch/arm64/conf/Makefile.arm64,v
retrieving revision 1.14
diff -u -p -u -r1.14 Makefile.arm64
--- sys/arch/arm64/conf/Makefile.arm64 13 Jun 2017 16:40:01 -0000 1.14
+++ sys/arch/arm64/conf/Makefile.arm64 21 Jun 2017 16:23:53 -0000
@@ -94,12 +94,6 @@ LINKFLAGS+= -S
%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
@@ -130,19 +124,23 @@ ld.script: ${_archdir}/conf/kern.ldscrip
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
@@ -159,16 +157,12 @@ in_cksum_arm.o fiq_subr.o bcopyinout.o 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})
Index: sys/arch/armv7/conf/Makefile.armv7
===================================================================
RCS file: /cvs/src/sys/arch/armv7/conf/Makefile.armv7,v
retrieving revision 1.27
diff -u -p -u -r1.27 Makefile.armv7
--- sys/arch/armv7/conf/Makefile.armv7 14 Jun 2017 13:12:49 -0000 1.27
+++ sys/arch/armv7/conf/Makefile.armv7 21 Jun 2017 16:40:00 -0000
@@ -91,12 +91,6 @@ LINKFLAGS+= -S
%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
@@ -128,19 +122,23 @@ ld.script: ${_archdir}/conf/ldscript.hea
-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
@@ -157,16 +155,12 @@ in_cksum_arm.o fiq_subr.o bcopyinout.o 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})
Index: sys/arch/hppa/conf/Makefile.hppa
===================================================================
RCS file: /cvs/src/sys/arch/hppa/conf/Makefile.hppa,v
retrieving revision 1.95
diff -u -p -u -r1.95 Makefile.hppa
--- sys/arch/hppa/conf/Makefile.hppa 13 Jun 2017 16:40:01 -0000 1.95
+++ sys/arch/hppa/conf/Makefile.hppa 21 Jun 2017 16:24:45 -0000
@@ -101,12 +101,6 @@ LINKFLAGS+= -S
%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
@@ -135,19 +129,19 @@ ioconf.o: ioconf.c
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
@@ -163,16 +157,12 @@ locore0.o: ${_machdir}/${_mach}/locore0.
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})
Index: sys/arch/i386/conf/Makefile.i386
===================================================================
RCS file: /cvs/src/sys/arch/i386/conf/Makefile.i386,v
retrieving revision 1.110
diff -u -p -u -r1.110 Makefile.i386
--- sys/arch/i386/conf/Makefile.i386 13 Jun 2017 16:40:01 -0000 1.110
+++ sys/arch/i386/conf/Makefile.i386 21 Jun 2017 16:39:57 -0000
@@ -97,12 +97,6 @@ LINKFLAGS+= -S
%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
@@ -131,19 +125,19 @@ ioconf.o: ioconf.c
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
@@ -159,16 +153,12 @@ locore0.o: ${_machdir}/${_mach}/locore0.
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})
Index: sys/arch/landisk/conf/Makefile.landisk
===================================================================
RCS file: /cvs/src/sys/arch/landisk/conf/Makefile.landisk,v
retrieving revision 1.67
diff -u -p -u -r1.67 Makefile.landisk
--- sys/arch/landisk/conf/Makefile.landisk 13 Jun 2017 16:40:01 -0000
1.67
+++ sys/arch/landisk/conf/Makefile.landisk 21 Jun 2017 16:36:17 -0000
@@ -93,12 +93,6 @@ LINKFLAGS+= -S
%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
@@ -127,19 +121,19 @@ ioconf.o: ioconf.c
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
@@ -155,16 +149,12 @@ locore.o: ${_machdir}/${_mach}/locore.S
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})
Index: sys/arch/loongson/conf/Makefile.loongson
===================================================================
RCS file: /cvs/src/sys/arch/loongson/conf/Makefile.loongson,v
retrieving revision 1.60
diff -u -p -u -r1.60 Makefile.loongson
--- sys/arch/loongson/conf/Makefile.loongson 13 Jun 2017 16:40:01 -0000
1.60
+++ sys/arch/loongson/conf/Makefile.loongson 21 Jun 2017 16:22:59 -0000
@@ -98,12 +98,6 @@ LINKFLAGS+= -S
%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
@@ -132,19 +126,23 @@ ioconf.o: ioconf.c
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
@@ -165,16 +163,12 @@ context.o cp0access.o exception.o locore
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})
Index: sys/arch/luna88k/conf/Makefile.luna88k
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/conf/Makefile.luna88k,v
retrieving revision 1.70
diff -u -p -u -r1.70 Makefile.luna88k
--- sys/arch/luna88k/conf/Makefile.luna88k 11 Jun 2017 22:51:21 -0000
1.70
+++ sys/arch/luna88k/conf/Makefile.luna88k 21 Jun 2017 04:31:00 -0000
@@ -120,12 +120,16 @@ ioconf.o: ioconf.c
ld.script: ${_machdir}/conf/ld.script
cp ${_machdir}/conf/ld.script $@
+makegap.sh: $S/conf/makegap.sh
+ cp $S/conf/makegap.sh $@
+
vers.o: ${SYSTEM_DEP:Ngap.o} ${SYSTEM_SWAP_DEP}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
clean:
- rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} param.c
+ rm -f *bsd *bsd.gdb *.[dio] [a-z]*.s assym.* ${DB_STRUCTINFO} \
+ gap.link ld.script lorder makegap.sh param.c
cleandir: clean
rm -f Makefile *.h ioconf.c options machine ${_mach} vers.c
@@ -140,16 +144,12 @@ db_structinfo.h: $S/ddb/db_structinfo.c
locore.o: ${_machdir}/${_mach}/locore.S assym.h
eh.o mutex.o process.o subr.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})
Index: sys/arch/macppc/conf/Makefile.macppc
===================================================================
RCS file: /cvs/src/sys/arch/macppc/conf/Makefile.macppc,v
retrieving revision 1.83
diff -u -p -u -r1.83 Makefile.macppc
--- sys/arch/macppc/conf/Makefile.macppc 13 Jun 2017 01:44:27 -0000
1.83
+++ sys/arch/macppc/conf/Makefile.macppc 21 Jun 2017 16:36:56 -0000
@@ -93,12 +93,6 @@ LINKFLAGS+= -S
%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
@@ -127,19 +121,19 @@ ioconf.o: ioconf.c
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
@@ -155,16 +149,12 @@ locore0.o: ${_machdir}/${_mach}/locore0.
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})
Index: sys/arch/octeon/conf/Makefile.octeon
===================================================================
RCS file: /cvs/src/sys/arch/octeon/conf/Makefile.octeon,v
retrieving revision 1.36
diff -u -p -u -r1.36 Makefile.octeon
--- sys/arch/octeon/conf/Makefile.octeon 13 Jun 2017 16:40:01 -0000
1.36
+++ sys/arch/octeon/conf/Makefile.octeon 21 Jun 2017 16:22:25 -0000
@@ -99,12 +99,6 @@ LINKFLAGS+= -S
%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
@@ -133,19 +127,23 @@ ioconf.o: ioconf.c
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
@@ -166,16 +164,12 @@ context.o cp0access.o exception.o locore
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 gapdummy.o
# pull in the dependency information
.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO})
Index: sys/arch/sgi/conf/Makefile.sgi
===================================================================
RCS file: /cvs/src/sys/arch/sgi/conf/Makefile.sgi,v
retrieving revision 1.84
diff -u -p -u -r1.84 Makefile.sgi
--- sys/arch/sgi/conf/Makefile.sgi 13 Jun 2017 16:40:01 -0000 1.84
+++ sys/arch/sgi/conf/Makefile.sgi 21 Jun 2017 16:21:52 -0000
@@ -98,12 +98,6 @@ LINKFLAGS+= -S
%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
@@ -132,19 +126,23 @@ ioconf.o: ioconf.c
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
@@ -166,16 +164,12 @@ lcore_access.o lcore_ddb.o lcore_float.o
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})
Index: sys/arch/sparc64/conf/Makefile.sparc64
===================================================================
RCS file: /cvs/src/sys/arch/sparc64/conf/Makefile.sparc64,v
retrieving revision 1.87
diff -u -p -u -r1.87 Makefile.sparc64
--- sys/arch/sparc64/conf/Makefile.sparc64 13 Jun 2017 16:40:01 -0000
1.87
+++ sys/arch/sparc64/conf/Makefile.sparc64 21 Jun 2017 16:36:53 -0000
@@ -91,12 +91,6 @@ LINKFLAGS+= -S
%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
@@ -125,19 +119,19 @@ ioconf.o: ioconf.c
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
@@ -152,16 +146,12 @@ db_structinfo.h: $S/ddb/db_structinfo.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})
Index: usr.sbin/config/config.h
===================================================================
RCS file: /cvs/src/usr.sbin/config/config.h,v
retrieving revision 1.29
diff -u -p -u -r1.29 config.h
--- usr.sbin/config/config.h 16 Oct 2016 09:35:40 -0000 1.29
+++ usr.sbin/config/config.h 21 Jun 2017 04:31:00 -0000
@@ -266,6 +266,7 @@ struct objects {
struct hashtab;
const char *conffile; /* source file, e.g., "GENERIC.sparc" */
+const char *last_component;
const char *machine; /* machine type, e.g., "sparc" or "sun3" */
const char *machinearch; /* machine arch, e.g., "sparc" or "m68k" */
const char *srcdir; /* path to source directory (rel. to build) */
Index: usr.sbin/config/main.c
===================================================================
RCS file: /cvs/src/usr.sbin/config/main.c,v
retrieving revision 1.58
diff -u -p -u -r1.58 main.c
--- usr.sbin/config/main.c 19 Jun 2017 17:35:04 -0000 1.58
+++ usr.sbin/config/main.c 21 Jun 2017 04:31:00 -0000
@@ -97,7 +97,6 @@ int
main(int argc, char *argv[])
{
char *p;
- const char *last_component;
char *outfile = NULL;
int ch, eflag, uflag, fflag;
char dirbuffer[PATH_MAX];
Index: usr.sbin/config/mkmakefile.c
===================================================================
RCS file: /cvs/src/usr.sbin/config/mkmakefile.c,v
retrieving revision 1.42
diff -u -p -u -r1.42 mkmakefile.c
--- usr.sbin/config/mkmakefile.c 16 Oct 2016 17:50:00 -0000 1.42
+++ usr.sbin/config/mkmakefile.c 21 Jun 2017 13:20:40 -0000
@@ -429,7 +429,7 @@ emitrules(FILE *fp)
".SUFFIXES:\n"
".SUFFIXES: .s .S .c .o\n\n"
- ".PHONY: depend all install clean tags\n\n"
+ ".PHONY: depend all install clean tags newbsd update-link\n\n"
".c.o:\n"
"\t${NORMAL_C}\n\n"
@@ -508,6 +508,27 @@ emitload(FILE *fp)
return (1);
}
if (fputs("\t${NORMAL_C}\n\n", fp) < 0)
+ return (1);
+
+ if (fprintf(fp, "new%s: gap.o\n", nm) < 0)
+ return (1);
+ if (fprintf(fp,
+ "\t${SYSTEM_LD_HEAD}\n"
+ "\t${SYSTEM_LD} swap%s.o\n"
+ "\t${SYSTEM_LD_TAIL}\n"
+ "\tmv -f new%s %s\n\n",
+ swname, nm, nm) < 0)
+ return (1);
+
+ if (fprintf(fp, "update-link:\n") < 0)
+ return (1);
+ if (fprintf(fp,
+ "\tmkdir -p -m 700 /usr/share/compile\n"
+ "\trm -rf /usr/share/compile/%s /usr/share/compile.tgz\n"
+ "\tmkdir /usr/share/compile/%s\n"
+ "\ttar -chf - Makefile makegap.sh ld.script *.o | \\\n"
+ "\t tar -C /usr/share/compile/%s -xf -\n\n",
+ last_component, last_component, last_component) < 0)
return (1);
}
return (0);
Index: etc/Makefile
===================================================================
RCS file: /cvs/src/etc/Makefile,v
retrieving revision 1.458
diff -u -p -u -r1.458 Makefile
--- etc/Makefile 13 Jun 2017 17:09:52 -0000 1.458
+++ etc/Makefile 21 Jun 2017 04:31:00 -0000
@@ -32,8 +32,7 @@ kernels: ${ALL_KERNELS}
cd ${.CURDIR}/../sys/arch/${MACHINE}/compile/ && \
tar -chzf ${DESTDIR}/usr/share/compile.tgz -s ',/obj/,/,' \
GENERIC*/obj/*.o GENERIC*/obj/Makefile \
- GENERIC*/obj/ld.script GENERIC*/obj/gap.S \
- GENERIC*/obj/machine
+ GENERIC*/obj/ld.script GENERIC*/obj/makegap.sh
chown root:wheel ${DESTDIR}/usr/share/compile.tgz
chmod 644 ${DESTDIR}/usr/share/compile.tgz
@@ -273,6 +272,7 @@ do-release:
release-sets:
su ${BUILDUSER} -c 'exec ${MAKE} distribution'
su ${BUILDUSER} -c 'exec ${MAKE} kernels'
+ cp -p ${DESTDIR}/usr/share/compile.tgz /usr/share/compile.tgz
${MAKE} bootblocks
cd ${RELEASEDIR} && rm -f SHA256
cd ../distrib/sets && exec su ${BUILDUSER} -c 'exec sh maketars
${OSrev}'
Index: etc/rc
===================================================================
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.503
diff -u -p -u -r1.503 rc
--- etc/rc 19 Jun 2017 22:50:50 -0000 1.503
+++ etc/rc 21 Jun 2017 04:31:00 -0000
@@ -228,7 +228,7 @@ reorder_kernel() {
_kernel=$(sysctl -n kern.osversion)
_kernel=${_kernel%#*} _kernel_dir=$_compile_dir/$_kernel
- _sha256=$_kernel_dir/SHA256
+ _sha256=/var/db/kernel.SHA256
if [[ -f /usr/share/compile.tgz ]]; then
rm -rf $_compile_dir
@@ -237,12 +237,12 @@ reorder_kernel() {
rm -f /usr/share/compile.tgz
fi
- [[ -f $_sha256 ]] && sha256 -q -C $_sha256 /bsd
+ sha256 -q -C $_sha256 /bsd
cd $_kernel_dir
make newbsd >$_kernel_dir/log 2>&1
- make install >>$_kernel_dir/log 2>&1
- sha256 -h $_sha256 /bsd
+ make newinstall >>$_kernel_dir/log 2>&1
+ (umask 077 && sha256 -h $_sha256 /bsd)
(echo "Kernel has been relinked and is active on next reboot\n"; \
cat $_sha256; echo "\nRelink log:\n"; cat $_kernel_dir/log ) |
Index: distrib/miniroot/install.sub
===================================================================
RCS file: /cvs/src/distrib/miniroot/install.sub,v
retrieving revision 1.1014
diff -u -p -u -r1.1014 install.sub
--- distrib/miniroot/install.sub 3 Jun 2017 22:27:41 -0000 1.1014
+++ distrib/miniroot/install.sub 21 Jun 2017 12:36:06 -0000
@@ -2633,6 +2633,14 @@ finish_up() {
mv /mnt/bsd.mp /mnt/bsd
fi
+ # Create/update kernel.SHA256 matching the just installed kernel.
+ # Fix path in kernel.SHA256 to ensure it references the kernel as /bsd.
+ (
+ umask 077
+ sha256 -h /mnt/var/db/kernel.SHA256 /mnt/bsd
+ sed -i 's,(/mnt,(,' /mnt/var/db/kernel.SHA256
+ )
+
# Ensure that sysmerge in batch mode is run on reboot.
[[ $MODE == upgrade ]] &&
echo "/usr/sbin/sysmerge -b" >>/mnt/etc/rc.sysmerge