Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add missing RPI FDT build goop, from nick.
details: https://anonhg.NetBSD.org/src/rev/c413ea8ce189
branches: trunk
changeset: 358101:c413ea8ce189
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Mon Dec 11 11:38:14 2017 +0000
description:
Add missing RPI FDT build goop, from nick.
diffstat:
distrib/evbarm/instkernel/instkernel/Makefile | 8 ++++-
distrib/utils/embedded/conf/armv7.conf | 14 +++++-----
distrib/utils/embedded/conf/rpi.conf | 35 +++++++++++++++++++++++++-
etc/etc.evbarm/Makefile.inc | 10 +++---
4 files changed, 51 insertions(+), 16 deletions(-)
diffs (166 lines):
diff -r 5d968c68085b -r c413ea8ce189 distrib/evbarm/instkernel/instkernel/Makefile
--- a/distrib/evbarm/instkernel/instkernel/Makefile Mon Dec 11 11:32:45 2017 +0000
+++ b/distrib/evbarm/instkernel/instkernel/Makefile Mon Dec 11 11:38:14 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2015/05/15 06:50:41 matt Exp $
+# $NetBSD: Makefile,v 1.28 2017/12/11 11:38:14 jmcneill Exp $
.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -13,7 +13,8 @@
MDSETTARGETS=
.for i in ${BUILD_KERNELS:M*_INSTALL}
.if ${i} == "RPI_INSTALL" || ${i} == "RPI2_INSTALL"
-MDSETTARGETS+= ${i} ${SSHRAMDISK} -
+MDSETTARGETS+= ${i} ${SSHRAMDISK} netbsd-${i}
+MDSET_SUFFIXES.${i}= bin create-bin img create-img
.else
MDSETTARGETS+= ${i} ${RAMDISK} -
.endif
@@ -24,6 +25,9 @@
MDSET_SUFFIXES.-= srec create-srec bin create-bin
create-srec= ${OBJCOPY} -O srec ${.TARGET:R} ${.TARGET}
create-bin= ${OBJCOPY} -O binary ${.TARGET:R} ${.TARGET}
+create-img= \
+ ${HOST_SH} ${NETBSDSRCDIR}/sys/arch/evbarm/compile/rpi-mkknlimg.sh \
+ ${.TARGET:R}.bin ${.TARGET}
.include "${DISTRIBDIR}/common/Makefile.mdset"
diff -r 5d968c68085b -r c413ea8ce189 distrib/utils/embedded/conf/armv7.conf
--- a/distrib/utils/embedded/conf/armv7.conf Mon Dec 11 11:32:45 2017 +0000
+++ b/distrib/utils/embedded/conf/armv7.conf Mon Dec 11 11:38:14 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.22 2017/12/03 13:31:45 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.23 2017/12/11 11:38:14 jmcneill Exp $
# ARMv7 customization script used by mkimage
#
board=armv7
@@ -45,9 +45,9 @@
firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
# RPI2 kernel needs to be installed as kernel7.img
- if [ -f "${mnt}/boot/netbsd-RPI2.bin" ]; then
- echo "${bar} renaming netbsd-RPI2.bin to kernel7.img ${bar}"
- mv "${mnt}/boot/netbsd-RPI2.bin" "${mnt}/boot/kernel7.img"
+ if [ -f "${mnt}/boot/netbsd-RPI2.img" ]; then
+ echo "${bar} renaming netbsd-RPI2.img to kernel7.img ${bar}"
+ mv "${mnt}/boot/netbsd-RPI2.img" "${mnt}/boot/kernel7.img"
cat > "${mnt}/boot/cmdline.txt" << EOF
root=ld0a console=${console}
@@ -120,13 +120,13 @@
f="${kernel}/netbsd-${k}.ub.gz"
test -f "${f}" && kernels="${kernels} ${f}"
done
- # .bin kernels
+ # .img kernels
for k in $kernels_rpi; do
- f="${kernel}/netbsd-${k}.bin.gz"
+ f="${kernel}/netbsd-${k}.img.gz"
test -f "${f}" && kernels="${kernels} ${f}"
done
# .dtb files
- for k in $kernels_sunxi $kernels_tegra; do
+ for k in $kernels_rpi $kernels_sunxi $kernels_tegra; do
test -d "${KERNOBJDIR}/${k}" && \
dtbs="$(${MAKE} -C ${KERNOBJDIR}/${k} -v DTB)" || \
dtbs=
diff -r 5d968c68085b -r c413ea8ce189 distrib/utils/embedded/conf/rpi.conf
--- a/distrib/utils/embedded/conf/rpi.conf Mon Dec 11 11:32:45 2017 +0000
+++ b/distrib/utils/embedded/conf/rpi.conf Mon Dec 11 11:38:14 2017 +0000
@@ -1,9 +1,11 @@
-# $NetBSD: rpi.conf,v 1.32 2017/11/28 02:56:44 kre Exp $
+# $NetBSD: rpi.conf,v 1.33 2017/12/11 11:38:14 jmcneill Exp $
# Raspberry Pi customization script used by mkimage
#
board=rpi
-kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI.bin
+kerneldir=$src/sys/arch/evbarm/compile/RPI/
+kernel=$kerneldir/netbsd-RPI.img
+kernels_rpi="RPI RPI2"
resize=true
. ${DIR}/conf/evbarm.conf
@@ -59,11 +61,14 @@
force_turbo=0
EOF
+ echo "${bar} kernel ${kernel} ${bar}"
+
if [ ! -f ${kernel} ]; then
echo ${PROG}: Missing ${kernel} 1>&2
exit 1
fi
+ # .img files
echo "${bar} installing RPI kernel ${bar}"
case ${kernel} in
*.gz)
@@ -84,6 +89,32 @@
;;
esac || fail "Copy of ${rpi2_kernel} to ${mnt}/boot/kernel7.img failed"
+ # dtb files
+ for k in $kernels_rpi; do
+ test -d "${KERNOBJDIR}/${k}" && \
+ dtbs="$(${MAKE} -C ${KERNOBJDIR}/${k} -v DTB)" || \
+ dtbs=
+ for dtb in $dtbs; do
+ f="${KERNOBJDIR}/${k}/${dtb}"
+ test -f "${f}" && kernels="${kernels} ${f}"
+ done
+ done
+
+ echo "${bar} installing kernel files ${bar}"
+ # install kernels to /boot partition
+ for k in ${kernels}; do
+ tgt="$(basename ${k} | sed 's/\.gz$//')"
+ echo "${bar} installing ${k} to /boot/${tgt} ${bar}"
+ case "${k}" in
+ *.gz)
+ ${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}"
+ ;;
+ *)
+ cp "${k}" "${mnt}/boot/${tgt}"
+ ;;
+ esac
+ done
+
echo "${bar} installing firmware files ${bar}"
(cd ${mnt}/boot &&
for f in ${firmwarefiles}; do
diff -r 5d968c68085b -r c413ea8ce189 etc/etc.evbarm/Makefile.inc
--- a/etc/etc.evbarm/Makefile.inc Mon Dec 11 11:32:45 2017 +0000
+++ b/etc/etc.evbarm/Makefile.inc Mon Dec 11 11:38:14 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.91 2017/11/30 19:54:50 jmcneill Exp $
+# $NetBSD: Makefile.inc,v 1.92 2017/12/11 11:38:14 jmcneill Exp $
#
# etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
#
@@ -175,19 +175,19 @@
.if !empty(KERNEL_SETS:MRPI)
smp_rpi: __mkimage
.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI)
-MKI_OPTS.smp_rpi= -K ${IMAGE.kern}/netbsd-RPI.bin.gz
+MKI_OPTS.smp_rpi= -K ${IMAGE.kern}/netbsd-RPI.img.gz
SNAP_MD_POST_DEPS+= smp_rpi
.endif
-smp_rpi_inst: ${IMAGE.instk}/netbsd-RPI_INSTALL.bin.gz __mkimage
+smp_rpi_inst: ${IMAGE.instk}/netbsd-RPI_INSTALL.img.gz __mkimage
.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI_INSTALL)
-MKI_OPTS.smp_rpi_inst= -b -K ${IMAGE.instk}/netbsd-RPI_INSTALL.bin.gz
+MKI_OPTS.smp_rpi_inst= -b -K ${IMAGE.instk}/netbsd-RPI_INSTALL.img.gz
SNAP_MD_POST_DEPS+= smp_rpi_inst
.endif
.endif
snap_md_post: check_DESTDIR check_RELEASEDIR snap_post .WAIT ${SNAP_MD_POST_DEPS}
-KERNEL_SUFFIXES= bin srec ub
+KERNEL_SUFFIXES= bin img srec ub
INSTALLATION_DIRS+= binary/gzimg \
installation/instkernel
Home |
Main Index |
Thread Index |
Old Index