Changeset View
Changeset View
Standalone View
Standalone View
sys/conf/Makefile.arm64
Show All 17 Lines | |||||
# | # | ||||
# Which version of config(8) is required. | # Which version of config(8) is required. | ||||
%VERSREQ= 600012 | %VERSREQ= 600012 | ||||
.if !defined(S) | .if !defined(S) | ||||
S= ../../.. | S= ../../.. | ||||
.endif | .endif | ||||
.include "src.lua.mk" | |||||
.include "$S/conf/kern.pre.mk" | .include "$S/conf/kern.pre.mk" | ||||
INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include | INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include | ||||
LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts | LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts | ||||
CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" | CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" | ||||
# Use a custom SYSTEM_LD command to generate the elf kernel, so we can | # Use a custom SYSTEM_LD command to generate the elf kernel, so we can | ||||
Show All 35 Lines | |||||
.include "$S/conf/kern.post.mk" | .include "$S/conf/kern.post.mk" | ||||
# Create a kernel.bin file... | # Create a kernel.bin file... | ||||
# Copy the kernel to u-boot's booti image format (the elf headers are | # Copy the kernel to u-boot's booti image format (the elf headers are | ||||
# stripped and a custom binary head blob is prepended), saving the | # stripped and a custom binary head blob is prepended), saving the | ||||
# output in a temp file. We also strip arm "marker" symbols which are | # output in a temp file. We also strip arm "marker" symbols which are | ||||
# used only by elf toolchains. Read the symbols from kernel.full and pass | # used only by elf toolchains. Read the symbols from kernel.full and pass | ||||
# them to arm_kernel_boothdr.awk, which generates a binary header blob | # them to kernel_boothdr.lua, which generates a binary header blob | ||||
# that goes on the front of the stripped kernel. Cat the header blob | # that goes on the front of the stripped kernel. Cat the header blob | ||||
# and the temp file together to make the kernel.bin file. | # and the temp file together to make the kernel.bin file. | ||||
${KERNEL_KO}.bin: ${FULLKERNEL} | ${KERNEL_KO}.bin: ${FULLKERNEL} | ||||
@${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \ | @${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \ | ||||
--output-target=binary ${.ALLSRC} ${.TARGET}.temp | --output-target=binary ${.ALLSRC} ${.TARGET}.temp | ||||
@{ readelf -s ${.ALLSRC} | \ | @{ | ||||
${AWK} -f $S/tools/arm_kernel_boothdr.awk -v hdrtype=v8booti && \ | ${LUA} $S/tools/kernel_boothdr.lua ${.ALLSRC} v8booti && \ | ||||
cat ${.TARGET}.temp; \ | cat ${.TARGET}.temp; \ | ||||
} > ${.TARGET} | } > ${.TARGET} | ||||
@rm ${.TARGET}.temp | @rm ${.TARGET}.temp | ||||
@echo "created ${.TARGET} from ${.ALLSRC}" | @echo "created ${.TARGET} from ${.ALLSRC}" |