From ccb7bf26233e1b6ef1dcb23ac7206beb53dcaff7 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 4 Feb 2015 11:45:15 +0000 Subject: [PATCH 01/74] Set a VERSION value. Sponsored by: The FreeBSD Foundation --- release/release.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/release.sh b/release/release.sh index 616ae96df7ae..eca772317fd6 100755 --- a/release/release.sh +++ b/release/release.sh @@ -39,6 +39,8 @@ PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" export PATH +VERSION=2 + # Prototypes that can be redefined per-chroot or per-target. load_chroot_env() { } load_target_env() { } From d8d0f3dc202282d964c153cee3e7831f8c108f4a Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 11 Feb 2015 20:25:21 +0000 Subject: [PATCH 02/74] Initial restructure for FreeBSD/arm release builds. Sponsored by: The FreeBSD Foundation --- release/Makefile | 1 + release/Makefile.arm | 36 +++++++++++++++++++++++++++++ release/arm/Makefile.BEAGLEBONE | 8 +++++++ release/arm/Makefile.PANDABOARD | 8 +++++++ release/arm/Makefile.RPI-B | 8 +++++++ release/arm/Makefile.WANDBOARD-QUAD | 8 +++++++ release/arm/Makefile.ZEDBOARD | 8 +++++++ 7 files changed, 77 insertions(+) create mode 100644 release/Makefile.arm create mode 100644 release/arm/Makefile.BEAGLEBONE create mode 100644 release/arm/Makefile.PANDABOARD create mode 100644 release/arm/Makefile.RPI-B create mode 100644 release/arm/Makefile.WANDBOARD-QUAD create mode 100644 release/arm/Makefile.ZEDBOARD diff --git a/release/Makefile b/release/Makefile index 0a3f50972d15..6dda932ac7d6 100644 --- a/release/Makefile +++ b/release/Makefile @@ -316,3 +316,4 @@ release-install: cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 .include "${.CURDIR}/Makefile.vm" +.include "${.CURDIR}/Makefile.arm" diff --git a/release/Makefile.arm b/release/Makefile.arm new file mode 100644 index 000000000000..714b2f56e675 --- /dev/null +++ b/release/Makefile.arm @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# + +BOARDS?= BEAGLEBONE \ + RPI-B \ + PANDABOARD \ + WANDBOARD-QUAD \ + ZEDBOARD \ + NUCLEUS + +ARMTARGETS?= +ARMSIZE?= 1G +ARMPORTS?= +CLEANFILES+= arm-all +WITH_ARM_IMAGES?=1 + +.if defined(WITH_ARM_IMAGES) && !empty(WITH_ARM_IMAGES) && !empty(BOARDS) +. for BOARD in ${BOARDS} +ARMTARGETS+= arm-${BOARD:tl} +CLEANDIRS+= arm-${BOARD:tl} +CLEANFILES+= arm-${BOARD:tu}.img \ + arm-${BOARD:tu}.raw \ + build-arm-${BOARD:tl} +. if exists(${.CURDIR}/arm/Makefile.${BOARD}) +. include "${.CURDIR}/arm/Makefile.${BOARD}" +. endif + +arm-${BOARD:tl}: + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} build-${.TARGET} +. endfor +.endif # !WITH_ARM_IMAGES + + +arm-all: ${ARMTARGETS} + touch ${.TARGET} diff --git a/release/arm/Makefile.BEAGLEBONE b/release/arm/Makefile.BEAGLEBONE new file mode 100644 index 000000000000..c70c29746be3 --- /dev/null +++ b/release/arm/Makefile.BEAGLEBONE @@ -0,0 +1,8 @@ +# +# $FreeBSD$ +# + +BOARD= BEAGLEBONE + +build-arm-${BOARD:tl}: + touch ${.TARGET} diff --git a/release/arm/Makefile.PANDABOARD b/release/arm/Makefile.PANDABOARD new file mode 100644 index 000000000000..ecec392584c4 --- /dev/null +++ b/release/arm/Makefile.PANDABOARD @@ -0,0 +1,8 @@ +# +# $FreeBSD$ +# + +BOARD= PANDABOARD + +build-arm-${BOARD:tl}: + touch ${.TARGET} diff --git a/release/arm/Makefile.RPI-B b/release/arm/Makefile.RPI-B new file mode 100644 index 000000000000..db36193dde1a --- /dev/null +++ b/release/arm/Makefile.RPI-B @@ -0,0 +1,8 @@ +# +# $FreeBSD$ +# + +BOARD= RPI-B + +build-arm-${BOARD:tl}: + touch ${.TARGET} diff --git a/release/arm/Makefile.WANDBOARD-QUAD b/release/arm/Makefile.WANDBOARD-QUAD new file mode 100644 index 000000000000..290bfdf46b7c --- /dev/null +++ b/release/arm/Makefile.WANDBOARD-QUAD @@ -0,0 +1,8 @@ +# +# $FreeBSD$ +# + +BOARD= WANDBOARD-QUAD + +build-arm-${BOARD:tl}: + touch ${.TARGET} diff --git a/release/arm/Makefile.ZEDBOARD b/release/arm/Makefile.ZEDBOARD new file mode 100644 index 000000000000..a17473fe80d6 --- /dev/null +++ b/release/arm/Makefile.ZEDBOARD @@ -0,0 +1,8 @@ +# +# $FreeBSD$ +# + +BOARD= ZEDBOARD + +build-arm-${BOARD:tl}: + touch ${.TARGET} From 879c1339e23ae9f521ba2354fe0d9e55dcdb19d1 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 11 Feb 2015 20:50:25 +0000 Subject: [PATCH 03/74] Add CROSS_TOOLCHAIN for arm builds. Remove a BOARDS entry left in while testing. Add build-arm-ports${BOARD} target as a prerequisite when ARMPORTS is set. Add build-arm-KERNCONF and build-arm-ports to CLEANFILES. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 22 +++++++++++++++++----- release/arm/Makefile.BEAGLEBONE | 3 ++- release/arm/Makefile.RPI-B | 3 ++- release/arm/Makefile.WANDBOARD-QUAD | 3 ++- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index 714b2f56e675..74c62c50da1e 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -6,14 +6,15 @@ BOARDS?= BEAGLEBONE \ RPI-B \ PANDABOARD \ WANDBOARD-QUAD \ - ZEDBOARD \ - NUCLEUS + ZEDBOARD ARMTARGETS?= ARMSIZE?= 1G +ARM_WFLAGS?= CROSS_TOOLCHAIN=armv6-gcc ARMPORTS?= -CLEANFILES+= arm-all + WITH_ARM_IMAGES?=1 +CLEANFILES+= arm-all .if defined(WITH_ARM_IMAGES) && !empty(WITH_ARM_IMAGES) && !empty(BOARDS) . for BOARD in ${BOARDS} @@ -21,7 +22,8 @@ ARMTARGETS+= arm-${BOARD:tl} CLEANDIRS+= arm-${BOARD:tl} CLEANFILES+= arm-${BOARD:tu}.img \ arm-${BOARD:tu}.raw \ - build-arm-${BOARD:tl} + build-arm-${BOARD:tl} \ + build-arm-ports${BOARD:tl} . if exists(${.CURDIR}/arm/Makefile.${BOARD}) . include "${.CURDIR}/arm/Makefile.${BOARD}" . endif @@ -31,6 +33,16 @@ arm-${BOARD:tl}: . endfor .endif # !WITH_ARM_IMAGES - arm-all: ${ARMTARGETS} touch ${.TARGET} + +build-arm-ports${BOARD:tl}: +.if defined(ARMPORTS) && !empty(ARMPORTS) +. if !exists(${PORTSDIR}/Makefile) +. error "Ports tree (${PORTSDIR}) is required." +. endif +. for AP in ${ARMPORTS} + @echo ${MAKE} -C ${PORTSDIR}/${AP} all install clean distclean +. endfor +.endif + touch ${.TARGET} diff --git a/release/arm/Makefile.BEAGLEBONE b/release/arm/Makefile.BEAGLEBONE index c70c29746be3..fdb1c2f5fee9 100644 --- a/release/arm/Makefile.BEAGLEBONE +++ b/release/arm/Makefile.BEAGLEBONE @@ -3,6 +3,7 @@ # BOARD= BEAGLEBONE +ARMPORTS= sysutils/u-boot-beaglebone -build-arm-${BOARD:tl}: +build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} touch ${.TARGET} diff --git a/release/arm/Makefile.RPI-B b/release/arm/Makefile.RPI-B index db36193dde1a..cf33862c0a72 100644 --- a/release/arm/Makefile.RPI-B +++ b/release/arm/Makefile.RPI-B @@ -3,6 +3,7 @@ # BOARD= RPI-B +ARMPORTS= sysutils/u-boot-rpi -build-arm-${BOARD:tl}: +build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} touch ${.TARGET} diff --git a/release/arm/Makefile.WANDBOARD-QUAD b/release/arm/Makefile.WANDBOARD-QUAD index 290bfdf46b7c..bea3d4ed4daa 100644 --- a/release/arm/Makefile.WANDBOARD-QUAD +++ b/release/arm/Makefile.WANDBOARD-QUAD @@ -3,6 +3,7 @@ # BOARD= WANDBOARD-QUAD +ARMPORTS= sysutils/u-boot-wandboard -build-arm-${BOARD:tl}: +build-arm-${BOARD:tl}: build-arm-ports touch ${.TARGET} From 5860267369d6f29aac47c4c318aa8d06181e9126 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 11 Feb 2015 20:51:58 +0000 Subject: [PATCH 04/74] Fix build-arm-ports target for WANDBOARD-QUAD. Sponsored by: The FreeBSD Foundation --- release/arm/Makefile.WANDBOARD-QUAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/arm/Makefile.WANDBOARD-QUAD b/release/arm/Makefile.WANDBOARD-QUAD index bea3d4ed4daa..9afc9f6f9e20 100644 --- a/release/arm/Makefile.WANDBOARD-QUAD +++ b/release/arm/Makefile.WANDBOARD-QUAD @@ -5,5 +5,5 @@ BOARD= WANDBOARD-QUAD ARMPORTS= sysutils/u-boot-wandboard -build-arm-${BOARD:tl}: build-arm-ports +build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} touch ${.TARGET} From 11a5d9d33b3fd22af17b9dc57082e39b94fcc487 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 12 Feb 2015 00:50:54 +0000 Subject: [PATCH 05/74] Add a ROADMAP file for FreeBSD/arm release builds, which will make final documentation much easier when done. Sponsored by: The FreeBSD Foundation --- release/arm/ROADMAP | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 release/arm/ROADMAP diff --git a/release/arm/ROADMAP b/release/arm/ROADMAP new file mode 100644 index 000000000000..c76a41eb57a9 --- /dev/null +++ b/release/arm/ROADMAP @@ -0,0 +1,18 @@ +# +# $FreeBSD$ +# + +== WORKFLOW +===================================================================== + +- buildworld [1] +- buildkernel [1] +- ports build [2] +- md(4) device creation, mount, installworld, installkernel +- u-boot magic [2] +- rc.conf edits (gpart resize, sshd, etc.) +- ??? +- profit. + +[1]: Requires CROSS_TOOLCHAIN +[2]: If necessary From 67a7660de36b59b482e97743883c2f26b65e1d2c Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 25 Mar 2015 23:24:05 +0000 Subject: [PATCH 06/74] Move the 'build-arm-ports${BOARD}' within the for loop to fix target/variable expansion. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index 74c62c50da1e..380fcb527b49 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -30,11 +30,6 @@ CLEANFILES+= arm-${BOARD:tu}.img \ arm-${BOARD:tl}: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} build-${.TARGET} -. endfor -.endif # !WITH_ARM_IMAGES - -arm-all: ${ARMTARGETS} - touch ${.TARGET} build-arm-ports${BOARD:tl}: .if defined(ARMPORTS) && !empty(ARMPORTS) @@ -46,3 +41,8 @@ build-arm-ports${BOARD:tl}: . endfor .endif touch ${.TARGET} +. endfor +.endif # !WITH_ARM_IMAGES + +arm-all: ${ARMTARGETS} + touch ${.TARGET} From 9515d8af2837c9f120aeea6252bebbd93b814571 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 25 Mar 2015 23:29:35 +0000 Subject: [PATCH 07/74] Reindent. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index 380fcb527b49..873ec5030d3e 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -32,14 +32,14 @@ arm-${BOARD:tl}: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} build-${.TARGET} build-arm-ports${BOARD:tl}: -.if defined(ARMPORTS) && !empty(ARMPORTS) -. if !exists(${PORTSDIR}/Makefile) -. error "Ports tree (${PORTSDIR}) is required." -. endif -. for AP in ${ARMPORTS} +. if defined(ARMPORTS) && !empty(ARMPORTS) +. if !exists(${PORTSDIR}/Makefile) +. error "Ports tree (${PORTSDIR}) is required." +. endif +. for AP in ${ARMPORTS} @echo ${MAKE} -C ${PORTSDIR}/${AP} all install clean distclean -. endfor -.endif +. endfor +. endif touch ${.TARGET} . endfor .endif # !WITH_ARM_IMAGES From 5fca2cc723b5d0453021a3cec59610afb9df70d8 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 00:07:40 +0000 Subject: [PATCH 08/74] Add targets for world/kernel build, currently only echoed for debugging purposes. Add comment to mark the end of the main loop. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index 873ec5030d3e..a716d37f96e7 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -20,7 +20,11 @@ CLEANFILES+= arm-all . for BOARD in ${BOARDS} ARMTARGETS+= arm-${BOARD:tl} CLEANDIRS+= arm-${BOARD:tl} -CLEANFILES+= arm-${BOARD:tu}.img \ +CLEANFILES+= arm-buildworld${BOARD:tl} \ + arm-buildkernel${BOARD:tl} \ + arm-installworld${BOARD:tl} \ + arm-installkernel${BOARD:tl} \ + arm-${BOARD:tu}.img \ arm-${BOARD:tu}.raw \ build-arm-${BOARD:tl} \ build-arm-ports${BOARD:tl} @@ -28,9 +32,30 @@ CLEANFILES+= arm-${BOARD:tu}.img \ . include "${.CURDIR}/arm/Makefile.${BOARD}" . endif -arm-${BOARD:tl}: +arm-${BOARD:tl}: arm-buildworld${BOARD:tl} arm-buildkernel${BOARD:tl} \ + arm-installworld${BOARD:tl} arm-installkernel${BOARD:tl} ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} build-${.TARGET} +arm-buildworld${BOARD:tl}: + @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ + buildworld + touch ${.TARGET} + +arm-buildkernel${BOARD:tl}: + @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ + KERNCONF=${BOARD} buildkernel + touch ${.TARGET} + +arm-installworld${BOARD:tl}: + @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ + installworld + touch ${.TARGET} + +arm-installkernel${BOARD:tl}: + @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ + KERNCONF=${BOARD} installkernel + touch ${.TARGET} + build-arm-ports${BOARD:tl}: . if defined(ARMPORTS) && !empty(ARMPORTS) . if !exists(${PORTSDIR}/Makefile) @@ -41,7 +66,8 @@ build-arm-ports${BOARD:tl}: . endfor . endif touch ${.TARGET} -. endfor + +. endfor # main loop .endif # !WITH_ARM_IMAGES arm-all: ${ARMTARGETS} From 36454f571139fbdafa0f221d9f7e0d76fcc0e1a8 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 01:00:48 +0000 Subject: [PATCH 09/74] Add glue to make the md(4) device for populating the userland/kernel. Clean up a few variable names. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index a716d37f96e7..6c5bd8d9b42a 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -19,19 +19,32 @@ CLEANFILES+= arm-all .if defined(WITH_ARM_IMAGES) && !empty(WITH_ARM_IMAGES) && !empty(BOARDS) . for BOARD in ${BOARDS} ARMTARGETS+= arm-${BOARD:tl} +ARMBEFORECLEAN+= arm-mdclean${BOARD:tl} CLEANDIRS+= arm-${BOARD:tl} CLEANFILES+= arm-buildworld${BOARD:tl} \ arm-buildkernel${BOARD:tl} \ arm-installworld${BOARD:tl} \ arm-installkernel${BOARD:tl} \ - arm-${BOARD:tu}.img \ - arm-${BOARD:tu}.raw \ + ${${BOARD:tu}IMAGE} \ + ${${BOARD:tu}MDDEV} \ + ${${BOARD:tu}MDFILE} \ build-arm-${BOARD:tl} \ build-arm-ports${BOARD:tl} +${BOARD:tu}IMAGE= arm-${BOARD:tu}.img +${BOARD:tu}MDDEV= arm-${BOARD:tu}.mddev +${BOARD:tu}MDFILE= arm-${BOARD:tu}.raw . if exists(${.CURDIR}/arm/Makefile.${BOARD}) . include "${.CURDIR}/arm/Makefile.${BOARD}" . endif +arm-mdcleanall: ${ARMBEFORECLEAN} + +arm-mdclean${BOARD:tl}: +.if exists(${${BOARD:tu}MDDEV}) + umount ${${BOARD:tu}MDFILE} || true + mdconfig -d -u $$(cat ${${BOARD:tu}MDDEV}) +.endif + arm-${BOARD:tl}: arm-buildworld${BOARD:tl} arm-buildkernel${BOARD:tl} \ arm-installworld${BOARD:tl} arm-installkernel${BOARD:tl} ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} build-${.TARGET} @@ -46,7 +59,7 @@ arm-buildkernel${BOARD:tl}: KERNCONF=${BOARD} buildkernel touch ${.TARGET} -arm-installworld${BOARD:tl}: +arm-installworld${BOARD:tl}: arm-mkfs${BOARD:tl} @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ installworld touch ${.TARGET} @@ -56,6 +69,12 @@ arm-installkernel${BOARD:tl}: KERNCONF=${BOARD} installkernel touch ${.TARGET} +arm-mkfs${BOARD:tl}: + mkdir -p ${.OBJDIR}/arm-${BOARD:tl} + truncate -s ${ARMSIZE} ${.OBJDIR}/arm-${BOARD:tu}.raw + echo $$(mdconfig -f ${${BOARD:tu}MDFILE}) > \ + ${${BOARD:tu}MDDEV} + build-arm-ports${BOARD:tl}: . if defined(ARMPORTS) && !empty(ARMPORTS) . if !exists(${PORTSDIR}/Makefile) @@ -70,5 +89,7 @@ build-arm-ports${BOARD:tl}: . endfor # main loop .endif # !WITH_ARM_IMAGES +beforeclean: arm-mdcleanall + arm-all: ${ARMTARGETS} touch ${.TARGET} From bf285fb8d11d62594093e6f0cb68b27b1c4a3a4e Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 01:03:38 +0000 Subject: [PATCH 10/74] Fix 'beforeclean' broken in previous commit. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index 6c5bd8d9b42a..fd8b466f6b9b 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -37,8 +37,6 @@ ${BOARD:tu}MDFILE= arm-${BOARD:tu}.raw . include "${.CURDIR}/arm/Makefile.${BOARD}" . endif -arm-mdcleanall: ${ARMBEFORECLEAN} - arm-mdclean${BOARD:tl}: .if exists(${${BOARD:tu}MDDEV}) umount ${${BOARD:tu}MDFILE} || true @@ -89,7 +87,7 @@ build-arm-ports${BOARD:tl}: . endfor # main loop .endif # !WITH_ARM_IMAGES -beforeclean: arm-mdcleanall +beforeclean: ${ARMBEFORECLEAN} arm-all: ${ARMTARGETS} touch ${.TARGET} From 97c7ab34a65224a9559872d3ea66b9ccb7fddce9 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 01:06:29 +0000 Subject: [PATCH 11/74] Prevent possible duplicate md(4) creation with separate device id. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/Makefile.arm b/release/Makefile.arm index fd8b466f6b9b..dd6fde16a1b5 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -68,10 +68,12 @@ arm-installkernel${BOARD:tl}: touch ${.TARGET} arm-mkfs${BOARD:tl}: +.if !exists(${${BOARD:tu}MDDEV}) mkdir -p ${.OBJDIR}/arm-${BOARD:tl} truncate -s ${ARMSIZE} ${.OBJDIR}/arm-${BOARD:tu}.raw echo $$(mdconfig -f ${${BOARD:tu}MDFILE}) > \ ${${BOARD:tu}MDDEV} +.endif build-arm-ports${BOARD:tl}: . if defined(ARMPORTS) && !empty(ARMPORTS) From 993137c18aa170eebff5dbfa68ca7513f4a0eb5b Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 01:20:54 +0000 Subject: [PATCH 12/74] Specify .OBJDIR for consistency. Call newfs(8) and mount the md(4) device to the target directory. Specify DESTDIR for installworld, distribution, and installkernel targets. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index dd6fde16a1b5..b1c094fda1a4 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -59,20 +59,24 @@ arm-buildkernel${BOARD:tl}: arm-installworld${BOARD:tl}: arm-mkfs${BOARD:tl} @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ - installworld + DESTDIR=${.OBJDIR}/arm-${BOARD:tl} installworld distribution touch ${.TARGET} arm-installkernel${BOARD:tl}: @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ - KERNCONF=${BOARD} installkernel + DESTDIR=${.OBJDIR}/arm-${BOARD:tl} KERNCONF=${BOARD} \ + installkernel touch ${.TARGET} arm-mkfs${BOARD:tl}: .if !exists(${${BOARD:tu}MDDEV}) mkdir -p ${.OBJDIR}/arm-${BOARD:tl} - truncate -s ${ARMSIZE} ${.OBJDIR}/arm-${BOARD:tu}.raw - echo $$(mdconfig -f ${${BOARD:tu}MDFILE}) > \ - ${${BOARD:tu}MDDEV} + truncate -s ${ARMSIZE} ${.OBJDIR}/${${BOARD:tu}MDFILE} + echo $$(mdconfig -f ${.OBJDIR}/${${BOARD:tu}MDFILE}) > \ + ${.OBJDIR}/${${BOARD:tu}MDDEV} + newfs -S 4096 /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}MDDEV}) + mount /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}MDDEV}) \ + ${.OBJDIR}/arm-${BOARD:tl} .endif build-arm-ports${BOARD:tl}: From ff67b7d13a6abddfd866e52bbacd9c1b8aa42f82 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 02:02:51 +0000 Subject: [PATCH 13/74] Create the md(4) device for the /boot msdosfs GPT partition. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index b1c094fda1a4..8bc58a89327a 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -10,6 +10,7 @@ BOARDS?= BEAGLEBONE \ ARMTARGETS?= ARMSIZE?= 1G +BOOTSIZE?= 4m ARM_WFLAGS?= CROSS_TOOLCHAIN=armv6-gcc ARMPORTS?= @@ -20,7 +21,8 @@ CLEANFILES+= arm-all . for BOARD in ${BOARDS} ARMTARGETS+= arm-${BOARD:tl} ARMBEFORECLEAN+= arm-mdclean${BOARD:tl} -CLEANDIRS+= arm-${BOARD:tl} +CLEANDIRS+= arm-${BOARD:tl} \ + arm-${BOARD:tl}-boot CLEANFILES+= arm-buildworld${BOARD:tl} \ arm-buildkernel${BOARD:tl} \ arm-installworld${BOARD:tl} \ @@ -28,11 +30,15 @@ CLEANFILES+= arm-buildworld${BOARD:tl} \ ${${BOARD:tu}IMAGE} \ ${${BOARD:tu}MDDEV} \ ${${BOARD:tu}MDFILE} \ + ${${BOARD:tu}BOOTDEV} \ + ${${BOARD:tu}BOOTFILE} \ build-arm-${BOARD:tl} \ build-arm-ports${BOARD:tl} ${BOARD:tu}IMAGE= arm-${BOARD:tu}.img ${BOARD:tu}MDDEV= arm-${BOARD:tu}.mddev ${BOARD:tu}MDFILE= arm-${BOARD:tu}.raw +${BOARD:tu}BOOTDEV= arm-${BOARD:tu}.bootdev +${BOARD:tu}BOOTFILE= arm-${BOARD:tu}.boot . if exists(${.CURDIR}/arm/Makefile.${BOARD}) . include "${.CURDIR}/arm/Makefile.${BOARD}" . endif @@ -42,6 +48,10 @@ arm-mdclean${BOARD:tl}: umount ${${BOARD:tu}MDFILE} || true mdconfig -d -u $$(cat ${${BOARD:tu}MDDEV}) .endif +.if exists(${${BOARD:tu}BOOTDEV}) + umount ${${BOARD:tu}BOOTFILE} || true + mdconfig -d -u $$(cat ${${BOARD:tu}BOOTDEV}) +.endif arm-${BOARD:tl}: arm-buildworld${BOARD:tl} arm-buildkernel${BOARD:tl} \ arm-installworld${BOARD:tl} arm-installkernel${BOARD:tl} @@ -78,6 +88,15 @@ arm-mkfs${BOARD:tl}: mount /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}MDDEV}) \ ${.OBJDIR}/arm-${BOARD:tl} .endif +.if !exists(${${BOARD:tu}BOOTDEV}) + mkdir -p ${.OBJDIR}/arm-${BOARD:tl}-boot + truncate -s ${BOOTSIZE} ${.OBJDIR}/${${BOARD:tu}BOOTFILE} + echo $$(mdconfig -f ${.OBJDIR}/${${BOARD:tu}BOOTFILE}) > \ + ${.OBJDIR}/${${BOARD:tu}BOOTDEV} + newfs_msdos -S 4096 /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) + mount /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) \ + ${.OBJDIR}/arm-${BOARD:tl}-boot +.endif build-arm-ports${BOARD:tl}: . if defined(ARMPORTS) && !empty(ARMPORTS) From 6c5e58750cde06819d08cf91cba929f3bfcc6874 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 02:19:38 +0000 Subject: [PATCH 14/74] Create the md(4) device for the /boot msdosfs GPT partition. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.arm b/release/Makefile.arm index 8bc58a89327a..e3c4a0873144 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -94,7 +94,7 @@ arm-mkfs${BOARD:tl}: echo $$(mdconfig -f ${.OBJDIR}/${${BOARD:tu}BOOTFILE}) > \ ${.OBJDIR}/${${BOARD:tu}BOOTDEV} newfs_msdos -S 4096 /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) - mount /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) \ + mount_msdosfs /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) \ ${.OBJDIR}/arm-${BOARD:tl}-boot .endif From 6d81f38c6a32511fb4c483348b1168d501bc76bc Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 26 Mar 2015 03:05:07 +0000 Subject: [PATCH 15/74] Attempt to create the final image (though not nearly ready for it yet). This is probably very broken and/or wrong, but that's why we have projects branches. Sponsored by: The FreeBSD Foundation --- release/Makefile.arm | 16 ++++++++++++++++ release/arm/Makefile.BEAGLEBONE | 1 + release/arm/Makefile.PANDABOARD | 1 + release/arm/Makefile.RPI-B | 1 + release/arm/Makefile.WANDBOARD-QUAD | 1 + release/arm/Makefile.ZEDBOARD | 1 + 6 files changed, 21 insertions(+) diff --git a/release/Makefile.arm b/release/Makefile.arm index e3c4a0873144..b7092c32bbc1 100644 --- a/release/Makefile.arm +++ b/release/Makefile.arm @@ -98,6 +98,22 @@ arm-mkfs${BOARD:tl}: ${.OBJDIR}/arm-${BOARD:tl}-boot .endif +arm-mkimage${BOARD:tl}: +.if exists(/dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) + umount ${.OBJDIR}/arm-${BOARD:tl}-boot +.endif +.if exists(/dev/$$(cat ${.OBJDIR}/${${BOARD:tu}MDDEV}) + umount ${.OBJDIR}/arm-${BOARD:tl} +.endif +# FIXME: +# Do these things need to be MBR? +# I'm also not entirely sure this is correct, anyway. +# + mkimg -s ${${BOARD}PARTSCHEME} \ + -b ${${BOARD:tu}BOOTFILE} \ + -p freebsd/rootfs:=${${BOARD:tu}MDFILE} \ + -o ${${BOARD:tu}IMAGE} + build-arm-ports${BOARD:tl}: . if defined(ARMPORTS) && !empty(ARMPORTS) . if !exists(${PORTSDIR}/Makefile) diff --git a/release/arm/Makefile.BEAGLEBONE b/release/arm/Makefile.BEAGLEBONE index fdb1c2f5fee9..5f59f0317d88 100644 --- a/release/arm/Makefile.BEAGLEBONE +++ b/release/arm/Makefile.BEAGLEBONE @@ -3,6 +3,7 @@ # BOARD= BEAGLEBONE +${BOARD}PARTSCHEME= mbr ARMPORTS= sysutils/u-boot-beaglebone build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} diff --git a/release/arm/Makefile.PANDABOARD b/release/arm/Makefile.PANDABOARD index ecec392584c4..cd911e9cbb62 100644 --- a/release/arm/Makefile.PANDABOARD +++ b/release/arm/Makefile.PANDABOARD @@ -3,6 +3,7 @@ # BOARD= PANDABOARD +${BOARD}PARTSCHEME= mbr build-arm-${BOARD:tl}: touch ${.TARGET} diff --git a/release/arm/Makefile.RPI-B b/release/arm/Makefile.RPI-B index cf33862c0a72..c81e51ed35c6 100644 --- a/release/arm/Makefile.RPI-B +++ b/release/arm/Makefile.RPI-B @@ -3,6 +3,7 @@ # BOARD= RPI-B +${BOARD}PARTSCHEME= mbr ARMPORTS= sysutils/u-boot-rpi build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} diff --git a/release/arm/Makefile.WANDBOARD-QUAD b/release/arm/Makefile.WANDBOARD-QUAD index 9afc9f6f9e20..d7f7ff7e4474 100644 --- a/release/arm/Makefile.WANDBOARD-QUAD +++ b/release/arm/Makefile.WANDBOARD-QUAD @@ -3,6 +3,7 @@ # BOARD= WANDBOARD-QUAD +${BOARD}PARTSCHEME= mbr ARMPORTS= sysutils/u-boot-wandboard build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} diff --git a/release/arm/Makefile.ZEDBOARD b/release/arm/Makefile.ZEDBOARD index a17473fe80d6..5d3a6856cc1d 100644 --- a/release/arm/Makefile.ZEDBOARD +++ b/release/arm/Makefile.ZEDBOARD @@ -3,6 +3,7 @@ # BOARD= ZEDBOARD +${BOARD}PARTSCHEME= mbr build-arm-${BOARD:tl}: touch ${.TARGET} From fb539361f71a6ae2f1123990d2d172036c7ecd60 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 14:21:51 +0000 Subject: [PATCH 16/74] Add the following functions to release.sh to organize and make clear the workflow: - env_setup() - env_check() - chroot_setup() - extra_chroot_setup() - chroot_build_target() - chroot_build_release() There should be no functional changes at this point. Sponsored by: The FreeBSD Foundation --- release/release.sh | 474 ++++++++++++++++++++++++--------------------- 1 file changed, 256 insertions(+), 218 deletions(-) diff --git a/release/release.sh b/release/release.sh index a822d783c59d..7806c036a993 100755 --- a/release/release.sh +++ b/release/release.sh @@ -46,249 +46,287 @@ load_chroot_env() { } load_target_env() { } buildenv_setup() { } -# The directory within which the release will be built. -CHROOTDIR="/scratch" -RELENGDIR="$(realpath $(dirname $(basename ${0})))" - -# The default version control system command to obtain the sources. -VCSCMD="svn checkout" - -# The default svn checkout server, and svn branches for src/, doc/, -# and ports/. -SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" - -# Set for embedded device builds. -EMBEDDEDBUILD= - -# Sometimes one needs to checkout src with --force svn option. -# If custom kernel configs copied to src tree before checkout, e.g. -SRC_FORCE_CHECKOUT= - -# The default make.conf and src.conf to use. Set to /dev/null -# by default to avoid polluting the chroot(8) environment with -# non-default settings. -MAKE_CONF="/dev/null" -SRC_CONF="/dev/null" - -# The number of make(1) jobs, defaults to the number of CPUs available for -# buildworld, and half of number of CPUs available for buildkernel. -WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" - -MAKE_FLAGS="-s" - -# The name of the kernel to build, defaults to GENERIC. -KERNEL="GENERIC" - -# Set to non-empty value to disable checkout of doc/ and/or ports/. Disabling -# ports/ checkout also forces NODOC to be set. -NODOC= -NOPORTS= - -# Set to non-empty value to build dvd1.iso as part of the release. -WITH_DVD= -WITH_COMPRESSED_IMAGES= - -# Set to non-empty value to build virtual machine images as part of -# the release. -WITH_VMIMAGES= -WITH_COMPRESSED_VMIMAGES= -XZ_THREADS=0 - -# Set to non-empty value to build virtual machine images for various -# cloud providers as part of the release. -WITH_CLOUDWARE= - usage() { echo "Usage: $0 [-c release.conf]" exit 1 } -while getopts c: opt; do - case ${opt} in - c) - RELEASECONF="${OPTARG}" - if [ ! -e "${RELEASECONF}" ]; then - echo "ERROR: Configuration file ${RELEASECONF} does not exist." - exit 1 - fi - # Source the specified configuration file for overrides - . ${RELEASECONF} - ;; - \?) - usage - ;; - esac -done -shift $(($OPTIND - 1)) +env_setup() { + # The directory within which the release will be built. + CHROOTDIR="/scratch" + RELENGDIR="$(realpath $(dirname $(basename ${0})))" -# Fix for backwards-compatibility with release.conf that does not have the -# trailing '/'. -case ${SVNROOT} in - *svn*) - SVNROOT="${SVNROOT}/" - ;; - *) - ;; -esac + # The default version control system command to obtain the sources. + VCSCMD="svn checkout" -# Prefix the branches with the SVNROOT for the full checkout URL. -SRCBRANCH="${SVNROOT}${SRCBRANCH}" -DOCBRANCH="${SVNROOT}${DOCBRANCH}" -PORTBRANCH="${SVNROOT}${PORTBRANCH}" + # The default svn checkout server, and svn branches for src/, doc/, + # and ports/. + SVNROOT="svn://svn.FreeBSD.org/" + SRCBRANCH="base/head@rHEAD" + DOCBRANCH="doc/head@rHEAD" + PORTBRANCH="ports/head@rHEAD" -if [ -n "${EMBEDDEDBUILD}" ]; then + # Set for embedded device builds. + EMBEDDEDBUILD= + + # Sometimes one needs to checkout src with --force svn option. + # If custom kernel configs copied to src tree before checkout, e.g. + SRC_FORCE_CHECKOUT= + + # The default make.conf and src.conf to use. Set to /dev/null + # by default to avoid polluting the chroot(8) environment with + # non-default settings. + MAKE_CONF="/dev/null" + SRC_CONF="/dev/null" + + # The number of make(1) jobs, defaults to the number of CPUs available for + # buildworld, and half of number of CPUs available for buildkernel. + WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" + KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" + + MAKE_FLAGS="-s" + + # The name of the kernel to build, defaults to GENERIC. + KERNEL="GENERIC" + + # Set to non-empty value to disable checkout of doc/ and/or ports/. Disabling + # ports/ checkout also forces NODOC to be set. + NODOC= + NOPORTS= + + # Set to non-empty value to build dvd1.iso as part of the release. WITH_DVD= WITH_COMPRESSED_IMAGES= - NODOC=yes -fi -# If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree -# is required to build the documentation set. -if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then - echo "*** NOTICE: Setting NODOC=1 since ports tree is required" - echo " and NOPORTS is set." - NODOC=yes -fi + # Set to non-empty value to build virtual machine images as part of + # the release. + WITH_VMIMAGES= + WITH_COMPRESSED_VMIMAGES= + XZ_THREADS=0 -# If NOPORTS and/or NODOC are unset, they must not pass to make as variables. -# The release makefile verifies definedness of NOPORTS/NODOC variables -# instead of their values. -DOCPORTS= -if [ -n "${NOPORTS}" ]; then - DOCPORTS="NOPORTS=yes " -fi -if [ -n "${NODOC}" ]; then - DOCPORTS="${DOCPORTS}NODOC=yes" -fi + # Set to non-empty value to build virtual machine images for various + # cloud providers as part of the release. + WITH_CLOUDWARE= -# The aggregated build-time flags based upon variables defined within -# this file, unless overridden by release.conf. In most cases, these -# will not need to be changed. -CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}" -if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then - ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" -else - ARCH_FLAGS= -fi -load_chroot_env -CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" -CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" -CHROOT_IMAKEFLAGS="${CONF_FILES}" -CHROOT_DMAKEFLAGS="${CONF_FILES}" -RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" -RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" -RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ - WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" + CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" + CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" + CHROOT_IMAKEFLAGS="${CONF_FILES}" + CHROOT_DMAKEFLAGS="${CONF_FILES}" + RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" + RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" + RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ + ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ + WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" -# Force src checkout if configured -FORCE_SRC_KEY= -if [ -n "${SRC_FORCE_CHECKOUT}" ]; then - FORCE_SRC_KEY="--force" -fi + return 0 +} # env_setup() -if [ -z "${CHROOTDIR}" ]; then - echo "Please set CHROOTDIR." - exit 1 -fi +env_check() { + # Fix for backwards-compatibility with release.conf that does not have the + # trailing '/'. + case ${SVNROOT} in + *svn*) + SVNROOT="${SVNROOT}/" + ;; + *) + ;; + esac -if [ $(id -u) -ne 0 ]; then - echo "Needs to be run as root." - exit 1 -fi + # Prefix the branches with the SVNROOT for the full checkout URL. + SRCBRANCH="${SVNROOT}${SRCBRANCH}" + DOCBRANCH="${SVNROOT}${DOCBRANCH}" + PORTBRANCH="${SVNROOT}${PORTBRANCH}" -set -e # Everything must succeed + if [ -n "${EMBEDDEDBUILD}" ]; then + WITH_DVD= + WITH_COMPRESSED_IMAGES= + NODOC=yes + fi -mkdir -p ${CHROOTDIR}/usr + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree + # is required to build the documentation set. + if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then + echo "*** NOTICE: Setting NODOC=1 since ports tree is required" + echo " and NOPORTS is set." + NODOC=yes + fi -if [ -z "${SRC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src -fi -if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc -fi -if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports -fi + # If NOPORTS and/or NODOC are unset, they must not pass to make as variables. + # The release makefile verifies definedness of NOPORTS/NODOC variables + # instead of their values. + DOCPORTS= + if [ -n "${NOPORTS}" ]; then + DOCPORTS="NOPORTS=yes " + fi + if [ -n "${NODOC}" ]; then + DOCPORTS="${DOCPORTS}NODOC=yes" + fi -if [ -z "${CHROOTBUILD_SKIP}" ]; then - cd ${CHROOTDIR}/usr/src - env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld - env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ - DESTDIR=${CHROOTDIR} - env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ - DESTDIR=${CHROOTDIR} -fi -mount -t devfs devfs ${CHROOTDIR}/dev -cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf -trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit + # The aggregated build-time flags based upon variables defined within + # this file, unless overridden by release.conf. In most cases, these + # will not need to be changed. + CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}" + if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then + ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" + else + ARCH_FLAGS= + fi + # Force src checkout if configured + FORCE_SRC_KEY= + if [ -n "${SRC_FORCE_CHECKOUT}" ]; then + FORCE_SRC_KEY="--force" + fi -# If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), -# copy them to the chroot. -if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then - mkdir -p ${CHROOTDIR}/$(dirname ${MAKE_CONF}) - cp ${MAKE_CONF} ${CHROOTDIR}/${MAKE_CONF} -fi -if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CONF} ]; then - mkdir -p ${CHROOTDIR}/$(dirname ${SRC_CONF}) - cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} -fi + if [ -z "${CHROOTDIR}" ]; then + echo "Please set CHROOTDIR." + exit 1 + fi -# Embedded builds do not use the 'make release' target. -if [ -n "${EMBEDDEDBUILD}" ]; then + if [ $(id -u) -ne 0 ]; then + echo "Needs to be run as root." + exit 1 + fi + + return 0 +} # env_check() + +chroot_setup() { + load_chroot_env + mkdir -p ${CHROOTDIR}/usr + + if [ -z "${SRC_UPDATE_SKIP}" ]; then + ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src + fi + if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then + ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc + fi + if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then + ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports + fi + + if [ -z "${CHROOTBUILD_SKIP}" ]; then + cd ${CHROOTDIR}/usr/src + env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld + env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ + DESTDIR=${CHROOTDIR} + env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ + DESTDIR=${CHROOTDIR} + fi + mount -t devfs devfs ${CHROOTDIR}/dev + cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf + + return 0 +} # chroot_setup() + +extra_chroot_setup() { + # If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), + # copy them to the chroot. + if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then + mkdir -p ${CHROOTDIR}/$(dirname ${MAKE_CONF}) + cp ${MAKE_CONF} ${CHROOTDIR}/${MAKE_CONF} + fi + if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CONF} ]; then + mkdir -p ${CHROOTDIR}/$(dirname ${SRC_CONF}) + cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} + fi + + if [ -d ${CHROOTDIR}/usr/ports ]; then + # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints + # is created. This is needed by ports-mgmt/pkg. + chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + + ## Trick the ports 'run-autotools-fixup' target to do the right thing. + _OSVERSION=$(sysctl -n kern.osreldate) + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + UNAME_r=${REVISION}-${BRANCH} + if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" + PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" + chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ + ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" \ + install clean distclean + fi + fi + + return 0 +} # extra_chroot_setup() + +chroot_build_target() { buildenv_setup - # If a crochet configuration file exists in *this* checkout of - # release/, copy it to the /tmp/external directory within the chroot. - # This allows building embedded releases without relying on updated - # scripts and/or configurations to exist in the branch being built. load_target_env - if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ - [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then - mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/ - cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \ - ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf - /bin/sh ${RELENGDIR}/${XDEV}/release.sh + eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld + eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel + + # Embedded builds do not use the 'make release' target. + if [ -n "${EMBEDDEDBUILD}" ]; then + buildenv_setup + # If a crochet configuration file exists in *this* checkout of + # release/, copy it to the /tmp/external directory within the chroot. + # This allows building embedded releases without relying on updated + # scripts and/or configurations to exist in the branch being built. + load_target_env + if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ + [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then + mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/ + cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \ + ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf + /bin/sh ${RELENGDIR}/${XDEV}/release.sh + fi + # If the script does not exist for this architecture, exit. + # This probably should be checked earlier, but allowing the rest + # of the build process to get this far will at least set up the + # chroot environment for testing. + return 1 + else + # Not embedded. + return 0 fi - # If the script does not exist for this architecture, exit. - # This probably should be checked earlier, but allowing the rest - # of the build process to get this far will at least set up the - # chroot environment for testing. - exit 0 -else - # Not embedded. - continue -fi -if [ -d ${CHROOTDIR}/usr/ports ]; then - # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints - # is created. This is needed by ports-mgmt/pkg. - chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + return 0 +} # chroot_build_target - ## Trick the ports 'run-autotools-fixup' target to do the right thing. - _OSVERSION=$(sysctl -n kern.osreldate) - REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) - BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) - UNAME_r=${REVISION}-${BRANCH} - if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then - PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" - PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" - PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" - chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ - ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" \ - install clean distclean - fi -fi +chroot_build_release() { + buildenv_setup + load_target_env + eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ + release + eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ + install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ + WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} -buildenv_setup -load_target_env -eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld -eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel -eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - release -eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ - WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} + return 0 +} # chroot_build_release() + +main() { + set -e # Everything must succeed + env_setup + while getopts c: opt; do + case ${opt} in + c) + RELEASECONF="${OPTARG}" + if [ ! -e "${RELEASECONF}" ]; then + echo "ERROR: Configuration file ${RELEASECONF} does not exist." + exit 1 + fi + # Source the specified configuration file for overrides + . ${RELEASECONF} + ;; + \?) + usage + ;; + esac + done + shift $(($OPTIND - 1)) + trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit + env_check + chroot_setup + extra_chroot_setup + chroot_build_target + chroot_build_release + + return 0 +} # main() + +main "${@}" From a12fa24967c5d53433d728392e91e8c67a3a6766 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 14:35:43 +0000 Subject: [PATCH 17/74] Add documentation for newly-added functions. While here, move CHROOT_* and RELEASE_* variables from env_setup() to env_check() since they may change if a release.conf file is used. Sponsored by: The FreeBSD Foundation --- release/release.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/release/release.sh b/release/release.sh index 7806c036a993..0674c2fa08f6 100755 --- a/release/release.sh +++ b/release/release.sh @@ -51,6 +51,9 @@ usage() { exit 1 } +# env_setup(): Set up the default build environment variables, such as the +# CHROOTDIR, VCSCMD, SVNROOT, etc. This is called before the release.conf +# file is sourced, if '-c ' is specified. env_setup() { # The directory within which the release will be built. CHROOTDIR="/scratch" @@ -108,19 +111,13 @@ env_setup() { # cloud providers as part of the release. WITH_CLOUDWARE= - CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" - CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" - CHROOT_IMAKEFLAGS="${CONF_FILES}" - CHROOT_DMAKEFLAGS="${CONF_FILES}" - RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" - RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" - RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ - WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" - return 0 } # env_setup() +# env_check(): Perform sanity tests on the build environment, such as ensuring +# files/directories exist, as well as adding backwards-compatibility hacks if +# necessary. This is called unconditionally, and overrides the defaults set +# in env_setup() if '-c ' is specified. env_check() { # Fix for backwards-compatibility with release.conf that does not have the # trailing '/'. @@ -187,9 +184,20 @@ env_check() { exit 1 fi + CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" + CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" + CHROOT_IMAKEFLAGS="${CONF_FILES}" + CHROOT_DMAKEFLAGS="${CONF_FILES}" + RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" + RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" + RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ + ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ + WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" + return 0 } # env_check() +# chroot_setup(): Prepare the build chroot environment for the release build. chroot_setup() { load_chroot_env mkdir -p ${CHROOTDIR}/usr @@ -218,6 +226,8 @@ chroot_setup() { return 0 } # chroot_setup() +# extra_chroot_setup(): Prepare anything additional within the build +# necessary for the release build. extra_chroot_setup() { # If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), # copy them to the chroot. @@ -253,6 +263,7 @@ extra_chroot_setup() { return 0 } # extra_chroot_setup() +# chroot_build_target(): Build the userland and kernel for the build target. chroot_build_target() { buildenv_setup load_target_env @@ -287,6 +298,7 @@ chroot_build_target() { return 0 } # chroot_build_target +# chroot_build_release(): Invoke the 'make release' target. chroot_build_release() { buildenv_setup load_target_env @@ -299,6 +311,7 @@ chroot_build_release() { return 0 } # chroot_build_release() +# main(): Start here. main() { set -e # Everything must succeed env_setup From 5dbf38dccac443520f1265b8ee5642a47bbcd008 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 14:48:35 +0000 Subject: [PATCH 18/74] Move PATH and export to the same line. Handle svn or svnlite being installed in /usr/bin or /usr/local/bin. Sponsored by: The FreeBSD Foundation --- release/release.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/release/release.sh b/release/release.sh index 0674c2fa08f6..e35f917965df 100755 --- a/release/release.sh +++ b/release/release.sh @@ -36,8 +36,7 @@ # $FreeBSD$ # -PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" -export PATH +export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" VERSION=2 @@ -60,7 +59,13 @@ env_setup() { RELENGDIR="$(realpath $(dirname $(basename ${0})))" # The default version control system command to obtain the sources. - VCSCMD="svn checkout" + for _dir in /usr/bin /usr/local/bin; do + for _svn in svn svnlite; do + [ -x "${_dir}/${_svn}" ] && VCSCMD="${_dir}/${_svn}" + [ ! -z "${VCSCMD}" ] && break 2 + done + done + VCSCMD="${VCSCMD} checkout" # The default svn checkout server, and svn branches for src/, doc/, # and ports/. From 3ddb84b3bb02a2505ca32b3d40792bb2c3c8fe15 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 14:53:01 +0000 Subject: [PATCH 19/74] Shorten long lines. Sponsored by: The FreeBSD Foundation --- release/release.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/release/release.sh b/release/release.sh index e35f917965df..7210bb0dead6 100755 --- a/release/release.sh +++ b/release/release.sh @@ -189,14 +189,18 @@ env_check() { exit 1 fi - CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" + CHROOT_MAKEENV="${CHROOT_MAKEENV} \ + MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" CHROOT_IMAKEFLAGS="${CONF_FILES}" CHROOT_DMAKEFLAGS="${CONF_FILES}" - RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" - RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" - RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ + RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} \ + ${CONF_FILES}" + RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \ + KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" + RELEASE_RMAKEFLAGS="${ARCH_FLAGS} \ + KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${DOCPORTS} \ + WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" return 0 From 43eee0751f6113a8d88680c263440a20688f8ee3 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 14:53:34 +0000 Subject: [PATCH 20/74] Move the trap after env_check(), since CHROOTDIR may be redefined. Sponsored by: The FreeBSD Foundation --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 7210bb0dead6..16d5b9f0544a 100755 --- a/release/release.sh +++ b/release/release.sh @@ -341,8 +341,8 @@ main() { esac done shift $(($OPTIND - 1)) - trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit env_check + trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit chroot_setup extra_chroot_setup chroot_build_target From 81cfc2845bac84181553b3fe436e5830f6ee7b7a Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 14:59:16 +0000 Subject: [PATCH 21/74] Move where the configuration file is sourced if '-c' is specified. If the configuration file does not exist, proceed with the default options instead of exiting. Sponsored by: The FreeBSD Foundation --- release/release.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/release/release.sh b/release/release.sh index 16d5b9f0544a..f1de9229ce57 100755 --- a/release/release.sh +++ b/release/release.sh @@ -328,12 +328,6 @@ main() { case ${opt} in c) RELEASECONF="${OPTARG}" - if [ ! -e "${RELEASECONF}" ]; then - echo "ERROR: Configuration file ${RELEASECONF} does not exist." - exit 1 - fi - # Source the specified configuration file for overrides - . ${RELEASECONF} ;; \?) usage @@ -341,6 +335,14 @@ main() { esac done shift $(($OPTIND - 1)) + if [ ! -z "${RELEASECONF}" ]; then + if [ -e "${RELEASECONF}" ]; then + . ${RELEASECONF} + else + echo "Nonexistent configuration file: ${RELEASECONF}" + echo "Using default build environment." + fi + fi env_check trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit chroot_setup From 3c9143a8887af728afd9afc84484132f30992780 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 15:05:38 +0000 Subject: [PATCH 22/74] Ensure resolv.conf exists on the build host before attempting to copy it to the build chroot. Move where the ldconfig(8) startup script is invoked. Sponsored by: The FreeBSD Foundation --- release/release.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/release/release.sh b/release/release.sh index f1de9229ce57..706fc6bc7ef3 100755 --- a/release/release.sh +++ b/release/release.sh @@ -229,8 +229,6 @@ chroot_setup() { env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ DESTDIR=${CHROOTDIR} fi - mount -t devfs devfs ${CHROOTDIR}/dev - cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf return 0 } # chroot_setup() @@ -238,6 +236,14 @@ chroot_setup() { # extra_chroot_setup(): Prepare anything additional within the build # necessary for the release build. extra_chroot_setup() { + + mount -t devfs devfs ${CHROOTDIR}/dev + [ -e /etc/resolv.conf ] && cp /etc/resolv.conf \ + ${CHROOTDIR}/etc/resolv.conf + # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints + # is created. This is needed by ports-mgmt/pkg. + eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + # If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), # copy them to the chroot. if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then @@ -250,10 +256,6 @@ extra_chroot_setup() { fi if [ -d ${CHROOTDIR}/usr/ports ]; then - # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints - # is created. This is needed by ports-mgmt/pkg. - chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart - ## Trick the ports 'run-autotools-fixup' target to do the right thing. _OSVERSION=$(sysctl -n kern.osreldate) REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) From 7290c83913b0df6f2bc404badd9d8f6106d2d9f1 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 15:10:50 +0000 Subject: [PATCH 23/74] Wrap long lines in comments after previous commits that indented the file. Sponsored by: The FreeBSD Foundation --- release/release.sh | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/release/release.sh b/release/release.sh index 706fc6bc7ef3..0b123dfb2617 100755 --- a/release/release.sh +++ b/release/release.sh @@ -87,8 +87,8 @@ env_setup() { MAKE_CONF="/dev/null" SRC_CONF="/dev/null" - # The number of make(1) jobs, defaults to the number of CPUs available for - # buildworld, and half of number of CPUs available for buildkernel. + # The number of make(1) jobs, defaults to the number of CPUs available + # for buildworld, and half of number of CPUs available for buildkernel. WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" @@ -97,8 +97,8 @@ env_setup() { # The name of the kernel to build, defaults to GENERIC. KERNEL="GENERIC" - # Set to non-empty value to disable checkout of doc/ and/or ports/. Disabling - # ports/ checkout also forces NODOC to be set. + # Set to non-empty value to disable checkout of doc/ and/or ports/. + # Disabling ports/ checkout also forces NODOC to be set. NODOC= NOPORTS= @@ -124,8 +124,8 @@ env_setup() { # necessary. This is called unconditionally, and overrides the defaults set # in env_setup() if '-c ' is specified. env_check() { - # Fix for backwards-compatibility with release.conf that does not have the - # trailing '/'. + # Fix for backwards-compatibility with release.conf that does not have + # the trailing '/'. case ${SVNROOT} in *svn*) SVNROOT="${SVNROOT}/" @@ -145,17 +145,17 @@ env_check() { NODOC=yes fi - # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree - # is required to build the documentation set. + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports + # tree is required to build the documentation set. if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then echo "*** NOTICE: Setting NODOC=1 since ports tree is required" echo " and NOPORTS is set." NODOC=yes fi - # If NOPORTS and/or NODOC are unset, they must not pass to make as variables. - # The release makefile verifies definedness of NOPORTS/NODOC variables - # instead of their values. + # If NOPORTS and/or NODOC are unset, they must not pass to make as + # variables. The release makefile verifies definedness of the + # NOPORTS/NODOC variables instead of their values. DOCPORTS= if [ -n "${NOPORTS}" ]; then DOCPORTS="NOPORTS=yes " @@ -244,8 +244,8 @@ extra_chroot_setup() { # is created. This is needed by ports-mgmt/pkg. eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart - # If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), - # copy them to the chroot. + # If MAKE_CONF and/or SRC_CONF are set and not character devices + # (/dev/null), copy them to the chroot. if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then mkdir -p ${CHROOTDIR}/$(dirname ${MAKE_CONF}) cp ${MAKE_CONF} ${CHROOTDIR}/${MAKE_CONF} @@ -256,7 +256,8 @@ extra_chroot_setup() { fi if [ -d ${CHROOTDIR}/usr/ports ]; then - ## Trick the ports 'run-autotools-fixup' target to do the right thing. + # Trick the ports 'run-autotools-fixup' target to do the right + # thing. _OSVERSION=$(sysctl -n kern.osreldate) REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) @@ -285,9 +286,10 @@ chroot_build_target() { if [ -n "${EMBEDDEDBUILD}" ]; then buildenv_setup # If a crochet configuration file exists in *this* checkout of - # release/, copy it to the /tmp/external directory within the chroot. - # This allows building embedded releases without relying on updated - # scripts and/or configurations to exist in the branch being built. + # release/, copy it to the /tmp/external directory within the + # chroot. This allows building embedded releases without + # relying on updated scripts and/or configurations to exist in + # the branch being built. load_target_env if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then @@ -297,9 +299,9 @@ chroot_build_target() { /bin/sh ${RELENGDIR}/${XDEV}/release.sh fi # If the script does not exist for this architecture, exit. - # This probably should be checked earlier, but allowing the rest - # of the build process to get this far will at least set up the - # chroot environment for testing. + # This probably should be checked earlier, but allowing the + # rest of the build process to get this far will at least set + # up the chroot environment for testing. return 1 else # Not embedded. From 8501ddab551e23d9595e569a5facf5451545ce24 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 15:20:29 +0000 Subject: [PATCH 24/74] Add a return to chroot_build_target(). In chroot_build_release(), reverse the order evaluating EMBEDDEDBUILD. Sponsored by: The FreeBSD Foundation --- release/release.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/release/release.sh b/release/release.sh index 0b123dfb2617..2db5cf347acf 100755 --- a/release/release.sh +++ b/release/release.sh @@ -236,7 +236,6 @@ chroot_setup() { # extra_chroot_setup(): Prepare anything additional within the build # necessary for the release build. extra_chroot_setup() { - mount -t devfs devfs ${CHROOTDIR}/dev [ -e /etc/resolv.conf ] && cp /etc/resolv.conf \ ${CHROOTDIR}/etc/resolv.conf @@ -282,8 +281,24 @@ chroot_build_target() { eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel + return 0 +} # chroot_build_target + +# chroot_build_release(): Invoke the 'make release' target. +chroot_build_release() { + buildenv_setup + load_target_env + + if [ -z "${EMBEDDEDBUILD}" ]; then + eval chroot ${CHROOTDIR} make -C /usr/src/release \ + ${RELEASE_RMAKEFLAGS} release + eval chroot ${CHROOTDIR} make -C /usr/src/release \ + ${RELEASE_RMAKEFLAGS} install DESTDIR=/R \ + WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ + WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} + return 0 + else # Embedded builds do not use the 'make release' target. - if [ -n "${EMBEDDEDBUILD}" ]; then buildenv_setup # If a crochet configuration file exists in *this* checkout of # release/, copy it to the /tmp/external directory within the @@ -297,30 +312,15 @@ chroot_build_target() { cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \ ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf /bin/sh ${RELENGDIR}/${XDEV}/release.sh + return 0 fi # If the script does not exist for this architecture, exit. # This probably should be checked earlier, but allowing the # rest of the build process to get this far will at least set # up the chroot environment for testing. return 1 - else - # Not embedded. - return 0 fi - return 0 -} # chroot_build_target - -# chroot_build_release(): Invoke the 'make release' target. -chroot_build_release() { - buildenv_setup - load_target_env - eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - release - eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ - WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} - return 0 } # chroot_build_release() From a03128832c6c71a3544f1c5ef0b15a17122c8f51 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 15:41:43 +0000 Subject: [PATCH 25/74] In extra_chroot_setup(), use 'uname -U' to determine OSVERSION. Move the port build for EMBEDDEDPORTS (if set) from arm/release.sh to release.sh. Remove arm/release.sh. Sponsored by: The FreeBSD Foundation --- release/arm/release.sh | 151 ----------------------------------------- release/release.sh | 9 ++- 2 files changed, 8 insertions(+), 152 deletions(-) delete mode 100755 release/arm/release.sh diff --git a/release/arm/release.sh b/release/arm/release.sh deleted file mode 100755 index c68f812c7043..000000000000 --- a/release/arm/release.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -#- -# Copyright (c) 2013, 2014 The FreeBSD Foundation -# All rights reserved. -# -# This software was developed by Glen Barber -# under sponsorship from the FreeBSD Foundation. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# $FreeBSD$ -# - -# This script is intended to be called by release/release.sh to build ARM -# images for release. It is not intended to be run directly. This sets up -# the software needed within a build chroot, then runs crochet to provide -# downloadable images for embedded devices. - -set -e - -before_build() { - WANT_UBOOT= - KNOWNHASH= - UBOOT_VERSION= - case ${KERNEL} in - PANDABOARD) - WANT_UBOOT=1 - KNOWNHASH="e08e20a6979bfca6eebb9a2b0e42aa4416af3d796332fd63a3470495a089d496" - UBOOT_VERSION="u-boot-2012.07" - ;; - WANDBOARD-QUAD) - WANT_UBOOT=1 - KNOWNHASH="b4f83b8db325c21671a997198ec3a373e2e00dde2fcf17be9b9afd7cfd727f56" - UBOOT_VERSION="u-boot-2014.07" - ;; - *) - # Fallthrough. - ;; - esac - if [ ! -z ${WANT_UBOOT} ]; then - chroot ${CHROOTDIR} fetch -o /tmp/crochet/${UBOOT_VERSION}.tar.bz2 \ - http://people.freebsd.org/~gjb/${UBOOT_VERSION}.tar.bz2 - UBOOT_HASH="$(sha256 -q ${CHROOTDIR}/tmp/crochet/${UBOOT_VERSION}.tar.bz2)" - if [ "${UBOOT_HASH}" != "${KNOWNHASH}" ]; then - echo "Checksum mismatch! Exiting now." - exit 1 - fi - chroot ${CHROOTDIR} tar xf /tmp/crochet/${UBOOT_VERSION}.tar.bz2 \ - -C /tmp/crochet/ - fi -} - -install_crochet() { - chroot ${CHROOTDIR} svn co -q ${CROCHETSRC}/${CROCHETBRANCH} \ - /tmp/crochet -} - -install_uboot() { - # Only fetch u-boot sources if UBOOTSRC is set; otherwise it is - # not needed. - if [ -n "${UBOOTSRC}" ]; then - continue - else - return 0 - fi - chroot ${CHROOTDIR} svn co -q ${UBOOTSRC}/${UBOOTBRANCH} \ - /${UBOOTDIR} -} - -main() { - # Fix broken ports that use kern.osreldate. - OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) - export OSVERSION - REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) - BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) - UNAME_r=${REVISION}-${BRANCH} - export UNAME_r - export XZ_CMD=$(chroot ${CHROOTDIR} make -C /usr/src/release -V XZ_CMD) - - # Build the 'xdev' target for crochet. - eval chroot ${CHROOTDIR} make -C /usr/src \ - ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ - TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ - ${WORLD_FLAGS} xdev - - # Install the cross-build symlinks to /usr/bin to make crochet - # happy. - eval chroot ${CHROOTDIR} make -C /usr/src \ - ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ - TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ - ${WORLD_FLAGS} xdev-links || true - - # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints - # is created. - eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart - # Install security/ca_root_nss since we need to check the https - # certificate of github. - eval chroot ${CHROOTDIR} make -C /usr/ports/security/ca_root_nss \ - OPTIONS_SET="ETCSYMLINK" BATCH=1 FORCE_PKG_REGISTER=1 \ - install clean distclean - EMBEDDEDPORTS="${EMBEDDEDPORTS} devel/subversion" - for _PORT in ${EMBEDDEDPORTS}; do - eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \ - BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean - done - - # Certain u-boot versions hardcode the use of a host gcc, and gcc's - # build relies on having gperf installed. - eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \ - WITH_GCC=1 ${WORLD_FLAGS} obj - eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \ - WITH_GCC=1 ${WORLD_FLAGS} -j1 depend all - eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \ - WITH_GCC=1 ${WORLD_FLAGS} -j1 install - eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \ - WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install - - mkdir -p ${CHROOTDIR}/tmp/crochet/work - before_build - install_crochet - install_uboot - eval chroot ${CHROOTDIR} /bin/sh /tmp/crochet/crochet.sh \ - -c /tmp/external/${XDEV}/crochet-${KERNEL}.conf - mkdir -p ${CHROOTDIR}/R/ - cp -p ${CHROOTDIR}/usr/obj/*.img ${CHROOTDIR}/R/ - ${XZ_CMD} ${CHROOTDIR}/R/FreeBSD*.img - cd ${CHROOTDIR}/R/ && sha256 FreeBSD*.img.xz > CHECKSUM.SHA256 - cd ${CHROOTDIR}/R/ && md5 FreeBSD*.img.xz > CHECKSUM.MD5 -} - -main "$@" -exit 0 diff --git a/release/release.sh b/release/release.sh index 2db5cf347acf..8ff974d68af3 100755 --- a/release/release.sh +++ b/release/release.sh @@ -257,7 +257,7 @@ extra_chroot_setup() { if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. - _OSVERSION=$(sysctl -n kern.osreldate) + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) UNAME_r=${REVISION}-${BRANCH} @@ -271,6 +271,13 @@ extra_chroot_setup() { fi fi + if [ ! -z "${EMBEDDEDPORTS}" ]; then + for _PORT in ${EMBEDDEDPORTS}; do + eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \ + BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean + done + fi + return 0 } # extra_chroot_setup() From cf582ac56f75c9db1242ef354d30202759f7b875 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 15:58:21 +0000 Subject: [PATCH 26/74] Update the arm/*.conf configuration files to only set EMBEDDEDBUILD, EMBEDDED_TARGET, EMBEDDED_TARGET_ARCH, EMBEDDEDPORTS, and KERNEL. In release.sh, set TARGET and TARGET_ARCH to the EMBEDDED_* variants from the configuration file. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 38 +++++-------------------------- release/arm/PANDABOARD.conf | 37 +++++------------------------- release/arm/RPI-B.conf | 40 +++++---------------------------- release/arm/RPI2.conf | 38 +++++-------------------------- release/arm/WANDBOARD-QUAD.conf | 37 +++++------------------------- release/arm/ZEDBOARD.conf | 35 ++++------------------------- release/release.sh | 8 +++++++ 7 files changed, 37 insertions(+), 196 deletions(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 72337f831cc3..19b88cb12f59 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -3,36 +3,8 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="sysutils/u-boot-beaglebone" - -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export EMBEDDEDPORTS="lang/python textproc/gsed" - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="BEAGLEBONE" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" -} +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-beaglebone" +KERNEL="BEAGLEBONE" diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf index dc8952d333b4..4cbe7e512b96 100644 --- a/release/arm/PANDABOARD.conf +++ b/release/arm/PANDABOARD.conf @@ -3,35 +3,8 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="lang/python textproc/gsed" - -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="PANDABOARD" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" -} +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-pandaboard" +KERNEL="PANDABOARD" diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index aae60c9831a9..28562c15a1f5 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -3,38 +3,8 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="lang/python textproc/gsed" - -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="RPI-B" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" - export UBOOTSRC="https://github.com/gonzoua/u-boot-pi" - export UBOOTBRANCH="trunk" - export UBOOTDIR="/tmp/crochet/u-boot-rpi" -} +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-rpi" +KERNEL="RPI-B" diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf index bb8ebe998ca9..4f8ea2f6a9e3 100644 --- a/release/arm/RPI2.conf +++ b/release/arm/RPI2.conf @@ -3,36 +3,8 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="sysutils/u-boot-rpi2" - -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="RPI2" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" -} - +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-rpi2" +KERNEL="RPI2" diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index c3fff91694ae..a368ea5d90ff 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -3,35 +3,8 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="lang/python textproc/gsed" - -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="WANDBOARD-QUAD" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" -} +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-wandboard" +KERNEL="WANDBOARD-QUAD" diff --git a/release/arm/ZEDBOARD.conf b/release/arm/ZEDBOARD.conf index 4d0a4615ba6b..8c08fb12d68c 100644 --- a/release/arm/ZEDBOARD.conf +++ b/release/arm/ZEDBOARD.conf @@ -3,34 +3,7 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 - -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="ZEDBOARD" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" -} +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +KERNEL="ZEDBOARD" diff --git a/release/release.sh b/release/release.sh index 8ff974d68af3..a01277f24d26 100755 --- a/release/release.sh +++ b/release/release.sh @@ -285,6 +285,14 @@ extra_chroot_setup() { chroot_build_target() { buildenv_setup load_target_env + if [ ! -z "${EMBEDDEDBUILD}" ]; then + RELEASE_WMAKEFLAGS="${RELEASE_WMAKEFLAGS} \ + TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" + RELEASE_KMAKEFLAGS="${RELEASE_KMAKEFLAGS} \ + TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" + fi eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel From fea236302d40e547acee94970dfd880448c83332 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 15:59:29 +0000 Subject: [PATCH 27/74] Remove crochet configuration files and tools/arm/ directory. Sponsored by: The FreeBSD Foundation --- release/tools/arm/crochet-BEAGLEBONE.conf | 40 ------------------- release/tools/arm/crochet-PANDABOARD.conf | 29 -------------- release/tools/arm/crochet-RPI-B.conf | 29 -------------- release/tools/arm/crochet-RPI2.conf | 29 -------------- release/tools/arm/crochet-WANDBOARD-QUAD.conf | 29 -------------- release/tools/arm/crochet-ZEDBOARD.conf | 29 -------------- 6 files changed, 185 deletions(-) delete mode 100644 release/tools/arm/crochet-BEAGLEBONE.conf delete mode 100644 release/tools/arm/crochet-PANDABOARD.conf delete mode 100644 release/tools/arm/crochet-RPI-B.conf delete mode 100644 release/tools/arm/crochet-RPI2.conf delete mode 100644 release/tools/arm/crochet-WANDBOARD-QUAD.conf delete mode 100644 release/tools/arm/crochet-ZEDBOARD.conf diff --git a/release/tools/arm/crochet-BEAGLEBONE.conf b/release/tools/arm/crochet-BEAGLEBONE.conf deleted file mode 100644 index 7a32542ed0f9..000000000000 --- a/release/tools/arm/crochet-BEAGLEBONE.conf +++ /dev/null @@ -1,40 +0,0 @@ -# -# $FreeBSD$ -# - -# This is the configuration file for use with crochet to produce -# FreeBSD BeagleBone images. - -board_setup BeagleBone -option ImageSize 1gb -option Growfs - -export MAKEOBJDIRPREFIX=/usr/obj -FREEBSD_SRC=/usr/src -__MAKE_CONF=/dev/null -SRCCONF=/dev/null -WORKDIR=/usr/obj -_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) -_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=BEAGLEBONE -TARGET=arm -TARGET_ARCH=armv6 -FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" -FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" -FREEBSD_INSTALLWORLD_EXTRA_ARGS="" -FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" -FREEBSD_WORLD_EXTRA_ARGS="" -FREEBSD_KERNEL_EXTRA_ARGS="" -FREEBSD_EXTRA_ARGS="" -IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img -BEAGLEBONE_UBOOT=/tmp/external/u-boot-beaglebone - -beaglebone_check_uboot() { - mkdir -p "${BEAGLEBONE_UBOOT}" - ln -fs /usr/local/share/u-boot/u-boot-beaglebone/MLO \ - ${BEAGLEBONE_UBOOT}/MLO - ln -fs /usr/local/share/u-boot/u-boot-beaglebone/u-boot.img \ - ${BEAGLEBONE_UBOOT}/bb-uboot.img - ln -fs ${BOARDDIR}/files/uEnv.txt \ - ${BEAGLEBONE_UBOOT}/bb-uenv.txt -} diff --git a/release/tools/arm/crochet-PANDABOARD.conf b/release/tools/arm/crochet-PANDABOARD.conf deleted file mode 100644 index 366c4ccb5002..000000000000 --- a/release/tools/arm/crochet-PANDABOARD.conf +++ /dev/null @@ -1,29 +0,0 @@ -# -# $FreeBSD$ -# - -# This is the configuration file for use with crochet to produce -# FreeBSD PandaBoard images. - -board_setup PandaBoard -option ImageSize 1gb -option Growfs - -export MAKEOBJDIRPREFIX=/usr/obj -FREEBSD_SRC=/usr/src -__MAKE_CONF=/dev/null -SRCCONF=/dev/null -WORKDIR=/usr/obj -_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) -_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=PANDABOARD -TARGET=arm -TARGET_ARCH=armv6 -FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" -FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" -FREEBSD_INSTALLWORLD_EXTRA_ARGS="" -FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" -FREEBSD_WORLD_EXTRA_ARGS="" -FREEBSD_KERNEL_EXTRA_ARGS="" -FREEBSD_EXTRA_ARGS="" -IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img diff --git a/release/tools/arm/crochet-RPI-B.conf b/release/tools/arm/crochet-RPI-B.conf deleted file mode 100644 index 352048faa2b7..000000000000 --- a/release/tools/arm/crochet-RPI-B.conf +++ /dev/null @@ -1,29 +0,0 @@ -# -# $FreeBSD$ -# - -# This is the configuration file for use with crochet to produce -# FreeBSD Raspberry Pi images. - -board_setup RaspberryPi -option ImageSize 1gb -option Growfs - -export MAKEOBJDIRPREFIX=/usr/obj -FREEBSD_SRC=/usr/src -__MAKE_CONF=/dev/null -SRCCONF=/dev/null -WORKDIR=/usr/obj -_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) -_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=RPI-B -TARGET=arm -TARGET_ARCH=armv6 -FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" -FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" -FREEBSD_INSTALLWORLD_EXTRA_ARGS="" -FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" -FREEBSD_WORLD_EXTRA_ARGS="" -FREEBSD_KERNEL_EXTRA_ARGS="" -FREEBSD_EXTRA_ARGS="" -IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img diff --git a/release/tools/arm/crochet-RPI2.conf b/release/tools/arm/crochet-RPI2.conf deleted file mode 100644 index 7ecab4ca5b44..000000000000 --- a/release/tools/arm/crochet-RPI2.conf +++ /dev/null @@ -1,29 +0,0 @@ -# -# $FreeBSD$ -# - -# This is the configuration file for use with crochet to produce -# FreeBSD Raspberry Pi 2 images. - -board_setup RaspberryPi2 -option ImageSize 1gb -option Growfs - -export MAKEOBJDIRPREFIX=/usr/obj -FREEBSD_SRC=/usr/src -__MAKE_CONF=/dev/null -SRCCONF=/dev/null -WORKDIR=/usr/obj -_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) -_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=RPI2 -TARGET=arm -TARGET_ARCH=armv6 -FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" -FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" -FREEBSD_INSTALLWORLD_EXTRA_ARGS="" -FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" -FREEBSD_WORLD_EXTRA_ARGS="" -FREEBSD_KERNEL_EXTRA_ARGS="" -FREEBSD_EXTRA_ARGS="" -IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img diff --git a/release/tools/arm/crochet-WANDBOARD-QUAD.conf b/release/tools/arm/crochet-WANDBOARD-QUAD.conf deleted file mode 100644 index d1e0062c869b..000000000000 --- a/release/tools/arm/crochet-WANDBOARD-QUAD.conf +++ /dev/null @@ -1,29 +0,0 @@ -# -# $FreeBSD$ -# - -# This is the configuration file for use with crochet to produce -# FreeBSD WandboardQuad images. - -board_setup Wandboard -option ImageSize 1gb -option Growfs - -export MAKEOBJDIRPREFIX=/usr/obj -FREEBSD_SRC=/usr/src -__MAKE_CONF=/dev/null -SRCCONF=/dev/null -WORKDIR=/usr/obj -_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) -_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=WANDBOARD-QUAD -TARGET=arm -TARGET_ARCH=armv6 -FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" -FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" -FREEBSD_INSTALLWORLD_EXTRA_ARGS="" -FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" -FREEBSD_WORLD_EXTRA_ARGS="" -FREEBSD_KERNEL_EXTRA_ARGS="" -FREEBSD_EXTRA_ARGS="" -IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img diff --git a/release/tools/arm/crochet-ZEDBOARD.conf b/release/tools/arm/crochet-ZEDBOARD.conf deleted file mode 100644 index 8353038302d7..000000000000 --- a/release/tools/arm/crochet-ZEDBOARD.conf +++ /dev/null @@ -1,29 +0,0 @@ -# -# $FreeBSD$ -# - -# This is the configuration file for use with crochet to produce -# FreeBSD ZedBoard images. - -board_setup ZedBoard -option ImageSize 1gb -option Growfs - -export MAKEOBJDIRPREFIX=/usr/obj -FREEBSD_SRC=/usr/src -__MAKE_CONF=/dev/null -SRCCONF=/dev/null -WORKDIR=/usr/obj -_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) -_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=ZEDBOARD -TARGET=arm -TARGET_ARCH=armv6 -FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" -FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" -FREEBSD_INSTALLWORLD_EXTRA_ARGS="" -FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" -FREEBSD_WORLD_EXTRA_ARGS="" -FREEBSD_KERNEL_EXTRA_ARGS="" -FREEBSD_EXTRA_ARGS="" -IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img From 6848c01fadd8193c46eb9a105630613d0fbbc696 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 16:04:11 +0000 Subject: [PATCH 28/74] Remove Crochet invocation. Sponsored by: The FreeBSD Foundation --- release/release.sh | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/release/release.sh b/release/release.sh index a01277f24d26..1ba848b753a3 100755 --- a/release/release.sh +++ b/release/release.sh @@ -313,27 +313,9 @@ chroot_build_release() { WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} return 0 else - # Embedded builds do not use the 'make release' target. - buildenv_setup - # If a crochet configuration file exists in *this* checkout of - # release/, copy it to the /tmp/external directory within the - # chroot. This allows building embedded releases without - # relying on updated scripts and/or configurations to exist in - # the branch being built. load_target_env - if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ - [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then - mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/ - cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \ - ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf - /bin/sh ${RELENGDIR}/${XDEV}/release.sh - return 0 - fi - # If the script does not exist for this architecture, exit. - # This probably should be checked earlier, but allowing the - # rest of the build process to get this far will at least set - # up the chroot environment for testing. - return 1 + # XXX: In progress. + return 0 fi return 0 From 57dbde2ca8d4c493746569ec819faa3141d3d576 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 16:21:12 +0000 Subject: [PATCH 29/74] buildenv_setup(), if overridden in the configuration file, only needs to be invoked once. Sponsored by: The FreeBSD Foundation --- release/release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index 1ba848b753a3..58f3d72460cf 100755 --- a/release/release.sh +++ b/release/release.sh @@ -278,12 +278,13 @@ extra_chroot_setup() { done fi + buildenv_setup + return 0 } # extra_chroot_setup() # chroot_build_target(): Build the userland and kernel for the build target. chroot_build_target() { - buildenv_setup load_target_env if [ ! -z "${EMBEDDEDBUILD}" ]; then RELEASE_WMAKEFLAGS="${RELEASE_WMAKEFLAGS} \ @@ -301,7 +302,6 @@ chroot_build_target() { # chroot_build_release(): Invoke the 'make release' target. chroot_build_release() { - buildenv_setup load_target_env if [ -z "${EMBEDDEDBUILD}" ]; then From 9056dae945680bce10b3cf844caf83cb51254a0a Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 18:16:27 +0000 Subject: [PATCH 30/74] Evaluage chroot_build_release_cmd based on the TARGET/TARGET_ARCH of the build target. Move arm/armv6 'release' bits to chroot_arm_armv6_build_release(). Sponsored by: The FreeBSD Foundation --- release/release.sh | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/release/release.sh b/release/release.sh index 58f3d72460cf..b51ebece7fd6 100755 --- a/release/release.sh +++ b/release/release.sh @@ -124,6 +124,7 @@ env_setup() { # necessary. This is called unconditionally, and overrides the defaults set # in env_setup() if '-c ' is specified. env_check() { + chroot_build_release_cmd="chroot_build_release" # Fix for backwards-compatibility with release.conf that does not have # the trailing '/'. case ${SVNROOT} in @@ -143,6 +144,12 @@ env_check() { WITH_DVD= WITH_COMPRESSED_IMAGES= NODOC=yes + case ${EMBEDDED_TARGET}:${EMBEDDED_TARGET_ARCH} in + arm:armv6) + chroot_build_release_cmd="chroot_arm_armv6_build_release" + ;; + *) + esac fi # If PORTS is set and NODOC is unset, force NODOC=yes because the ports @@ -303,24 +310,27 @@ chroot_build_target() { # chroot_build_release(): Invoke the 'make release' target. chroot_build_release() { load_target_env - - if [ -z "${EMBEDDEDBUILD}" ]; then - eval chroot ${CHROOTDIR} make -C /usr/src/release \ - ${RELEASE_RMAKEFLAGS} release - eval chroot ${CHROOTDIR} make -C /usr/src/release \ - ${RELEASE_RMAKEFLAGS} install DESTDIR=/R \ - WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ - WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} - return 0 - else - load_target_env - # XXX: In progress. - return 0 - fi + eval chroot ${CHROOTDIR} make -C /usr/src/release \ + ${RELEASE_RMAKEFLAGS} release + eval chroot ${CHROOTDIR} make -C /usr/src/release \ + ${RELEASE_RMAKEFLAGS} install DESTDIR=/R \ + WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ + WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} return 0 } # chroot_build_release() +# chroot_arm_armv6_build_release(): Create arm/armv6 SD card image. +chroot_arm_armv6_build_release() { + load_target_env + # XXX: In progress. + if [ -e "${RELENGDIR}/tools/${TARGET}.subr" ]; then + . "${RELENGDIR}/tools/${TARGET}.subr" + fi + + return 0 +} # chroot_arm_armv6_build_release() + # main(): Start here. main() { set -e # Everything must succeed @@ -349,7 +359,7 @@ main() { chroot_setup extra_chroot_setup chroot_build_target - chroot_build_release + ${chroot_build_release_cmd} return 0 } # main() From 4ad8b75d537c206da46429897a5ff4ddc3b94ec3 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 19:58:12 +0000 Subject: [PATCH 31/74] Add tools/arm.subr to contain common subroutines used for building arm images. This is similar to tools/vmimage.subr used for building virtual machine disk images. By default, only arm_create_disk() and arm_install_base() contain real functionality here, and arm_install_uboot() must be overridden in the arm/KERNEL.conf file. In release.sh, make create_arm_armv6_build_release() do something now. In arm/BEAGLEBONE.conf, set IMAGE_SIZE, PART_SCHEME, FAT_SIZE, FAT_TYPE, and MD_ARGS, as well as make arm_install_uboot() functional. Parts of this were taken from disecting a previous BEAGLEBONE image, and other parts obtained from Crochet sources. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 21 +++++++ release/release.sh | 11 ++++ release/tools/arm.subr | 121 ++++++++++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 release/tools/arm.subr diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 19b88cb12f59..70dadc0fa7b6 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -8,3 +8,24 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" KERNEL="BEAGLEBONE" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="2m" +FAT_TYPE="12" +MD_ARGS="-x 63 -y 255" + +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" + FDT_DIR="${WORLDIR}/sys/boot/fdt/dts/arm" + mount_msdosfs /dev/${mddev}s1 ${DESTDIR} + cp -p ${UBOOT_DIR}/MLO ${DESTDIR}/MLO + cp -p ${UBOOT_DIR}/u-boot.img ${DESTDIR}/bb-uboot.img + cp -p ${FDT_DIR}/beaglebone.dts ${DESTDIR}/bbone.dts + cp -p ${FDT_DIR}/beaglebone.dts ${DESTDIR}/bbone.dtb + cp -p ${FDT_DIR}/beaglebone-black.dts ${DESTDIR}/bboneblk.dts + cp -p ${FDT_DIR}/beaglebone-black.dts ${DESTDIR}/bboneblk.dtb + touch ${DESTDIR}/bb-uEnv.txt + umount_loop ${DESTDIR} + + return 0 +} diff --git a/release/release.sh b/release/release.sh index b51ebece7fd6..367eae4db9bf 100755 --- a/release/release.sh +++ b/release/release.sh @@ -327,6 +327,17 @@ chroot_arm_armv6_build_release() { if [ -e "${RELENGDIR}/tools/${TARGET}.subr" ]; then . "${RELENGDIR}/tools/${TARGET}.subr" fi + . "${RELENGDIR}/arm/${KERNEL}.conf" + WORLDDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V WORLDDIR)" + OBJDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V .OBJDIR)" + DESTDIR="${OBJDIR}/${KERNEL}" + IMGBASE="${OBJDIR}/${KERNEL}.img" + mkdir -p ${DESTDIR} + truncate -s ${IMAGE_SIZE} ${IMGBASE} + mddev=$(mdconfig -f ${IMGBASE} ${MD_ARGS}) + arm_create_disk + arm_install_base + arm_install_uboot return 0 } # chroot_arm_armv6_build_release() diff --git a/release/tools/arm.subr b/release/tools/arm.subr new file mode 100644 index 000000000000..66b02da90478 --- /dev/null +++ b/release/tools/arm.subr @@ -0,0 +1,121 @@ +#!/bin/sh +#- +# Copyright (c) 2015 The FreeBSD Foundation +# All rights reserved. +# +# Portions of this software were developed by Glen Barber +# under sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Common subroutines used to build arm/armv6 images. +# +# $FreeBSD$ +# + +cleanup() { + if [ -c "${DESTDIR}/dev/null" ]; then + umount_loop ${DESTDIR}/dev 2>/dev/null + fi + umount_loop ${DESTDIR} + if [ ! -z "${mddev}" ]; then + mdconfig -d -u ${mddev} + fi + + return 0 +} + +umount_loop() { + DIR=$1 + i=0 + sync + while ! umount ${DIR}; do + i=$(( $i + 1 )) + if [ $i -ge 10 ]; then + # This should never happen. But, it has happened. + echo "Cannot umount(8) ${DIR}" + echo "Something has gone horribly wrong." + return 1 + fi + sleep 1 + done + + return 0 +} + +arm_create_disk() { + # Create the target raw file and temporary work directory. + gpart create -s ${PART_SCHEME} ${IMGBASE} + gpart add -t '\!12' -a 63 -s ${FAT_SIZE} ${mddev} + gpart set -a active -i 1 ${mddev} + newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 + gpart add -t freebsd ${mddev} + gpart create -s bsd ${mddev}s2 + gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 + newfs -U -L rootfs /dev/${mddev}s2a + tunefs -j enable -N enable /dev/${mddev}s2a + + return 0 +} + +arm_install_base() { + mount /dev/${mddev}s2a ${DESTDIR} + cd ${WORLDDIR} && \ + eval make TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ + DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ + installworld installkernel distribution + + echo '# Custom /etc/fstab for FreeBSD embedded images' \ + > ${DESTDIR}/etc/fstab + echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ + >> ${DESTDIR}/etc/fstab + echo "/dev/ufs/rootfs / ufs rw 1 1" \ + >> ${DESTDIR}/etc/fstab + echo "md /tmp mfs rw,noatime,-s30m 0 0" \ + >> ${DESTDIR}/etc/fstab + echo "md /var/log mfs rw,noatime,-s15m 0 0" \ + >> ${DESTDIR}/etc/fstab + echo "md /var/tmp mfs rw,noatime,-s12m 0 0" \ + >> ${DESTDIR}/etc/fstab + + local hostname + hostname="$(echo ${KERNEL} | tr '[:upper:]' '[:lower:]')" + echo "hostname=\"${hostname}\"" > ${DESTDIR}/etc/rc.conf + echo 'ifconfig_DEFAULT="DHCP"' >> ${DESTDIR}/etc/rc.conf + echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'sendmail_enable="NONE"' >> ${DESTDIR}/etc/rc.conf + echo 'sendmail_submit_enable="NO"' >> ${DESTDIR}/etc/rc.conf + echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf + echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf + + sync + umount_loop ${DESTDIR} + + return 0 +} + +arm_install_uboot() { + # Override in the arm/KERNEL.conf file. + + return 0 +} From 68bca5fb302b5635c266076593f56d6bcb85abf3 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 6 May 2015 23:26:51 +0000 Subject: [PATCH 32/74] Use the correct variable for the tools/TARGET.conf file. Sponsored by: The FreeBSD Foundation --- release/release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index 367eae4db9bf..68d2f168c1e2 100755 --- a/release/release.sh +++ b/release/release.sh @@ -324,8 +324,8 @@ chroot_build_release() { chroot_arm_armv6_build_release() { load_target_env # XXX: In progress. - if [ -e "${RELENGDIR}/tools/${TARGET}.subr" ]; then - . "${RELENGDIR}/tools/${TARGET}.subr" + if [ -e "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr" ]; then + . "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr" fi . "${RELENGDIR}/arm/${KERNEL}.conf" WORLDDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V WORLDDIR)" From befaadd56c4c82d99e6f8de0717e4cb13333a033 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 00:27:28 +0000 Subject: [PATCH 33/74] In release.sh, create the /dev directory within the chroot before attempting to mount(8) devfs. Also, create the .OBJDIR for the 'release' target, so files end up in the correct location. In tools/arm.subr, fix the target device when creating the gpart partition scheme. Sponsored by: The FreeBSD Foundation --- release/release.sh | 2 ++ release/tools/arm.subr | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index 68d2f168c1e2..2a226e8944be 100755 --- a/release/release.sh +++ b/release/release.sh @@ -243,6 +243,7 @@ chroot_setup() { # extra_chroot_setup(): Prepare anything additional within the build # necessary for the release build. extra_chroot_setup() { + mkdir -p ${CHROOTDIR}/dev mount -t devfs devfs ${CHROOTDIR}/dev [ -e /etc/resolv.conf ] && cp /etc/resolv.conf \ ${CHROOTDIR}/etc/resolv.conf @@ -323,6 +324,7 @@ chroot_build_release() { # chroot_arm_armv6_build_release(): Create arm/armv6 SD card image. chroot_arm_armv6_build_release() { load_target_env + eval chroot ${CHROOTDIR} make -C /usr/src/release obj # XXX: In progress. if [ -e "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr" ]; then . "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr" diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 66b02da90478..67ba25e9190c 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -64,8 +64,8 @@ umount_loop() { arm_create_disk() { # Create the target raw file and temporary work directory. - gpart create -s ${PART_SCHEME} ${IMGBASE} - gpart add -t '\!12' -a 63 -s ${FAT_SIZE} ${mddev} + gpart create -s ${PART_SCHEME} ${mddev} + gpart add -t '!12' -a 63 -s ${FAT_SIZE} ${mddev} gpart set -a active -i 1 ${mddev} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 gpart add -t freebsd ${mddev} From 379d8dca3761d6e1e9b6a886682f052163ce930e Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 17:33:21 +0000 Subject: [PATCH 34/74] Fix file/directory paths. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 70dadc0fa7b6..2ac7e15979df 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -15,17 +15,17 @@ FAT_TYPE="12" MD_ARGS="-x 63 -y 255" arm_install_uboot() { - UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" - FDT_DIR="${WORLDIR}/sys/boot/fdt/dts/arm" - mount_msdosfs /dev/${mddev}s1 ${DESTDIR} - cp -p ${UBOOT_DIR}/MLO ${DESTDIR}/MLO - cp -p ${UBOOT_DIR}/u-boot.img ${DESTDIR}/bb-uboot.img - cp -p ${FDT_DIR}/beaglebone.dts ${DESTDIR}/bbone.dts - cp -p ${FDT_DIR}/beaglebone.dts ${DESTDIR}/bbone.dtb - cp -p ${FDT_DIR}/beaglebone-black.dts ${DESTDIR}/bboneblk.dts - cp -p ${FDT_DIR}/beaglebone-black.dts ${DESTDIR}/bboneblk.dtb - touch ${DESTDIR}/bb-uEnv.txt - umount_loop ${DESTDIR} + UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-beaglebone" + FDT_DIR="${CHROOTDIR}/${WORLDIR}/sys/boot/fdt/dts/arm" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${DESTDIR} + cp -p ${UBOOT_DIR}/MLO ${CHROOTDIR}/${DESTDIR}/MLO + cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${DESTDIR}/bb-uboot.img + cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${DESTDIR}/bbone.dts + cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${DESTDIR}/bbone.dtb + cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${DESTDIR}/bboneblk.dts + cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${DESTDIR}/bboneblk.dtb + touch ${CHROOTDIR}/${DESTDIR}/bb-uEnv.txt + umount_loop ${CHROOTDIR}/${DESTDIR} return 0 } From 04b7fd007b0f7cb2bbea1cfda02078b498f15a5a Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 17:35:48 +0000 Subject: [PATCH 35/74] In arm_create_disk(), chroot(8) to the build environment is necessary. In arm_install_base(), chroot(8) when installing world and kernel. Fix paths for fstab(5) and rc.conf(5). Sponsored by: The FreeBSD Foundation --- release/tools/arm.subr | 58 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 67ba25e9190c..5272c3f6e53a 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -64,52 +64,52 @@ umount_loop() { arm_create_disk() { # Create the target raw file and temporary work directory. - gpart create -s ${PART_SCHEME} ${mddev} - gpart add -t '!12' -a 63 -s ${FAT_SIZE} ${mddev} - gpart set -a active -i 1 ${mddev} - newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 - gpart add -t freebsd ${mddev} - gpart create -s bsd ${mddev}s2 - gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 - newfs -U -L rootfs /dev/${mddev}s2a - tunefs -j enable -N enable /dev/${mddev}s2a + chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} + chroot ${CHROOTDIR} gpart add -t '!12' -a 63 -s ${FAT_SIZE} ${mddev} + chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev} + chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 + chroot ${CHROOTDIR} gpart add -t freebsd ${mddev} + chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 + chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 + chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a + chroot ${CHROOTDIR} tunefs -j enable -N enable /dev/${mddev}s2a return 0 } arm_install_base() { - mount /dev/${mddev}s2a ${DESTDIR} - cd ${WORLDDIR} && \ - eval make TARGET=${EMBEDDED_TARGET} \ - TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ - DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ - installworld installkernel distribution + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} + eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ + TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ + DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ + installworld installkernel distribution echo '# Custom /etc/fstab for FreeBSD embedded images' \ - > ${DESTDIR}/etc/fstab + > ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ - >> ${DESTDIR}/etc/fstab + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/ufs/rootfs / ufs rw 1 1" \ - >> ${DESTDIR}/etc/fstab + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "md /tmp mfs rw,noatime,-s30m 0 0" \ - >> ${DESTDIR}/etc/fstab + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "md /var/log mfs rw,noatime,-s15m 0 0" \ - >> ${DESTDIR}/etc/fstab + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "md /var/tmp mfs rw,noatime,-s12m 0 0" \ - >> ${DESTDIR}/etc/fstab + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab local hostname hostname="$(echo ${KERNEL} | tr '[:upper:]' '[:lower:]')" - echo "hostname=\"${hostname}\"" > ${DESTDIR}/etc/rc.conf - echo 'ifconfig_DEFAULT="DHCP"' >> ${DESTDIR}/etc/rc.conf - echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'sendmail_enable="NONE"' >> ${DESTDIR}/etc/rc.conf - echo 'sendmail_submit_enable="NO"' >> ${DESTDIR}/etc/rc.conf - echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf - echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf + echo "hostname=\"${hostname}\"" > ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'ifconfig_DEFAULT="DHCP"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'sshd_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'sendmail_enable="NONE"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'sendmail_submit_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'sendmail_outbound_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf sync - umount_loop ${DESTDIR} + umount_loop ${CHROOTDIR}/${DESTDIR} return 0 } From ac1401b2c31b65cb660bf7df572d37f89d1c56cb Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 17:40:00 +0000 Subject: [PATCH 36/74] Fix paths. Remove the temporary directory when done with it. Destroy the md(4) device when done with it. Sponsored by: The FreeBSD Foundation --- release/release.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/release/release.sh b/release/release.sh index 2a226e8944be..4c40dcc523f2 100755 --- a/release/release.sh +++ b/release/release.sh @@ -333,13 +333,15 @@ chroot_arm_armv6_build_release() { WORLDDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V WORLDDIR)" OBJDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V .OBJDIR)" DESTDIR="${OBJDIR}/${KERNEL}" - IMGBASE="${OBJDIR}/${KERNEL}.img" - mkdir -p ${DESTDIR} + IMGBASE="${CHROOTDIR}/${OBJDIR}/${KERNEL}.img" + mkdir -p ${CHROOTDIR}/${DESTDIR} truncate -s ${IMAGE_SIZE} ${IMGBASE} - mddev=$(mdconfig -f ${IMGBASE} ${MD_ARGS}) + export mddev=$(mdconfig -f ${IMGBASE} ${MD_ARGS}) arm_create_disk arm_install_base arm_install_uboot + mdconfig -d -u ${mddev} + rmdir ${CHROOTDIR}/${DESTDIR} return 0 } # chroot_arm_armv6_build_release() From c2b4ad660a676bbdb1ee02ef22c016f9f6cedf41 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 17:48:19 +0000 Subject: [PATCH 37/74] Do not rename u-boot.img file when copying to the FAT partition. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 2ac7e15979df..da18ff1cc9a6 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -19,7 +19,7 @@ arm_install_uboot() { FDT_DIR="${CHROOTDIR}/${WORLDIR}/sys/boot/fdt/dts/arm" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${DESTDIR} cp -p ${UBOOT_DIR}/MLO ${CHROOTDIR}/${DESTDIR}/MLO - cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${DESTDIR}/bb-uboot.img + cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${DESTDIR}/u-boot.img cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${DESTDIR}/bbone.dts cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${DESTDIR}/bbone.dtb cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${DESTDIR}/bboneblk.dts From ab44589d807245e98975cae59b6ea8baf3910ff0 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 17:50:24 +0000 Subject: [PATCH 38/74] Set UBLDR_LOADADDR for the BEAGLEBONE image. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index da18ff1cc9a6..9845b152a35a 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -8,6 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" KERNEL="BEAGLEBONE" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" FAT_SIZE="2m" From 6bd844ae0ddca4a46a16df37c13dc95d8350bf56 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:00:12 +0000 Subject: [PATCH 39/74] In arm_install_uboot(), mount both FAT and UFS partitions in the empty DESTDIR, and update path names. Copy the ubldr to the FAT partition. [1] Spotted by: andrew [1] Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 9845b152a35a..2b2c787929e5 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -18,15 +18,25 @@ MD_ARGS="-x 63 -y 255" arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-beaglebone" FDT_DIR="${CHROOTDIR}/${WORLDIR}/sys/boot/fdt/dts/arm" - chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${DESTDIR} - cp -p ${UBOOT_DIR}/MLO ${CHROOTDIR}/${DESTDIR}/MLO - cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${DESTDIR}/u-boot.img - cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${DESTDIR}/bbone.dts - cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${DESTDIR}/bbone.dtb - cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${DESTDIR}/bboneblk.dts - cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${DESTDIR}/bboneblk.dtb - touch ${CHROOTDIR}/${DESTDIR}/bb-uEnv.txt - umount_loop ${CHROOTDIR}/${DESTDIR} + FATMOUNT="${DESTDIR}/fat" + UFSMOUNT="${DESTDIR}/ufs" + mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + cp -p ${UBOOT_DIR}/MLO ${CHROOTDIR}/${FATMOUNT}/MLO + cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${FATMOUNT}/u-boot.img + cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${FATMOUNT}/bbone.dts + cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${FATMOUNT}/bbone.dtb + cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${FATMOUNT}/bboneblk.dts + cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${FATMOUNT}/bboneblk.dtb + touch ${CHROOTDIR}/${FATMOUNT}/bb-uEnv.txt + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ + ${CHROOTDIR}/${FATMOUNT}/ubldr + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + rmdir ${CHROOTDIR}/${FATMOUNT} + rmdir ${CHROOTDIR}/${UFSMOUNT} return 0 } From 91ea0e63de161b5242bdf1a376e60caf907cf596 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:32:11 +0000 Subject: [PATCH 40/74] Reduce the number of files copied onto the FAT partition. The DTB files are loaded from /boot/dtb on the UFS filesystem. Submitted by: loos Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 2b2c787929e5..8e71b9bf829c 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -25,11 +25,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} cp -p ${UBOOT_DIR}/MLO ${CHROOTDIR}/${FATMOUNT}/MLO cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${FATMOUNT}/u-boot.img - cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${FATMOUNT}/bbone.dts - cp -p ${FDT_DIR}/beaglebone.dts ${CHROOTDIR}/${FATMOUNT}/bbone.dtb - cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${FATMOUNT}/bboneblk.dts - cp -p ${FDT_DIR}/beaglebone-black.dts ${CHROOTDIR}/${FATMOUNT}/bboneblk.dtb - touch ${CHROOTDIR}/${FATMOUNT}/bb-uEnv.txt cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ ${CHROOTDIR}/${FATMOUNT}/ubldr sync From 8c6160744405d85f74e005d46f9fba196ce4ba37 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:41:23 +0000 Subject: [PATCH 41/74] Remove FDT_DIR definition, which is no longer needed. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 8e71b9bf829c..ca16018dd0ff 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -17,7 +17,6 @@ MD_ARGS="-x 63 -y 255" arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-beaglebone" - FDT_DIR="${CHROOTDIR}/${WORLDIR}/sys/boot/fdt/dts/arm" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" mkdir -p "${FATMOUNT}" "${UFSMOUNT}" From b36739d1ea864c6e5f6a714d847849ba45d0abc3 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:47:59 +0000 Subject: [PATCH 42/74] Add initial native suppor for RPI-B: - Set UBLDR_LOADADDR. - Include files to install to the FAT partition. Obtained from: Crochet Sponsored by: The FreeBSD Foundation --- release/arm/RPI-B.conf | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 28562c15a1f5..1607dcb9ea77 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -8,3 +8,32 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi" KERNEL="RPI-B" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="17m" +FAT_TYPE="16" +MD_ARGS="-x 63 -y 255" + +arm_install_uboot() { + UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-rpi" + UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ + start.elf start_cd.elf ubldr uboot.img" + FATMOUNT="${DESTDIR}/fat" + UFSMOUNT="${DESTDIR}/ufs" + mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + for _UF in ${UBOOT_FILES}; do + cp -p ${UBOOT_DIR}/${_UF} ${CHROOTDIR}/${FATMOUNT}/${_UF} + done + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ + ${CHROOTDIR}/${FATMOUNT}/ubldr + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + rmdir ${CHROOTDIR}/${FATMOUNT} + rmdir ${CHROOTDIR}/${UFSMOUNT} + + return 0 +} From 77d9ac17031733c9363f3d1bdc666544ed0e3d99 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:48:47 +0000 Subject: [PATCH 43/74] Set NODOC=1 to avoid building the reldoc target. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 1 + release/arm/PANDABOARD.conf | 1 + release/arm/RPI-B.conf | 1 + release/arm/RPI2.conf | 1 + release/arm/WANDBOARD-QUAD.conf | 1 + release/arm/ZEDBOARD.conf | 1 + 6 files changed, 6 insertions(+) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index ca16018dd0ff..72377251b7b2 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -14,6 +14,7 @@ PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" MD_ARGS="-x 63 -y 255" +NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-beaglebone" diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf index 4cbe7e512b96..439fd37156b9 100644 --- a/release/arm/PANDABOARD.conf +++ b/release/arm/PANDABOARD.conf @@ -8,3 +8,4 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" KERNEL="PANDABOARD" +NODOC=1 diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 1607dcb9ea77..397d174fb883 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -14,6 +14,7 @@ PART_SCHEME="MBR" FAT_SIZE="17m" FAT_TYPE="16" MD_ARGS="-x 63 -y 255" +NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-rpi" diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf index 4f8ea2f6a9e3..e4b565957d44 100644 --- a/release/arm/RPI2.conf +++ b/release/arm/RPI2.conf @@ -8,3 +8,4 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi2" KERNEL="RPI2" +NODOC=1 diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index a368ea5d90ff..2f3ecf699074 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -8,3 +8,4 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-wandboard" KERNEL="WANDBOARD-QUAD" +NODOC=1 diff --git a/release/arm/ZEDBOARD.conf b/release/arm/ZEDBOARD.conf index 8c08fb12d68c..507117a841cd 100644 --- a/release/arm/ZEDBOARD.conf +++ b/release/arm/ZEDBOARD.conf @@ -7,3 +7,4 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" KERNEL="ZEDBOARD" +NODOC=1 From 60bc17f490fc317afa0d3940d74b8ee48f36e3bb Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:49:43 +0000 Subject: [PATCH 44/74] Enable the growfs rc(8) script. Sponsored by: The FreeBSD Foundation --- release/tools/arm.subr | 1 + 1 file changed, 1 insertion(+) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 5272c3f6e53a..271fca95ceca 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -107,6 +107,7 @@ arm_install_base() { echo 'sendmail_submit_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sendmail_outbound_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf sync umount_loop ${CHROOTDIR}/${DESTDIR} From 5287f5496efc87b1d8e80f0bcebad57f8209ca46 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:51:59 +0000 Subject: [PATCH 45/74] Add entries to uenv.txt. Obtained from: Crochet Sponsored by: The FreeBSD Foundation --- release/arm/RPI-B.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 397d174fb883..ab93053fc4d3 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -30,6 +30,10 @@ arm_install_uboot() { done cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ ${CHROOTDIR}/${FATMOUNT}/ubldr + echo 'loadbootscript=fatload mmc 0 0x2000000 ubldr' > \ + ${CHROOTDIR}/${FATMOUNT}/uenv.txt + echo 'bootscript=fdt addr 0x100;bootelf 0x2000000' >> \ + ${CHROOTDIR}/${FATMOUNT}/uenv.txt sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} From 51aa8af2cc8ed36f8a7ceeab6a0a11c8885ff99b Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 18:53:48 +0000 Subject: [PATCH 46/74] Fix a copy/paste mistake. Sponsored by: The FreeBSD Foundation --- release/arm/RPI-B.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index ab93053fc4d3..9ee176263892 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -19,7 +19,7 @@ NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-rpi" UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ - start.elf start_cd.elf ubldr uboot.img" + start.elf start_cd.elf uboot.img" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" mkdir -p "${FATMOUNT}" "${UFSMOUNT}" From 6052b0ac86fcf206e98bcc5c1a0b989e45d6fbac Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 19:10:08 +0000 Subject: [PATCH 47/74] Fix creating directories within DESTDIR. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 2 +- release/arm/RPI-B.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 72377251b7b2..add96e196427 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -20,7 +20,7 @@ arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-beaglebone" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" - mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} cp -p ${UBOOT_DIR}/MLO ${CHROOTDIR}/${FATMOUNT}/MLO diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 9ee176263892..41301f782e46 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -22,7 +22,7 @@ arm_install_uboot() { start.elf start_cd.elf uboot.img" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" - mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} for _UF in ${UBOOT_FILES}; do From 1deb618afd207bb3e1fc650a45ae031b78b546df Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 19:47:15 +0000 Subject: [PATCH 48/74] Remove arm/Makefile.{KERNEL} files, as this project branch is now going in a different direction than originally planned. Sponsored by: The FreeBSD Foundation --- release/Makefile | 1 - release/Makefile.arm | 134 ---------------------------- release/arm/Makefile.BEAGLEBONE | 10 --- release/arm/Makefile.PANDABOARD | 9 -- release/arm/Makefile.RPI-B | 10 --- release/arm/Makefile.WANDBOARD-QUAD | 10 --- release/arm/Makefile.ZEDBOARD | 9 -- 7 files changed, 183 deletions(-) delete mode 100644 release/Makefile.arm delete mode 100644 release/arm/Makefile.BEAGLEBONE delete mode 100644 release/arm/Makefile.PANDABOARD delete mode 100644 release/arm/Makefile.RPI-B delete mode 100644 release/arm/Makefile.WANDBOARD-QUAD delete mode 100644 release/arm/Makefile.ZEDBOARD diff --git a/release/Makefile b/release/Makefile index 7b599409e51c..e3485f222ad5 100644 --- a/release/Makefile +++ b/release/Makefile @@ -303,4 +303,3 @@ release-install: cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 .include "${.CURDIR}/Makefile.vm" -.include "${.CURDIR}/Makefile.arm" diff --git a/release/Makefile.arm b/release/Makefile.arm deleted file mode 100644 index b7092c32bbc1..000000000000 --- a/release/Makefile.arm +++ /dev/null @@ -1,134 +0,0 @@ -# -# $FreeBSD$ -# - -BOARDS?= BEAGLEBONE \ - RPI-B \ - PANDABOARD \ - WANDBOARD-QUAD \ - ZEDBOARD - -ARMTARGETS?= -ARMSIZE?= 1G -BOOTSIZE?= 4m -ARM_WFLAGS?= CROSS_TOOLCHAIN=armv6-gcc -ARMPORTS?= - -WITH_ARM_IMAGES?=1 -CLEANFILES+= arm-all - -.if defined(WITH_ARM_IMAGES) && !empty(WITH_ARM_IMAGES) && !empty(BOARDS) -. for BOARD in ${BOARDS} -ARMTARGETS+= arm-${BOARD:tl} -ARMBEFORECLEAN+= arm-mdclean${BOARD:tl} -CLEANDIRS+= arm-${BOARD:tl} \ - arm-${BOARD:tl}-boot -CLEANFILES+= arm-buildworld${BOARD:tl} \ - arm-buildkernel${BOARD:tl} \ - arm-installworld${BOARD:tl} \ - arm-installkernel${BOARD:tl} \ - ${${BOARD:tu}IMAGE} \ - ${${BOARD:tu}MDDEV} \ - ${${BOARD:tu}MDFILE} \ - ${${BOARD:tu}BOOTDEV} \ - ${${BOARD:tu}BOOTFILE} \ - build-arm-${BOARD:tl} \ - build-arm-ports${BOARD:tl} -${BOARD:tu}IMAGE= arm-${BOARD:tu}.img -${BOARD:tu}MDDEV= arm-${BOARD:tu}.mddev -${BOARD:tu}MDFILE= arm-${BOARD:tu}.raw -${BOARD:tu}BOOTDEV= arm-${BOARD:tu}.bootdev -${BOARD:tu}BOOTFILE= arm-${BOARD:tu}.boot -. if exists(${.CURDIR}/arm/Makefile.${BOARD}) -. include "${.CURDIR}/arm/Makefile.${BOARD}" -. endif - -arm-mdclean${BOARD:tl}: -.if exists(${${BOARD:tu}MDDEV}) - umount ${${BOARD:tu}MDFILE} || true - mdconfig -d -u $$(cat ${${BOARD:tu}MDDEV}) -.endif -.if exists(${${BOARD:tu}BOOTDEV}) - umount ${${BOARD:tu}BOOTFILE} || true - mdconfig -d -u $$(cat ${${BOARD:tu}BOOTDEV}) -.endif - -arm-${BOARD:tl}: arm-buildworld${BOARD:tl} arm-buildkernel${BOARD:tl} \ - arm-installworld${BOARD:tl} arm-installkernel${BOARD:tl} - ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} build-${.TARGET} - -arm-buildworld${BOARD:tl}: - @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ - buildworld - touch ${.TARGET} - -arm-buildkernel${BOARD:tl}: - @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ - KERNCONF=${BOARD} buildkernel - touch ${.TARGET} - -arm-installworld${BOARD:tl}: arm-mkfs${BOARD:tl} - @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ - DESTDIR=${.OBJDIR}/arm-${BOARD:tl} installworld distribution - touch ${.TARGET} - -arm-installkernel${BOARD:tl}: - @echo ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${ARM_WFLAGS} \ - DESTDIR=${.OBJDIR}/arm-${BOARD:tl} KERNCONF=${BOARD} \ - installkernel - touch ${.TARGET} - -arm-mkfs${BOARD:tl}: -.if !exists(${${BOARD:tu}MDDEV}) - mkdir -p ${.OBJDIR}/arm-${BOARD:tl} - truncate -s ${ARMSIZE} ${.OBJDIR}/${${BOARD:tu}MDFILE} - echo $$(mdconfig -f ${.OBJDIR}/${${BOARD:tu}MDFILE}) > \ - ${.OBJDIR}/${${BOARD:tu}MDDEV} - newfs -S 4096 /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}MDDEV}) - mount /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}MDDEV}) \ - ${.OBJDIR}/arm-${BOARD:tl} -.endif -.if !exists(${${BOARD:tu}BOOTDEV}) - mkdir -p ${.OBJDIR}/arm-${BOARD:tl}-boot - truncate -s ${BOOTSIZE} ${.OBJDIR}/${${BOARD:tu}BOOTFILE} - echo $$(mdconfig -f ${.OBJDIR}/${${BOARD:tu}BOOTFILE}) > \ - ${.OBJDIR}/${${BOARD:tu}BOOTDEV} - newfs_msdos -S 4096 /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) - mount_msdosfs /dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) \ - ${.OBJDIR}/arm-${BOARD:tl}-boot -.endif - -arm-mkimage${BOARD:tl}: -.if exists(/dev/$$(cat ${.OBJDIR}/${${BOARD:tu}BOOTDEV}) - umount ${.OBJDIR}/arm-${BOARD:tl}-boot -.endif -.if exists(/dev/$$(cat ${.OBJDIR}/${${BOARD:tu}MDDEV}) - umount ${.OBJDIR}/arm-${BOARD:tl} -.endif -# FIXME: -# Do these things need to be MBR? -# I'm also not entirely sure this is correct, anyway. -# - mkimg -s ${${BOARD}PARTSCHEME} \ - -b ${${BOARD:tu}BOOTFILE} \ - -p freebsd/rootfs:=${${BOARD:tu}MDFILE} \ - -o ${${BOARD:tu}IMAGE} - -build-arm-ports${BOARD:tl}: -. if defined(ARMPORTS) && !empty(ARMPORTS) -. if !exists(${PORTSDIR}/Makefile) -. error "Ports tree (${PORTSDIR}) is required." -. endif -. for AP in ${ARMPORTS} - @echo ${MAKE} -C ${PORTSDIR}/${AP} all install clean distclean -. endfor -. endif - touch ${.TARGET} - -. endfor # main loop -.endif # !WITH_ARM_IMAGES - -beforeclean: ${ARMBEFORECLEAN} - -arm-all: ${ARMTARGETS} - touch ${.TARGET} diff --git a/release/arm/Makefile.BEAGLEBONE b/release/arm/Makefile.BEAGLEBONE deleted file mode 100644 index 5f59f0317d88..000000000000 --- a/release/arm/Makefile.BEAGLEBONE +++ /dev/null @@ -1,10 +0,0 @@ -# -# $FreeBSD$ -# - -BOARD= BEAGLEBONE -${BOARD}PARTSCHEME= mbr -ARMPORTS= sysutils/u-boot-beaglebone - -build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} - touch ${.TARGET} diff --git a/release/arm/Makefile.PANDABOARD b/release/arm/Makefile.PANDABOARD deleted file mode 100644 index cd911e9cbb62..000000000000 --- a/release/arm/Makefile.PANDABOARD +++ /dev/null @@ -1,9 +0,0 @@ -# -# $FreeBSD$ -# - -BOARD= PANDABOARD -${BOARD}PARTSCHEME= mbr - -build-arm-${BOARD:tl}: - touch ${.TARGET} diff --git a/release/arm/Makefile.RPI-B b/release/arm/Makefile.RPI-B deleted file mode 100644 index c81e51ed35c6..000000000000 --- a/release/arm/Makefile.RPI-B +++ /dev/null @@ -1,10 +0,0 @@ -# -# $FreeBSD$ -# - -BOARD= RPI-B -${BOARD}PARTSCHEME= mbr -ARMPORTS= sysutils/u-boot-rpi - -build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} - touch ${.TARGET} diff --git a/release/arm/Makefile.WANDBOARD-QUAD b/release/arm/Makefile.WANDBOARD-QUAD deleted file mode 100644 index d7f7ff7e4474..000000000000 --- a/release/arm/Makefile.WANDBOARD-QUAD +++ /dev/null @@ -1,10 +0,0 @@ -# -# $FreeBSD$ -# - -BOARD= WANDBOARD-QUAD -${BOARD}PARTSCHEME= mbr -ARMPORTS= sysutils/u-boot-wandboard - -build-arm-${BOARD:tl}: build-arm-ports${BOARD:tl} - touch ${.TARGET} diff --git a/release/arm/Makefile.ZEDBOARD b/release/arm/Makefile.ZEDBOARD deleted file mode 100644 index 5d3a6856cc1d..000000000000 --- a/release/arm/Makefile.ZEDBOARD +++ /dev/null @@ -1,9 +0,0 @@ -# -# $FreeBSD$ -# - -BOARD= ZEDBOARD -${BOARD}PARTSCHEME= mbr - -build-arm-${BOARD:tl}: - touch ${.TARGET} From 57fa7d0f2d42c7057d464dd20247c82f1f70ce30 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 19:48:06 +0000 Subject: [PATCH 49/74] Remove the arm/ROADMAP file. Sponsored by: The FreeBSD Foundation --- release/arm/ROADMAP | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 release/arm/ROADMAP diff --git a/release/arm/ROADMAP b/release/arm/ROADMAP deleted file mode 100644 index c76a41eb57a9..000000000000 --- a/release/arm/ROADMAP +++ /dev/null @@ -1,18 +0,0 @@ -# -# $FreeBSD$ -# - -== WORKFLOW -===================================================================== - -- buildworld [1] -- buildkernel [1] -- ports build [2] -- md(4) device creation, mount, installworld, installkernel -- u-boot magic [2] -- rc.conf edits (gpart resize, sshd, etc.) -- ??? -- profit. - -[1]: Requires CROSS_TOOLCHAIN -[2]: If necessary From a3a86d8697518ef4110b7be912f2796f4abf833a Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 20:02:50 +0000 Subject: [PATCH 50/74] Spell 'u-boot.img' correctly. Sponsored by: The FreeBSD Foundation --- release/arm/RPI-B.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 41301f782e46..4715c733b4fa 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -19,7 +19,7 @@ NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-rpi" UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ - start.elf start_cd.elf uboot.img" + start.elf start_cd.elf u-boot.img" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" From e26ba8ae963b11de34bbe8fdb69d3b207398e4c3 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 20:06:39 +0000 Subject: [PATCH 51/74] Remove the ZEDBOARD configuration file, as it does not have a corresponding u-boot port in the Ports Collection. Sponsored by: The FreeBSD Foundation --- release/arm/ZEDBOARD.conf | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 release/arm/ZEDBOARD.conf diff --git a/release/arm/ZEDBOARD.conf b/release/arm/ZEDBOARD.conf deleted file mode 100644 index 507117a841cd..000000000000 --- a/release/arm/ZEDBOARD.conf +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" -KERNEL="ZEDBOARD" -NODOC=1 From efc6ab44f252e4ae24d2e253a757922a2452e211 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 20:25:17 +0000 Subject: [PATCH 52/74] Create the /boot/msdos directory so the FAT partition is mounted properly. Noticed by: sbruno Sponsored by: The FreeBSD Foundation --- release/tools/arm.subr | 1 + 1 file changed, 1 insertion(+) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 271fca95ceca..1b7d4817fd5c 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -84,6 +84,7 @@ arm_install_base() { TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ installworld installkernel distribution + chroot ${CHROOTDIR} mkdir -p /boot/msdos echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab From 869ef347221b24e318598c7e2ac82266061dabdd Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 23:46:33 +0000 Subject: [PATCH 53/74] Reorder / and /boot/msdos mount to avoid the following error: Mounting local file systems: mount: /boot/msdos: No such file or directory Sponsored by: The FreeBSD Foundation --- release/tools/arm.subr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 1b7d4817fd5c..3e405a99b4d1 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -88,10 +88,10 @@ arm_install_base() { echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ - >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/ufs/rootfs / ufs rw 1 1" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab + echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ + >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "md /tmp mfs rw,noatime,-s30m 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "md /var/log mfs rw,noatime,-s15m 0 0" \ From 70437a3a2f68790ecabcfd57d15b0a8df080da59 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Thu, 7 May 2015 23:49:48 +0000 Subject: [PATCH 54/74] Copy the rpi.dtb file to the FAT partition, preventing the 'Unrecognized partition table' error, causing boot failure. Sponsored by: The FreeBSD Foundation --- release/arm/RPI-B.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 4715c733b4fa..6130d8cc6190 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -30,6 +30,8 @@ arm_install_uboot() { done cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ ${CHROOTDIR}/${FATMOUNT}/ubldr + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/dtb/rpi.dtb \ + ${CHROOTDIR}/${FATMOUNT}/rpi.dtb echo 'loadbootscript=fatload mmc 0 0x2000000 ubldr' > \ ${CHROOTDIR}/${FATMOUNT}/uenv.txt echo 'bootscript=fdt addr 0x100;bootelf 0x2000000' >> \ From fef41f600ce1b7595b45ad180d545eacc946a5c8 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 10:38:32 +0000 Subject: [PATCH 55/74] Fix path to /boot/msdos for the target image. Sponsored by: The FreeBSD Foundation --- release/tools/arm.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 3e405a99b4d1..c42cf0daa19e 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -84,7 +84,7 @@ arm_install_base() { TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ installworld installkernel distribution - chroot ${CHROOTDIR} mkdir -p /boot/msdos + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab From 78e712f1bcd57a1d5b33395575e03d6a65c93552 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 10:39:52 +0000 Subject: [PATCH 56/74] Do not create the uenv.txt file for RPI-B. It is not needed. Submitted by: ian Sponsored by: The FreeBSD Foundation --- release/arm/RPI-B.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 6130d8cc6190..364f15591084 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -32,10 +32,6 @@ arm_install_uboot() { ${CHROOTDIR}/${FATMOUNT}/ubldr cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/dtb/rpi.dtb \ ${CHROOTDIR}/${FATMOUNT}/rpi.dtb - echo 'loadbootscript=fatload mmc 0 0x2000000 ubldr' > \ - ${CHROOTDIR}/${FATMOUNT}/uenv.txt - echo 'bootscript=fdt addr 0x100;bootelf 0x2000000' >> \ - ${CHROOTDIR}/${FATMOUNT}/uenv.txt sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} From b3e7a59bdf6153059edf5887ffe6853fa9ffbc13 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 10:43:29 +0000 Subject: [PATCH 57/74] Rename KERNEL.img -> OSRELEASE-KERNEL.img when complete. Sponsored by: The FreeBSD Foundation --- release/release.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release/release.sh b/release/release.sh index 4c40dcc523f2..80c68ce98e92 100755 --- a/release/release.sh +++ b/release/release.sh @@ -334,6 +334,9 @@ chroot_arm_armv6_build_release() { OBJDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V .OBJDIR)" DESTDIR="${OBJDIR}/${KERNEL}" IMGBASE="${CHROOTDIR}/${OBJDIR}/${KERNEL}.img" + OSRELEASE="$(eval chroot ${CHROOTDIR} make -C /usr/src/release \ + TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ + -V OSRELEASE)" mkdir -p ${CHROOTDIR}/${DESTDIR} truncate -s ${IMAGE_SIZE} ${IMGBASE} export mddev=$(mdconfig -f ${IMGBASE} ${MD_ARGS}) @@ -342,6 +345,7 @@ chroot_arm_armv6_build_release() { arm_install_uboot mdconfig -d -u ${mddev} rmdir ${CHROOTDIR}/${DESTDIR} + mv ${IMGBASE} ${IMGBASE}-${KERNEL}.img return 0 } # chroot_arm_armv6_build_release() From 40847e360bb20909725ee55c6729f8519e0e8738 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 10:47:57 +0000 Subject: [PATCH 58/74] Fix the name of the final image. Sigh. Thou shalt not commit before coffee. Sponsored by: The FreeBSD Foundation --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 80c68ce98e92..c1ab0f6c9527 100755 --- a/release/release.sh +++ b/release/release.sh @@ -345,7 +345,7 @@ chroot_arm_armv6_build_release() { arm_install_uboot mdconfig -d -u ${mddev} rmdir ${CHROOTDIR}/${DESTDIR} - mv ${IMGBASE} ${IMGBASE}-${KERNEL}.img + mv ${IMGBASE} ${CHROOTDIR}/${OBJDIR}/${OSRELEASE}-${KERNEL}.img return 0 } # chroot_arm_armv6_build_release() From 99cf2362e2c2f4b84d2144632e49ce37911e3491 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 12:50:48 +0000 Subject: [PATCH 59/74] Move the finished image build to the '/R' directory (the standard 'install' location for other architectures), then compress the image with xz(1), and generate the CHECKSUM files. Sponsored by: The FreeBSD Foundation --- release/release.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/release/release.sh b/release/release.sh index c1ab0f6c9527..cdab65474500 100755 --- a/release/release.sh +++ b/release/release.sh @@ -346,6 +346,14 @@ chroot_arm_armv6_build_release() { mdconfig -d -u ${mddev} rmdir ${CHROOTDIR}/${DESTDIR} mv ${IMGBASE} ${CHROOTDIR}/${OBJDIR}/${OSRELEASE}-${KERNEL}.img + chroot ${CHROOTDIR} mkdir -p /R + chroot ${CHROOTDIR} cp -p ${OBJDIR}/${OSRELEASE}-${KERNEL}.img \ + /R/${OSRELEASE}-${KERNEL}.img + chroot ${CHROOTDIR} xz -T ${XZ_THREADS} /R/${OSRELEASE}-${KERNEL}.img + chroot ${CHROOTDIR} cd /R && sha256 /R/${OSRELEASE}* \ + > /R/CHECKSUM.SHA256 + chroot ${CHROOTDIR} cd /R && md5 /R/${OSRELEASE}* \ + > /R/CHECKSUM.MD5 return 0 } # chroot_arm_armv6_build_release() From 4bf1e8aee022e9cf2459b3423184903272215eeb Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 12:55:25 +0000 Subject: [PATCH 60/74] Do not include '/R' in the path when generating checksums, since that will cause '/R' to be included in the CHECKSUM files. Sponsored by: The FreeBSD Foundation --- release/release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index cdab65474500..ca95a4340081 100755 --- a/release/release.sh +++ b/release/release.sh @@ -350,9 +350,9 @@ chroot_arm_armv6_build_release() { chroot ${CHROOTDIR} cp -p ${OBJDIR}/${OSRELEASE}-${KERNEL}.img \ /R/${OSRELEASE}-${KERNEL}.img chroot ${CHROOTDIR} xz -T ${XZ_THREADS} /R/${OSRELEASE}-${KERNEL}.img - chroot ${CHROOTDIR} cd /R && sha256 /R/${OSRELEASE}* \ + chroot ${CHROOTDIR} cd /R && sha256 ${OSRELEASE}* \ > /R/CHECKSUM.SHA256 - chroot ${CHROOTDIR} cd /R && md5 /R/${OSRELEASE}* \ + chroot ${CHROOTDIR} cd /R && md5 ${OSRELEASE}* \ > /R/CHECKSUM.MD5 return 0 From 763034ac01587584406cee9b5124c2f2f67e3315 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 13:55:27 +0000 Subject: [PATCH 61/74] Initial commit to support building RPI2 images, based on information and documentation written by loos@ on the Wiki. Sponsored by: The FreeBSD Foundation --- release/arm/RPI2.conf | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf index e4b565957d44..1aaed771e547 100644 --- a/release/arm/RPI2.conf +++ b/release/arm/RPI2.conf @@ -9,3 +9,34 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi2" KERNEL="RPI2" NODOC=1 +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="50m" +FAT_TYPE="16" +MD_ARGS="-x 63 -y 255" + +arm_install_uboot() { + UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-rpi2" + UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ + fixup_x.dat start.elf start_cd.elf start_x.elf u-boot.bin" + FATMOUNT="${DESTDIR}/fat" + UFSMOUNT="${DESTDIR}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + for _UF in ${UBOOT_FILES}; do + cp -p ${UBOOT_DIR}/${_UF} ${CHROOTDIR}/${FATMOUNT}/${_UF} + done + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ + ${CHROOTDIR}/${FATMOUNT}/ubldr + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/dtb/rpi2.dtb \ + ${CHROOTDIR}/${FATMOUNT}/rpi2.dtb + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + rmdir ${CHROOTDIR}/${FATMOUNT} + rmdir ${CHROOTDIR}/${UFSMOUNT} + + return 0 +} From 1993c0f1e6a2ffa04cf5dd9df34f7a8510b69697 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 14:13:19 +0000 Subject: [PATCH 62/74] Enable ttyv0 and ttyu0 by default if they are available consoles. Tested on: RPI-B Sponsored by: The FreeBSD Foundation --- etc/etc.arm/ttys | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/etc.arm/ttys b/etc/etc.arm/ttys index ba410b707c1c..501bae69bd50 100644 --- a/etc/etc.arm/ttys +++ b/etc/etc.arm/ttys @@ -29,7 +29,7 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm off secure +ttyv0 "/usr/libexec/getty Pc" xterm onifconsole secure # Virtual terminals ttyv1 "/usr/libexec/getty Pc" xterm off secure ttyv2 "/usr/libexec/getty Pc" xterm off secure @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm off secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure From 53f0cb8fae299acf9d383851c3dac63141ae80dd Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 15:07:17 +0000 Subject: [PATCH 63/74] Initial support for building WANDBOARD-QUAD images. Several parts of this were obtained from Crochet. Sponsored by: The FreeBSD Foundation --- release/arm/WANDBOARD-QUAD.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index 2f3ecf699074..4bab7889492b 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -8,4 +8,34 @@ EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-wandboard" KERNEL="WANDBOARD-QUAD" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="17m" +FAT_TYPE="16 -b 16384" +MD_ARGS="-x 63 -y 255" NODOC=1 + +arm_install_uboot() { + UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" + UBOOT_FILES="u-boot.imx" + FATMOUNT="${DESTDIR}/fat" + UFSMOUNT="${DESTDIR}/ufs" + chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + of=/dev/${mddev} bs=512 seek=2 + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ + ${CHROOTDIR}/${FATMOUNT}/ubldr + chroot ${CHROOTDIR} echo \ + 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ + > ${FATMOUNT}/boot.txt + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + rmdir ${CHROOTDIR}/${FATMOUNT} + rmdir ${CHROOTDIR}/${UFSMOUNT} + + return 0 +} From 395475f31e431f43e17e426f230aa19c864d3c5f Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 15:10:00 +0000 Subject: [PATCH 64/74] Fix CHECKSUM file creation. Sponsored by: The FreeBSD Foundation --- release/release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/release.sh b/release/release.sh index ca95a4340081..6a2c6d12af4d 100755 --- a/release/release.sh +++ b/release/release.sh @@ -350,10 +350,10 @@ chroot_arm_armv6_build_release() { chroot ${CHROOTDIR} cp -p ${OBJDIR}/${OSRELEASE}-${KERNEL}.img \ /R/${OSRELEASE}-${KERNEL}.img chroot ${CHROOTDIR} xz -T ${XZ_THREADS} /R/${OSRELEASE}-${KERNEL}.img - chroot ${CHROOTDIR} cd /R && sha256 ${OSRELEASE}* \ - > /R/CHECKSUM.SHA256 - chroot ${CHROOTDIR} cd /R && md5 ${OSRELEASE}* \ - > /R/CHECKSUM.MD5 + chroot ${CHROOTDIR} (cd /R && sha256 ${OSRELEASE}* \ + > /R/CHECKSUM.SHA256) + chroot ${CHROOTDIR} (cd /R && md5 ${OSRELEASE}* \ + > /R/CHECKSUM.MD5) return 0 } # chroot_arm_armv6_build_release() From 9fcdd5a3c9c65882fa162fa66b5ba5895540d908 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 15:15:36 +0000 Subject: [PATCH 65/74] Sigh. Really fix CHECKSUM file creation. Sponsored by: The FreeBSD Foundation --- release/release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/release.sh b/release/release.sh index 6a2c6d12af4d..6c1226c1d724 100755 --- a/release/release.sh +++ b/release/release.sh @@ -350,10 +350,10 @@ chroot_arm_armv6_build_release() { chroot ${CHROOTDIR} cp -p ${OBJDIR}/${OSRELEASE}-${KERNEL}.img \ /R/${OSRELEASE}-${KERNEL}.img chroot ${CHROOTDIR} xz -T ${XZ_THREADS} /R/${OSRELEASE}-${KERNEL}.img - chroot ${CHROOTDIR} (cd /R && sha256 ${OSRELEASE}* \ - > /R/CHECKSUM.SHA256) - chroot ${CHROOTDIR} (cd /R && md5 ${OSRELEASE}* \ - > /R/CHECKSUM.MD5) + cd ${CHROOTDIR}/R && sha256 ${OSRELEASE}* \ + > CHECKSUM.SHA256 + cd ${CHROOTDIR}/R && md5 ${OSRELEASE}* \ + > CHECKSUM.MD5 return 0 } # chroot_arm_armv6_build_release() From ea904d2c76b2c70664d868e589d6e77a0467c6db Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 15:18:31 +0000 Subject: [PATCH 66/74] Fix FAT partition size. Sponsored by: The FreeBSD Foundation --- release/arm/WANDBOARD-QUAD.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index 4bab7889492b..7039cc798adc 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -11,7 +11,7 @@ KERNEL="WANDBOARD-QUAD" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" -FAT_SIZE="17m" +FAT_SIZE="50m" FAT_TYPE="16 -b 16384" MD_ARGS="-x 63 -y 255" NODOC=1 From 89d922bb33dcf0481e5a88e967896eac979da8b0 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 15:22:29 +0000 Subject: [PATCH 67/74] Copy arm/WANDBOARD-QUAD.conf to arm/WANDBOARD-{SOLO,DUAL}.conf. Ian informed me a few months ago that the WANDBOARD-* kernels will eventually be combined into one that will work across all these boards, but for now, build them individually. Sponsored by: The FreeBSD Foundation --- release/arm/WANDBOARD-SOLO.conf | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 release/arm/WANDBOARD-SOLO.conf diff --git a/release/arm/WANDBOARD-SOLO.conf b/release/arm/WANDBOARD-SOLO.conf new file mode 100644 index 000000000000..efcca730b21c --- /dev/null +++ b/release/arm/WANDBOARD-SOLO.conf @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-wandboard" +KERNEL="WANDBOARD-SOLO" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="50m" +FAT_TYPE="16 -b 16384" +MD_ARGS="-x 63 -y 255" +NODOC=1 + +arm_install_uboot() { + UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" + UBOOT_FILES="u-boot.imx" + FATMOUNT="${DESTDIR}/fat" + UFSMOUNT="${DESTDIR}/ufs" + chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + of=/dev/${mddev} bs=512 seek=2 + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ + ${CHROOTDIR}/${FATMOUNT}/ubldr + chroot ${CHROOTDIR} echo \ + 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ + > ${FATMOUNT}/boot.txt + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + rmdir ${CHROOTDIR}/${FATMOUNT} + rmdir ${CHROOTDIR}/${UFSMOUNT} + + return 0 +} From d3c70a1f4434efa9389b4369aca628ca62dcae8a Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 15:23:21 +0000 Subject: [PATCH 68/74] Add a file missed in the previous commit. Sponsored by: The FreeBSD Foundation --- release/arm/WANDBOARD-DUAL.conf | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 release/arm/WANDBOARD-DUAL.conf diff --git a/release/arm/WANDBOARD-DUAL.conf b/release/arm/WANDBOARD-DUAL.conf new file mode 100644 index 000000000000..4f7685218ec8 --- /dev/null +++ b/release/arm/WANDBOARD-DUAL.conf @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-wandboard" +KERNEL="WANDBOARD-DUAL" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="50m" +FAT_TYPE="16 -b 16384" +MD_ARGS="-x 63 -y 255" +NODOC=1 + +arm_install_uboot() { + UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" + UBOOT_FILES="u-boot.imx" + FATMOUNT="${DESTDIR}/fat" + UFSMOUNT="${DESTDIR}/ufs" + chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + of=/dev/${mddev} bs=512 seek=2 + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ + ${CHROOTDIR}/${FATMOUNT}/ubldr + chroot ${CHROOTDIR} echo \ + 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ + > ${FATMOUNT}/boot.txt + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + rmdir ${CHROOTDIR}/${FATMOUNT} + rmdir ${CHROOTDIR}/${UFSMOUNT} + + return 0 +} From f8254ea6866d4bab8f797807af9d3b7d3febbb27 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 16:00:06 +0000 Subject: [PATCH 69/74] Initial support for building the PANDABOARD image. Sponsored by: The FreeBSD Foundation --- release/arm/PANDABOARD.conf | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf index 439fd37156b9..0ea697eae548 100644 --- a/release/arm/PANDABOARD.conf +++ b/release/arm/PANDABOARD.conf @@ -9,3 +9,29 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" KERNEL="PANDABOARD" NODOC=1 +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="2m" +FAT_TYPE="12" +MD_ARGS="-x 63 -y 255" + +arm_install_uboot() { + UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-pandaboard" + FATMOUNT="${DESTDIR}/fat" + UFSMOUNT="${DESTDIR}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + cp -p ${UBOOT_DIR}/MLO ${CHROOTDIR}/${FATMOUNT}/MLO + cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${FATMOUNT}/u-boot.img + cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ + ${CHROOTDIR}/${FATMOUNT}/ubldr + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + rmdir ${CHROOTDIR}/${FATMOUNT} + rmdir ${CHROOTDIR}/${UFSMOUNT} + + return 0 +} From 4c32646a7258a5e871a49983eec4015931eca064 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 16:37:57 +0000 Subject: [PATCH 70/74] Fix the starting block of the partition. Sponsored by: The FreeBSD Foundation --- release/arm/WANDBOARD-DUAL.conf | 4 ++-- release/arm/WANDBOARD-QUAD.conf | 4 ++-- release/arm/WANDBOARD-SOLO.conf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/release/arm/WANDBOARD-DUAL.conf b/release/arm/WANDBOARD-DUAL.conf index 4f7685218ec8..ea87e172f230 100644 --- a/release/arm/WANDBOARD-DUAL.conf +++ b/release/arm/WANDBOARD-DUAL.conf @@ -11,8 +11,8 @@ KERNEL="WANDBOARD-DUAL" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" -FAT_SIZE="50m" -FAT_TYPE="16 -b 16384" +FAT_SIZE="50m -b 16384" +FAT_TYPE="16" MD_ARGS="-x 63 -y 255" NODOC=1 diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index 7039cc798adc..220fa81a6b60 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -11,8 +11,8 @@ KERNEL="WANDBOARD-QUAD" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" -FAT_SIZE="50m" -FAT_TYPE="16 -b 16384" +FAT_SIZE="50m -b 16384" +FAT_TYPE="16" MD_ARGS="-x 63 -y 255" NODOC=1 diff --git a/release/arm/WANDBOARD-SOLO.conf b/release/arm/WANDBOARD-SOLO.conf index efcca730b21c..72c4161466f8 100644 --- a/release/arm/WANDBOARD-SOLO.conf +++ b/release/arm/WANDBOARD-SOLO.conf @@ -11,8 +11,8 @@ KERNEL="WANDBOARD-SOLO" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" -FAT_SIZE="50m" -FAT_TYPE="16 -b 16384" +FAT_SIZE="50m -b 16384" +FAT_TYPE="16" MD_ARGS="-x 63 -y 255" NODOC=1 From e2ae79b18141490324d3d9093a80db7c5690d6eb Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 16:41:21 +0000 Subject: [PATCH 71/74] Touch '/firstboot' so the growfs rc(8) script runs. Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 1 + release/arm/PANDABOARD.conf | 1 + release/arm/RPI-B.conf | 1 + release/arm/RPI2.conf | 1 + release/arm/WANDBOARD-DUAL.conf | 1 + release/arm/WANDBOARD-QUAD.conf | 1 + release/arm/WANDBOARD-SOLO.conf | 1 + 7 files changed, 7 insertions(+) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index add96e196427..f5d8189c63da 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -27,6 +27,7 @@ arm_install_uboot() { cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${FATMOUNT}/u-boot.img cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ ${CHROOTDIR}/${FATMOUNT}/ubldr + touch ${CHROOTDIR}/${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf index 0ea697eae548..45b7085a892d 100644 --- a/release/arm/PANDABOARD.conf +++ b/release/arm/PANDABOARD.conf @@ -27,6 +27,7 @@ arm_install_uboot() { cp -p ${UBOOT_DIR}/u-boot.img ${CHROOTDIR}/${FATMOUNT}/u-boot.img cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ ${CHROOTDIR}/${FATMOUNT}/ubldr + touch ${CHROOTDIR}/${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 364f15591084..5610237ff404 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -32,6 +32,7 @@ arm_install_uboot() { ${CHROOTDIR}/${FATMOUNT}/ubldr cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/dtb/rpi.dtb \ ${CHROOTDIR}/${FATMOUNT}/rpi.dtb + touch ${CHROOTDIR}/${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf index 1aaed771e547..7de718835c6d 100644 --- a/release/arm/RPI2.conf +++ b/release/arm/RPI2.conf @@ -32,6 +32,7 @@ arm_install_uboot() { ${CHROOTDIR}/${FATMOUNT}/ubldr cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/dtb/rpi2.dtb \ ${CHROOTDIR}/${FATMOUNT}/rpi2.dtb + touch ${CHROOTDIR}/${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} diff --git a/release/arm/WANDBOARD-DUAL.conf b/release/arm/WANDBOARD-DUAL.conf index ea87e172f230..e69dec358090 100644 --- a/release/arm/WANDBOARD-DUAL.conf +++ b/release/arm/WANDBOARD-DUAL.conf @@ -31,6 +31,7 @@ arm_install_uboot() { chroot ${CHROOTDIR} echo \ 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ > ${FATMOUNT}/boot.txt + touch ${CHROOTDIR}/${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index 220fa81a6b60..0ddf3d3dce4a 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -31,6 +31,7 @@ arm_install_uboot() { chroot ${CHROOTDIR} echo \ 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ > ${FATMOUNT}/boot.txt + touch ${CHROOTDIR}/${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} diff --git a/release/arm/WANDBOARD-SOLO.conf b/release/arm/WANDBOARD-SOLO.conf index 72c4161466f8..b7b035e10a8a 100644 --- a/release/arm/WANDBOARD-SOLO.conf +++ b/release/arm/WANDBOARD-SOLO.conf @@ -31,6 +31,7 @@ arm_install_uboot() { chroot ${CHROOTDIR} echo \ 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ > ${FATMOUNT}/boot.txt + touch ${CHROOTDIR}/${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} From 0c66fe4daae375aa2f64361f8ca070cf4ed18ad0 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 17:53:44 +0000 Subject: [PATCH 72/74] Fix path to the u-boot.imx file, which is relative to the root of the chroot environment. Sponsored by: The FreeBSD Foundation --- release/arm/WANDBOARD-DUAL.conf | 2 +- release/arm/WANDBOARD-QUAD.conf | 2 +- release/arm/WANDBOARD-SOLO.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/arm/WANDBOARD-DUAL.conf b/release/arm/WANDBOARD-DUAL.conf index e69dec358090..c20a4a96635f 100644 --- a/release/arm/WANDBOARD-DUAL.conf +++ b/release/arm/WANDBOARD-DUAL.conf @@ -21,7 +21,7 @@ arm_install_uboot() { UBOOT_FILES="u-boot.imx" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" - chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index 0ddf3d3dce4a..d6de53dafab7 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -21,7 +21,7 @@ arm_install_uboot() { UBOOT_FILES="u-boot.imx" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" - chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} diff --git a/release/arm/WANDBOARD-SOLO.conf b/release/arm/WANDBOARD-SOLO.conf index b7b035e10a8a..bdc2ef91138a 100644 --- a/release/arm/WANDBOARD-SOLO.conf +++ b/release/arm/WANDBOARD-SOLO.conf @@ -21,7 +21,7 @@ arm_install_uboot() { UBOOT_FILES="u-boot.imx" FATMOUNT="${DESTDIR}/fat" UFSMOUNT="${DESTDIR}/ufs" - chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} From 4194ca40a5a1a4f3616c144e7b74bd5bd88573db Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 18:45:32 +0000 Subject: [PATCH 73/74] Strip the KERNEL from the mount paths, working around the following error: root@releng2:/ # mount_msdosfs /dev/md5s1 /usr/obj/usr/src/release/WANDBOARD-QUAD/fat mount_msdosfs: /dev/md5s1: File name too long Sponsored by: The FreeBSD Foundation --- release/arm/BEAGLEBONE.conf | 4 ++-- release/arm/PANDABOARD.conf | 4 ++-- release/arm/RPI-B.conf | 4 ++-- release/arm/RPI2.conf | 4 ++-- release/arm/WANDBOARD-DUAL.conf | 4 ++-- release/arm/WANDBOARD-QUAD.conf | 4 ++-- release/arm/WANDBOARD-SOLO.conf | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index f5d8189c63da..87d2ffe7a6da 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -18,8 +18,8 @@ NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-beaglebone" - FATMOUNT="${DESTDIR}/fat" - UFSMOUNT="${DESTDIR}/ufs" + FATMOUNT="${DESTDIR##${KERNEL}}/fat" + UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf index 45b7085a892d..28a46396b4fb 100644 --- a/release/arm/PANDABOARD.conf +++ b/release/arm/PANDABOARD.conf @@ -18,8 +18,8 @@ MD_ARGS="-x 63 -y 255" arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-pandaboard" - FATMOUNT="${DESTDIR}/fat" - UFSMOUNT="${DESTDIR}/ufs" + FATMOUNT="${DESTDIR##${KERNEL}}/fat" + UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 5610237ff404..db3c1025fca9 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -20,8 +20,8 @@ arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-rpi" UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ start.elf start_cd.elf u-boot.img" - FATMOUNT="${DESTDIR}/fat" - UFSMOUNT="${DESTDIR}/ufs" + FATMOUNT="${DESTDIR##${KERNEL}}/fat" + UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf index 7de718835c6d..aadd4582a9c3 100644 --- a/release/arm/RPI2.conf +++ b/release/arm/RPI2.conf @@ -20,8 +20,8 @@ arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-rpi2" UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ fixup_x.dat start.elf start_cd.elf start_x.elf u-boot.bin" - FATMOUNT="${DESTDIR}/fat" - UFSMOUNT="${DESTDIR}/ufs" + FATMOUNT="${DESTDIR##${KERNEL}}/fat" + UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} diff --git a/release/arm/WANDBOARD-DUAL.conf b/release/arm/WANDBOARD-DUAL.conf index c20a4a96635f..614a142edd3f 100644 --- a/release/arm/WANDBOARD-DUAL.conf +++ b/release/arm/WANDBOARD-DUAL.conf @@ -19,8 +19,8 @@ NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" UBOOT_FILES="u-boot.imx" - FATMOUNT="${DESTDIR}/fat" - UFSMOUNT="${DESTDIR}/ufs" + FATMOUNT="${DESTDIR##${KERNEL}}/fat" + UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf index d6de53dafab7..a811aaa4ca7d 100644 --- a/release/arm/WANDBOARD-QUAD.conf +++ b/release/arm/WANDBOARD-QUAD.conf @@ -19,8 +19,8 @@ NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" UBOOT_FILES="u-boot.imx" - FATMOUNT="${DESTDIR}/fat" - UFSMOUNT="${DESTDIR}/ufs" + FATMOUNT="${DESTDIR##${KERNEL}}/fat" + UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" diff --git a/release/arm/WANDBOARD-SOLO.conf b/release/arm/WANDBOARD-SOLO.conf index bdc2ef91138a..2878c197c8bf 100644 --- a/release/arm/WANDBOARD-SOLO.conf +++ b/release/arm/WANDBOARD-SOLO.conf @@ -19,8 +19,8 @@ NODOC=1 arm_install_uboot() { UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" UBOOT_FILES="u-boot.imx" - FATMOUNT="${DESTDIR}/fat" - UFSMOUNT="${DESTDIR}/ufs" + FATMOUNT="${DESTDIR##${KERNEL}}/fat" + UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" From c083dc0321e53f9892df1116d4e7c808795a2fd1 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 8 May 2015 18:55:09 +0000 Subject: [PATCH 74/74] Use the IMX6 kernel configuration for the WANDBOARD build, since it supports all of these board variants. While here, remove the WANDBOARD-{QUAD,SOLO,DUAL} kernel configuration files. Discussed with: ian Sponsored by: The FreeBSD Foundation --- release/arm/WANDBOARD-QUAD.conf | 42 ------------------- release/arm/WANDBOARD-SOLO.conf | 42 ------------------- .../{WANDBOARD-DUAL.conf => WANDBOARD.conf} | 2 +- sys/arm/conf/WANDBOARD-DUAL | 28 ------------- sys/arm/conf/WANDBOARD-QUAD | 28 ------------- sys/arm/conf/WANDBOARD-SOLO | 28 ------------- 6 files changed, 1 insertion(+), 169 deletions(-) delete mode 100644 release/arm/WANDBOARD-QUAD.conf delete mode 100644 release/arm/WANDBOARD-SOLO.conf rename release/arm/{WANDBOARD-DUAL.conf => WANDBOARD.conf} (98%) delete mode 100644 sys/arm/conf/WANDBOARD-DUAL delete mode 100644 sys/arm/conf/WANDBOARD-QUAD delete mode 100644 sys/arm/conf/WANDBOARD-SOLO diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf deleted file mode 100644 index a811aaa4ca7d..000000000000 --- a/release/arm/WANDBOARD-QUAD.conf +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" -EMBEDDEDPORTS="sysutils/u-boot-wandboard" -KERNEL="WANDBOARD-QUAD" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" -FAT_SIZE="50m -b 16384" -FAT_TYPE="16" -MD_ARGS="-x 63 -y 255" -NODOC=1 - -arm_install_uboot() { - UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" - UBOOT_FILES="u-boot.imx" - FATMOUNT="${DESTDIR##${KERNEL}}/fat" - UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" - chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ - of=/dev/${mddev} bs=512 seek=2 - chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" - chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ - ${CHROOTDIR}/${FATMOUNT}/ubldr - chroot ${CHROOTDIR} echo \ - 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ - > ${FATMOUNT}/boot.txt - touch ${CHROOTDIR}/${UFSMOUNT}/firstboot - sync - umount_loop ${CHROOTDIR}/${FATMOUNT} - umount_loop ${CHROOTDIR}/${UFSMOUNT} - rmdir ${CHROOTDIR}/${FATMOUNT} - rmdir ${CHROOTDIR}/${UFSMOUNT} - - return 0 -} diff --git a/release/arm/WANDBOARD-SOLO.conf b/release/arm/WANDBOARD-SOLO.conf deleted file mode 100644 index 2878c197c8bf..000000000000 --- a/release/arm/WANDBOARD-SOLO.conf +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" -EMBEDDEDPORTS="sysutils/u-boot-wandboard" -KERNEL="WANDBOARD-SOLO" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" -FAT_SIZE="50m -b 16384" -FAT_TYPE="16" -MD_ARGS="-x 63 -y 255" -NODOC=1 - -arm_install_uboot() { - UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" - UBOOT_FILES="u-boot.imx" - FATMOUNT="${DESTDIR##${KERNEL}}/fat" - UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" - chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ - of=/dev/${mddev} bs=512 seek=2 - chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" - chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ - ${CHROOTDIR}/${FATMOUNT}/ubldr - chroot ${CHROOTDIR} echo \ - 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ - > ${FATMOUNT}/boot.txt - touch ${CHROOTDIR}/${UFSMOUNT}/firstboot - sync - umount_loop ${CHROOTDIR}/${FATMOUNT} - umount_loop ${CHROOTDIR}/${UFSMOUNT} - rmdir ${CHROOTDIR}/${FATMOUNT} - rmdir ${CHROOTDIR}/${UFSMOUNT} - - return 0 -} diff --git a/release/arm/WANDBOARD-DUAL.conf b/release/arm/WANDBOARD.conf similarity index 98% rename from release/arm/WANDBOARD-DUAL.conf rename to release/arm/WANDBOARD.conf index 614a142edd3f..63614d7cf083 100644 --- a/release/arm/WANDBOARD-DUAL.conf +++ b/release/arm/WANDBOARD.conf @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-wandboard" -KERNEL="WANDBOARD-DUAL" +KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" diff --git a/sys/arm/conf/WANDBOARD-DUAL b/sys/arm/conf/WANDBOARD-DUAL deleted file mode 100644 index 66e2535a4b2b..000000000000 --- a/sys/arm/conf/WANDBOARD-DUAL +++ /dev/null @@ -1,28 +0,0 @@ -# Kernel configuration for Wandboard-Dual -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "IMX6" -ident WANDBOARD-DUAL - -# Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=wandboard-dual.dts - diff --git a/sys/arm/conf/WANDBOARD-QUAD b/sys/arm/conf/WANDBOARD-QUAD deleted file mode 100644 index 830a445fc99c..000000000000 --- a/sys/arm/conf/WANDBOARD-QUAD +++ /dev/null @@ -1,28 +0,0 @@ -# Kernel configuration for Wandboard-Quad -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "IMX6" -ident WANDBOARD-QUAD - -# Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=wandboard-quad.dts - diff --git a/sys/arm/conf/WANDBOARD-SOLO b/sys/arm/conf/WANDBOARD-SOLO deleted file mode 100644 index ad56365c6d06..000000000000 --- a/sys/arm/conf/WANDBOARD-SOLO +++ /dev/null @@ -1,28 +0,0 @@ -# Kernel configuration for Wandboard-Solo -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -include "IMX6" -ident WANDBOARD-SOLO - -nooptions SMP - -# Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=wandboard-solo.dts -