Commit 6525b7aa authored by Natanael Copa's avatar Natanael Copa

main/busybox: upgrade to 1.25.0

parent 8b04cc51
From c0eb20351d14932c5535789bce0251ab8718df77 Mon Sep 17 00:00:00 2001
From: Ron Yorston <rmy@pobox.com>
Date: Thu, 29 Oct 2015 11:31:39 +0000
Subject: [PATCH] ash: backport fix for here document issues
Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Ron Yorston <rmy@pobox.com>
---
shell/ash.c | 72 +++++++++++++------------------
shell/ash_test/ash-heredoc/heredoc2.right | 2 +
shell/ash_test/ash-heredoc/heredoc2.tests | 7 +++
3 files changed, 39 insertions(+), 42 deletions(-)
create mode 100644 shell/ash_test/ash-heredoc/heredoc2.right
create mode 100644 shell/ash_test/ash-heredoc/heredoc2.tests
diff --git a/shell/ash.c b/shell/ash.c
index 8a1628e..f13dd2a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -10516,7 +10516,7 @@ static union node *andor(void);
static union node *pipeline(void);
static union node *parse_command(void);
static void parseheredoc(void);
-static char nexttoken_ends_list(void);
+static int peektoken(void);
static int readtoken(void);
static union node *
@@ -10525,11 +10525,27 @@ list(int nlflag)
union node *n1, *n2, *n3;
int tok;
- checkkwd = CHKNL | CHKKWD | CHKALIAS;
- if (nlflag == 2 && nexttoken_ends_list())
- return NULL;
n1 = NULL;
for (;;) {
+ switch (peektoken()) {
+ case TNL:
+ if (!(nlflag & 1))
+ break;
+ parseheredoc();
+ return n1;
+
+ case TEOF:
+ if (!n1 && (nlflag & 1))
+ n1 = NODE_EOF;
+ parseheredoc();
+ return n1;
+ }
+
+ checkkwd = CHKNL | CHKKWD | CHKALIAS;
+ if (nlflag == 2 && tokname_array[peektoken()][0])
+ return n1;
+ nlflag |= 2;
+
n2 = andor();
tok = readtoken();
if (tok == TBACKGND) {
@@ -10555,37 +10571,15 @@ list(int nlflag)
n1 = n3;
}
switch (tok) {
+ case TNL:
+ case TEOF:
+ tokpushback = 1;
+ /* fall through */
case TBACKGND:
case TSEMI:
- tok = readtoken();
- /* fall through */
- case TNL:
- if (tok == TNL) {
- parseheredoc();
- if (nlflag == 1)
- return n1;
- } else {
- tokpushback = 1;
- }
- checkkwd = CHKNL | CHKKWD | CHKALIAS;
- if (nexttoken_ends_list()) {
- /* Testcase: "<<EOF; then <W".
- * It used to segfault w/o this check:
- */
- if (heredoclist) {
- raise_error_unexpected_syntax(-1);
- }
- return n1;
- }
break;
- case TEOF:
- if (heredoclist)
- parseheredoc();
- else
- pungetc(); /* push back EOF on input */
- return n1;
default:
- if (nlflag == 1)
+ if ((nlflag & 1))
raise_error_unexpected_syntax(-1);
tokpushback = 1;
return n1;
@@ -11954,14 +11948,14 @@ readtoken(void)
return t;
}
-static char
-nexttoken_ends_list(void)
+static int
+peektoken(void)
{
int t;
t = readtoken();
tokpushback = 1;
- return tokname_array[t][0];
+ return t;
}
/*
@@ -11971,18 +11965,12 @@ nexttoken_ends_list(void)
static union node *
parsecmd(int interact)
{
- int t;
-
tokpushback = 0;
+ checkkwd = 0;
+ heredoclist = 0;
doprompt = interact;
setprompt_if(doprompt, doprompt);
needprompt = 0;
- t = readtoken();
- if (t == TEOF)
- return NODE_EOF;
- if (t == TNL)
- return NULL;
- tokpushback = 1;
return list(1);
}
diff --git a/shell/ash_test/ash-heredoc/heredoc2.right b/shell/ash_test/ash-heredoc/heredoc2.right
new file mode 100644
index 0000000..a486f1a
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc2.right
@@ -0,0 +1,2 @@
+bar
+bar
diff --git a/shell/ash_test/ash-heredoc/heredoc2.tests b/shell/ash_test/ash-heredoc/heredoc2.tests
new file mode 100644
index 0000000..6d9ccb6
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc2.tests
@@ -0,0 +1,7 @@
+foo () {
+cat <<EOF && { echo "$1" ; }
+$1
+EOF
+}
+
+foo "bar"
--
2.6.1
diff -ru busybox-1.11.1.orig/shell/ash.c busybox-1.11.1/shell/ash.c
--- busybox-1.11.1.orig/shell/ash.c 2008-07-28 09:04:29 +0000
+++ busybox-1.11.1/shell/ash.c 2008-07-28 09:09:21 +0000
@@ -6873,6 +6873,8 @@
run_applet_no_and_exit(applet_no, argv);
From 1e3c84d780b94719575dc8afbe4a08050596a6d8 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 4 Aug 2016 11:03:07 +0200
Subject: [PATCH 01/15] ash: exec busybox.static
---
shell/ash.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/shell/ash.c b/shell/ash.c
index faa45a8..1348ece 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7380,6 +7380,8 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **
}
/* re-exec ourselves with the new arguments */
execve(bb_busybox_exec_path, argv, envp);
+ execve("/bin/busybox.static",argv,envp);
......@@ -10,3 +20,6 @@ diff -ru busybox-1.11.1.orig/shell/ash.c busybox-1.11.1/shell/ash.c
/* If they called chroot or otherwise made the binary no longer
* executable, fall through */
}
--
2.9.1
From 0df7bfd74aadd258d040c25fbe9e63d0298fa63b Mon Sep 17 00:00:00 2001
From: Ron Yorston <rmy@pobox.com>
Date: Thu, 29 Oct 2015 16:44:56 +0000
Subject: [PATCH] ash: fix error during recursive processing of here document
Save the value of the checkkwd flag to prevent it being clobbered
during recursion.
Based on commit ec2c84d from git://git.kernel.org/pub/scm/utils/dash/dash.git
by Herbert Xu.
function old new delta
readtoken 190 203 +13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0) Total: 13 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
---
shell/ash.c | 5 +++--
shell/ash_test/ash-heredoc/heredoc3.right | 1 +
shell/ash_test/ash-heredoc/heredoc3.tests | 9 +++++++++
3 files changed, 13 insertions(+), 2 deletions(-)
create mode 100644 shell/ash_test/ash-heredoc/heredoc3.right
create mode 100755 shell/ash_test/ash-heredoc/heredoc3.tests
diff --git a/shell/ash.c b/shell/ash.c
index f13dd2a..753eacf 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -11887,6 +11887,7 @@ static int
readtoken(void)
{
int t;
+ int kwd = checkkwd;
#if DEBUG
smallint alreadyseen = tokpushback;
#endif
@@ -11900,7 +11901,7 @@ readtoken(void)
/*
* eat newlines
*/
- if (checkkwd & CHKNL) {
+ if (kwd & CHKNL) {
while (t == TNL) {
parseheredoc();
t = xxreadtoken();
@@ -11914,7 +11915,7 @@ readtoken(void)
/*
* check for keywords
*/
- if (checkkwd & CHKKWD) {
+ if (kwd & CHKKWD) {
const char *const *pp;
pp = findkwd(wordtext);
diff --git a/shell/ash_test/ash-heredoc/heredoc3.right b/shell/ash_test/ash-heredoc/heredoc3.right
new file mode 100644
index 0000000..ce01362
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc3.right
@@ -0,0 +1 @@
+hello
diff --git a/shell/ash_test/ash-heredoc/heredoc3.tests b/shell/ash_test/ash-heredoc/heredoc3.tests
new file mode 100755
index 0000000..96c227c
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc3.tests
@@ -0,0 +1,9 @@
+echo hello >greeting
+cat <<EOF &&
+$(cat greeting)
+EOF
+{
+ echo $?
+ cat greeting
+} >/dev/null
+rm greeting
--
2.6.1
From 028524317d8d0011ed38e86e507a06738a5b5a97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Mon, 26 Oct 2015 17:06:12 +0100
Subject: [PATCH] ifupdown: pass interface device name for ipv6 route commands
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
IPv6 routes need the device argument for link-local routes, or they
cannot be used at all. E.g. "gateway fe80::def" seems to be used in
some places, but kernel refuses to insert the route unless device
name is explicitly specified in the route addition.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
networking/ifupdown.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 7c45e89..d477ff6 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -394,8 +394,8 @@ static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec)
# if ENABLE_FEATURE_IFUPDOWN_IP
result = execute("ip addr add %address%/%netmask% dev %iface%[[ label %label%]]", ifd, exec);
result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec);
- /* Was: "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking */
- result += execute("[[ip route add ::/0 via %gateway%]][[ metric %metric%]]", ifd, exec);
+ /* Reportedly, IPv6 needs "dev %iface%", but IPv4 does not: */
+ result += execute("[[ip route add ::/0 via %gateway% dev %iface%]][[ metric %metric%]]", ifd, exec);
# else
result = execute("ifconfig %iface%[[ media %media%]][[ hw %hwaddress%]][[ mtu %mtu%]] up", ifd, exec);
result += execute("ifconfig %iface% add %address%/%netmask%", ifd, exec);
@@ -421,7 +421,8 @@ static int FAST_FUNC v4tunnel_up(struct interface_defn_t *ifd, execfn *exec)
"%endpoint%[[ local %local%]][[ ttl %ttl%]]", ifd, exec);
result += execute("ip link set %iface% up", ifd, exec);
result += execute("ip addr add %address%/%netmask% dev %iface%", ifd, exec);
- result += execute("[[ip route add ::/0 via %gateway%]]", ifd, exec);
+ /* Reportedly, IPv6 needs "dev %iface%", but IPv4 does not: */
+ result += execute("[[ip route add ::/0 via %gateway% dev %iface%]]", ifd, exec);
return ((result == 4) ? 4 : 0);
}
--
2.6.1
From ad69a8dea4fff640a7e1dcfa78d0ea96eb201ec4 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 19 Sep 2012 15:53:02 +0200
Subject: [PATCH] ifupdown: use -x hostname:NAME with udhcpc
The -H NAME is deprecated in udhcpc. See commit
2017d48c0d70bef8768efb42909e605ea8eb5a21
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
networking/ifupdown.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index ad0a997..6eb3570 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -540,7 +540,7 @@ static const struct dhcp_client_t ext_dhcp_clients[] = {
"pump -i %iface% -k",
},
{ "udhcpc",
- "udhcpc " UDHCPC_CMD_OPTIONS " -p /var/run/udhcpc.%iface%.pid -i %iface%[[ -H %hostname%]][[ -c %client%]]"
+ "udhcpc " UDHCPC_CMD_OPTIONS " -p /var/run/udhcpc.%iface%.pid -i %iface%[[ -x hostname:%hostname%]][[ -c %client%]]"
"[[ -s %script%]][[ %udhcpc_opts%]]",
"kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null",
},
@@ -580,7 +580,7 @@ static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec)
return 0;
# endif
return execute("udhcpc " UDHCPC_CMD_OPTIONS " -p /var/run/udhcpc.%iface%.pid "
- "-i %iface%[[ -H %hostname%]][[ -c %client%]][[ -s %script%]][[ %udhcpc_opts%]]",
+ "-i %iface%[[ -x hostname:%hostname%]][[ -c %client%]][[ -s %script%]][[ %udhcpc_opts%]]",
ifd, exec);
}
# else
--
1.7.12
From c9ee7417d8d838c16bc2c270d4dbb5fdb9c8b786 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 19 May 2016 16:17:32 +0200
Subject: [PATCH] libbb: fix time parsing of [[CC]YY]MMDDhhmm[.SS]
If SS is not given a value, it is assumed to be zero.
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html
closes 8951
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
libbb/time.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libbb/time.c b/libbb/time.c
index aa19a47..82e6cb1 100644
--- a/libbb/time.c
+++ b/libbb/time.c
@@ -186,6 +186,7 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm)
} else {
bb_error_msg_and_die(bb_msg_invalid_date, date_str);
}
+ ptm->tm_sec = 0; /* assume zero if [.SS] is not given */
if (end == '.') {
/* xxx.SS */
if (sscanf(strchr(date_str, '.') + 1, "%u%c",
--
2.8.2
From 0dab6f340920d1e5c61bda6640205a9e376b9a97 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 4 Aug 2016 11:05:02 +0200
Subject: [PATCH 02/15] set applet location to correspond to upstream for vi
and lspci
---
editors/vi.c | 2 +-
include/applets.src.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/editors/vi.c b/editors/vi.c
index 974f997..05d39ea 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -166,7 +166,7 @@
//config: Unless you want more (or less) frequent "undo points" while typing,
//config: you should probably leave this unchanged.
-//applet:IF_VI(APPLET(vi, BB_DIR_BIN, BB_SUID_DROP))
+//applet:IF_VI(APPLET(vi, BB_DIR_USR_BIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_VI) += vi.o
diff --git a/include/applets.src.h b/include/applets.src.h
index 6e1b02f..03ee70d 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -199,7 +199,7 @@ IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname))
IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP))
IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls))
-IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP))
+IF_LSPCI(APPLET(lspci, BB_DIR_USR_SBIN, BB_SUID_DROP))
IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP))
IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP))
--
2.9.1
From c5a44a23ce9b2893c6a5b6e037c4c1cc5aa543a5 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 4 Aug 2016 11:08:35 +0200
Subject: [PATCH 03/15] udhcpc: set default discover retries to 5
Some slower nics needs more attempts to get a lease
---
networking/udhcp/dhcpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- ./networking/udhcp/dhcpc.c.orig
+++ ./networking/udhcp/dhcpc.c
@@ -1238,7 +1238,7 @@
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index fc7b621..ada6142 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1255,7 +1255,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
llist_t *list_x = NULL;
int tryagain_timeout = 20;
int discover_timeout = 3;
......@@ -11,3 +21,6 @@ Some slower nics needs more attempts to get a lease
uint32_t server_addr = server_addr; /* for compiler */
uint32_t requested_ip = 0;
uint32_t xid = xid; /* for compiler */
--
2.9.1
From 8fa06464b2c1cb80553a0f47b47503cf231d64d8 Mon Sep 17 00:00:00 2001
From dc3cf4277f672ed1ce567c6915e28341e7963380 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 29 Mar 2016 18:59:22 +0200
Subject: [PATCH] ping: make ping work without root privileges
Subject: [PATCH 04/15] ping: make ping work without root privileges
---
networking/ping.c | 103 +++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 87 insertions(+), 16 deletions(-)
diff --git a/networking/ping.c b/networking/ping.c
index dcbf196..1d96790 100644
index cfe6826..e4474ae 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -154,6 +154,7 @@ enum {
@@ -155,6 +155,7 @@ enum {
pingsock = 0,
};
......@@ -19,7 +19,7 @@ index dcbf196..1d96790 100644
static void
#if ENABLE_PING6
create_icmp_socket(len_and_sockaddr *lsa)
@@ -170,9 +171,23 @@ create_icmp_socket(void)
@@ -171,9 +172,23 @@ create_icmp_socket(void)
#endif
sock = socket(AF_INET, SOCK_RAW, 1); /* 1 == ICMP */
if (sock < 0) {
......@@ -46,7 +46,7 @@ index dcbf196..1d96790 100644
}
xmove_fd(sock, pingsock);
@@ -223,10 +238,12 @@ static void ping4(len_and_sockaddr *lsa)
@@ -224,10 +239,12 @@ static void ping4(len_and_sockaddr *lsa)
bb_perror_msg("recvfrom");
continue;
}
......@@ -148,7 +148,7 @@ index dcbf196..1d96790 100644
signal(SIGINT, print_stats_and_exit);
/* start the ping's going ... */
@@ -742,10 +790,33 @@ static void ping6(len_and_sockaddr *lsa)
@@ -741,10 +789,33 @@ static void ping6(len_and_sockaddr *lsa)
char control_buf[CMSG_SPACE(36)];
pingaddr.sin6 = lsa->u.sin6;
......@@ -183,7 +183,7 @@ index dcbf196..1d96790 100644
{
struct icmp6_filter filt;
if (!(option_mask32 & OPT_VERBOSE)) {
@@ -874,7 +945,7 @@ static int common_ping_main(int opt, char **argv)
@@ -872,7 +943,7 @@ static int common_ping_main(int opt, char **argv)
if (opt & OPT_p)
G.pattern = xstrtou_range(str_p, 16, 0, 255);
......@@ -193,5 +193,5 @@ index dcbf196..1d96790 100644
#if ENABLE_PING6
{
--
2.7.4
2.9.1
From 78e0c5d3ec8354b94e5d7bd978222651dbb2c8c0 Mon Sep 17 00:00:00 2001
From 44be65aa1de3ad093cd754574734175884048285 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Mon, 24 Sep 2012 07:58:29 +0300
Subject: [PATCH] fbsplash: support console switching
Subject: [PATCH 05/15] fbsplash: support console switching
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
......@@ -12,7 +12,7 @@ Signed-off-by: Timo Teräs <timo.teras@iki.fi>
1 file changed, 76 insertions(+), 7 deletions(-)
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index 58e491d..8599f78 100644
index 3ddf8a2..aaaca39 100644
--- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c
@@ -22,7 +22,7 @@
......@@ -24,13 +24,14 @@ index 58e491d..8599f78 100644
//usage:#define fbsplash_full_usage "\n\n"
//usage: " -s Image"
//usage: "\n -c Hide cursor"
@@ -32,10 +32,16 @@
@@ -32,11 +32,17 @@
//usage: "\n BAR_R,BAR_G,BAR_B"
//usage: "\n -f Control pipe (else exit after drawing image)"
//usage: "\n commands: 'NN' (% for progress bar) or 'exit'"
+//usage: "\n -T Switch to TTY to hide all console messages"
#include "libbb.h"
#include "common_bufsiz.h"
#include <linux/fb.h>
+#include <sys/vt.h>
......@@ -41,7 +42,7 @@ index 58e491d..8599f78 100644
/* If you want logging messages on /tmp/fbsplash.log... */
#define DEBUG 0
@@ -47,6 +53,8 @@ struct globals {
@@ -48,6 +54,8 @@ struct globals {
unsigned char *addr; // pointer to framebuffer memory
unsigned ns[7]; // n-parameters
const char *image_filename;
......@@ -50,7 +51,7 @@ index 58e491d..8599f78 100644
struct fb_var_screeninfo scr_var;
struct fb_fix_screeninfo scr_fix;
unsigned bytes_per_pixel;
@@ -455,6 +463,11 @@ static void init(const char *cfg_filename)
@@ -458,6 +466,11 @@ static void init(const char *cfg_filename)
config_close(parser);
}
......@@ -62,7 +63,7 @@ index 58e491d..8599f78 100644
int fbsplash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -464,6 +477,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -467,6 +480,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
char *num_buf;
unsigned num;
bool bCursorOff;
......@@ -72,7 +73,7 @@ index 58e491d..8599f78 100644
INIT_G();
@@ -471,8 +487,10 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -474,8 +490,10 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
fb_device = "/dev/fb0";
cfg_filename = NULL;
fifo_filename = NULL;
......@@ -85,7 +86,7 @@ index 58e491d..8599f78 100644
// parse configuration file
if (cfg_filename)
@@ -482,11 +500,43 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -485,11 +503,43 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
if (!G.image_filename)
bb_show_usage();
......@@ -130,7 +131,7 @@ index 58e491d..8599f78 100644
}
fb_drawimage();
@@ -494,6 +544,7 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -497,6 +547,7 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
if (!fifo_filename)
return EXIT_SUCCESS;
......@@ -138,7 +139,7 @@ index 58e491d..8599f78 100644
fp = xfopen_stdin(fifo_filename);
if (fp != stdin) {
// For named pipes, we want to support this:
@@ -509,8 +560,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -512,8 +563,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
// and become an additional writer :)
open(fifo_filename, O_WRONLY); // errors are ignored
}
......@@ -149,7 +150,7 @@ index 58e491d..8599f78 100644
// Block on read, waiting for some input.
// Use of <stdio.h> style I/O allows to correctly
// handle a case when we have many buffered lines
@@ -525,12 +577,29 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -528,12 +580,29 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
#if DEBUG
DEBUG_MESSAGE(itoa(num));
#endif
......@@ -182,5 +183,5 @@ index 58e491d..8599f78 100644
return EXIT_SUCCESS;
--
2.1.3
2.9.1
From 99d9c9a46b47190f1d2f061ba11c767b4089cf0a Mon Sep 17 00:00:00 2001
From 942f123dce1f36144b200731df7abfd3dbc92f22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 21 Nov 2014 16:06:34 +0200
Subject: [PATCH] fbsplash: support image and bar alignment and positioning
Subject: [PATCH 06/15] fbsplash: support image and bar alignment and
positioning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
......@@ -12,7 +13,7 @@ Signed-off-by: Timo Teräs <timo.teras@iki.fi>
1 file changed, 76 insertions(+), 15 deletions(-)
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index 8599f78..660fddd 100644
index aaaca39..ea0dc22 100644
--- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c
@@ -28,6 +28,7 @@
......@@ -23,7 +24,7 @@ index 8599f78..660fddd 100644
//usage: "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT"
//usage: "\n BAR_R,BAR_G,BAR_B"
//usage: "\n -f Control pipe (else exit after drawing image)"
@@ -45,13 +46,38 @@
@@ -46,13 +47,38 @@
/* If you want logging messages on /tmp/fbsplash.log... */
#define DEBUG 0
......@@ -63,7 +64,7 @@ index 8599f78..660fddd 100644
const char *image_filename;
int silent_tty, fd_tty_s;
bool do_not_draw;
@@ -68,14 +94,6 @@ struct globals {
@@ -69,14 +95,6 @@ struct globals {
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
} while (0)
......@@ -78,7 +79,7 @@ index 8599f78..660fddd 100644
#if DEBUG
#define DEBUG_MESSAGE(strMessage, args...) \
if (G.bdebug_messages) { \
@@ -356,7 +374,7 @@ static void fb_drawimage(void)
@@ -357,7 +375,7 @@ static void fb_drawimage(void)
FILE *theme_file;
char *read_ptr;
unsigned char *pixline;
......@@ -87,7 +88,7 @@ index 8599f78..660fddd 100644
if (LONE_DASH(G.image_filename)) {
theme_file = stdin;
@@ -404,18 +422,46 @@ static void fb_drawimage(void)
@@ -407,18 +425,46 @@ static void fb_drawimage(void)
line_size = width*3;
pixline = xmalloc(line_size);
......@@ -136,7 +137,7 @@ index 8599f78..660fddd 100644
for (i = 0; i < width; i++) {
unsigned thispix = fb_pixel_value(pixel[0], pixel[1], pixel[2]);
fb_write_pixel(src, thispix);
@@ -434,9 +480,17 @@ static void fb_drawimage(void)
@@ -437,9 +483,17 @@ static void fb_drawimage(void)
*/
static void init(const char *cfg_filename)
{
......@@ -154,7 +155,7 @@ index 8599f78..660fddd 100644
"BAR_R\0" "BAR_G\0" "BAR_B\0"
#if DEBUG
"DEBUG\0"
@@ -446,14 +500,21 @@ static void init(const char *cfg_filename)
@@ -449,14 +503,21 @@ static void init(const char *cfg_filename)
parser_t *parser = config_open2(cfg_filename, xfopen_stdin);
while (config_read(parser, token, 2, 2, "#=",
(PARSE_NORMAL | PARSE_MIN_DIE) & ~(PARSE_TRIM | PARSE_COLLAPSE))) {
......@@ -180,5 +181,5 @@ index 8599f78..660fddd 100644
if (G.bdebug_messages)
G.logfile_fd = xfopen_for_write("/tmp/fbsplash.log");
--
2.1.3
2.9.1
From d8c1e5b77fd9fac9e03172a00bcd3f18aa20e2d9 Mon Sep 17 00:00:00 2001
From 249ef5277e15bd9f6728275a4d21ffdcd7877dc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Sun, 25 Oct 2015 22:21:41 +0200
Subject: [PATCH 2002/2003] depmod: support generating kmod binary index files
Subject: [PATCH 07/15] depmod: support generating kmod binary index files
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
......@@ -16,11 +16,11 @@ the code size a little bit.