M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,24 @@
Upstream-Status: Inappropriate [configuration]
# copy commit message from OE as the patch comment:
# commit 5b1ed09b1ab1a60a28a76e4658bc9957cd361b5d
# Author: Valentin Longchamp <valentin.longchamp@epfl.ch>
# Date: Mon Dec 8 14:43:23 2008 +0100
# busybox: added support for 921600 speed of serial line
#
# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
diff -upNr busybox-1.7.2/libbb/speed_table.c busybox-1.7.2-921600/libbb/speed_table.c
--- busybox-1.7.2/libbb/speed_table.c 2007-09-03 13:48:41.000000000 +0200
+++ busybox-1.7.2-921600/libbb/speed_table.c 2008-10-09 16:23:26.269592899 +0200
@@ -52,6 +52,9 @@ static const struct speed_map speeds[] =
#ifdef B460800
{B460800, 460800/256 + 0x8000U},
#endif
+#ifdef B921600
+ {B921600, 921600/256 + 0x8000U},
+#endif
};
enum { NUM_SPEEDS = ARRAY_SIZE(speeds) };
@@ -0,0 +1,17 @@
Upstream-Status: Backport
Patch is taken from upstream
http://busybox.net/downloads/fixes-1.19.3/busybox-1.19.3-getty.patch
--- busybox-1.19.3/loginutils/getty.c
+++ busybox-1.19.3-getty/loginutils/getty.c
@@ -271,7 +271,9 @@ static void termios_init(int speed)
#ifdef CMSPAR
| CMSPAR /* mark or space parity */
#endif
+#ifdef CBAUD
| CBAUD /* (output) baud rate */
+#endif
#ifdef CBAUDEX
| CBAUDEX /* (output) baud rate */
#endif
@@ -0,0 +1,37 @@
Upstream-Status: Pending
# copy commit message from OE as the patch comment:
# commit 98c24291aa165f53423c27ae033831ce0b3bb676
# Author: Roman I Khimov <khimov@altell.ru>
# Date: Thu Mar 26 23:03:58 2009 +0000
#
# busybox: update appletlib dependency patch
#
# Previous version still failed from time to time on clean-start builds
# with 4 bitbake threads and '-j16'. Building busybox as sole target worked
# well.
#
# The reason is that previous version introduced a race between applets make
# processes spawned from top-level Makefile and from libbb Makefile.
#
# Fix it with high-level dependency that doesn't create races.
#
# Signed-off-by: Koen Kooi <koen@openembedded.org>
#
# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
Index: busybox-1.13.2/Makefile
===================================================================
--- busybox-1.13.2.orig/Makefile 2009-03-19 15:44:37.419270265 +0300
+++ busybox-1.13.2/Makefile 2009-03-19 15:45:57.737521296 +0300
@@ -471,6 +471,10 @@
util-linux/ \
util-linux/volume_id/ \
+# Lib interdeps
+# libbb uses headers generated in applets
+libbb: applets
+
endif # KBUILD_EXTMOD
ifeq ($(dot-config),1)
@@ -0,0 +1,133 @@
From 16c5fa61059f9862b2534c75dad75f7ece338208 Mon Sep 17 00:00:00 2001
From: Anders Darander <anders@chargestorm.se>
Date: Thu, 3 Nov 2011 08:51:31 +0100
Subject: [PATCH] busybox-udhcpc-no_deconfig.patch
Upstream-Status: Pending
Add a new option -D to the udhcpc client that allows for
dhcp renewal to occur without having to down the interface
in the process.
Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com>
Updated to latest Busybox 1.17.3
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Updated to Busybox 1.18.4
option spec is changed
Signed-off-by: Qing He <qing.he@intel.com>
Updated to Busybox 1.19.3
Signed-off-by: Anders Darander <anders@chargestorm.se>
---
networking/udhcp/dhcpc.c | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 4d755e6..eb80484 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -29,6 +29,9 @@
#include <netpacket/packet.h>
#include <linux/filter.h>
+/* option whether to down the interface when reconfiguring */
+static int allow_deconfig = 1;
+
/* struct client_config_t client_config is in bb_common_bufsiz1 */
@@ -82,6 +85,7 @@ enum {
OPT_x = 1 << 18,
OPT_f = 1 << 19,
OPT_B = 1 << 20,
+ OPT_D = 1 << 21,
/* The rest has variable bit positions, need to be clever */
OPTBIT_B = 20,
USE_FOR_MMU( OPTBIT_b,)
@@ -899,7 +903,8 @@ static void perform_renew(void)
state = RENEW_REQUESTED;
break;
case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
- udhcp_run_script(NULL, "deconfig");
+ if (allow_deconfig)
+ udhcp_run_script(NULL, "deconfig");
case REQUESTING:
case RELEASED:
change_listen_mode(LISTEN_RAW);
@@ -923,7 +928,8 @@ static void perform_release(uint32_t requested_ip, uint32_t server_addr)
bb_info_msg("Unicasting a release of %s to %s",
inet_ntoa(temp_addr), buffer);
send_release(server_addr, requested_ip); /* unicast */
- udhcp_run_script(NULL, "deconfig");
+ if (allow_deconfig)
+ udhcp_run_script(NULL, "deconfig");
}
bb_info_msg("Entering released state");
@@ -1083,7 +1089,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
#endif
;
IF_LONG_OPTS(applet_long_options = udhcpc_longopts;)
- opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fB"
+ opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fBD"
USE_FOR_MMU("b")
IF_FEATURE_UDHCPC_ARPING("a")
IF_FEATURE_UDHCP_PORT("P:")
@@ -1175,6 +1181,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
logmode |= LOGMODE_SYSLOG;
}
+ if (opt & OPT_D)
+ allow_deconfig = 0;
+
/* Make sure fd 0,1,2 are open */
bb_sanitize_stdio();
/* Equivalent of doing a fflush after every \n */
@@ -1189,7 +1198,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
srand(monotonic_us());
state = INIT_SELECTING;
- udhcp_run_script(NULL, "deconfig");
+ if (allow_deconfig)
+ udhcp_run_script(NULL, "deconfig");
change_listen_mode(LISTEN_RAW);
packet_num = 0;
timeout = 0;
@@ -1341,7 +1351,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
}
/* Timed out, enter init state */
bb_info_msg("Lease lost, entering init state");
- udhcp_run_script(NULL, "deconfig");
+ if (allow_deconfig)
+ udhcp_run_script(NULL, "deconfig");
state = INIT_SELECTING;
client_config.first_secs = 0; /* make secs field count from 0 */
/*timeout = 0; - already is */
@@ -1489,7 +1500,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
send_decline(xid, server_addr, packet.yiaddr);
if (state != REQUESTING)
- udhcp_run_script(NULL, "deconfig");
+ if (allow_deconfig)
+ udhcp_run_script(NULL, "deconfig");
change_listen_mode(LISTEN_RAW);
state = INIT_SELECTING;
client_config.first_secs = 0; /* make secs field count from 0 */
@@ -1536,7 +1548,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
bb_info_msg("Received DHCP NAK");
udhcp_run_script(&packet, "nak");
if (state != REQUESTING)
- udhcp_run_script(NULL, "deconfig");
+ if (allow_deconfig)
+ udhcp_run_script(NULL, "deconfig");
change_listen_mode(LISTEN_RAW);
sleep(3); /* avoid excessive network traffic */
state = INIT_SELECTING;
--
1.7.7.1
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
Upstream-Status: Pending
# copy commit message from OE as the patch comment:
# commit 5a0e1d473ca7aca5ffefffe9a2ec44ae7a1f35bc
# Author: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
# Date: Wed Feb 11 22:40:21 2009 +0100
#
# busybox: fix tar problem with filenames that are exactly 100 bytes
#
# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
--- busybox-1.13.2/archival/libarchive/get_header_tar.c.orig 2008-11-09 18:28:02.000000000 +0100
+++ busybox-1.13.2/archival/libarchive/get_header_tar.c 2009-02-11 22:34:52.000000000 +0100
@@ -252,6 +252,8 @@
file_header->name = concat_path_file(tar.prefix, tar.name);
} else
file_header->name = xstrdup(tar.name);
+ if (strlen(file_header->name) > 100)
+ file_header->name[100] = 0;
}
/* Set bits 12-15 of the files mode */
@@ -0,0 +1,29 @@
Upstream-Status: Inappropriate [configuration]
# copy commit message from OE as the patch comment:
# commit f1b326c83be0d95571b991d8d2ee239982380b6b
# Author: Martin Jansa <Martin.Jansa@gmail.com>
# Date: Fri Apr 30 15:37:38 2010 +0200
#
# busybox: add patch for installing run-parts to /usr/bin/ instead of /bin
#
# * otherwise debianutils install will fail with
# update-alternatives: Error: cannot register alternative run-parts to /usr/bin/run-parts since it is
#
# Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
#
# Poky doesn't have debianutils, but let's keep it for safety
# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
diff -uNr busybox-1.15.3.orig//include/applets.src.h busybox-1.15.3/include/applets.src.h
--- busybox-1.15.3.orig//include/applets.src.h 2009-12-12 22:13:28.000000000 +0100
+++ busybox-1.15.3/include/applets.src.h 2010-04-30 15:35:40.000000000 +0200
@@ -323,7 +323,7 @@
IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP))
IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_BIN, BB_SUID_DROP))
-IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts))
+IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_USR_BIN, BB_SUID_DROP, run_parts))
IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP))
IF_RUNSV(APPLET(runsv, BB_DIR_USR_BIN, _BB_SUID_DROP))
@@ -0,0 +1,56 @@
Upstream-Status: Pending
# copy commit message from OE as the patch comment:
# commit ec4da6df3ad5b8b03446d0dda9c50a2439ae325a
# Author: Denys Dmytriyenko <denis@denix.org>
# Date: Wed Feb 4 11:43:18 2009 -0500
#
# busybox: fix nfsroot issues with resetting IP and deleting routes
#
# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
Index: busybox-1.15.3/examples/udhcp/simple.script
===================================================================
--- busybox-1.15.3.orig/examples/udhcp/simple.script 2010-06-27 12:17:14.116876946 +0200
+++ busybox-1.15.3/examples/udhcp/simple.script 2010-06-27 12:18:38.607868533 +0200
@@ -10,10 +10,17 @@
BROADCAST="broadcast +"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+# return 0 if root is mounted on a network filesystem
+root_is_nfs() {
+ grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
+}
+
case "$1" in
deconfig)
+ if ! root_is_nfs ; then
echo "Setting IP address 0.0.0.0 on $interface"
- ifconfig $interface 0.0.0.0
+ ifconfig $interface 0.0.0.0
+ fi
;;
renew|bound)
@@ -21,15 +28,17 @@
ifconfig $interface $ip $NETMASK $BROADCAST
if [ -n "$router" ] ; then
- echo "Deleting routers"
- while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
- :
- done
+ if ! root_is_nfs ; then
+ echo "Deleting routers"
+ while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
+ :
+ done
+ fi
metric=0
for i in $router ; do
echo "Adding router $i"
- route add default gw $i dev $interface metric $((metric++))
+ route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
done
fi
@@ -0,0 +1,24 @@
Upstream-Status: Pending
# copy commit message from OE as the patch comment
# commit c9bb6478a873d6de4c8a0e712435ac9a658a345d
# Author: Holger Schurig <schurig@mn-solutions.de>
# Date: Wed Sep 29 08:29:58 2004 +0000
#
# udhcpscript: fixes the "deleting routers" error message in case of no existing default routes
#
# Above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
Index: busybox-1.15.1/examples/udhcp/simple.script
===================================================================
--- busybox-1.15.1.orig/examples/udhcp/simple.script 2009-09-12 17:55:36.000000000 +0200
+++ busybox-1.15.1/examples/udhcp/simple.script 2009-09-16 22:51:06.599693412 +0200
@@ -22,7 +22,7 @@ case "$1" in
if [ -n "$router" ] ; then
echo "Deleting routers"
- while route del default gw 0.0.0.0 dev $interface ; do
+ while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
:
done
@@ -0,0 +1,295 @@
SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable."
DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system."
HOMEPAGE = "http://www.busybox.net"
BUGTRACKER = "https://bugs.busybox.net/"
# bzip2 applet in busybox is based on lightly-modified bzip2 source
# the GPL is version 2 only
# bzip2 is not a bzip2 license (no such thing)
LICENSE = "GPLv2 & BSD-4-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb"
SECTION = "base"
export EXTRA_CFLAGS = "${CFLAGS}"
export EXTRA_LDFLAGS = "${LDFLAGS}"
PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev"
FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf*"
FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc ${sysconfdir}/init.d/busybox-udhcpc"
INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-udhcpc ${PN}-mdev"
INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
INITSCRIPT_NAME_${PN}-syslog = "syslog"
INITSCRIPT_NAME_${PN}-mdev = "mdev"
INITSCRIPT_PARAMS_${PN}-mdev = "start 06 S ."
INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
INITSCRIPT_NAME_${PN}-udhcpc = "busybox-udhcpc"
CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}"
CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
inherit cml1 update-rc.d
# internal helper
def busybox_cfg(feature, features, tokens, cnf, rem):
if type(tokens) == type(""):
tokens = [tokens]
rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
if type(features) == type([]) and feature in features:
cnf.extend([token + '=y' for token in tokens])
else:
cnf.extend(['# ' + token + ' is not set' for token in tokens])
# Map distro features to config settings
def features_to_busybox_settings(d):
cnf, rem = ([], [])
distro_features = d.getVar('DISTRO_FEATURES', True).split()
busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IPV6', cnf, rem)
busybox_cfg('largefile', distro_features, 'CONFIG_LFS', cnf, rem)
busybox_cfg('largefile', distro_features, 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
return "\n".join(cnf), "\n".join(rem)
# X, Y = ${@features_to_uclibc_settings(d)}
# unfortunately doesn't seem to work with bitbake, workaround:
def features_to_busybox_conf(d):
cnf, rem = features_to_busybox_settings(d)
return cnf
def features_to_busybox_del(d):
cnf, rem = features_to_busybox_settings(d)
return rem
configmangle = '/CROSS_COMPILER_PREFIX/d; \
/CONFIG_EXTRA_CFLAGS/d; \
'
OE_FEATURES := "${@features_to_busybox_conf(d)}"
OE_DEL := "${@features_to_busybox_del(d)}"
DO_IPv4 := ${@base_contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}
DO_IPv6 := ${@base_contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}
python () {
if "${OE_DEL}":
d.setVar('configmangle_append', "${OE_DEL}" + "\n")
if "${OE_FEATURES}":
d.setVar('configmangle_append',
"/^### DISTRO FEATURES$/a\\\n%s\n\n" %
("\\n".join((bb.data.expand("${OE_FEATURES}", d).split("\n")))))
d.setVar('configmangle_append',
"/^### CROSS$/a\\\n%s\n" %
("\\n".join(["CONFIG_CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
"CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\""
])
))
}
do_prepare_config () {
sed -e 's#@DATADIR@#${datadir}#g' \
< ${WORKDIR}/defconfig > ${S}/.config
sed -i -e '/CONFIG_STATIC/d' .config
echo "# CONFIG_STATIC is not set" >> .config
for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
${S}/.config
sed -i -e '${configmangle}' ${S}/.config
if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then
# disable networking applets
mv ${S}/.config ${S}/.config.oe-tmp
awk 'BEGIN{net=0}
/^# Networking Utilities/{net=1}
/^#$/{if(net){net=net+1}}
{if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
${S}/.config.oe-tmp > ${S}/.config
fi
}
do_configure () {
do_prepare_config
cml1_do_configure
}
do_compile() {
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
oe_runmake busybox_unstripped
cp busybox_unstripped busybox
}
do_install () {
oe_runmake busybox.links
if [ "${prefix}" != "/usr" ]; then
sed "s:^/usr/:${prefix}/:" busybox.links > busybox.links.new
mv busybox.links.new busybox.links
fi
if [ "${base_sbindir}" != "/sbin" ]; then
sed "s:^/sbin/:${base_sbindir}/:" busybox.links > busybox.links.new
mv busybox.links.new busybox.links
fi
install -d ${D}${sysconfdir}/init.d
if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${WORKDIR}/defconfig; then
# Install /bin/busybox, and the /bin/sh link so the postinst script
# can run. Let update-alternatives handle the rest.
install -d ${D}${base_bindir}
if grep -q "CONFIG_FEATURE_SUID=y" ${WORKDIR}/defconfig; then
install -m 4755 ${S}/busybox ${D}${base_bindir}
else
install -m 0755 ${S}/busybox ${D}${base_bindir}
fi
ln -sf busybox ${D}${base_bindir}/sh
else
install -d ${D}${base_bindir} ${D}${base_sbindir}
install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir}
cat busybox.links | while read FILE; do
NAME=`basename "$FILE"`
install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
done
# add suid bit where needed
for i in `grep -E "APPLET.*_BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
find ${D} -name $i.${BPN} -exec chmod a+s {} \;
done
install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
ln -sf sh.${BPN} ${D}${base_bindir}/sh
ln -sf ln.${BPN} ${D}${base_bindir}/ln
ln -sf test.${BPN} ${D}${bindir}/test
if [ -f ${D}/linuxrc.${BPN} ]; then
mv ${D}/linuxrc.${BPN} ${D}/linuxrc
fi
fi
if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then
install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${BPN}
install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf.${BPN}
fi
if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
fi
if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then
install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
install -d ${D}/srv/www
fi
if grep "CONFIG_UDHCPD=y" ${WORKDIR}/defconfig; then
install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
fi
if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then
install -d ${D}${sysconfdir}/default
install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
fi
if grep "CONFIG_UDHCPC=y" ${WORKDIR}/defconfig; then
install -d ${D}${sysconfdir}/udhcpc.d
install -d ${D}${datadir}/udhcpc
install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default
install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
install -m 0755 ${WORKDIR}/busybox-udhcpc ${D}${sysconfdir}/init.d/
fi
if grep "CONFIG_INETD=y" ${WORKDIR}/defconfig; then
install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN}
install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/
fi
if grep "CONFIG_MDEV=y" ${WORKDIR}/defconfig; then
install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
if grep "CONFIG_FEATURE_MDEV_CONF=y" ${WORKDIR}/defconfig; then
install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
fi
fi
install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
}
python package_do_filedeps_append () {
# We need to load the full set of busybox provides from the /etc/busybox.links
# The pkg_postinst_ is what creates the actual links
pkg = d.getVar('PN', True)
f_busybox = "/bin/busybox"
f_busybox_links = "/etc/busybox.links"
requires_files = []
provides_files = []
# Load/backup original set
filerprovides = d.getVar('FILERPROVIDES_%s_%s' % (f_busybox, pkg), True) or ""
dep_pipe = os.popen('sed -e "s,^,Provides: ," %s/%s%s' % (pkgdest, pkg, f_busybox_links))
process_deps(dep_pipe, pkg, "%s/%s%s" % (pkgdest, pkg, f_busybox), provides_files, requires_files)
# Add the new set
filerprovides += d.getVar('FILERPROVIDES_%s_%s' % (f_busybox, pkg), True) or ""
# Make sure there is an entry for this item in the FILERPROVIDESFLIST...
filerprovidesflist = (d.getVar('FILERPROVIDESFLIST_%s' % pkg, True) or "").split()
for file in provides_files:
if file not in filerprovidesflist:
filerprovidesflist.append(file)
d.setVar('FILERPROVIDESFLIST_%s' % pkg, " ".join(filerprovidesflist))
# Store the new provides
d.setVar('FILERPROVIDES_%s_%s' % (f_busybox, pkg), filerprovides)
}
pkg_postinst_${PN} () {
# If we are not making an image we create links for the utilities that doesn't exist
# so the update-alternatives script will get the utilities it needs
# (update-alternatives have no problem replacing links later anyway)
test -n 2> /dev/null || alias test='busybox test'
if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; busybox ln -s $to $link; fi; done </etc/busybox.links; fi
# This adds the links, remember that this has to work when building an image too, hence the $D
while read link; do case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 50; done <$D/etc/busybox.links
}
pkg_postinst_${PN}-syslog () {
update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${BPN} 50
update-alternatives --install ${sysconfdir}/syslog-startup.conf syslog-startup-conf syslog-startup.conf.${BPN} 50
}
pkg_prerm_${PN} () {
# This is so you can make busybox commit suicide - removing busybox with no other packages
# providing its files, this will make update-alternatives work, but the update-rc.d part
# for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
ln -s /bin/busybox $tmpdir/[
ln -s /bin/busybox $tmpdir/test
ln -s /bin/busybox $tmpdir/head
ln -s /bin/busybox $tmpdir/sh
ln -s /bin/busybox $tmpdir/basename
ln -s /bin/busybox $tmpdir/echo
ln -s /bin/busybox $tmpdir/mv
ln -s /bin/busybox $tmpdir/ln
ln -s /bin/busybox $tmpdir/dirname
ln -s /bin/busybox $tmpdir/rm
ln -s /bin/busybox $tmpdir/sed
ln -s /bin/busybox $tmpdir/sort
ln -s /bin/busybox $tmpdir/grep
export PATH=$PATH:$tmpdir
while read link
do
case "$link" in
/*/*/*) to="../../bin/busybox";;
/bin/*) to="busybox";;
/*/*) to="../bin/busybox";;
esac
bn=`basename $link`
sh /usr/bin/update-alternatives --remove $bn $to
done </etc/busybox.links
}
pkg_prerm_${PN}-syslog () {
# remove syslog
if test "x$D" = "x"; then
if test "$1" = "upgrade" -o "$1" = "remove"; then
/etc/init.d/syslog stop
fi
fi
update-alternatives --remove syslog-init syslog.${BPN}
update-alternatives --remove syslog-startup-conf syslog-startup.conf.${BPN}
}
@@ -0,0 +1,32 @@
require busybox.inc
PR = "r3"
SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://udhcpscript.patch \
file://udhcpc-fix-nfsroot.patch \
file://B921600.patch \
file://get_header_tar.patch \
file://busybox-appletlib-dependency.patch \
file://busybox-1.19.3-getty.patch \
file://run-parts.in.usr-bin.patch \
file://busybox-udhcpc-no_deconfig.patch \
file://find-touchscreen.sh \
file://busybox-cron \
file://busybox-httpd \
file://busybox-udhcpd \
file://busybox-udhcpc \
file://default.script \
file://simple.script \
file://hwclock.sh \
file://mount.busybox \
file://syslog \
file://syslog-startup.conf \
file://mdev \
file://mdev.conf \
file://umount.busybox \
file://defconfig"
SRC_URI[tarball.md5sum] = "c3938e1ac59602387009bbf1dd1af7f6"
SRC_URI[tarball.sha256sum] = "a1a9a35732c719ef384f02b6e357c324d8be25bc154af91a48c4264b1e6038f0"
EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
DAEMON=/usr/sbin/crond
NAME=crond
DESC="Busybox Periodic Command Scheduler"
ARGS="-c /etc/cron/crontabs"
test -f $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "starting $DESC: $NAME... "
start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
echo "done."
;;
stop)
echo -n "stopping $DESC: $NAME... "
start-stop-daemon -K -n $NAME
echo "done."
;;
restart)
echo -n "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
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
DAEMON=/usr/sbin/httpd
NAME=httpd
DESC="Busybox HTTP Daemon"
HTTPROOT="/srv/www"
ARGS="-h $HTTPROOT"
test -f $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "starting $DESC: $NAME... "
if [ ! -d $HTTPROOT ]; then
echo "$HTTPROOT is missing."
exit 1
fi
start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
echo "done."
;;
stop)
echo -n "stopping $DESC: $NAME... "
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
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
#
# (c) 2010-2011 Wind River Systems, Inc.
#
# Busybox udhcpc init script
#
# script to start the udpchc DHCP client on boots where
# the parameter 'ip=dhcp' was included in the kernel parameters
# ensure the required binaries are present
[ -x /sbin/udhcpc ] || exit 1
[ -x /bin/grep ] || exit 1
[ -x /bin/mount ] || exit 1
# ensure /proc is mounted
if ! mount | grep -q "/proc "; then
exit 2
fi
rc=0
if grep -q -E "\bip=dhcp\b" /proc/cmdline; then
/sbin/udhcpc -D -s /usr/share/udhcpc/default.script
rc=$?
fi
exit $rc
+43
View File
@@ -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
@@ -0,0 +1,4 @@
#!/bin/sh
exec run-parts -a "$1" /etc/udhcpc.d
@@ -0,0 +1,9 @@
#!/bin/sh
if [ `egrep "input:.*-e0.*,3,.*a0,1,.*18,.*" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
ln -sf /dev/input/$MDEV /dev/input/touchscreen0
fi
if [ `egrep "ads7846" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
ln -sf /dev/input/$MDEV /dev/input/touchscreen0
fi
@@ -0,0 +1,82 @@
#!/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
. /etc/default/rcS
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 --hctosys
else
TZ="$TZ" hwclock --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 --systohc
fi
if [ "$VERBOSE" != no ]
then
echo "Hardware Clock updated to `date`."
fi
exit 0
;;
show)
if [ "$HWCLOCKACCESS" != no ]
then
hwclock --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
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
mount -t tmpfs tmpfs /dev -o size=64k,mode=0755
mkdir /dev/pts /dev/shm
mount -t devpts devpts /dev/pts
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
mdev -s
@@ -0,0 +1,35 @@
console 0:0 0600
cpu_dma_latency 0:0 0660
fb0:0 44 0660
full 0:0 0666
initctl 0:0 0600
ircomm[0-9].* 0:20 0660
kmem 0:15 0640
kmsg 0:0 0660
log 0:0 0666
loop[0-9].* 0:6 0640
mem 0:15 0640
network_latency 0:0 0660
network_throughput 0:0 0660
null 0:0 0666
port 0:15 0640
ptmx 0:5 0666
ram[0-9].* 0:6 0640
random 0:0 0666
sda 0:6 0640
tty 0:5 0666
tty.* 0:0 0620
urandom 0:0 0666
usbdev.* 0:0 0660 */etc/mdev/usb.sh
vcs.* 0:5 0660
zero 0:0 0666
pcm.* 0:0 0660 =snd/
control.* 0:0 0660 =snd/
timer 0:0 0660 =snd/
event.* 0:0 0660 =input/ @/etc/mdev/find-touchscreen.sh
mice 0:0 0660 =input/
mouse.* 0:0 0660 =input/
tun[0-9]* 0:0 0660 =net/
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
exec /bin/busybox mount $@
@@ -0,0 +1,72 @@
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
# return 0 if root is mounted on a network filesystem
root_is_nfs() {
grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
}
have_bin_ip=0
if [ -x /bin/ip ]; then
have_bin_ip=1
fi
case "$1" in
deconfig)
if ! root_is_nfs ; then
if [ $have_bin_ip -eq 1 ]; then
ip addr flush dev $interface
ip link set dev $interface up
else
/sbin/ifconfig $interface 0.0.0.0
fi
fi
;;
renew|bound)
if [ $have_bin_ip -eq 1 ]; then
ip addr add dev $interface local $ip/$mask $BROADCAST
else
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
fi
if [ -n "$router" ] ; then
if ! root_is_nfs ; then
if [ $have_bin_ip -eq 1 ]; then
while ip route del default 2>/dev/null ; do
:
done
else
while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
:
done
fi
fi
metric=0
for i in $router ; do
if [ $have_bin_ip -eq 1 ]; then
ip route add default via $i metric $((metric++))
else
route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
fi
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0
@@ -0,0 +1,77 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: sysklogd
# Required-Start: $remote_fs $time
# Required-Stop: $remote_fs $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: System logger
### END INIT INFO
set -e
if [ -f /etc/syslog-startup.conf ]; then
. /etc/syslog-startup.conf
LOG_LOCAL=0
LOG_REMOTE=0
for D in $DESTINATION; do
if [ "$D" = "buffer" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
LOG_LOCAL=1
elif [ "$D" = "file" ]; then
if [ -n "$LOGFILE" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
fi
if [ -n "$ROTATESIZE" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
fi
if [ -n "$ROTATEGENS" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
fi
LOCAL=0
elif [ "$D" = "remote" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
LOG_REMOTE=1
fi
done
if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -L"
fi
if [ "$REDUCE" = "yes" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -S"
fi
if [ "$DROPDUPLICATES" = "yes" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -D"
fi
if [ -n "$LOGLEVEL" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
fi
else
# default: log to 16K shm circular buffer
SYSLOG_ARGS="-C"
fi
case "$1" in
start)
echo -n "Starting syslogd/klogd: "
start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
echo "done"
;;
stop)
echo -n "Stopping syslogd/klogd: "
start-stop-daemon -K -n syslogd
start-stop-daemon -K -n klogd
echo "done"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: syslog { start | stop | restart }" >&2
exit 1
;;
esac
exit 0
@@ -0,0 +1,13 @@
# This configuration file is used by the busybox syslog init script,
# /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
DESTINATION=file # log destinations (buffer file remote)
LOGFILE=/var/log/messages # where to log (file)
REMOTE=loghost:514 # where to log (syslog remote)
REDUCE=no # reduce-size logging
DROPDUPLICATES=no # whether to drop duplicate log entries
#ROTATESIZE=0 # rotate log if grown beyond X [kByte]
#ROTATEGENS=3 # keep X generations of rotated logs
BUFFERSIZE=64 # size of circular buffer [kByte]
FOREGROUND=no # run in foreground (don't use!)
#LOGLEVEL=5 # local log level (between 1 and 8)
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
exec /bin/busybox umount $@