diff options
| author | John Ogness <john.ogness@linutronix.de> | 2017-12-19 11:16:28 +0100 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2017-12-19 11:16:28 +0100 |
| commit | 6e7e1b7172813fc4ecb60597f903dd21a4616159 (patch) | |
| tree | dbfe0b8f1a3d51c275722ba86d4ffe109ee88aef /distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox | |
| parent | 270520b4a2eac8725c8575c3180964289722e191 (diff) | |
update yocto-advanced: sync to devel/manut/yocto
The devel/manut/yocto heavily diverted from master. Sync
with latest version 8cd4956a9b48a316eab6dc6d1b1f6cd51362fecf.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox')
4 files changed, 273 insertions, 0 deletions
diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.24.1.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.24.1.bb new file mode 100644 index 0000000..de441f7 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.24.1.bb @@ -0,0 +1,64 @@ +# source file +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=upstream" + +# source file checksums +SRC_URI[upstream.md5sum] = "be98a40cadf84ce2d6b05fa41a275c6a" +SRC_URI[upstream.sha256sum] = "37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d" + +# license information +LICENSE = "GPLv2 & bzip2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb" + +# specify additional arguments used by "oe_runmake" +# - busybox requires "CROSS_COMPILE" to specify the toolchain prefix +# (${TARGET_PREFIX} is correctly set to this in bitbake.conf) +# - busybox requires "CONFIG_SYSROOT" to specify the sysroot +# - if V=1 is used the busybox Makefiles produce verbose build output, +# which helps to investigate any possible build errors +EXTRA_OEMAKE += "CROSS_COMPILE=${TARGET_PREFIX}" +EXTRA_OEMAKE += "CONFIG_SYSROOT=${PKG_CONFIG_SYSROOT_DIR}" +EXTRA_OEMAKE += "V=1" + +# configure busybox using the shipped defconfig +do_configure () { + oe_runmake defconfig +} + +# build busybox and the links file +# - the links file is a text file listing all the links that +# should be created to use all configured busybox features +# - ${TARGET_CC_ARCH} is set in bitbake.conf and specifies the architecture- +# specific compiler options (for example, hardware floating point) +# (busybox needs this additional information in CFLAGS) +do_compile () { + export CFLAGS="${TARGET_CC_ARCH} ${CFLAGS}" + oe_runmake busybox_unstripped + oe_runmake busybox.links +} + +# install the busybox binary and the links file +# - the links file needs to be adjusted if non-default definitions +# for ${prefix}, ${base_sbindir}, ${base_bindir} are used +do_install () { + # fixup the links file if bitbake is using different paths + test "${prefix}" != "/usr" && \ + sed -i -e "s:^/usr/:${prefix}/:" busybox.links + test "${base_sbindir}" != "/sbin" && \ + sed -i -e "s:^/sbin/:${base_sbindir}/:" busybox.links + test "${base_bindir}" != "/bin" && \ + sed -i -e "s:^/bin/:${base_bindir}/:" busybox.links + + install -D -m 0755 busybox_unstripped ${D}${base_bindir}/busybox + install -D -m 0644 busybox.links ${D}${datadir}/busybox/busybox.links + + # NOTE: We do _not_ create the busybox links here because it should + # _not_ be busybox's decision which files appear on the + # root filesystem. That is a decision to be made by the root + # filesystem recipe. A root filesystem recipe can use the + # links file to determine what links can be created. +} + +# the links file belongs in the -dev package +# (it will not be installed in the root filesystem) +# - the links file will be used when building the root filesystem +FILES_${PN}-dev_append = " ${datadir}/busybox/busybox.links" diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.26.2.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.26.2.bb new file mode 100644 index 0000000..8eaf3f8 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.26.2.bb @@ -0,0 +1,83 @@ +# source file +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=upstream \ + file://hwclock.sh \ + file://busybox-udhcpd \ +" + +# source file checksums +SRC_URI[upstream.md5sum] = "bb59d25ee2643db20f212eec539429f1" +SRC_URI[upstream.sha256sum] = "da3e44913fc1a9c9b7c5337ea5292da518683cbff32be630777f565d6036af16" + +# license information +LICENSE = "GPLv2 & bzip2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb" + +# specify additional arguments used by "oe_runmake" +# - busybox requires "CROSS_COMPILE" to specify the toolchain prefix +# (${TARGET_PREFIX} is correctly set to this in bitbake.conf) +# - busybox requires "CONFIG_SYSROOT" to specify the sysroot +# - if V=1 is used the busybox Makefiles produce verbose build output, +# which helps to investigate any possible build errors +EXTRA_OEMAKE += "CROSS_COMPILE=${TARGET_PREFIX}" +EXTRA_OEMAKE += "CONFIG_SYSROOT=${PKG_CONFIG_SYSROOT_DIR}" +EXTRA_OEMAKE += "V=1" + +# configure busybox using the shipped defconfig +do_configure () { + oe_runmake defconfig +} + +# build busybox and the links file +# - the links file is a text file listing all the links that +# should be created to use all configured busybox features +# - ${TARGET_CC_ARCH} is set in bitbake.conf and specifies the architecture- +# specific compiler options (for example, hardware floating point) +# (busybox needs this additional information in CFLAGS) +do_compile () { + export CFLAGS="${TARGET_CC_ARCH} ${CFLAGS}" + oe_runmake busybox_unstripped + oe_runmake busybox.links +} + +# install the busybox binary and the links file +# - the links file needs to be adjusted if non-default definitions +# for ${prefix}, ${base_sbindir}, ${base_bindir} are used +do_install () { + # fixup the links file if bitbake is using different paths + test "${prefix}" != "/usr" && \ + sed -i -e "s:^/usr/:${prefix}/:" busybox.links + test "${base_sbindir}" != "/sbin" && \ + sed -i -e "s:^/sbin/:${base_sbindir}/:" busybox.links + test "${base_bindir}" != "/bin" && \ + sed -i -e "s:^/bin/:${base_bindir}/:" busybox.links + + install -D -m 0755 busybox_unstripped ${D}${base_bindir}/busybox + install -D -m 0644 busybox.links ${D}${datadir}/busybox/busybox.links + + # NOTE: We do _not_ create the busybox links here because it should + # _not_ be busybox's decision which files appear on the + # root filesystem. That is a decision to be made by the root + # filesystem recipe. A root filesystem recipe can use the + # links file to determine what links can be created. + + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ +} + +# the links file belongs in the -dev package +# (it will not be installed in the root filesystem) +# - the links file will be used when building the root filesystem +FILES_${PN}-dev_append = " ${datadir}/busybox/busybox.links" + + +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock" + +FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" +FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc" +FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh" + +INITSCRIPT_PACKAGES = "${PN}-udhcpd ${PN}-hwclock" + +INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh" +INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/busybox-udhcpd b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/busybox-udhcpd new file mode 100755 index 0000000..c43903e --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/busybox-udhcpd @@ -0,0 +1,43 @@ +#!/bin/sh +DAEMON=/usr/sbin/udhcpd +NAME=udhcpd +DESC="Busybox UDHCP Server" +ARGS="/etc/udhcpd.conf" + +test -f $DAEMON || exit 1 + +set -e + +case "$1" in + start) + echo -n "starting $DESC: $NAME... " + if [ ! -f /etc/udhcpd.conf ]; then + echo "error: /etc/udhcpd.conf is missing." + exit 1 + fi + /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS + echo "done." + ;; + stop) + echo -n "stopping $DESC: $NAME... " + /sbin/start-stop-daemon -K -n $NAME + echo "done." + ;; + restart) + echo "restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + reload) + echo -n "reloading $DESC: $NAME... " + killall -HUP $(basename ${DAEMON}) + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/hwclock.sh b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/hwclock.sh new file mode 100644 index 0000000..be5f94d --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/hwclock.sh @@ -0,0 +1,83 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: hwclock +# Required-Start: +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Set system clock +# Description: Set system clock to hardware clock, according to the UTC +# setting in /etc/default/rcS (see also rcS(5)). +### END INIT INFO +# +# WARNING: If your hardware clock is not in UTC/GMT, this script +# must know the local time zone. This information is +# stored in /etc/localtime. This might be a problem if +# your /etc/localtime is a symlink to something in +# /usr/share/zoneinfo AND /usr isn't in the root +# partition! The workaround is to define TZ either +# in /etc/default/rcS, or in the proper place below. + +[ ! -x /sbin/hwclock ] && exit 0 + +[ -f /etc/default/rcS ] && . /etc/default/rcS + +[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime" +case "$1" in + start) + if [ "$VERBOSE" != no ] + then + echo "System time was `date`." + echo "Setting the System Clock using the Hardware Clock as reference..." + fi + + if [ "$HWCLOCKACCESS" != no ] + then + if [ -z "$TZ" ] + then + hwclock $tz --hctosys + else + TZ="$TZ" hwclock $tz --hctosys + fi + fi + + if [ "$VERBOSE" != no ] + then + echo "System Clock set. System local time is now `date`." + fi + ;; + stop|restart|reload|force-reload) + # + # Updates the Hardware Clock with the System Clock time. + # This will *override* any changes made to the Hardware Clock. + # + # WARNING: If you disable this, any changes to the system + # clock will not be carried across reboots. + # + if [ "$VERBOSE" != no ] + then + echo "Saving the System Clock time to the Hardware Clock..." + fi + if [ "$HWCLOCKACCESS" != no ] + then + hwclock $tz --systohc + fi + if [ "$VERBOSE" != no ] + then + echo "Hardware Clock updated to `date`." + fi + exit 0 + ;; + show) + if [ "$HWCLOCKACCESS" != no ] + then + hwclock $tz --show + fi + ;; + *) + echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2 + echo " start sets kernel (system) clock from hardware (RTC) clock" >&2 + echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2 + exit 1 + ;; +esac |
