Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: problems in building evbearm7hf (Re: big-endian kernel fails to boot on Cubietruck)



Sorry, my mailer breaks the patches. I'm sending them as attached files.

Rin
--- sys/arch/evbarm/stand/gzboot/Makefile.gzboot.orig	2015-07-14 12:49:29.000000000 +0900
+++ sys/arch/evbarm/stand/gzboot/Makefile.gzboot	2015-07-13 16:10:47.000000000 +0900
@@ -26,6 +26,7 @@
 LIBC=
 LIBCRTBEGIN= 
 LIBCRTEND=      
+STRIPFLAG=
 
 .PATH: ${EVBARM_STAND}/gzboot
 .PATH: ${EVBARM_STAND}/board
--- distrib/evbarm/instkernel/sshramdisk/Makefile.orig	2015-07-13 16:39:15.000000000 +0900
+++ distrib/evbarm/instkernel/sshramdisk/Makefile	2015-07-13 16:40:17.000000000 +0900
@@ -13,7 +13,11 @@
 CRUNCHBIN=	ramdiskbin
 LISTS=		${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst
 MTREECONF=	${.CURDIR}/mtree.conf
+.if empty(MACHINE_ARCH:M*eb)
 IMAGEENDIAN=	le
+.else
+IMAGEENDIAN=	be
+.endif
 MAKEDEVTARGETS=	ramdisk
 IMAGEDEPENDS=	${CRUNCHBIN} \
 		dot.profile master.passwd sshd_config ssh_host_dsa_key \
--- distrib/utils/embedded/mkimage.orig	2015-07-13 17:54:01.000000000 +0900
+++ distrib/utils/embedded/mkimage	2015-07-13 18:01:02.000000000 +0900
@@ -84,7 +84,7 @@
 
 usage() {
 	cat << EOF 1>&2
-Usage: $PROG -h <host-arch> [-bdmx] [-K <kerneldir>] [-S <srcdir>] [-D <destdir>] [-c <custom-files-dir>] [-s <Mb size>] [<image>]
+Usage: $PROG -h <host-arch> [-bdmx] [-B <byte-order>] [-K <kerneldir>] [-S <srcdir>] [-D <destdir>] [-c <custom-files-dir>] [-s <Mb size>] [<image>]
 
 -b	Boot only, no sets loaded
 -r	root device kind (sd, wd, ld)
@@ -96,7 +96,7 @@
 }
 
 # First pass for options to get the host and src directories
-OPTS="K:D:S:bc:dh:mr:s:x"
+OPTS="B:D:K:S:bc:dh:mr:s:x"
 while getopts "$OPTS" f
 do
 	case $f in
@@ -127,11 +127,13 @@
 xsets_p=false
 minwrites=false
 rootdev=ld
+endian=
 
 OPTIND=1
 while getopts "$OPTS" f
 do
 	case $f in
+	B)	endian="-B $OPTARG";;
 	D)	release="$OPTARG";;
 	K)	kernel="$OPTARG";;
 	S)	;;
@@ -193,7 +195,7 @@
 
 if [ -z "${bootonly}" ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
-	${MAKEFS} -r -N ${release}/etc -t ffs -rx \
+	${MAKEFS} -rx ${endian} -N ${release}/etc -t ffs \
 	    -O ${ffsoffset} \
 	    -o d=4096,f=2048,b=16384 -b $((${extra}))m \
 	    -F "$tmp/selected_sets" ${image} "${release}" "${mnt}"
--- etc/etc.evbarm/Makefile.inc.orig	2015-07-13 17:18:27.000000000 +0900
+++ etc/etc.evbarm/Makefile.inc	2015-07-13 17:53:35.000000000 +0900
@@ -13,6 +13,7 @@
 .endfor
 
 .if !empty(MACHINE_ARCH:M*eb)
+IMAGEENDIAN=	be
 # big endian boards
 KERNEL_SETS.armv4+=		IXM1200
 EVBARM_BOARDS.xscale+=		ADI_BRH
@@ -32,6 +33,7 @@
 EVBARM_BOARDS.armv7+=		HUMMINGBIRD_A31
 EVBARM_BOARDS.armv7hf+=		HUMMINGBIRD_A31
 .else
+IMAGEENDIAN=	le
 # little endian boards
 #EVBARM_BOARDS.armv4+=		ARMADILLO210
 #EVBARM_BOARDS.armv4+=		ARMADILLO9
@@ -136,7 +138,7 @@
 	TOOL_MTREE=${TOOL_MTREE} \
 	HOST_SH=${HOST_SH} \
 	${HOST_SH} ${MKIMAGE} -x -h ${.TARGET:S/smp_//} -D ${DESTDIR} \
-	    -S ${NETBSDSRCDIR} ${MKI_OPTS.${.TARGET}} \
+	    -S ${NETBSDSRCDIR} -B ${IMAGEENDIAN} ${MKI_OPTS.${.TARGET}} \
 	    ${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz
 
 ARCHES.arm=		armv4 xscale armv5t armv6 armv7
--- distrib/utils/embedded/conf/armv7.conf.orig	2015-07-13 17:51:04.000000000 +0900
+++ distrib/utils/embedded/conf/armv7.conf	2015-07-13 17:51:21.000000000 +0900
@@ -45,7 +45,7 @@
 populate_awin() {
 	cat >> "${mnt}/boot/uEnv.txt" << EOF
 bootargs=root=ld0a console=${console}
-uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 82000000 ${kernel}; bootm 82000000
+uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 82000000 \$kernel; bootm 82000000
 EOF
 }
 


Home | Main Index | Thread Index | Old Index