aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/ntp/ntpd/ntp_control.c2
-rw-r--r--include/Makefile25
-rw-r--r--release/Makefile1
-rw-r--r--release/Makefile.arm134
-rw-r--r--release/arm/Makefile.BEAGLEBONE10
-rw-r--r--release/arm/Makefile.PANDABOARD9
-rw-r--r--release/arm/Makefile.RPI-B10
-rw-r--r--release/arm/Makefile.WANDBOARD-QUAD10
-rw-r--r--release/arm/Makefile.ZEDBOARD9
-rw-r--r--release/arm/ROADMAP18
-rwxr-xr-xrelease/release.sh2
-rw-r--r--sys/kern/kern_sig.c2
-rw-r--r--sys/netinet/sctp_auth.c4
13 files changed, 221 insertions, 15 deletions
diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c
index c53cf52d9562..22460927204a 100644
--- a/contrib/ntp/ntpd/ntp_control.c
+++ b/contrib/ntp/ntpd/ntp_control.c
@@ -4,7 +4,7 @@
*/
/*
- * $FreeBSD: head/contrib/ntp/ntpd/ntp_control.c 276071 2014-12-22 18:54:55Z delphij $
+ * $FreeBSD: projects/release-arm-redux/contrib/ntp/ntpd/ntp_control.c 276071 2014-12-22 18:54:55Z delphij $
*/
#ifdef HAVE_CONFIG_H
diff --git a/include/Makefile b/include/Makefile
index d7badd7489b1..fe29186bfccd 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -57,16 +57,20 @@ LSUBDIRS= cam/ata cam/scsi \
security/mac_mls security/mac_partition \
ufs/ffs ufs/ufs
-LSUBSUBDIRS= dev/mpt/mpilib
-
-.if ${MK_BLUETOOTH} != "no"
-LSUBSUBDIRS+= netgraph/bluetooth/include
+.if ${MK_USB} != "no"
+LSUBDIRS+= dev/usb
.endif
+LSUBSUBDIRS= dev/mpt/mpilib
+
.if ${MK_CUSE} != "no"
LSUBDIRS+= fs/cuse
.endif
+.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
+_dev_powermac_nvram= dev/powermac_nvram
+.endif
+
.if ${MK_GSSAPI} != "no"
SUBDIR+= gssapi
INCS+= gssapi.h
@@ -76,18 +80,15 @@ INCS+= gssapi.h
INCS+= hesiod.h
.endif
+.if ${MK_BLUETOOTH} != "no"
+LSUBSUBDIRS+= netgraph/bluetooth/include
+.endif
+
# Handle the #define aliases for libiconv
.if ${MK_ICONV} == "yes"
INCS+= iconv.h
.endif
-
-.if ${MK_USB} != "no"
-LSUBDIRS+= dev/usb
-.endif
-
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
-_dev_powermac_nvram= dev/powermac_nvram
-.endif
+
# Define SHARED to indicate whether you want symbolic links to the system
# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
diff --git a/release/Makefile b/release/Makefile
index e3485f222ad5..7b599409e51c 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -303,3 +303,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..b7092c32bbc1
--- /dev/null
+++ b/release/Makefile.arm
@@ -0,0 +1,134 @@
+#
+# $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
new file mode 100644
index 000000000000..5f59f0317d88
--- /dev/null
+++ b/release/arm/Makefile.BEAGLEBONE
@@ -0,0 +1,10 @@
+#
+# $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
new file mode 100644
index 000000000000..cd911e9cbb62
--- /dev/null
+++ b/release/arm/Makefile.PANDABOARD
@@ -0,0 +1,9 @@
+#
+# $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
new file mode 100644
index 000000000000..c81e51ed35c6
--- /dev/null
+++ b/release/arm/Makefile.RPI-B
@@ -0,0 +1,10 @@
+#
+# $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
new file mode 100644
index 000000000000..d7f7ff7e4474
--- /dev/null
+++ b/release/arm/Makefile.WANDBOARD-QUAD
@@ -0,0 +1,10 @@
+#
+# $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
new file mode 100644
index 000000000000..5d3a6856cc1d
--- /dev/null
+++ b/release/arm/Makefile.ZEDBOARD
@@ -0,0 +1,9 @@
+#
+# $FreeBSD$
+#
+
+BOARD= ZEDBOARD
+${BOARD}PARTSCHEME= mbr
+
+build-arm-${BOARD:tl}:
+ touch ${.TARGET}
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
diff --git a/release/release.sh b/release/release.sh
index 6b24b73b8071..d2573715023b 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() { }
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 154c250b4b91..1d5ba1a96f1a 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -3371,6 +3371,8 @@ coredump(struct thread *td)
len = MAXPATHLEN * 2 + sizeof(comm_name) - 1 +
sizeof(' ') + sizeof(core_name) - 1;
data = malloc(len, M_TEMP, M_WAITOK);
+ if (data == NULL)
+ goto out;
if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
goto out;
if (!coredump_sanitise_path(fullpath))
diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c
index 7c2e194e1d2f..8ce2aab4f936 100644
--- a/sys/netinet/sctp_auth.c
+++ b/sys/netinet/sctp_auth.c
@@ -576,12 +576,13 @@ sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked
/* decrement the ref count */
if (skey) {
+ sctp_free_sharedkey(skey);
SCTPDBG(SCTP_DEBUG_AUTH2,
"%s: stcb %p key %u refcount release to %d\n",
__FUNCTION__, (void *)stcb, key_id, skey->refcount);
/* see if a notification should be generated */
- if ((skey->refcount <= 2) && (skey->deactivated)) {
+ if ((skey->refcount <= 1) && (skey->deactivated)) {
/* notify ULP that key is no longer used */
sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb,
key_id, 0, so_locked);
@@ -589,7 +590,6 @@ sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked
"%s: stcb %p key %u no longer used, %d\n",
__FUNCTION__, (void *)stcb, key_id, skey->refcount);
}
- sctp_free_sharedkey(skey);
}
}