Commit dc6cfb7c authored by Sören Tempel's avatar Sören Tempel

main/busybox: upgrade to 1.28.1

parent 4923b942
From cc86b2ad965bff071185edbb77b5a6ea45023e43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 14 Jul 2017 09:59:52 +0200
Subject: [PATCH] add-remove-shell: fix crash when shell is already added
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Avoid dereferencing 'don_add' in strcmp since it is invalid
pointer.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
loginutils/add-remove-shell.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/loginutils/add-remove-shell.c b/loginutils/add-remove-shell.c
index 922b3333d..54b62c773 100644
--- a/loginutils/add-remove-shell.c
+++ b/loginutils/add-remove-shell.c
@@ -84,7 +84,7 @@ int add_remove_shell_main(int argc UNUSED_PARAM, char **argv)
while ((line = xmalloc_fgetline(orig_fp)) != NULL) {
char **cpp = argv;
while (*cpp) {
- if (strcmp(*cpp, line) == 0) {
+ if (*cpp != dont_add && strcmp(*cpp, line) == 0) {
/* Old file has this shell name */
if (REMOVE_SHELL) {
/* we are remove-shell */
--
2.15.0
From f76c1ddd625b3d9912d9e6df2e90fcb94d08be99 Mon Sep 17 00:00:00 2001 From 185ba65457e991ebd0f6e64266380df5e11cc489 Mon Sep 17 00:00:00 2001
From: William Pitcock <nenolod@dereferenced.org> From: William Pitcock <nenolod@dereferenced.org>
Date: Thu, 19 Oct 2017 17:24:40 +0000 Date: Thu, 19 Oct 2017 17:24:40 +0000
Subject: [PATCH] ash: add support for command_not_found_handle hook function, Subject: [PATCH 01/16] ash: add support for command_not_found_handle hook
like bash function, like bash
This implements support for the command_not_found_handle hook function, which is This implements support for the command_not_found_handle hook function, which is
useful for allowing package managers to suggest packages which could provide the useful for allowing package managers to suggest packages which could provide the
...@@ -17,7 +17,7 @@ Signed-off-by: William Pitcock <nenolod@dereferenced.org> ...@@ -17,7 +17,7 @@ Signed-off-by: William Pitcock <nenolod@dereferenced.org>
1 file changed, 22 insertions(+), 2 deletions(-) 1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/shell/ash.c b/shell/ash.c diff --git a/shell/ash.c b/shell/ash.c
index 88e607f08..c3c4f4e93 100644 index b73a79975..7ceb91920 100644
--- a/shell/ash.c --- a/shell/ash.c
+++ b/shell/ash.c +++ b/shell/ash.c
@@ -132,6 +132,15 @@ @@ -132,6 +132,15 @@
...@@ -36,7 +36,7 @@ index 88e607f08..c3c4f4e93 100644 ...@@ -36,7 +36,7 @@ index 88e607f08..c3c4f4e93 100644
//config:endif # ash options //config:endif # ash options
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP)) //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
@@ -13123,8 +13132,19 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) @@ -13166,8 +13175,19 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
/* We failed. If there was an entry for this command, delete it */ /* We failed. If there was an entry for this command, delete it */
if (cmdp && updatetbl) if (cmdp && updatetbl)
delete_cmd_entry(); delete_cmd_entry();
...@@ -59,5 +59,5 @@ index 88e607f08..c3c4f4e93 100644 ...@@ -59,5 +59,5 @@ index 88e607f08..c3c4f4e93 100644
return; return;
-- --
2.14.2 2.16.2
From 54f76ba53e22fdbc9efebe8b42dd121ec3126fef Mon Sep 17 00:00:00 2001 From bce882404ab41d32d5d9def274e49264717135b2 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org> From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 28 Nov 2017 13:23:17 +0100 Date: Tue, 28 Nov 2017 13:23:17 +0100
Subject: [PATCH] fsck: resolve LABEL=.../UUID=... spec to device Subject: [PATCH 02/16] fsck: resolve LABEL=.../UUID=... spec to device
--- ---
e2fsprogs/fsck.c | 10 +++++----- e2fsprogs/fsck.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-) 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index eb53002b1..338701c6a 100644 index 1c285bb92..5af38c0aa 100644
--- a/e2fsprogs/fsck.c --- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c
@@ -60,6 +60,7 @@ @@ -60,6 +60,7 @@
...@@ -55,5 +55,5 @@ index eb53002b1..338701c6a 100644 ...@@ -55,5 +55,5 @@ index eb53002b1..338701c6a 100644
devices[num_devices++] = arg; devices[num_devices++] = arg;
continue; continue;
-- --
2.15.0 2.16.2
From 134582e8dd1c85cbcf1fc047956a57fcd642e46a Mon Sep 17 00:00:00 2001 From 36b6cc36d1f259e4ac76a1c2de743113845ff4cd Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org> From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 4 Aug 2016 11:03:07 +0200 Date: Thu, 4 Aug 2016 11:03:07 +0200
Subject: [PATCH 01/11] ash: exec busybox.static Subject: [PATCH 03/16] ash: exec busybox.static
--- ---
shell/ash.c | 2 ++ shell/ash.c | 2 ++
1 file changed, 2 insertions(+) 1 file changed, 2 insertions(+)
diff --git a/shell/ash.c b/shell/ash.c diff --git a/shell/ash.c b/shell/ash.c
index b7635a823..e613ee6bb 100644 index 7ceb91920..d04096a9b 100644
--- a/shell/ash.c --- a/shell/ash.c
+++ b/shell/ash.c +++ b/shell/ash.c
@@ -7721,6 +7721,8 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char ** @@ -7845,6 +7845,8 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, c
} }
/* re-exec ourselves with the new arguments */ /* re-exec ourselves with the new arguments */
execve(bb_busybox_exec_path, argv, envp); execve(bb_busybox_exec_path, argv, envp);
...@@ -21,5 +21,5 @@ index b7635a823..e613ee6bb 100644 ...@@ -21,5 +21,5 @@ index b7635a823..e613ee6bb 100644
* executable, fall through */ * executable, fall through */
} }
-- --
2.13.2 2.16.2
From 8937e2dfb3dbfa23597853e9605f930b3607fa63 Mon Sep 17 00:00:00 2001 From 9bbc93f12f7cff8fb51a0bf89907d9875f5c14e6 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org> From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 27 Dec 2016 20:46:59 +0100 Date: Tue, 27 Dec 2016 20:46:59 +0100
Subject: [PATCH 02/11] app location for cpio, vi and lspci Subject: [PATCH 04/16] app location for cpio, vi and lspci
Adjust location to where alpine linux installs them Adjust location to where alpine linux installs them
--- ---
...@@ -11,25 +11,25 @@ Adjust location to where alpine linux installs them ...@@ -11,25 +11,25 @@ Adjust location to where alpine linux installs them
3 files changed, 3 insertions(+), 3 deletions(-) 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/archival/cpio.c b/archival/cpio.c diff --git a/archival/cpio.c b/archival/cpio.c
index 683f0bb1f..45362b6bc 100644 index 1d6cbd1e2..0c14f79e7 100644
--- a/archival/cpio.c --- a/archival/cpio.c
+++ b/archival/cpio.c +++ b/archival/cpio.c
@@ -43,7 +43,7 @@ @@ -39,7 +39,7 @@
//config: help //config: help
//config: Passthrough mode. Rarely used. //config: Passthrough mode. Rarely used.
-//applet:IF_CPIO(APPLET(cpio, BB_DIR_BIN, BB_SUID_DROP)) -//applet:IF_CPIO(APPLET(cpio, BB_DIR_BIN, BB_SUID_DROP))
+//applet:IF_CPIO(APPLET(cpio, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_CPIO(APPLET(cpio, BB_DIR_USR_BIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_CPIO) += cpio.o //kbuild:lib-$(CONFIG_CPIO) += cpio.o
//usage:#define cpio_trivial_usage
diff --git a/editors/vi.c b/editors/vi.c diff --git a/editors/vi.c b/editors/vi.c
index 76d1f261b..73d0a67a9 100644 index cdfb27cc5..20077727e 100644
--- a/editors/vi.c --- a/editors/vi.c
+++ b/editors/vi.c +++ b/editors/vi.c
@@ -163,7 +163,7 @@ @@ -161,7 +161,7 @@
//config: Unless you want more (or less) frequent "undo points" while typing, //config: Unless you want more (or less) frequent "undo points" while typing,
//config: you should probably leave this unchanged. //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_BIN, BB_SUID_DROP))
+//applet:IF_VI(APPLET(vi, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_VI(APPLET(vi, BB_DIR_USR_BIN, BB_SUID_DROP))
...@@ -37,18 +37,18 @@ index 76d1f261b..73d0a67a9 100644 ...@@ -37,18 +37,18 @@ index 76d1f261b..73d0a67a9 100644
//kbuild:lib-$(CONFIG_VI) += vi.o //kbuild:lib-$(CONFIG_VI) += vi.o
diff --git a/util-linux/lspci.c b/util-linux/lspci.c diff --git a/util-linux/lspci.c b/util-linux/lspci.c
index 8b38a2366..f918f0972 100644 index 0000fbfda..34189d2b5 100644
--- a/util-linux/lspci.c --- a/util-linux/lspci.c
+++ b/util-linux/lspci.c +++ b/util-linux/lspci.c
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
//config: //config:
//config: This version uses sysfs (/sys/bus/pci/devices) only. //config: This version uses sysfs (/sys/bus/pci/devices) only.
-//applet:IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) -//applet:IF_LSPCI(APPLET_NOEXEC(lspci, lspci, BB_DIR_USR_BIN, BB_SUID_DROP, lspci))
+//applet:IF_LSPCI(APPLET(lspci, BB_DIR_USR_SBIN, BB_SUID_DROP)) +//applet:IF_LSPCI(APPLET_NOEXEC(lspci, lspci, BB_DIR_USR_SBIN, BB_SUID_DROP, lspci))
//kbuild:lib-$(CONFIG_LSPCI) += lspci.o //kbuild:lib-$(CONFIG_LSPCI) += lspci.o
-- --
2.13.2 2.16.2
From 18415adc1cd9993a95d100dd773daf69b8ec819e Mon Sep 17 00:00:00 2001 From b67940090709f3bbd868557dd4d5317cb807250d Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org> From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 4 Aug 2016 11:08:35 +0200 Date: Thu, 4 Aug 2016 11:08:35 +0200
Subject: [PATCH 03/11] udhcpc: set default discover retries to 5 Subject: [PATCH 05/16] udhcpc: set default discover retries to 5
Some slower nics needs more attempts to get a lease Some slower nics needs more attempts to get a lease
--- ---
...@@ -9,19 +9,19 @@ Some slower nics needs more attempts to get a lease ...@@ -9,19 +9,19 @@ Some slower nics needs more attempts to get a lease
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 1a66c610e..43aac1b85 100644 index 55f21c187..cc1d22c8e 100644
--- a/networking/udhcp/dhcpc.c --- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c
@@ -1191,7 +1191,7 @@ static void client_background(void) @@ -1203,7 +1203,7 @@ static void client_background(void)
//usage: "\n -s,--script PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" //usage: "\n -p FILE Create pidfile"
//usage: "\n -p,--pidfile FILE Create pidfile" //usage: "\n -B Request broadcast replies"
//usage: "\n -B,--broadcast Request broadcast replies" //usage: "\n -t N Send up to N discover packets (default 3)"
-//usage: "\n -t,--retries N Send up to N discover packets (default 3)" -//usage: "\n -T SEC Pause between packets (default 3)"
+//usage: "\n -t,--retries N Send up to N discover packets (default 5)" +//usage: "\n -T SEC Pause between packets (default 5)"
//usage: "\n -T,--timeout SEC Pause between packets (default 3)" //usage: "\n -A SEC Wait if lease is not obtained (default 20)"
//usage: "\n -A,--tryagain SEC Wait if lease is not obtained (default 20)" //usage: "\n -n Exit if lease is not obtained"
//usage: "\n -n,--now Exit if lease is not obtained" //usage: "\n -q Exit after obtaining lease"
@@ -1274,7 +1274,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) @@ -1247,7 +1247,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
llist_t *list_x = NULL; llist_t *list_x = NULL;
int tryagain_timeout = 20; int tryagain_timeout = 20;
int discover_timeout = 3; int discover_timeout = 3;
...@@ -31,5 +31,5 @@ index 1a66c610e..43aac1b85 100644 ...@@ -31,5 +31,5 @@ index 1a66c610e..43aac1b85 100644
uint32_t requested_ip = 0; uint32_t requested_ip = 0;
uint32_t xid = xid; /* for compiler */ uint32_t xid = xid; /* for compiler */
-- --
2.13.2 2.16.2
From bef770d1ee4179e380dff24305d9b6d899147add Mon Sep 17 00:00:00 2001 From 21d74f2989d0046e5b7c586f5a052643d5da8dcc Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org> From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 29 Mar 2016 18:59:22 +0200 Date: Tue, 29 Mar 2016 18:59:22 +0200
Subject: [PATCH 04/11] ping: make ping work without root privileges Subject: [PATCH 06/16] ping: make ping work without root privileges
--- ---
networking/ping.c | 103 +++++++++++++++++++++++++++++++++++++++++++++--------- networking/ping.c | 103 +++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 87 insertions(+), 16 deletions(-) 1 file changed, 87 insertions(+), 16 deletions(-)
diff --git a/networking/ping.c b/networking/ping.c diff --git a/networking/ping.c b/networking/ping.c
index 94fb007f5..26e40e1fc 100644 index d1d59d545..c0ebc0f9a 100644
--- a/networking/ping.c --- a/networking/ping.c
+++ b/networking/ping.c +++ b/networking/ping.c
@@ -155,6 +155,7 @@ enum { @@ -163,6 +163,7 @@ enum {
pingsock = 0, pingsock = 0,
}; };
...@@ -19,7 +19,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -19,7 +19,7 @@ index 94fb007f5..26e40e1fc 100644
static void static void
#if ENABLE_PING6 #if ENABLE_PING6
create_icmp_socket(len_and_sockaddr *lsa) create_icmp_socket(len_and_sockaddr *lsa)
@@ -171,9 +172,23 @@ create_icmp_socket(void) @@ -179,9 +180,23 @@ create_icmp_socket(void)
#endif #endif
sock = socket(AF_INET, SOCK_RAW, 1); /* 1 == ICMP */ sock = socket(AF_INET, SOCK_RAW, 1); /* 1 == ICMP */
if (sock < 0) { if (sock < 0) {
...@@ -46,7 +46,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -46,7 +46,7 @@ index 94fb007f5..26e40e1fc 100644
} }
xmove_fd(sock, pingsock); xmove_fd(sock, pingsock);
@@ -226,10 +241,12 @@ static void ping4(len_and_sockaddr *lsa) @@ -234,10 +249,12 @@ static void ping4(len_and_sockaddr *lsa)
bb_perror_msg("recvfrom"); bb_perror_msg("recvfrom");
continue; continue;
} }
...@@ -62,7 +62,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -62,7 +62,7 @@ index 94fb007f5..26e40e1fc 100644
if (pkt->icmp_id != G.myid) if (pkt->icmp_id != G.myid)
continue; /* not our ping */ continue; /* not our ping */
if (pkt->icmp_type == ICMP_ECHOREPLY) if (pkt->icmp_type == ICMP_ECHOREPLY)
@@ -627,19 +644,21 @@ static void unpack_tail(int sz, uint32_t *tp, @@ -634,19 +651,21 @@ static void unpack_tail(int sz, uint32_t *tp,
} }
static void unpack4(char *buf, int sz, struct sockaddr_in *from) static void unpack4(char *buf, int sz, struct sockaddr_in *from)
{ {
...@@ -90,7 +90,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -90,7 +90,7 @@ index 94fb007f5..26e40e1fc 100644
if (icmppkt->icmp_id != myid) if (icmppkt->icmp_id != myid)
return; /* not our ping */ return; /* not our ping */
@@ -651,7 +670,7 @@ static void unpack4(char *buf, int sz, struct sockaddr_in *from) @@ -658,7 +677,7 @@ static void unpack4(char *buf, int sz, struct sockaddr_in *from)
tp = (uint32_t *) icmppkt->icmp_data; tp = (uint32_t *) icmppkt->icmp_data;
unpack_tail(sz, tp, unpack_tail(sz, tp,
inet_ntoa(*(struct in_addr *) &from->sin_addr.s_addr), inet_ntoa(*(struct in_addr *) &from->sin_addr.s_addr),
...@@ -99,7 +99,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -99,7 +99,7 @@ index 94fb007f5..26e40e1fc 100644
} else if (icmppkt->icmp_type != ICMP_ECHO) { } else if (icmppkt->icmp_type != ICMP_ECHO) {
bb_error_msg("warning: got ICMP %d (%s)", bb_error_msg("warning: got ICMP %d (%s)",
icmppkt->icmp_type, icmppkt->icmp_type,
@@ -695,11 +714,31 @@ static void ping4(len_and_sockaddr *lsa) @@ -702,11 +721,31 @@ static void ping4(len_and_sockaddr *lsa)
int sockopt; int sockopt;
pingaddr.sin = lsa->u.sin; pingaddr.sin = lsa->u.sin;
...@@ -132,7 +132,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -132,7 +132,7 @@ index 94fb007f5..26e40e1fc 100644
} }
/* enable broadcast pings */ /* enable broadcast pings */
@@ -716,6 +755,15 @@ static void ping4(len_and_sockaddr *lsa) @@ -723,6 +762,15 @@ static void ping4(len_and_sockaddr *lsa)
setsockopt_int(pingsock, IPPROTO_IP, IP_MULTICAST_TTL, opt_ttl); setsockopt_int(pingsock, IPPROTO_IP, IP_MULTICAST_TTL, opt_ttl);
} }
...@@ -148,7 +148,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -148,7 +148,7 @@ index 94fb007f5..26e40e1fc 100644
signal(SIGINT, print_stats_and_exit); signal(SIGINT, print_stats_and_exit);
/* start the ping's going ... */ /* start the ping's going ... */
@@ -749,10 +797,33 @@ static void ping6(len_and_sockaddr *lsa) @@ -756,10 +804,33 @@ static void ping6(len_and_sockaddr *lsa)
char control_buf[CMSG_SPACE(36)]; char control_buf[CMSG_SPACE(36)];
pingaddr.sin6 = lsa->u.sin6; pingaddr.sin6 = lsa->u.sin6;
...@@ -156,26 +156,26 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -156,26 +156,26 @@ index 94fb007f5..26e40e1fc 100644
+ if (source_lsa && !using_dgram) + if (source_lsa && !using_dgram)
xbind(pingsock, &source_lsa->u.sa, source_lsa->len); xbind(pingsock, &source_lsa->u.sa, source_lsa->len);
+ else if(using_dgram) { + else if(using_dgram) {
+ struct sockaddr_in6 sa = {0}; + struct sockaddr_in6 sa = {0};
+ socklen_t sl; + socklen_t sl;
+ +
+ sa.sin6_family = AF_INET6; + sa.sin6_family = AF_INET6;
+ sa.sin6_port = 0; + sa.sin6_port = 0;
+ if(source_lsa) { + if(source_lsa) {
+ memcpy(&sa.sin6_addr, &source_lsa->u.sin6.sin6_addr, sizeof(struct in6_addr)); + memcpy(&sa.sin6_addr, &source_lsa->u.sin6.sin6_addr, sizeof(struct in6_addr));
+ } + }
+ sl = sizeof(sa); + sl = sizeof(sa);
+ +
+ if (bind(pingsock, (struct sockaddr *) &sa, sl) == -1) { + if (bind(pingsock, (struct sockaddr *) &sa, sl) == -1) {
+ perror("bind"); + perror("bind");
+ exit(2); + exit(2);
+ } + }
+ +
+ if (getsockname(pingsock, (struct sockaddr *) &sa, &sl) == -1) { + if (getsockname(pingsock, (struct sockaddr *) &sa, &sl) == -1) {
+ perror("getsockname"); + perror("getsockname");
+ exit(2); + exit(2);
+ } + }
+ myid = sa.sin6_port; + myid = sa.sin6_port;
+ } + }
#ifdef ICMP6_FILTER #ifdef ICMP6_FILTER
...@@ -183,7 +183,7 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -183,7 +183,7 @@ index 94fb007f5..26e40e1fc 100644
{ {
struct icmp6_filter filt; struct icmp6_filter filt;
if (!(option_mask32 & OPT_VERBOSE)) { if (!(option_mask32 & OPT_VERBOSE)) {
@@ -880,7 +951,7 @@ static int common_ping_main(int opt, char **argv) @@ -890,7 +961,7 @@ static int common_ping_main(int opt, char **argv)
if (opt & OPT_p) if (opt & OPT_p)
G.pattern = xstrtou_range(str_p, 16, 0, 255); G.pattern = xstrtou_range(str_p, 16, 0, 255);
...@@ -193,5 +193,5 @@ index 94fb007f5..26e40e1fc 100644 ...@@ -193,5 +193,5 @@ index 94fb007f5..26e40e1fc 100644
#if ENABLE_PING6 #if ENABLE_PING6
{ {
-- --
2.13.2 2.16.2
From a8f7d33f47cc28732cd04573ae1fb6a1ca6e9617 Mon Sep 17 00:00:00 2001 From 377e2f20c1034de1195fd900fc637821952cfa49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Mon, 24 Sep 2012 07:58:29 +0300 Date: Mon, 24 Sep 2012 07:58:29 +0300
Subject: [PATCH 05/11] fbsplash: support console switching Subject: [PATCH 07/16] fbsplash: support console switching
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
--- ---
miscutils/fbsplash.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++----- miscutils/fbsplash.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 76 insertions(+), 7 deletions(-) 1 file changed, 75 insertions(+), 7 deletions(-)
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index fc6c9b953..ec5947314 100644 index 5b2e5ac56..bc80f728c 100644
--- a/miscutils/fbsplash.c --- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
...@@ -42,7 +38,7 @@ index fc6c9b953..ec5947314 100644 ...@@ -42,7 +38,7 @@ index fc6c9b953..ec5947314 100644
/* If you want logging messages on /tmp/fbsplash.log... */ /* If you want logging messages on /tmp/fbsplash.log... */
#define DEBUG 0 #define DEBUG 0
@@ -73,6 +79,8 @@ struct globals { @@ -75,6 +81,8 @@ struct globals {
unsigned char *addr; // pointer to framebuffer memory unsigned char *addr; // pointer to framebuffer memory
unsigned ns[7]; // n-parameters unsigned ns[7]; // n-parameters
const char *image_filename; const char *image_filename;
...@@ -51,7 +47,7 @@ index fc6c9b953..ec5947314 100644 ...@@ -51,7 +47,7 @@ index fc6c9b953..ec5947314 100644
struct fb_var_screeninfo scr_var; struct fb_var_screeninfo scr_var;
struct fb_fix_screeninfo scr_fix; struct fb_fix_screeninfo scr_fix;
unsigned bytes_per_pixel; unsigned bytes_per_pixel;
@@ -483,6 +491,11 @@ static void init(const char *cfg_filename) @@ -485,6 +493,11 @@ static void init(const char *cfg_filename)
config_close(parser); config_close(parser);
} }
...@@ -63,7 +59,7 @@ index fc6c9b953..ec5947314 100644 ...@@ -63,7 +59,7 @@ index fc6c9b953..ec5947314 100644
int fbsplash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int fbsplash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int fbsplash_main(int argc UNUSED_PARAM, char **argv) int fbsplash_main(int argc UNUSED_PARAM, char **argv)
@@ -492,6 +505,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) @@ -494,6 +507,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
char *num_buf; char *num_buf;
unsigned num; unsigned num;
bool bCursorOff; bool bCursorOff;
...@@ -73,20 +69,19 @@ index fc6c9b953..ec5947314 100644 ...@@ -73,20 +69,19 @@ index fc6c9b953..ec5947314 100644
INIT_G(); INIT_G();
@@ -499,8 +515,10 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) @@ -501,8 +517,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
fb_device = "/dev/fb0"; fb_device = "/dev/fb0";
cfg_filename = NULL; cfg_filename = NULL;
fifo_filename = NULL; fifo_filename = NULL;
- bCursorOff = 1 & getopt32(argv, "cs:d:i:f:", - bCursorOff = 1 & getopt32(argv, "cs:d:i:f:",
- &G.image_filename, &fb_device, &cfg_filename, &fifo_filename); - &G.image_filename, &fb_device, &cfg_filename, &fifo_filename);
+ opt_complementary = "T+"; // numeric params
+ bCursorOff = 1 & getopt32(argv, "cs:d:i:f:T:", + bCursorOff = 1 & getopt32(argv, "cs:d:i:f:T:",
+ &G.image_filename, &fb_device, &cfg_filename, &fifo_filename, + &G.image_filename, &fb_device, &cfg_filename, &fifo_filename,
+ &G.silent_tty); + &G.silent_tty);
// parse configuration file // parse configuration file
if (cfg_filename) if (cfg_filename)
@@ -510,11 +528,43 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) @@ -512,11 +529,43 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
if (!G.image_filename) if (!G.image_filename)
bb_show_usage(); bb_show_usage();
...@@ -126,12 +121,12 @@ index fc6c9b953..ec5947314 100644 ...@@ -126,12 +121,12 @@ index fc6c9b953..ec5947314 100644
if (fifo_filename && bCursorOff) { if (fifo_filename && bCursorOff) {
// hide cursor (BEFORE any fb ops) // hide cursor (BEFORE any fb ops)
- full_write(STDOUT_FILENO, "\033[?25l", 6); - full_write(STDOUT_FILENO, ESC"[?25l", 6);
+ full_write(G.fd_tty_s, "\033[?25l", 6); + full_write(G.fd_tty_s, ESC"[?25l", 6);
} }
fb_drawimage(); fb_drawimage();
@@ -522,6 +572,7 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) @@ -524,6 +573,7 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
if (!fifo_filename) if (!fifo_filename)
return EXIT_SUCCESS; return EXIT_SUCCESS;
...@@ -139,7 +134,7 @@ index fc6c9b953..ec5947314 100644 ...@@ -139,7 +134,7 @@ index fc6c9b953..ec5947314 100644
fp = xfopen_stdin(fifo_filename); fp = xfopen_stdin(fifo_filename);
if (fp != stdin) { if (fp != stdin) {
// For named pipes, we want to support this: // For named pipes, we want to support this:
@@ -537,8 +588,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) @@ -539,8 +589,9 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
// and become an additional writer :) // and become an additional writer :)
open(fifo_filename, O_WRONLY); // errors are ignored open(fifo_filename, O_WRONLY); // errors are ignored
} }
...@@ -150,7 +145,7 @@ index fc6c9b953..ec5947314 100644 ...@@ -150,7 +145,7 @@ index fc6c9b953..ec5947314 100644
// Block on read, waiting for some input. // Block on read, waiting for some input.
// Use of <stdio.h> style I/O allows to correctly // Use of <stdio.h> style I/O allows to correctly
// handle a case when we have many buffered lines // handle a case when we have many buffered lines
@@ -553,12 +605,29 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) @@ -555,12 +606,29 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv)
#if DEBUG #if DEBUG
DEBUG_MESSAGE(itoa(num)); DEBUG_MESSAGE(itoa(num));
#endif #endif
...@@ -179,9 +174,9 @@ index fc6c9b953..ec5947314 100644 ...@@ -179,9 +174,9 @@ index fc6c9b953..ec5947314 100644
+ console_make_active(fd_tty0, active_vt); + console_make_active(fd_tty0, active_vt);
+ ioctl(fd_tty0, VT_DISALLOCATE, (void *)(ptrdiff_t)G.silent_tty); + ioctl(fd_tty0, VT_DISALLOCATE, (void *)(ptrdiff_t)G.silent_tty);
+ } else if (bCursorOff) // restore cursor + } else if (bCursorOff) // restore cursor
full_write(STDOUT_FILENO, "\033[?25h", 6); full_write(STDOUT_FILENO, ESC"[?25h", 6);
return EXIT_SUCCESS; return EXIT_SUCCESS;
-- --
2.13.2 2.16.2
From 64e2d2e495f82ef7ccc952bfa4216d1ff8ab3481 Mon Sep 17 00:00:00 2001 From 97fcb49bfbe74fa17a52e63b2196d8a5c3b27d93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 21 Nov 2014 16:06:34 +0200 Date: Fri, 21 Nov 2014 16:06:34 +0200
Subject: [PATCH 06/11] fbsplash: support image and bar alignment and Subject: [PATCH 08/16] fbsplash: support image and bar alignment and
positioning positioning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
--- ---
miscutils/fbsplash.c | 91 +++++++++++++++++++++++++++++++++++++++++++--------- miscutils/fbsplash.c | 91 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 76 insertions(+), 15 deletions(-) 1 file changed, 76 insertions(+), 15 deletions(-)
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index ec5947314..34bbf81f5 100644 index bc80f728c..9089131b8 100644
--- a/miscutils/fbsplash.c --- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c
@@ -53,6 +53,7 @@ @@ -53,6 +53,7 @@
...@@ -24,9 +20,9 @@ index ec5947314..34bbf81f5 100644 ...@@ -24,9 +20,9 @@ index ec5947314..34bbf81f5 100644
//usage: "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" //usage: "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT"
//usage: "\n BAR_R,BAR_G,BAR_B" //usage: "\n BAR_R,BAR_G,BAR_B"
//usage: "\n -f Control pipe (else exit after drawing image)" //usage: "\n -f Control pipe (else exit after drawing image)"
@@ -71,13 +72,38 @@ @@ -73,13 +74,38 @@
/* If you want logging messages