busybox: upgrade to v1.34.1
Backport the recipes from the honister poky branch. This version includes fixes for several CVEs: https://thehackernews.com/2021/11/14-new-security-flaws-found-in-busybox.html Sync our defconfig with the latest version while keeping our custom config changes. https://onedigi.atlassian.net/browse/DEL-7728 Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
parent
82dd2cbc4d
commit
f3aab304c6
|
|
@ -0,0 +1,114 @@
|
|||
From a9333eb6a7b8dbda735947cd5bc981ff9352a2c9 Mon Sep 17 00:00:00 2001
|
||||
From: Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
|
||||
Date: Thu, 10 Mar 2011 00:27:08 -0500
|
||||
Subject: [PATCH 1/2] Use $(CC) when linking instead of $(LD) and use $(CFLAGS)
|
||||
and $(EXTRA_CFLAGS) when linking.
|
||||
|
||||
This fixes the issue where LDFLAGS escaped with -Wl are ignored during
|
||||
compilation. It also simplifies using CFLAGS or EXTRA_CFLAGS (such as
|
||||
-m32 on x86_64 or -flto) which apply to both compilation and linking
|
||||
situations.
|
||||
|
||||
Signed-off-by: Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
Makefile | 7 ++++---
|
||||
scripts/Makefile.build | 8 ++++----
|
||||
scripts/Makefile.lib | 13 +++----------
|
||||
3 files changed, 11 insertions(+), 17 deletions(-)
|
||||
|
||||
Index: busybox-1.23.2/Makefile
|
||||
===================================================================
|
||||
--- busybox-1.23.2.orig/Makefile
|
||||
+++ busybox-1.23.2/Makefile
|
||||
@@ -309,7 +309,8 @@ CHECKFLAGS := -D__linux__ -Dlinux -D
|
||||
MODFLAGS = -DMODULE
|
||||
CFLAGS_MODULE = $(MODFLAGS)
|
||||
AFLAGS_MODULE = $(MODFLAGS)
|
||||
-LDFLAGS_MODULE = -r
|
||||
+LDFLAGS_RELOCATABLE = -r -nostdlib
|
||||
+LDFLAGS_MODULE = $(LDFLAGS_RELOCATABLE)
|
||||
CFLAGS_KERNEL =
|
||||
AFLAGS_KERNEL =
|
||||
|
||||
@@ -331,7 +332,7 @@ KERNELVERSION = $(VERSION).$(PATCHLEVEL)
|
||||
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \
|
||||
ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
|
||||
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
|
||||
- HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
|
||||
+ HOSTCXX HOSTCXXFLAGS LDFLAGS_RELOCATABLE LDFLAGS_MODULE CHECK CHECKFLAGS
|
||||
|
||||
export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
|
||||
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
|
||||
@@ -610,7 +611,7 @@ quiet_cmd_busybox__ ?= LINK $@
|
||||
cmd_busybox__ ?= $(srctree)/scripts/trylink \
|
||||
"$@" \
|
||||
"$(CC)" \
|
||||
- "$(CFLAGS) $(CFLAGS_busybox)" \
|
||||
+ "$(CFLAGS) $(CFLAGS_busybox) $(EXTRA_CFLAGS)" \
|
||||
"$(LDFLAGS) $(EXTRA_LDFLAGS)" \
|
||||
"$(core-y)" \
|
||||
"$(libs-y)" \
|
||||
Index: busybox-1.23.2/scripts/Makefile.build
|
||||
===================================================================
|
||||
--- busybox-1.23.2.orig/scripts/Makefile.build
|
||||
+++ busybox-1.23.2/scripts/Makefile.build
|
||||
@@ -174,7 +174,7 @@ cmd_modversions = \
|
||||
| $(GENKSYMS) -a $(ARCH) \
|
||||
> $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
\
|
||||
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
|
||||
+ $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(@D)/.tmp_$(@F) \
|
||||
-T $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
else \
|
||||
@@ -257,7 +257,7 @@ quiet_cmd_link_o_target = LD $@
|
||||
# If the list of objects to link is empty, just create an empty built-in.o
|
||||
# -nostdlib is added to make "make LD=gcc ..." work (some people use that)
|
||||
cmd_link_o_target = $(if $(strip $(obj-y)),\
|
||||
- $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
|
||||
+ $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(filter $(obj-y), $^),\
|
||||
rm -f $@; $(AR) rcs $@)
|
||||
|
||||
$(builtin-target): $(obj-y) FORCE
|
||||
@@ -292,10 +292,10 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \
|
||||
$($(subst $(obj)/,,$(@:.o=-y)))), $^)
|
||||
|
||||
quiet_cmd_link_multi-y = LD $@
|
||||
-cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
|
||||
+cmd_link_multi-y = $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(link_multi_deps)
|
||||
|
||||
quiet_cmd_link_multi-m = LD [M] $@
|
||||
-cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
|
||||
+cmd_link_multi-m = $(CC) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
|
||||
|
||||
# We would rather have a list of rules like
|
||||
# foo.o: $(foo-objs)
|
||||
Index: busybox-1.23.2/scripts/Makefile.lib
|
||||
===================================================================
|
||||
--- busybox-1.23.2.orig/scripts/Makefile.lib
|
||||
+++ busybox-1.23.2/scripts/Makefile.lib
|
||||
@@ -121,7 +121,8 @@ cpp_flags = -Wp,-MD,$(depfile) $(NO
|
||||
# yet ld_flags is fed to ld.
|
||||
#ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
|
||||
# Remove the -Wl, prefix from linker options normally passed through gcc
|
||||
-ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS))
|
||||
+ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS) $(CFLAGS) $(EXTRA_CFLAGS))
|
||||
+ld_flags_partial = $($(filter-out -shared%, $(filter-out -pie%,$(ld_flags))))
|
||||
|
||||
|
||||
# Finds the multi-part object the current object will be linked into
|
||||
@@ -151,10 +152,8 @@ $(obj)/%:: $(src)/%_shipped
|
||||
# Linking
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
-# TODO: LDFLAGS usually is supposed to contain gcc's flags, not ld's.
|
||||
-# but here we feed them to ld!
|
||||
-quiet_cmd_ld = LD $@
|
||||
-cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
|
||||
+quiet_cmd_ld = CC $@
|
||||
+cmd_ld = $(CC) $(ld_flags) $(LDFLAGS_$(@F)) \
|
||||
$(filter-out FORCE,$^) -o $@
|
||||
|
||||
# Objcopy
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
From c69feb2fdb755d6db34d0eb0a9e9994386c15e3a Mon Sep 17 00:00:00 2001
|
||||
From: Chen Qi <Qi.Chen@windriver.com>
|
||||
Date: Wed, 14 Nov 2018 15:19:57 +0800
|
||||
Subject: [PATCH] du-l-works: fix to use 145 instead of 144
|
||||
|
||||
64 + 64 + 16 = 144
|
||||
144 + size_of_directory >= 145
|
||||
So fix to use 145 instead of 144.
|
||||
|
||||
Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086836.html]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
testsuite/du/du-l-works | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works
|
||||
index af87345..575064a 100644
|
||||
--- a/testsuite/du/du-l-works
|
||||
+++ b/testsuite/du/du-l-works
|
||||
@@ -5,7 +5,7 @@ cd du.testdir
|
||||
dd if=/dev/zero of=file1 bs=1k count=64 2>/dev/null
|
||||
ln file1 file1.1
|
||||
dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null
|
||||
-test x"`busybox du -l .`" = x"144 ." \
|
||||
+test x"`busybox du -l .`" = x"145 ." \
|
||||
-o x"`busybox du -l .`" = x"146 ." \
|
||||
-o x"`busybox du -l .`" = x"148 ." \
|
||||
-o x"`busybox du -l .`" = x"152 ." \
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
From ceb378209f953ea745ed93a8645567196380ce3c Mon Sep 17 00:00:00 2001
|
||||
From: Andrej Valek <andrej.valek@siemens.com>
|
||||
Date: Thu, 24 Jun 2021 19:13:22 +0200
|
||||
Subject: [PATCH] mktemp: add tmpdir option
|
||||
|
||||
Make mktemp more compatible with coreutils.
|
||||
- add "--tmpdir" option
|
||||
- add long variants for "d,q,u" options
|
||||
|
||||
Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2021-June/088932.html]
|
||||
|
||||
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
coreutils/mktemp.c | 26 ++++++++++++++++++--------
|
||||
1 file changed, 18 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/coreutils/mktemp.c b/coreutils/mktemp.c
|
||||
index 5393320a5..05c6d98c6 100644
|
||||
--- a/coreutils/mktemp.c
|
||||
+++ b/coreutils/mktemp.c
|
||||
@@ -39,16 +39,17 @@
|
||||
//kbuild:lib-$(CONFIG_MKTEMP) += mktemp.o
|
||||
|
||||
//usage:#define mktemp_trivial_usage
|
||||
-//usage: "[-dt] [-p DIR] [TEMPLATE]"
|
||||
+//usage: "[-dt] [-p DIR, --tmpdir[=DIR]] [TEMPLATE]"
|
||||
//usage:#define mktemp_full_usage "\n\n"
|
||||
//usage: "Create a temporary file with name based on TEMPLATE and print its name.\n"
|
||||
//usage: "TEMPLATE must end with XXXXXX (e.g. [/dir/]nameXXXXXX).\n"
|
||||
//usage: "Without TEMPLATE, -t tmp.XXXXXX is assumed.\n"
|
||||
-//usage: "\n -d Make directory, not file"
|
||||
-//usage: "\n -q Fail silently on errors"
|
||||
-//usage: "\n -t Prepend base directory name to TEMPLATE"
|
||||
-//usage: "\n -p DIR Use DIR as a base directory (implies -t)"
|
||||
-//usage: "\n -u Do not create anything; print a name"
|
||||
+//usage: "\n -d Make directory, not file"
|
||||
+//usage: "\n -q Fail silently on errors"
|
||||
+//usage: "\n -t Prepend base directory name to TEMPLATE"
|
||||
+//usage: "\n -p DIR, --tmpdir[=DIR] Use DIR as a base directory (implies -t)"
|
||||
+//usage: "\n For --tmpdir is a optional one."
|
||||
+//usage: "\n -u Do not create anything; print a name"
|
||||
//usage: "\n"
|
||||
//usage: "\nBase directory is: -p DIR, else $TMPDIR, else /tmp"
|
||||
//usage:
|
||||
@@ -72,13 +73,22 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
|
||||
OPT_t = 1 << 2,
|
||||
OPT_p = 1 << 3,
|
||||
OPT_u = 1 << 4,
|
||||
+ OPT_td = 1 << 5,
|
||||
};
|
||||
|
||||
path = getenv("TMPDIR");
|
||||
if (!path || path[0] == '\0')
|
||||
path = "/tmp";
|
||||
|
||||
- opts = getopt32(argv, "^" "dqtp:u" "\0" "?1"/*1 arg max*/, &path);
|
||||
+ opts = getopt32long(argv, "^"
|
||||
+ "dqtp:u\0"
|
||||
+ "?1" /* 1 arg max */,
|
||||
+ "directory\0" No_argument "d"
|
||||
+ "quiet\0" No_argument "q"
|
||||
+ "dry-run\0" No_argument "u"
|
||||
+ "tmpdir\0" Optional_argument "\xff"
|
||||
+ , &path, &path
|
||||
+ );
|
||||
|
||||
chp = argv[optind];
|
||||
if (!chp) {
|
||||
@@ -95,7 +105,7 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
- if (opts & (OPT_t|OPT_p))
|
||||
+ if (opts & (OPT_t|OPT_p|OPT_td))
|
||||
chp = concat_path_file(path, chp);
|
||||
|
||||
if (opts & OPT_u) {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
From 3bee0460d74bad88eca6592e63ca926961b43b67 Mon Sep 17 00:00:00 2001
|
||||
From: Yi Zhao <yi.zhao@windriver.com>
|
||||
Date: Fri, 6 Mar 2020 16:09:26 +0800
|
||||
Subject: [PATCH] sysctl: ignore EIO of stable_secret below
|
||||
/proc/sys/net/ipv6/conf
|
||||
|
||||
Avoid confusing messages caused by EIO on reading
|
||||
/proc/sys/net/ipv6/conf/*/stable_secret if those are not set yet.
|
||||
Make it behave the same as procps(>=3.3.13).
|
||||
|
||||
Upstream-Status: Submitted [busybox@busybox.net mailing list]
|
||||
|
||||
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
||||
---
|
||||
procps/sysctl.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/procps/sysctl.c b/procps/sysctl.c
|
||||
index 6d77185ca..42c51cc91 100644
|
||||
--- a/procps/sysctl.c
|
||||
+++ b/procps/sysctl.c
|
||||
@@ -202,7 +202,14 @@ static int sysctl_act_on_setting(char *setting)
|
||||
value = cptr = xmalloc_read(fd, NULL);
|
||||
close(fd);
|
||||
if (value == NULL) {
|
||||
- bb_perror_msg("error reading key '%s'", outname);
|
||||
+ switch (errno) {
|
||||
+ case EIO:
|
||||
+ /* Ignore stable_secret below /proc/sys/net/ipv6/conf */
|
||||
+ break;
|
||||
+ default:
|
||||
+ bb_perror_msg("error reading key '%s'", outname);
|
||||
+ break;
|
||||
+ }
|
||||
retval = EXIT_FAILURE;
|
||||
goto end;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
From 85f164ec427fecbae24140b3c93acbbe2ba1c817 Mon Sep 17 00:00:00 2001
|
||||
From: Chen Qi <Qi.Chen@windriver.com>
|
||||
Date: Tue, 13 Nov 2018 11:27:01 +0800
|
||||
Subject: [PATCH] testsuite: check uudecode before using it
|
||||
|
||||
The unzip and tar test cases use uudecode command, so also
|
||||
check it via optional function.
|
||||
|
||||
Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086833.html]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
testsuite/tar.tests | 2 +-
|
||||
testsuite/unzip.tests | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/testsuite/tar.tests b/testsuite/tar.tests
|
||||
index d71a349..8c88567 100755
|
||||
--- a/testsuite/tar.tests
|
||||
+++ b/testsuite/tar.tests
|
||||
@@ -339,7 +339,7 @@ cd .. || exit 1; rm -rf tar.tempdir 2>/d
|
||||
fi
|
||||
|
||||
mkdir tar.tempdir && cd tar.tempdir || exit 1
|
||||
-optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS
|
||||
+optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS UUDECODE
|
||||
testing "tar Symlink attack: create symlink and then write through it" '\
|
||||
exec 2>&1
|
||||
uudecode -o input && tar xvf input; echo $?
|
||||
diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
|
||||
index af53de9..3b45ece 100755
|
||||
--- a/testsuite/unzip.tests
|
||||
+++ b/testsuite/unzip.tests
|
||||
@@ -31,7 +31,7 @@ rmdir foo
|
||||
rm foo.zip
|
||||
|
||||
# File containing some damaged encrypted stream
|
||||
-optional FEATURE_UNZIP_CDF CONFIG_UNICODE_SUPPORT
|
||||
+optional FEATURE_UNZIP_CDF CONFIG_UNICODE_SUPPORT UUDECODE
|
||||
testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
|
||||
"Archive: bad.zip
|
||||
inflating: ]3j½r«I??K-%Ix
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
From 03acf460990dfcf6e52b298301b348b9504460a8 Mon Sep 17 00:00:00 2001
|
||||
From: Chen Qi <Qi.Chen@windriver.com>
|
||||
Date: Tue, 13 Nov 2018 13:51:42 +0800
|
||||
Subject: [PATCH] testsuite: use www.example.org for wget test cases
|
||||
|
||||
Use example.org instead of google.com to make sure it's
|
||||
always reachible.
|
||||
|
||||
Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2018-November/086835.html]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
testsuite/wget/wget--O-overrides--P | 2 +-
|
||||
testsuite/wget/wget-handles-empty-path | 2 +-
|
||||
testsuite/wget/wget-retrieves-google-index | 2 +-
|
||||
testsuite/wget/wget-supports--P | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/testsuite/wget/wget--O-overrides--P b/testsuite/wget/wget--O-overrides--P
|
||||
index 40a3a96..490d743 100644
|
||||
--- a/testsuite/wget/wget--O-overrides--P
|
||||
+++ b/testsuite/wget/wget--O-overrides--P
|
||||
@@ -1,5 +1,5 @@
|
||||
test x"$SKIP_INTERNET_TESTS" != x"" && exit
|
||||
|
||||
mkdir foo
|
||||
-busybox wget -q -O index.html -P foo http://www.google.com/
|
||||
+busybox wget -q -O index.html -P foo http://www.example.org/
|
||||
test -s index.html
|
||||
diff --git a/testsuite/wget/wget-handles-empty-path b/testsuite/wget/wget-handles-empty-path
|
||||
index 01d60bd..1802db6 100644
|
||||
--- a/testsuite/wget/wget-handles-empty-path
|
||||
+++ b/testsuite/wget/wget-handles-empty-path
|
||||
@@ -1,3 +1,3 @@
|
||||
test x"$SKIP_INTERNET_TESTS" != x"" && exit
|
||||
|
||||
-busybox wget http://www.google.com
|
||||
+busybox wget http://www.example.org
|
||||
diff --git a/testsuite/wget/wget-retrieves-google-index b/testsuite/wget/wget-retrieves-google-index
|
||||
index f9dbb8b..fc801d4 100644
|
||||
--- a/testsuite/wget/wget-retrieves-google-index
|
||||
+++ b/testsuite/wget/wget-retrieves-google-index
|
||||
@@ -1,4 +1,4 @@
|
||||
test x"$SKIP_INTERNET_TESTS" != x"" && exit
|
||||
|
||||
-busybox wget -q -O foo http://www.google.com/
|
||||
+busybox wget -q -O foo http://www.example.org/
|
||||
test -s foo
|
||||
diff --git a/testsuite/wget/wget-supports--P b/testsuite/wget/wget-supports--P
|
||||
index bfe4ac4..4ff2fe0 100644
|
||||
--- a/testsuite/wget/wget-supports--P
|
||||
+++ b/testsuite/wget/wget-supports--P
|
||||
@@ -1,5 +1,5 @@
|
||||
test x"$SKIP_INTERNET_TESTS" != x"" && exit
|
||||
|
||||
mkdir foo
|
||||
-busybox wget -q -P foo http://www.google.com/
|
||||
+busybox wget -q -P foo http://www.example.org/
|
||||
test -s foo/index.html
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
From: Jason Wessel <jason.wessel@windriver.com>
|
||||
Date: Sun, 3 Mar 2013 12:31:40 -0600
|
||||
Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses location
|
||||
|
||||
Upstream-Status: Submitted
|
||||
|
||||
[ based on: https://lkml.org/lkml/2013/3/3/103 ]
|
||||
|
||||
This patch syncs up with the way the menuconfig ncurses / curses
|
||||
is detected and the HOST_EXTRACFLAGS works in the Linux kernel
|
||||
and it allows the menuconfig to work with a sysroot version
|
||||
of the curses libraries.
|
||||
|
||||
---
|
||||
|
||||
In some cross build environments such as the Yocto Project build
|
||||
environment it provides an ncurses library that is compiled
|
||||
differently than the host's version. This causes display corruption
|
||||
problems when the host's curses includes are used instead of the
|
||||
includes from the provided compiler are overridden. There is a second
|
||||
case where there is no curses libraries at all on the host system and
|
||||
menuconfig will just fail entirely.
|
||||
|
||||
The solution is simply to allow an override variable in
|
||||
check-lxdialog.sh for environments such as the Yocto Project. Adding
|
||||
a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing
|
||||
compiling and linking against the right headers and libraries.
|
||||
|
||||
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
|
||||
cc: Michal Marek <mmarek@suse.cz>
|
||||
cc: linux-kbuild@vger.kernel.org
|
||||
---
|
||||
scripts/kconfig/lxdialog/Makefile | 2 +-
|
||||
scripts/kconfig/lxdialog/check-lxdialog.sh | 8 ++++++++
|
||||
2 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
|
||||
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
|
||||
@@ -4,6 +4,10 @@
|
||||
# What library to link
|
||||
ldflags()
|
||||
{
|
||||
+ if [ x"$CROSS_CURSES_LIB" != x ]; then
|
||||
+ echo "$CROSS_CURSES_LIB"
|
||||
+ exit
|
||||
+ fi
|
||||
pkg-config --libs ncursesw 2>/dev/null && exit
|
||||
pkg-config --libs ncurses 2>/dev/null && exit
|
||||
for ext in so a dll.a dylib ; do
|
||||
@@ -21,6 +25,10 @@
|
||||
# Where is ncurses.h?
|
||||
ccflags()
|
||||
{
|
||||
+ if [ x"$CROSS_CURSES_INC" != x ]; then
|
||||
+ echo "$CROSS_CURSES_INC"
|
||||
+ exit
|
||||
+ fi
|
||||
if pkg-config --cflags ncursesw 2>/dev/null; then
|
||||
echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
|
||||
elif pkg-config --cflags ncurses 2>/dev/null; then
|
||||
--- a/scripts/kconfig/lxdialog/Makefile
|
||||
+++ b/scripts/kconfig/lxdialog/Makefile
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
# Use reursively expanded variables so we do not call gcc unless
|
||||
# we really need to do so. (Do not call gcc as part of make mrproper)
|
||||
-HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
|
||||
+HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
|
||||
HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
|
||||
|
||||
HOST_EXTRACFLAGS += -DLOCALE
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
From 53626cd06a3ef05ed847daea802ef0aa9661caa7 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>
|
||||
|
||||
Fixed options -b, -a and -P.
|
||||
|
||||
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
|
||||
---
|
||||
networking/udhcp/dhcpc.c | 29 ++++++++++++++++------
|
||||
1 file changed, 21 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: busybox-1.34.0/networking/udhcp/dhcpc.c
|
||||
===================================================================
|
||||
--- busybox-1.34.0.orig/networking/udhcp/dhcpc.c
|
||||
+++ busybox-1.34.0/networking/udhcp/dhcpc.c
|
||||
@@ -48,6 +48,8 @@
|
||||
};
|
||||
#endif
|
||||
|
||||
+/* option whether to down the interface when reconfiguring */
|
||||
+static int allow_deconfig = 1;
|
||||
|
||||
/* "struct client_data_t client_data" is in bb_common_bufsiz1 */
|
||||
|
||||
@@ -100,8 +102,10 @@
|
||||
OPT_x = 1 << 16,
|
||||
OPT_f = 1 << 17,
|
||||
OPT_B = 1 << 18,
|
||||
+ OPT_D = 1 << 19,
|
||||
/* The rest has variable bit positions, need to be clever */
|
||||
OPTBIT_B = 18,
|
||||
+ OPTBIT_D = 19,
|
||||
USE_FOR_MMU( OPTBIT_b,)
|
||||
IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
|
||||
IF_FEATURE_UDHCP_PORT( OPTBIT_P,)
|
||||
@@ -587,7 +591,8 @@
|
||||
|
||||
static void d4_run_script_deconfig(void)
|
||||
{
|
||||
- d4_run_script(NULL, "deconfig");
|
||||
+ if (allow_deconfig)
|
||||
+ d4_run_script(NULL, "deconfig");
|
||||
}
|
||||
|
||||
/*** Sending/receiving packets ***/
|
||||
@@ -1244,7 +1249,7 @@
|
||||
/* Parse command line */
|
||||
opt = getopt32long(argv, "^"
|
||||
/* O,x: list; -T,-t,-A take numeric param */
|
||||
- "CV:F:i:np:qRr:s:T:+t:+SA:+O:*ox:*fB"
|
||||
+ "CV: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:")
|
||||
@@ -1361,6 +1366,10 @@
|
||||
logmode |= LOGMODE_SYSLOG;
|
||||
}
|
||||
|
||||
+ if (opt & OPT_D) {
|
||||
+ allow_deconfig = 0;
|
||||
+ }
|
||||
+
|
||||
/* Create pidfile */
|
||||
write_pidfile(client_data.pidfile);
|
||||
/* Goes to stdout (unless NOMMU) and possibly syslog */
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
Upstream-Status: Denied
|
||||
[https://www.mail-archive.com/busybox@busybox.net/msg22354.html]
|
||||
|
||||
The current behaviour of busybox is to try all fstype when automounting
|
||||
even when no media exists. The util-linux mount command bails when no
|
||||
media exists, so change the behaviour of busybox to do the same.
|
||||
|
||||
It could also be argued that the KERN_INFO message from btrfs could be
|
||||
removed, but that would be harder to accomplish.
|
||||
|
||||
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
||||
|
||||
|
||||
Index: busybox-1.20.2/util-linux/mount.c
|
||||
===================================================================
|
||||
--- busybox-1.20.2.orig/util-linux/mount.c
|
||||
+++ busybox-1.20.2/util-linux/mount.c
|
||||
@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m
|
||||
break;
|
||||
errno = errno_save;
|
||||
}
|
||||
-
|
||||
+ /*
|
||||
+ * Break if there is no media, no point retrying for all
|
||||
+ * fs types since there is no media available
|
||||
+ */
|
||||
+ if (rc == -1 && errno == ENOMEDIUM) {
|
||||
+ bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
|
||||
+ }
|
||||
if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
|
||||
break;
|
||||
if (!(vfsflags & MS_SILENT))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
CONFIG_GETOPT=y
|
||||
CONFIG_LONG_OPTS=y
|
||||
CONFIG_FEATURE_GETOPT_LONG=y
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
CONFIG_INIT=y
|
||||
CONFIG_RUNLEVEL=y
|
||||
CONFIG_FEATURE_USE_INITTAB=y
|
||||
CONFIG_HALT=y
|
||||
CONFIG_POWEROFF=y
|
||||
CONFIG_FEATURE_KILL_DELAY=0
|
||||
CONFIG_TELINIT_PATH=""
|
||||
CONFIG_INIT_TERMINAL_TYPE=""
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
CONFIG_FEATURE_SHADOWPASSWDS=y
|
||||
CONFIG_ADDUSER=y
|
||||
CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y
|
||||
CONFIG_ADDGROUP=y
|
||||
CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y
|
||||
CONFIG_DELUSER=y
|
||||
CONFIG_DELGROUP=y
|
||||
CONFIG_GETTY=y
|
||||
CONFIG_LOGIN=y
|
||||
CONFIG_PASSWD=y
|
||||
CONFIG_SU=y
|
||||
CONFIG_SULOGIN=y
|
||||
CONFIG_VLOCK=y
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
CONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_GZIP_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_CP_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_DIFF_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_BC_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_IPCALC_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
There is a potential race when building libbb, as some header files
|
||||
needed by libbb are not generated yet (or are being modified) at the time
|
||||
libbb is compiled.
|
||||
This patch avoids this scenario by building libbb as the last directory.
|
||||
|
||||
Upstream-Status: Submitted
|
||||
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
|
||||
|
||||
Index: busybox-1.24.1/Makefile
|
||||
===================================================================
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 5cfc763..69f3831 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -738,9 +738,18 @@ $(sort $(busybox-all)): $(busybox-dirs) ;
|
||||
# Error messages still appears in the original language
|
||||
|
||||
PHONY += $(busybox-dirs)
|
||||
-$(busybox-dirs): prepare scripts
|
||||
+
|
||||
+libbb-dir = $(filter libbb,$(busybox-dirs))
|
||||
+busybox-dirs1 = $(filter-out libbb,$(busybox-dirs))
|
||||
+
|
||||
+$(busybox-dirs1): prepare scripts
|
||||
$(Q)$(MAKE) $(build)=$@
|
||||
|
||||
+ifneq ($(libbb-dir),)
|
||||
+$(libbb-dir): | $(busybox-dirs1)
|
||||
+ $(Q)$(MAKE) $(build)=$@
|
||||
+endif
|
||||
+
|
||||
# Build the kernel release string
|
||||
# The KERNELRELEASE is stored in a file named .kernelrelease
|
||||
# to be used when executing for example make install or make modules_install
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
CONFIG_MDEV=y
|
||||
CONFIG_FEATURE_MDEV_CONF=y
|
||||
CONFIG_FEATURE_MDEV_RENAME=y
|
||||
CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
|
||||
CONFIG_FEATURE_MDEV_EXEC=y
|
||||
CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
|
||||
|
||||
CONFIG_SETSID=y
|
||||
CONFIG_CTTYHACK=y
|
||||
|
||||
CONFIG_FEATURE_SHADOWPASSWDS=y
|
||||
CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
|
||||
CONFIG_FEATURE_MDEV_DAEMON=y
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
CONFIG_BLKID=y
|
||||
CONFIG_FEATURE_BLKID_TYPE=y
|
||||
CONFIG_FEATURE_MOUNT_LABEL=y
|
||||
CONFIG_FEATURE_SWAPONOFF_LABEL=y
|
||||
CONFIG_VOLUMEID=y
|
||||
CONFIG_FEATURE_VOLUMEID_BTRFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_EXT=y
|
||||
CONFIG_FEATURE_VOLUMEID_F2FS=y
|
||||
CONFIG_FEATURE_VOLUMEID_FAT=y
|
||||
CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# CONFIG_EXTRA_COMPAT is not set
|
||||
# CONFIG_SELINUX is not set
|
||||
# CONFIG_FEATURE_HAVE_RPC is not set
|
||||
# CONFIG_WERROR is not set
|
||||
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
|
||||
# CONFIG_PAM is not set
|
||||
# CONFIG_FEATURE_INETD_RPC is not set
|
||||
# CONFIG_SELINUXENABLED is not set
|
||||
# CONFIG_FEATURE_MOUNT_NFS is not set
|
||||
# CONFIG_FEATURE_UTMP is not set
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
CONFIG_PGREP=y
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
This adds connmand to the list of know dhcp clients
|
||||
|
||||
Upstream-Status: Inappropriate [OE-Core]
|
||||
|
||||
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
||||
|
||||
Index: busybox-1.22.1/networking/ifupdown.c
|
||||
===================================================================
|
||||
--- busybox-1.22.1.orig/networking/ifupdown.c
|
||||
+++ busybox-1.22.1/networking/ifupdown.c
|
||||
@@ -521,6 +521,10 @@ struct dhcp_client_t {
|
||||
};
|
||||
|
||||
static const struct dhcp_client_t ext_dhcp_clients[] = {
|
||||
+ { "connmand",
|
||||
+ "true",
|
||||
+ "true",
|
||||
+ },
|
||||
{ "dhcpcd",
|
||||
"dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %client%]][[ -l %leasetime%]] %iface%",
|
||||
"dhcpcd -k %iface%",
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
CONFIG_RESIZE=y
|
||||
CONFIG_FEATURE_RESIZE_PRINT=y
|
||||
|
|
@ -0,0 +1 @@
|
|||
CONFIG_REV=y
|
||||
|
|
@ -0,0 +1 @@
|
|||
CONFIG_SHA1SUM=y
|
||||
|
|
@ -0,0 +1 @@
|
|||
CONFIG_SHA256SUM=y
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
CONFIG_SYSLOGD=y
|
||||
CONFIG_FEATURE_ROTATE_LOGFILE=y
|
||||
CONFIG_FEATURE_REMOTE_LOG=y
|
||||
CONFIG_FEATURE_SYSLOGD_DUP=y
|
||||
CONFIG_FEATURE_SYSLOGD_CFG=y
|
||||
CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
|
||||
CONFIG_FEATURE_IPC_SYSLOG=y
|
||||
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=64
|
||||
CONFIG_LOGREAD=y
|
||||
CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
|
||||
CONFIG_FEATURE_KMSG_SYSLOG=y
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
CONFIG_UNICODE_SUPPORT=y
|
||||
# CONFIG_UNICODE_USING_LOCALE is not set
|
||||
CONFIG_FEATURE_CHECK_UNICODE_IN_ENV=y
|
||||
CONFIG_SUBST_WCHAR=63
|
||||
CONFIG_LAST_SUPPORTED_WCHAR=767
|
||||
CONFIG_UNICODE_COMBINING_WCHARS=y
|
||||
CONFIG_UNICODE_WIDE_WCHARS=y
|
||||
# CONFIG_UNICODE_BIDI_SUPPORT is not set
|
||||
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
|
||||
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
SUMMARY = "inittab configuration for BusyBox"
|
||||
LICENSE = "GPLv2"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
|
||||
|
||||
SRC_URI = "file://inittab"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
|
||||
do_compile() {
|
||||
:
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sysconfdir}
|
||||
install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
|
||||
tmp="${SERIAL_CONSOLES}"
|
||||
[ -n "$tmp" ] && echo >> ${D}${sysconfdir}/inittab
|
||||
for i in $tmp
|
||||
do
|
||||
j=`echo ${i} | sed s/\;/\ /g`
|
||||
id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'`
|
||||
echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
|
||||
done
|
||||
if [ "${USE_VT}" = "1" ]; then
|
||||
cat <<EOF >>${D}${sysconfdir}/inittab
|
||||
# ${base_sbindir}/getty invocations for the runlevels.
|
||||
#
|
||||
# The "id" field MUST be the same as the last
|
||||
# characters of the device (after "tty").
|
||||
#
|
||||
# Format:
|
||||
# <id>:<runlevels>:<action>:<process>
|
||||
#
|
||||
|
||||
EOF
|
||||
|
||||
for n in ${SYSVINIT_ENABLED_GETTYS}
|
||||
do
|
||||
echo "tty$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
|
||||
done
|
||||
echo "" >> ${D}${sysconfdir}/inittab
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
pkg_postinst_${PN} () {
|
||||
# run this on host and on target
|
||||
if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst_ontarget_${PN} () {
|
||||
# run this on the target
|
||||
if [ -e /proc/consoles ]; then
|
||||
tmp="${SERIAL_CONSOLES_CHECK}"
|
||||
for i in $tmp
|
||||
do
|
||||
j=`echo ${i} | sed -e s/^.*\;//g -e s/\:.*//g`
|
||||
k=`echo ${i} | sed s/^.*\://g`
|
||||
if [ -z "`grep ${j} /proc/consoles`" ]; then
|
||||
if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
|
||||
sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab
|
||||
fi
|
||||
fi
|
||||
done
|
||||
kill -HUP 1
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# SERIAL_CONSOLES is generally defined by the MACHINE .conf.
|
||||
# Set PACKAGE_ARCH appropriately.
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
FILES_${PN} = "${sysconfdir}/inittab"
|
||||
CONFFILES_${PN} = "${sysconfdir}/inittab"
|
||||
|
||||
RCONFLICTS_${PN} = "sysvinit-inittab"
|
||||
|
||||
USE_VT ?= "1"
|
||||
SYSVINIT_ENABLED_GETTYS ?= "1"
|
||||
|
|
@ -0,0 +1,508 @@
|
|||
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 = "https://www.busybox.net"
|
||||
BUGTRACKER = "https://bugs.busybox.net/"
|
||||
|
||||
DEPENDS += "kern-tools-native virtual/crypt"
|
||||
|
||||
# bzip2 applet in busybox is based on lightly-modified bzip2-1.0.4 source
|
||||
# the GPL is version 2 only
|
||||
LICENSE = "GPLv2 & bzip2-1.0.4"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb \
|
||||
file://archival/libarchive/bz/LICENSE;md5=28e3301eae987e8cfe19988e98383dae"
|
||||
|
||||
SECTION = "base"
|
||||
|
||||
# Whether to split the suid apps into a seperate binary
|
||||
BUSYBOX_SPLIT_SUID ?= "1"
|
||||
|
||||
export EXTRA_CFLAGS = "${CFLAGS}"
|
||||
export EXTRA_LDFLAGS = "${LDFLAGS}"
|
||||
|
||||
EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' HOSTCPP='${BUILD_CPP}'"
|
||||
|
||||
PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
|
||||
|
||||
FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
|
||||
FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
|
||||
FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*"
|
||||
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}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
|
||||
|
||||
INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
|
||||
INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
|
||||
INITSCRIPT_NAME_${PN}-mdev = "mdev"
|
||||
INITSCRIPT_PARAMS_${PN}-mdev = "start 04 S ."
|
||||
INITSCRIPT_NAME_${PN}-syslog = "syslog"
|
||||
INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}-syslog"
|
||||
SYSTEMD_SERVICE_${PN}-syslog = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'busybox-syslog.service', '', d)}"
|
||||
|
||||
RDEPENDS_${PN}-syslog = "busybox"
|
||||
CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf"
|
||||
RCONFLICTS_${PN}-syslog = "rsyslog sysklogd syslog-ng"
|
||||
|
||||
CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
|
||||
|
||||
RRECOMMENDS_${PN} = "${PN}-udhcpc"
|
||||
|
||||
RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]}"
|
||||
|
||||
inherit cml1 systemd update-rc.d ptest
|
||||
|
||||
# busybox's unzip test case needs zip command, which busybox itself does not provide
|
||||
RDEPENDS_${PN}-ptest = "zip"
|
||||
|
||||
# internal helper
|
||||
def busybox_cfg(feature, tokens, cnf, rem):
|
||||
if type(tokens) == type(""):
|
||||
tokens = [tokens]
|
||||
rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
|
||||
if feature:
|
||||
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 = ([], [])
|
||||
busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem)
|
||||
busybox_cfg(True, 'CONFIG_LFS', cnf, rem)
|
||||
busybox_cfg(True, 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
|
||||
busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem)
|
||||
busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
|
||||
busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
|
||||
busybox_cfg(bb.utils.contains_any('DISTRO_FEATURES', 'bluetooth wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem)
|
||||
return "\n".join(cnf), "\n".join(rem)
|
||||
|
||||
# X, Y = ${@features_to_busybox_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 = '/CONFIG_EXTRA_CFLAGS/d; \
|
||||
'
|
||||
OE_FEATURES := "${@features_to_busybox_conf(d)}"
|
||||
OE_DEL := "${@features_to_busybox_del(d)}"
|
||||
DO_IPv4 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}"
|
||||
DO_IPv6 := "${@bb.utils.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((d.expand("${OE_FEATURES}").split("\n")))))
|
||||
d.setVar('configmangle_append',
|
||||
"/^### CROSS$/a\\\n%s\n" %
|
||||
("\\n".join(["CONFIG_EXTRA_CFLAGS=\"${CFLAGS} ${HOST_CC_ARCH}\""
|
||||
])
|
||||
))
|
||||
}
|
||||
|
||||
do_prepare_config () {
|
||||
if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
|
||||
export KCONFIG_NOTIMESTAMP=1
|
||||
fi
|
||||
sed -e '/CONFIG_STATIC/d' \
|
||||
< ${WORKDIR}/defconfig > ${S}/.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
|
||||
sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"/' ${S}/.config
|
||||
if [ -n "${DEBUG_PREFIX_MAP}" ]; then
|
||||
sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
|
||||
fi
|
||||
}
|
||||
|
||||
do_configure () {
|
||||
set -x
|
||||
do_prepare_config
|
||||
merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
|
||||
cml1_do_configure
|
||||
}
|
||||
|
||||
do_compile() {
|
||||
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
|
||||
if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
|
||||
export KCONFIG_NOTIMESTAMP=1
|
||||
fi
|
||||
if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
|
||||
# split the .config into two parts, and make two busybox binaries
|
||||
if [ -e .config.orig ]; then
|
||||
# Need to guard again an interrupted do_compile - restore any backup
|
||||
cp .config.orig .config
|
||||
fi
|
||||
cp .config .config.orig
|
||||
oe_runmake busybox.cfg.suid
|
||||
oe_runmake busybox.cfg.nosuid
|
||||
|
||||
# workaround for suid bug 10346
|
||||
if ! grep -q "CONFIG_SH_IS_NONE" busybox.cfg.nosuid; then
|
||||
echo "CONFIG_SH_IS_NONE" >> busybox.cfg.suid
|
||||
fi
|
||||
|
||||
for i in `cat busybox.cfg.suid busybox.cfg.nosuid`; do
|
||||
echo "# $i is not set" >> .config.disable.apps
|
||||
done
|
||||
merge_config.sh -m .config.orig .config.disable.apps
|
||||
cp .config .config.nonapps
|
||||
for s in suid nosuid; do
|
||||
cat busybox.cfg.$s | while read item; do
|
||||
grep -w "$item" .config.orig
|
||||
done > .config.app.$s
|
||||
|
||||
# workaround for suid bug 10346
|
||||
if [ "$s" = "suid" ] ; then
|
||||
sed "s/.*CONFIG_SH_IS_NONE.*$/CONFIG_SH_IS_NONE=y/" -i .config.app.suid
|
||||
fi
|
||||
|
||||
merge_config.sh -m .config.nonapps .config.app.$s
|
||||
oe_runmake busybox_unstripped
|
||||
mv busybox_unstripped busybox.$s
|
||||
oe_runmake busybox.links
|
||||
sort busybox.links > busybox.links.$s
|
||||
rm busybox.links
|
||||
done
|
||||
|
||||
# hard fail if sh is being linked to the suid busybox (detects bug 10346)
|
||||
if grep -q -x "/bin/sh" busybox.links.suid; then
|
||||
bbfatal "busybox suid binary incorrectly provides /bin/sh"
|
||||
fi
|
||||
|
||||
# copy .config.orig back to .config, because the install process may check this file
|
||||
cp .config.orig .config
|
||||
# cleanup
|
||||
rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
|
||||
else
|
||||
oe_runmake busybox_unstripped
|
||||
cp busybox_unstripped busybox
|
||||
oe_runmake busybox.links
|
||||
fi
|
||||
}
|
||||
|
||||
do_install () {
|
||||
sed -i "s:^/bin/:BASE_BINDIR/:" busybox.links*
|
||||
sed -i "s:^/sbin/:BASE_SBINDIR/:" busybox.links*
|
||||
sed -i "s:^/usr/bin/:BINDIR/:" busybox.links*
|
||||
sed -i "s:^/usr/sbin/:SBINDIR/:" busybox.links*
|
||||
|
||||
# Move arch/link to BINDIR to match coreutils
|
||||
sed -i "s:^BASE_BINDIR/arch:BINDIR/arch:" busybox.links*
|
||||
sed -i "s:^BASE_BINDIR/link:BINDIR/link:" busybox.links*
|
||||
|
||||
sed -i "s:^BASE_BINDIR/:${base_bindir}/:" busybox.links*
|
||||
sed -i "s:^BASE_SBINDIR/:${base_sbindir}/:" busybox.links*
|
||||
sed -i "s:^BINDIR/:${bindir}/:" busybox.links*
|
||||
sed -i "s:^SBINDIR/:${sbindir}/:" busybox.links*
|
||||
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
|
||||
if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then
|
||||
# Install ${base_bindir}/busybox, and the ${base_bindir}/sh link so the postinst script
|
||||
# can run. Let update-alternatives handle the rest.
|
||||
install -d ${D}${base_bindir}
|
||||
if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
|
||||
install -m 4755 ${B}/busybox.suid ${D}${base_bindir}
|
||||
install -m 0755 ${B}/busybox.nosuid ${D}${base_bindir}
|
||||
install -m 0644 ${S}/busybox.links.suid ${D}${sysconfdir}
|
||||
install -m 0644 ${S}/busybox.links.nosuid ${D}${sysconfdir}
|
||||
if grep -q "CONFIG_SH_IS_ASH=y" ${B}/.config; then
|
||||
ln -sf busybox.nosuid ${D}${base_bindir}/sh
|
||||
fi
|
||||
# Keep a default busybox for people who want to invoke busybox directly.
|
||||
# This is also useful for the on device upgrade. Because we want
|
||||
# to use the busybox command in postinst.
|
||||
ln -sf busybox.nosuid ${D}${base_bindir}/busybox
|
||||
else
|
||||
if grep -q "CONFIG_FEATURE_SUID=y" ${B}/.config; then
|
||||
install -m 4755 ${B}/busybox ${D}${base_bindir}
|
||||
else
|
||||
install -m 0755 ${B}/busybox ${D}${base_bindir}
|
||||
fi
|
||||
install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
|
||||
if grep -q "CONFIG_SH_IS_ASH=y" ${B}/.config; then
|
||||
ln -sf busybox ${D}${base_bindir}/sh
|
||||
fi
|
||||
# We make this symlink here to eliminate the error when upgrading together
|
||||
# with busybox-syslog. Without this symlink, the opkg may think of the
|
||||
# busybox.nosuid as obsolete and remove it, resulting in dead links like
|
||||
# ${base_bindir}/sed -> ${base_bindir}/busybox.nosuid. This will make upgrading busybox-syslog fail.
|
||||
# This symlink will be safely deleted in postinst, thus no negative effect.
|
||||
ln -sf busybox ${D}${base_bindir}/busybox.nosuid
|
||||
fi
|
||||
else
|
||||
install -d ${D}${base_bindir} ${D}${bindir} ${D}${libdir}
|
||||
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
|
||||
install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
|
||||
fi
|
||||
|
||||
if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
|
||||
install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog
|
||||
install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf
|
||||
install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
|
||||
fi
|
||||
if grep -q "CONFIG_CROND=y" ${B}/.config; then
|
||||
install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
|
||||
fi
|
||||
if grep -q "CONFIG_HTTPD=y" ${B}/.config; then
|
||||
install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
|
||||
install -d ${D}/srv/www
|
||||
fi
|
||||
if grep -q "CONFIG_UDHCPD=y" ${B}/.config; then
|
||||
install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
|
||||
fi
|
||||
if grep -q "CONFIG_HWCLOCK=y" ${B}/.config; then
|
||||
install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
|
||||
fi
|
||||
if grep -q "CONFIG_UDHCPC=y" ${B}/.config; then
|
||||
install -d ${D}${sysconfdir}/udhcpc.d
|
||||
install -d ${D}${datadir}/udhcpc
|
||||
install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default
|
||||
sed -i "s:/SBIN_DIR/:${base_sbindir}/:" ${D}${sysconfdir}/udhcpc.d/50default
|
||||
install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
|
||||
fi
|
||||
if grep -q "CONFIG_INETD=y" ${B}/.config; then
|
||||
install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN}
|
||||
sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN}
|
||||
install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/
|
||||
fi
|
||||
if grep -q "CONFIG_MDEV=y" ${B}/.config; then
|
||||
install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
|
||||
if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then
|
||||
install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
|
||||
install -d ${D}${sysconfdir}/mdev
|
||||
install -m 0755 ${WORKDIR}/find-touchscreen.sh ${D}${sysconfdir}/mdev
|
||||
install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
|
||||
fi
|
||||
fi
|
||||
if grep -q "CONFIG_INIT=y" ${B}/.config && ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','busybox','true','false',d)}; then
|
||||
install -D -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS
|
||||
install -D -m 0755 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK
|
||||
install -D -m 0755 ${WORKDIR}/rcS.default ${D}${sysconfdir}/default/rcS
|
||||
fi
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||
if grep -q "CONFIG_KLOGD=y" ${B}/.config; then
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
|
||||
> ${D}${systemd_unitdir}/system/busybox-klogd.service
|
||||
fi
|
||||
|
||||
if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
|
||||
> ${D}${systemd_unitdir}/system/busybox-syslog.service
|
||||
if [ ! -e ${D}${systemd_unitdir}/system/busybox-klogd.service ] ; then
|
||||
sed -i '/klog/d' ${D}${systemd_unitdir}/system/busybox-syslog.service
|
||||
fi
|
||||
if [ -f ${WORKDIR}/busybox-syslog.default ] ; then
|
||||
install -d ${D}${sysconfdir}/default
|
||||
install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Remove the sysvinit specific configuration file for systemd systems to avoid confusion
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
|
||||
rm -f ${D}${sysconfdir}/syslog-startup.conf
|
||||
fi
|
||||
}
|
||||
|
||||
PTEST_BINDIR = "1"
|
||||
|
||||
do_install_ptest () {
|
||||
cp -r ${B}/testsuite ${D}${PTEST_PATH}/
|
||||
# These access the internet which is not guaranteed to work on machines running the tests
|
||||
rm -rf ${D}${PTEST_PATH}/testsuite/wget
|
||||
sort ${B}/.config > ${D}${PTEST_PATH}/.config
|
||||
ln -s /bin/busybox ${D}${PTEST_PATH}/busybox
|
||||
}
|
||||
|
||||
inherit update-alternatives
|
||||
|
||||
ALTERNATIVE_PRIORITY = "50"
|
||||
|
||||
python do_package_prepend () {
|
||||
# We need to load the full set of busybox provides from the /etc/busybox.links
|
||||
# Use this to see the update-alternatives with the right information
|
||||
|
||||
dvar = d.getVar('D')
|
||||
pn = d.getVar('PN')
|
||||
def set_alternative_vars(links, target):
|
||||
links = d.expand(links)
|
||||
target = d.expand(target)
|
||||
f = open('%s%s' % (dvar, links), 'r')
|
||||
for alt_link_name in f:
|
||||
alt_link_name = alt_link_name.strip()
|
||||
alt_name = os.path.basename(alt_link_name)
|
||||
# Match coreutils
|
||||
if alt_name == '[':
|
||||
alt_name = 'lbracket'
|
||||
if alt_name == 'klogd' or alt_name == 'syslogd':
|
||||
d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' ' + alt_name)
|
||||
else:
|
||||
d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
|
||||
d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
|
||||
if os.path.exists('%s%s' % (dvar, target)):
|
||||
d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
|
||||
f.close()
|
||||
return
|
||||
|
||||
if os.path.exists('%s/etc/busybox.links' % (dvar)):
|
||||
set_alternative_vars("${sysconfdir}/busybox.links", "${base_bindir}/busybox")
|
||||
else:
|
||||
set_alternative_vars("${sysconfdir}/busybox.links.nosuid", "${base_bindir}/busybox.nosuid")
|
||||
set_alternative_vars("${sysconfdir}/busybox.links.suid", "${base_bindir}/busybox.suid")
|
||||
}
|
||||
|
||||
# This part of code is dedicated to the on target upgrade problem. It's known
|
||||
# that if we don't make appropriate symlinks before update-alternatives calls,
|
||||
# there will be errors indicating missing commands such as 'sed'.
|
||||
# These symlinks will later be updated by update-alternatives calls.
|
||||
# The update-alternatives.bbclass' postinst script runs firstly before other
|
||||
# postinst, but this part of code needs run firstly, so add this funtion.
|
||||
python populate_packages_updatealternatives_append() {
|
||||
postinst = """
|
||||
test -n 2 > /dev/null || alias test='busybox test'
|
||||
if test "x$D" = "x"; then
|
||||
# Remove busybox.nosuid if it's a symlink, because this situation indicates
|
||||
# that we're installing or upgrading to a one-binary busybox.
|
||||
if test -h ${base_bindir}/busybox.nosuid; then
|
||||
rm -f ${base_bindir}/busybox.nosuid
|
||||
fi
|
||||
for suffix in "" ".nosuid" ".suid"; do
|
||||
if test -e ${sysconfdir}/busybox.links$suffix; then
|
||||
while read link; do
|
||||
if test ! -e "$link"; then
|
||||
# we can use busybox here because even if we are using splitted busybox
|
||||
# we've made a symlink from /bin/busybox to /bin/busybox.nosuid.
|
||||
busybox rm -f $link
|
||||
busybox ln -s "${base_bindir}/busybox$suffix" $link
|
||||
fi
|
||||
done < ${sysconfdir}/busybox.links$suffix
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links*; then
|
||||
grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
|
||||
fi
|
||||
|
||||
"""
|
||||
d.prependVar('pkg_postinst_%s' % pkg, postinst)
|
||||
}
|
||||
|
||||
pkg_postinst_${PN}_prepend () {
|
||||
# Need path to saved utils, but they may have be removed on upgrade of busybox
|
||||
# Only use shell to get paths. Also capture if busybox was saved.
|
||||
BUSYBOX=""
|
||||
if [ "x$D" = "x" ] ; then
|
||||
for busybox_rmdir in /tmp/busyboxrm-*; do
|
||||
if [ "$busybox_rmdir" != '/tmp/busyboxrm-*' ] ; then
|
||||
export PATH=$busybox_rmdir:$PATH
|
||||
if [ -e $busybox_rmdir/busybox* ] ; then
|
||||
BUSYBOX="$busybox_rmdir/busybox*"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst_${PN}_append () {
|
||||
# If busybox exists in the remove directory it is because it was the only shell left.
|
||||
if [ "x$D" = "x" ] ; then
|
||||
if [ "x$BUSYBOX" != "x" ] ; then
|
||||
update-alternatives --remove sh $BUSYBOX
|
||||
rm -f $BUSYBOX
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
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 ${base_bindir}/busybox $tmpdir/[
|
||||
ln -s ${base_bindir}/busybox $tmpdir/test
|
||||
ln -s ${base_bindir}/busybox $tmpdir/head
|
||||
ln -s ${base_bindir}/busybox $tmpdir/sh
|
||||
ln -s ${base_bindir}/busybox $tmpdir/basename
|
||||
ln -s ${base_bindir}/busybox $tmpdir/echo
|
||||
ln -s ${base_bindir}/busybox $tmpdir/mv
|
||||
ln -s ${base_bindir}/busybox $tmpdir/ln
|
||||
ln -s ${base_bindir}/busybox $tmpdir/dirname
|
||||
ln -s ${base_bindir}/busybox $tmpdir/rm
|
||||
ln -s ${base_bindir}/busybox $tmpdir/sed
|
||||
ln -s ${base_bindir}/busybox $tmpdir/sort
|
||||
ln -s ${base_bindir}/busybox $tmpdir/grep
|
||||
ln -s ${base_bindir}/busybox $tmpdir/tail
|
||||
export PATH=$PATH:$tmpdir
|
||||
|
||||
# If busybox is the shell, we need to save it since its the lowest priority shell
|
||||
# Register saved bitbake as the lowest priority shell possible as back up.
|
||||
if [ -n "$(readlink -f /bin/sh | grep busybox)" ] ; then
|
||||
BUSYBOX=$(readlink -f /bin/sh)
|
||||
cp $BUSYBOX $tmpdir/$(basename $BUSYBOX)
|
||||
update-alternatives --install /bin/sh sh $tmpdir/$(basename $BUSYBOX) 1
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postrm_${PN} () {
|
||||
# Add path to remove dir in case we removed our only grep
|
||||
if [ "x$D" = "x" ] ; then
|
||||
for busybox_rmdir in /tmp/busyboxrm-*; do
|
||||
if [ "$busybox_rmdir" != '/tmp/busyboxrm-*' ] ; then
|
||||
export PATH=$busybox_rmdir:$PATH
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links* && [ ! -e $D${base_bindir}/bash ]; then
|
||||
printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_prerm_${PN}-syslog () {
|
||||
# remove syslog
|
||||
if test "x$D" = "x"; then
|
||||
if test "$1" = "upgrade" -o "$1" = "remove"; then
|
||||
${sysconfdir}/init.d/syslog stop || :
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/ash', '', d)}"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Busybox version: 1.29.2
|
||||
# Fri Feb 1 12:10:55 2019
|
||||
# Busybox version: 1.34.0
|
||||
# Wed Aug 23 09:07:25 2021
|
||||
#
|
||||
CONFIG_HAVE_DOT_CONFIG=y
|
||||
|
||||
|
|
@ -24,6 +24,7 @@ CONFIG_FEATURE_UTMP=y
|
|||
CONFIG_FEATURE_PIDFILE=y
|
||||
CONFIG_PID_FILE_PATH="/var/run"
|
||||
CONFIG_BUSYBOX=y
|
||||
# CONFIG_FEATURE_SHOW_SCRIPT is not set
|
||||
CONFIG_FEATURE_INSTALLER=y
|
||||
# CONFIG_INSTALL_NO_USR is not set
|
||||
CONFIG_FEATURE_SUID=y
|
||||
|
|
@ -33,8 +34,8 @@ CONFIG_FEATURE_SUID_CONFIG_QUIET=y
|
|||
CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
|
||||
# CONFIG_SELINUX is not set
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
CONFIG_FEATURE_SYSLOG_INFO=y
|
||||
CONFIG_FEATURE_SYSLOG=y
|
||||
CONFIG_PLATFORM_LINUX=y
|
||||
|
||||
#
|
||||
# Build Options
|
||||
|
|
@ -53,6 +54,7 @@ CONFIG_EXTRA_LDFLAGS=""
|
|||
CONFIG_EXTRA_LDLIBS=""
|
||||
# CONFIG_USE_PORTABLE_CODE is not set
|
||||
# CONFIG_STACK_OPTIMIZATION_386 is not set
|
||||
CONFIG_STATIC_LIBGCC=y
|
||||
|
||||
#
|
||||
# Installation Options ("make install" behavior)
|
||||
|
|
@ -74,6 +76,7 @@ CONFIG_PREFIX="./_install"
|
|||
# CONFIG_DEBUG_SANITIZE is not set
|
||||
# CONFIG_UNIT_TEST is not set
|
||||
# CONFIG_WERROR is not set
|
||||
# CONFIG_WARN_SIMPLE_MSG is not set
|
||||
CONFIG_NO_DEBUG_LIB=y
|
||||
# CONFIG_DMALLOC is not set
|
||||
# CONFIG_EFENCE is not set
|
||||
|
|
@ -82,7 +85,9 @@ CONFIG_NO_DEBUG_LIB=y
|
|||
# Library Tuning
|
||||
#
|
||||
# CONFIG_FEATURE_USE_BSS_TAIL is not set
|
||||
CONFIG_FLOAT_DURATION=y
|
||||
CONFIG_FEATURE_RTMINMAX=y
|
||||
# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set
|
||||
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
|
||||
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
|
||||
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
|
||||
|
|
@ -107,11 +112,11 @@ CONFIG_FEATURE_EDITING_WINCH=y
|
|||
# CONFIG_LOCALE_SUPPORT is not set
|
||||
CONFIG_UNICODE_SUPPORT=y
|
||||
# CONFIG_UNICODE_USING_LOCALE is not set
|
||||
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
|
||||
CONFIG_FEATURE_CHECK_UNICODE_IN_ENV=y
|
||||
CONFIG_SUBST_WCHAR=63
|
||||
CONFIG_LAST_SUPPORTED_WCHAR=767
|
||||
# CONFIG_UNICODE_COMBINING_WCHARS is not set
|
||||
# CONFIG_UNICODE_WIDE_WCHARS is not set
|
||||
CONFIG_UNICODE_COMBINING_WCHARS=y
|
||||
CONFIG_UNICODE_WIDE_WCHARS=y
|
||||
# CONFIG_UNICODE_BIDI_SUPPORT is not set
|
||||
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
|
||||
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
|
||||
|
|
@ -202,10 +207,13 @@ CONFIG_CHOWN=y
|
|||
CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y
|
||||
CONFIG_CHROOT=y
|
||||
CONFIG_CKSUM=y
|
||||
CONFIG_CRC32=y
|
||||
# CONFIG_COMM is not set
|
||||
CONFIG_CP=y
|
||||
CONFIG_FEATURE_CP_LONG_OPTIONS=y
|
||||
# CONFIG_FEATURE_CP_REFLINK is not set
|
||||
CONFIG_CUT=y
|
||||
CONFIG_FEATURE_CUT_REGEX=y
|
||||
CONFIG_DATE=y
|
||||
CONFIG_FEATURE_DATE_ISOFMT=y
|
||||
# CONFIG_FEATURE_DATE_NANO is not set
|
||||
|
|
@ -258,7 +266,7 @@ CONFIG_FEATURE_LS_USERNAME=y
|
|||
# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
|
||||
CONFIG_MD5SUM=y
|
||||
CONFIG_SHA1SUM=y
|
||||
# CONFIG_SHA256SUM is not set
|
||||
CONFIG_SHA256SUM=y
|
||||
# CONFIG_SHA512SUM is not set
|
||||
CONFIG_SHA3SUM=y
|
||||
|
||||
|
|
@ -317,7 +325,6 @@ CONFIG_TEST2=y
|
|||
CONFIG_FEATURE_TEST_64=y
|
||||
CONFIG_TIMEOUT=y
|
||||
CONFIG_TOUCH=y
|
||||
CONFIG_FEATURE_TOUCH_NODEREF=y
|
||||
CONFIG_FEATURE_TOUCH_SUSV3=y
|
||||
CONFIG_TR=y
|
||||
CONFIG_FEATURE_TR_CLASSES=y
|
||||
|
|
@ -332,6 +339,7 @@ CONFIG_UNIQ=y
|
|||
CONFIG_UNLINK=y
|
||||
CONFIG_USLEEP=y
|
||||
CONFIG_UUDECODE=y
|
||||
CONFIG_BASE32=y
|
||||
CONFIG_BASE64=y
|
||||
CONFIG_UUENCODE=y
|
||||
CONFIG_WC=y
|
||||
|
|
@ -370,6 +378,10 @@ CONFIG_FGCONSOLE=y
|
|||
# CONFIG_SETFONT is not set
|
||||
# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
|
||||
CONFIG_DEFAULT_SETFONT_DIR=""
|
||||
|
||||
#
|
||||
# Common options for loadfont and setfont
|
||||
#
|
||||
# CONFIG_FEATURE_LOADFONT_PSF2 is not set
|
||||
# CONFIG_FEATURE_LOADFONT_RAW is not set
|
||||
CONFIG_LOADKMAP=y
|
||||
|
|
@ -420,6 +432,7 @@ CONFIG_VI=y
|
|||
CONFIG_FEATURE_VI_MAX_LEN=4096
|
||||
CONFIG_FEATURE_VI_8BIT=y
|
||||
CONFIG_FEATURE_VI_COLON=y
|
||||
CONFIG_FEATURE_VI_COLON_EXPAND=y
|
||||
CONFIG_FEATURE_VI_YANKMARK=y
|
||||
CONFIG_FEATURE_VI_SEARCH=y
|
||||
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
|
||||
|
|
@ -433,6 +446,7 @@ CONFIG_FEATURE_VI_ASK_TERMINAL=y
|
|||
CONFIG_FEATURE_VI_UNDO=y
|
||||
CONFIG_FEATURE_VI_UNDO_QUEUE=y
|
||||
CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
|
||||
CONFIG_FEATURE_VI_VERBOSE_STATUS=y
|
||||
CONFIG_FEATURE_ALLOW_EXEC=y
|
||||
|
||||
#
|
||||
|
|
@ -444,6 +458,7 @@ CONFIG_FEATURE_FIND_MTIME=y
|
|||
CONFIG_FEATURE_FIND_MMIN=y
|
||||
CONFIG_FEATURE_FIND_PERM=y
|
||||
CONFIG_FEATURE_FIND_TYPE=y
|
||||
CONFIG_FEATURE_FIND_EXECUTABLE=y
|
||||
CONFIG_FEATURE_FIND_XDEV=y
|
||||
CONFIG_FEATURE_FIND_MAXDEPTH=y
|
||||
CONFIG_FEATURE_FIND_NEWER=y
|
||||
|
|
@ -458,6 +473,7 @@ CONFIG_FEATURE_FIND_PAREN=y
|
|||
CONFIG_FEATURE_FIND_SIZE=y
|
||||
CONFIG_FEATURE_FIND_PRUNE=y
|
||||
CONFIG_FEATURE_FIND_DELETE=y
|
||||
CONFIG_FEATURE_FIND_EMPTY=y
|
||||
CONFIG_FEATURE_FIND_PATH=y
|
||||
CONFIG_FEATURE_FIND_REGEX=y
|
||||
# CONFIG_FEATURE_FIND_CONTEXT is not set
|
||||
|
|
@ -536,7 +552,7 @@ CONFIG_FEATURE_SU_SYSLOG=y
|
|||
CONFIG_FEATURE_SU_CHECKS_SHELLS=y
|
||||
# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
|
||||
CONFIG_SULOGIN=y
|
||||
# CONFIG_VLOCK is not set
|
||||
CONFIG_VLOCK=y
|
||||
|
||||
#
|
||||
# Linux Ext2 FS Progs
|
||||
|
|
@ -636,6 +652,7 @@ CONFIG_FEATURE_MDEV_RENAME=y
|
|||
CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
|
||||
CONFIG_FEATURE_MDEV_EXEC=y
|
||||
CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
|
||||
# CONFIG_FEATURE_MDEV_DAEMON is not set
|
||||
# CONFIG_MESG is not set
|
||||
# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
|
||||
# CONFIG_MKE2FS is not set
|
||||
|
|
@ -686,6 +703,7 @@ CONFIG_SWAPOFF=y
|
|||
CONFIG_SWITCH_ROOT=y
|
||||
# CONFIG_TASKSET is not set
|
||||
# CONFIG_FEATURE_TASKSET_FANCY is not set
|
||||
# CONFIG_FEATURE_TASKSET_CPULIST is not set
|
||||
CONFIG_UEVENT=y
|
||||
CONFIG_UMOUNT=y
|
||||
CONFIG_FEATURE_UMOUNT_ALL=y
|
||||
|
|
@ -706,6 +724,7 @@ CONFIG_VOLUMEID=y
|
|||
# CONFIG_FEATURE_VOLUMEID_BCACHE is not set
|
||||
CONFIG_FEATURE_VOLUMEID_BTRFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_CRAMFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_EROFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_EXFAT=y
|
||||
CONFIG_FEATURE_VOLUMEID_EXT=y
|
||||
CONFIG_FEATURE_VOLUMEID_F2FS=y
|
||||
|
|
@ -733,8 +752,15 @@ CONFIG_FEATURE_VOLUMEID_XFS=y
|
|||
# Miscellaneous Utilities
|
||||
#
|
||||
CONFIG_ADJTIMEX=y
|
||||
CONFIG_ASCII=y
|
||||
CONFIG_BBCONFIG=y
|
||||
CONFIG_FEATURE_COMPRESS_BBCONFIG=y
|
||||
# CONFIG_BC is not set
|
||||
CONFIG_DC=y
|
||||
# CONFIG_FEATURE_DC_BIG is not set
|
||||
# CONFIG_FEATURE_DC_LIBM is not set
|
||||
# CONFIG_FEATURE_BC_INTERACTIVE is not set
|
||||
# CONFIG_FEATURE_BC_LONG_OPTIONS is not set
|
||||
# CONFIG_BEEP is not set
|
||||
CONFIG_FEATURE_BEEP_FREQ=0
|
||||
CONFIG_FEATURE_BEEP_LENGTH_MS=0
|
||||
|
|
@ -798,6 +824,7 @@ CONFIG_MAKEDEVS=y
|
|||
CONFIG_FEATURE_MAKEDEVS_TABLE=y
|
||||
# CONFIG_MAN is not set
|
||||
CONFIG_MICROCOM=y
|
||||
# CONFIG_MIM is not set
|
||||
# CONFIG_MT is not set
|
||||
CONFIG_NANDWRITE=y
|
||||
CONFIG_NANDDUMP=y
|
||||
|
|
@ -811,6 +838,7 @@ CONFIG_RX=y
|
|||
CONFIG_SETSERIAL=y
|
||||
CONFIG_STRINGS=y
|
||||
CONFIG_TIME=y
|
||||
CONFIG_TS=y
|
||||
CONFIG_TTYSIZE=y
|
||||
CONFIG_UBIATTACH=y
|
||||
CONFIG_UBIDETACH=y
|
||||
|
|
@ -821,6 +849,7 @@ CONFIG_UBIUPDATEVOL=y
|
|||
CONFIG_UBIRENAME=y
|
||||
# CONFIG_VOLNAME is not set
|
||||
CONFIG_WATCHDOG=y
|
||||
# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set
|
||||
|
||||
#
|
||||
# Networking Utilities
|
||||
|
|
@ -857,6 +886,10 @@ CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
|
|||
CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
|
||||
CONFIG_FEATURE_HTTPD_PROXY=y
|
||||
CONFIG_FEATURE_HTTPD_GZIP=y
|
||||
CONFIG_FEATURE_HTTPD_ETAG=y
|
||||
CONFIG_FEATURE_HTTPD_LAST_MODIFIED=y
|
||||
CONFIG_FEATURE_HTTPD_DATE=y
|
||||
CONFIG_FEATURE_HTTPD_ACL_IP=y
|
||||
CONFIG_IFCONFIG=y
|
||||
CONFIG_FEATURE_IFCONFIG_STATUS=y
|
||||
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
|
||||
|
|
@ -936,11 +969,8 @@ CONFIG_FEATURE_TELNETD_STANDALONE=y
|
|||
# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
|
||||
CONFIG_TFTP=y
|
||||
# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
|
||||
CONFIG_FEATURE_TFTP_HPA_COMPAT=y
|
||||
CONFIG_TFTPD=y
|
||||
|
||||
#
|
||||
# Common options for tftp/tftpd
|
||||
#
|
||||
CONFIG_FEATURE_TFTP_GET=y
|
||||
CONFIG_FEATURE_TFTP_PUT=y
|
||||
CONFIG_FEATURE_TFTP_BLOCKSIZE=y
|
||||
|
|
@ -956,6 +986,7 @@ CONFIG_TLS=y
|
|||
CONFIG_WGET=y
|
||||
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
|
||||
CONFIG_FEATURE_WGET_STATUSBAR=y
|
||||
CONFIG_FEATURE_WGET_FTP=y
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
CONFIG_FEATURE_WGET_TIMEOUT=y
|
||||
CONFIG_FEATURE_WGET_HTTPS=y
|
||||
|
|
@ -984,7 +1015,7 @@ CONFIG_UDHCPC6=y
|
|||
# CONFIG_FEATURE_UDHCP_PORT is not set
|
||||
CONFIG_UDHCP_DEBUG=0
|
||||
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
|
||||
# CONFIG_FEATURE_UDHCP_RFC3397 is not set
|
||||
CONFIG_FEATURE_UDHCP_RFC3397=y
|
||||
CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
|
||||
|
||||
|
|
@ -1090,6 +1121,7 @@ CONFIG_SH_IS_ASH=y
|
|||
# CONFIG_BASH_IS_ASH is not set
|
||||
# CONFIG_BASH_IS_HUSH is not set
|
||||
CONFIG_BASH_IS_NONE=y
|
||||
CONFIG_SHELL_ASH=y
|
||||
CONFIG_ASH=y
|
||||
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_ASH_INTERNAL_GLOB=y
|
||||
|
|
@ -1110,6 +1142,7 @@ CONFIG_ASH_GETOPTS=y
|
|||
CONFIG_ASH_CMDCMD=y
|
||||
CONFIG_CTTYHACK=y
|
||||
# CONFIG_HUSH is not set
|
||||
# CONFIG_SHELL_HUSH is not set
|
||||
# CONFIG_HUSH_BASH_COMPAT is not set
|
||||
# CONFIG_HUSH_BRACE_EXPANSION is not set
|
||||
# CONFIG_HUSH_LINENO_VAR is not set
|
||||
|
|
@ -1152,6 +1185,7 @@ CONFIG_CTTYHACK=y
|
|||
#
|
||||
CONFIG_FEATURE_SH_MATH=y
|
||||
# CONFIG_FEATURE_SH_MATH_64 is not set
|
||||
CONFIG_FEATURE_SH_MATH_BASE=y
|
||||
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
|
||||
# CONFIG_FEATURE_SH_STANDALONE is not set
|
||||
# CONFIG_FEATURE_SH_NOFORK is not set
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
require busybox.inc
|
||||
|
||||
SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
|
||||
file://busybox-udhcpc-no_deconfig.patch \
|
||||
file://find-touchscreen.sh \
|
||||
file://busybox-cron \
|
||||
file://busybox-httpd \
|
||||
file://busybox-udhcpd \
|
||||
file://default.script \
|
||||
file://simple.script \
|
||||
file://hwclock.sh \
|
||||
file://syslog \
|
||||
file://syslog-startup.conf \
|
||||
file://syslog.conf \
|
||||
file://busybox-syslog.default \
|
||||
file://mdev \
|
||||
file://mdev.conf \
|
||||
file://mdev-mount.sh \
|
||||
file://defconfig \
|
||||
file://busybox-syslog.service.in \
|
||||
file://busybox-klogd.service.in \
|
||||
file://fail_on_no_media.patch \
|
||||
file://run-ptest \
|
||||
file://inetd.conf \
|
||||
file://inetd \
|
||||
file://login-utilities.cfg \
|
||||
file://recognize_connmand.patch \
|
||||
file://busybox-cross-menuconfig.patch \
|
||||
file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
|
||||
file://mount-via-label.cfg \
|
||||
file://sha1sum.cfg \
|
||||
file://sha256sum.cfg \
|
||||
file://getopts.cfg \
|
||||
file://longopts.cfg \
|
||||
file://resize.cfg \
|
||||
${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]} \
|
||||
${@["", "file://rcS.default"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]} \
|
||||
${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager') == 'busybox-mdev')]} \
|
||||
file://syslog.cfg \
|
||||
file://unicode.cfg \
|
||||
file://rev.cfg \
|
||||
file://pgrep.cfg \
|
||||
file://rcS \
|
||||
file://rcK \
|
||||
file://makefile-libbb-race.patch \
|
||||
file://0001-testsuite-check-uudecode-before-using-it.patch \
|
||||
file://0001-testsuite-use-www.example.org-for-wget-test-cases.patch \
|
||||
file://0001-du-l-works-fix-to-use-145-instead-of-144.patch \
|
||||
file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \
|
||||
file://0001-mktemp-add-tmpdir-option.patch \
|
||||
"
|
||||
SRC_URI_append_libc-musl = " file://musl.cfg "
|
||||
|
||||
SRC_URI[tarball.sha256sum] = "415fbd89e5344c96acf449d94a6f956dbed62e18e835fc83e064db33a34bd549"
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
[Unit]
|
||||
Description=Kernel Logging Service
|
||||
|
||||
[Service]
|
||||
ExecStart=@base_sbindir@/klogd -n
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#OPTIONS="-C"
|
||||
# The above option means syslogd will log to 16K shm circular buffer.
|
||||
# You could use `logread' to read it.
|
||||
|
||||
# All available options are:
|
||||
# -O FILE : Log to FILE (default:/var/log/messages)
|
||||
# -l N : Log only messages more urgent than prio N (1-8)
|
||||
# -S : Smaller output
|
||||
# -s SIZE : Max size (KB) before rotation (default:200KB, 0=off)
|
||||
# -b N : N rotated logs to keep (default:1, max=99, 0=purge)
|
||||
# -R HOST[:PORT]: Log to HOST:PORT (default PORT:514)
|
||||
# -L : Log locally and via network
|
||||
# -D : Drop duplicates
|
||||
# -C[size_kb] : Log to shared mem buffer (use logread to read it)
|
||||
# -f FILE : Use FILE as config (default:/etc/syslog.conf)
|
||||
# -m MIN : Minutes between mark lines (default:20, 0=off)
|
||||
# -K : Log to kernel printk buffer (use dmesg to read it)
|
||||
|
||||
# Example 1:
|
||||
# Log to local file /var/log/mylog
|
||||
# OPTIONS="-O /var/log/mylog"
|
||||
#
|
||||
# Example 2:
|
||||
# Log to remote host
|
||||
# OPTIONS="-R 192.168.1.1:601"
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=System Logging Service
|
||||
Wants=busybox-klogd.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/default/busybox-syslog
|
||||
ExecStart=@base_sbindir@/syslogd -n $OPTIONS
|
||||
Sockets=syslog.socket
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Also=busybox-klogd.service
|
||||
Alias=syslog.service
|
||||
|
|
@ -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,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
if grep -q "input:.*-e0.*,3,.*a0,1,\|ads7846" /sys/class/$MDEV/device/modalias ; then
|
||||
ln -sf /dev/$MDEV /dev/input/touchscreen0
|
||||
fi
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# start/stop inetd super server.
|
||||
|
||||
if ! [ -x /usr/sbin/inetd ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting internet superserver:"
|
||||
echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping internet superserver:"
|
||||
echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
|
||||
echo "."
|
||||
;;
|
||||
restart)
|
||||
echo -n "Restarting internet superserver:"
|
||||
echo -n " inetd "
|
||||
killall -HUP inetd
|
||||
echo "."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/inetd {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# /etc/inetd.conf: see inetd(8) for further informations.
|
||||
#
|
||||
# Internet server configuration database
|
||||
#
|
||||
# If you want to disable an entry so it isn't touched during
|
||||
# package updates just comment it out with a single '#' character.
|
||||
#
|
||||
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
|
||||
#
|
||||
#:INTERNAL: Internal services
|
||||
#echo stream tcp nowait root internal
|
||||
#echo dgram udp wait root internal
|
||||
#chargen stream tcp nowait root internal
|
||||
#chargen dgram udp wait root internal
|
||||
#discard stream tcp nowait root internal
|
||||
#discard dgram udp wait root internal
|
||||
#daytime stream tcp nowait root internal
|
||||
#daytime dgram udp wait root internal
|
||||
#time stream tcp nowait root internal
|
||||
#time dgram udp wait root internal
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# This is run first except when booting in single-user mode.
|
||||
|
||||
# Startup the system
|
||||
::sysinit:/bin/mount -t proc proc /proc
|
||||
::sysinit:/bin/mount -t sysfs sysfs /sys
|
||||
::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
|
||||
::sysinit:/bin/mount -o remount,rw /
|
||||
::sysinit:/bin/mkdir -p /dev/pts
|
||||
::sysinit:/bin/mount -t devpts devpts /dev/pts
|
||||
::sysinit:/bin/mount -a
|
||||
::sysinit:/sbin/swapon -a
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
|
||||
# set hostname
|
||||
null::sysinit:/bin/busybox hostname -F /etc/hostname
|
||||
::sysinit:/etc/init.d/rcS
|
||||
|
||||
# Stuff to do before rebooting
|
||||
#::ctrlaltdel:/sbin/reboot
|
||||
::shutdown:/etc/init.d/rcK
|
||||
::shutdown:/sbin/swapoff -a
|
||||
::shutdown:/bin/umount -a -r
|
||||
|
||||
# Stuff to do when restarting the init process
|
||||
::restart:/sbin/init
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Run the mdev daemon
|
||||
#
|
||||
|
||||
DAEMON="mdev"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
|
||||
start() {
|
||||
echo -n "Starting $DAEMON... "
|
||||
start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/mdev -- -df
|
||||
[ $? -eq 0 ] && echo "OK" || echo "ERROR"
|
||||
|
||||
# coldplug modules
|
||||
find /sys/ -name modalias -print0 | \
|
||||
xargs -0 sort -u | \
|
||||
tr '\n' '\0' | \
|
||||
xargs -0 modprobe -abq
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n "Stopping $DAEMON... "
|
||||
start-stop-daemon -K -p $PIDFILE
|
||||
[ $? -eq 0 ] && echo "OK" || echo "ERROR"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
#!/bin/sh
|
||||
MDEV_AUTOMOUNT=y
|
||||
MDEV_AUTOMOUNT_ROOT=/run/media
|
||||
[ -f /etc/default/mdev ] && . /etc/default/mdev
|
||||
if [ "${MDEV_AUTOMOUNT}" = "n" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$ACTION" in
|
||||
add|"")
|
||||
ACTION="add"
|
||||
# check if already mounted
|
||||
if grep -q "^/dev/${MDEV} " /proc/mounts ; then
|
||||
# Already mounted
|
||||
exit 0
|
||||
fi
|
||||
DEVBASE=`expr substr $MDEV 1 3`
|
||||
if [ "${DEVBASE}" = "mmc" ] ; then
|
||||
DEVBASE=`expr substr $MDEV 1 7`
|
||||
fi
|
||||
# check for "please don't mount it" file
|
||||
if [ -f "/dev/nomount.${DEVBASE}" ] ; then
|
||||
# blocked
|
||||
exit 0
|
||||
fi
|
||||
# check for full-disk partition
|
||||
if [ "${DEVBASE}" = "${MDEV}" ] ; then
|
||||
if [ -f /sys/block/${DEVBASE}/${DEVBASE}*1/partition ] ; then
|
||||
# Partition detected, just quit
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f /sys/block/${DEVBASE}/size ] ; then
|
||||
# No size at all
|
||||
exit 0
|
||||
fi
|
||||
if [ "`cat /sys/block/${DEVBASE}/size`" = "0" ] ; then
|
||||
# empty device, bail out
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
# first allow fstab to determine the mountpoint
|
||||
if ! mount /dev/$MDEV > /dev/null 2>&1
|
||||
then
|
||||
MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
|
||||
mkdir -p "$MOUNTPOINT"
|
||||
mount -t auto /dev/$MDEV "$MOUNTPOINT" || rmdir "$MOUNTPOINT"
|
||||
fi
|
||||
;;
|
||||
remove)
|
||||
MOUNTPOINT=`grep "^/dev/$MDEV\s" /proc/mounts | cut -d' ' -f 2`
|
||||
if [ ! -z "$MOUNTPOINT" ]
|
||||
then
|
||||
umount "$MOUNTPOINT"
|
||||
rmdir "$MOUNTPOINT"
|
||||
else
|
||||
umount /dev/$MDEV
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Unexpected keyword
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"
|
||||
|
||||
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
|
||||
|
||||
snd/pcm.* 0:0 0660
|
||||
snd/control.* 0:0 0660
|
||||
snd/timer 0:0 0660
|
||||
snd/seq 0:0 0660
|
||||
snd/mini.* 0:00 0660
|
||||
|
||||
input/event.* 0:0 0660 @/etc/mdev/find-touchscreen.sh
|
||||
input/mice 0:0 0660
|
||||
input/mouse.* 0:0 0660
|
||||
|
||||
tun[0-9]* 0:0 0660 =net/
|
||||
|
||||
[hs]d[a-z][0-9]? 0:0 660 */etc/mdev/mdev-mount.sh
|
||||
mmcblk[0-9]rpmb 0:0 660
|
||||
mmcblk[0-9]boot[0-9] 0:0 660
|
||||
mmcblk[0-9].* 0:0 660 */etc/mdev/mdev-mount.sh
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Stop all init scripts in /etc/rc6.d
|
||||
# executing them in numerical order.
|
||||
#
|
||||
for i in /etc/rc6.d/K??*; do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set stop
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i stop
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Start all init scripts in /etc/rcS.d and /etc/rc5.d
|
||||
# executing them in numerical order.
|
||||
#
|
||||
|
||||
for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set start
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i start
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
#
|
||||
# Defaults for the boot scripts in /etc/rcS.d
|
||||
#
|
||||
|
||||
# Time files in /tmp are kept in days.
|
||||
TMPTIME=0
|
||||
# Set to yes if you want sulogin to be spawned on bootup
|
||||
SULOGIN=no
|
||||
# Set to no if you want to be able to login over telnet/rlogin
|
||||
# before system startup is complete (as soon as inetd is started)
|
||||
DELAYLOGIN=no
|
||||
# Assume that the BIOS clock is set to UTC time (recommended)
|
||||
UTC=yes
|
||||
# Set VERBOSE to "no" if you would like a more quiet bootup.
|
||||
VERBOSE=no
|
||||
# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
|
||||
EDITMOTD=no
|
||||
# Whether to fsck root on boot
|
||||
ENABLE_ROOTFS_FSCK=no
|
||||
# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
|
||||
FSCKFIX=yes
|
||||
# Set TICKADJ to the correct tick value for this specific machine
|
||||
#TICKADJ=10000
|
||||
# Enable caching in populate-volatile.sh
|
||||
VOLATILE_ENABLE_CACHE=yes
|
||||
# Indicate whether the rootfs is intended to be read-only or not.
|
||||
# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
|
||||
# Normally you should not change this value.
|
||||
ROOTFS_READ_ONLY=no
|
||||
# Indicate init system type
|
||||
INIT_SYSTEM=busybox
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
current_path=$(readlink -f $0)
|
||||
export bindir=$(dirname $current_path)
|
||||
export PATH=$bindir/bin:$PATH
|
||||
export SKIP_KNOWN_BUGS=1
|
||||
|
||||
cd testsuite || exit 1
|
||||
LANG=C.UTF-8 ./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/'
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
#!/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 "$subnet" ] && NETMASK="netmask $subnet"
|
||||
|
||||
# return 0 if root is mounted on a network filesystem
|
||||
root_is_nfs() {
|
||||
sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
|
||||
grep -q "^/ \(nfs\|smbfs\|ncp\|coda\)$"
|
||||
}
|
||||
|
||||
have_bin_ip=0
|
||||
if [ -x /SBIN_DIR/ip ]; then
|
||||
have_bin_ip=1
|
||||
BROADCAST="broadcast +"
|
||||
fi
|
||||
|
||||
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
|
||||
|
||||
case "$1" in
|
||||
deconfig)
|
||||
if [ -x /SBIN_DIR/resolvconf ]; then
|
||||
/SBIN_DIR/resolvconf -d "${interface}.udhcpc"
|
||||
fi
|
||||
if ! root_is_nfs ; then
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
/SBIN_DIR/ip -4 addr flush dev $interface
|
||||
/SBIN_DIR/ip link set dev $interface up
|
||||
else
|
||||
/SBIN_DIR/ifconfig $interface 0.0.0.0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
renew|bound)
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
/SBIN_DIR/ip addr add dev $interface local $ip/$mask $BROADCAST
|
||||
else
|
||||
/SBIN_DIR/ifconfig $interface $ip $BROADCAST $NETMASK
|
||||
fi
|
||||
|
||||
if [ -n "$router" ] ; then
|
||||
if ! root_is_nfs ; then
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
while /SBIN_DIR/ip route del default dev $interface 2>/dev/null ; do
|
||||
:
|
||||
done
|
||||
else
|
||||
while /SBIN_DIR/route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
|
||||
:
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
metric=10
|
||||
for i in $router ; do
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
/SBIN_DIR/ip route add default via $i metric $metric dev $interface
|
||||
else
|
||||
/SBIN_DIR/route add default gw $i dev $interface metric $metric 2>/dev/null
|
||||
fi
|
||||
metric=$(($metric + 1))
|
||||
done
|
||||
fi
|
||||
|
||||
# Update resolver configuration file
|
||||
R=""
|
||||
[ -n "$domain" ] && R="domain $domain
|
||||
"
|
||||
for i in $dns; do
|
||||
echo "$0: Adding DNS $i"
|
||||
R="${R}nameserver $i
|
||||
"
|
||||
done
|
||||
|
||||
if [ -x /SBIN_DIR/resolvconf ]; then
|
||||
echo -n "$R" | /SBIN_DIR/resolvconf -a "${interface}.udhcpc"
|
||||
else
|
||||
echo -n "$R" > "$RESOLV_CONF"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
#! /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
|
||||
LOG_LOCAL=1
|
||||
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
|
||||
|
||||
waitpid ()
|
||||
{
|
||||
pid=$1
|
||||
# Give pid a chance to exit before we restart with a 5s timeout in 1s intervals
|
||||
if [ -z "$pid" ]; then
|
||||
return
|
||||
fi
|
||||
timeout=5;
|
||||
while [ $timeout -gt 0 ]
|
||||
do
|
||||
timeout=$(( $timeout-1 ))
|
||||
kill -0 $pid 2> /dev/null || break
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
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)
|
||||
pid1=`pidof syslogd`
|
||||
pid2=`pidof klogd`
|
||||
$0 stop
|
||||
waitpid $pid1
|
||||
waitpid $pid2
|
||||
$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)
|
||||
|
|
@ -0,0 +1 @@
|
|||
# /etc/syslog.conf Configuration file for busybox's syslogd utility
|
||||
Loading…
Reference in New Issue