Timo Teras | 2 May 09:17 2016
Picon
Picon

ntpd does not start without dns

Hi,

On systems with dhcp enabled, ntpd does not start at bootup due to DNS
not being available and using xhost2sockaddr() for initial lookup.

Would it be possible to have default behaviour that if DNS lookup fails
due to temporary error (no network) it would start, and retry dns
lookups. It could still refuse to start if dns lookup failed with
permanent error (no such name).

Thanks,
Timo
Tito | 29 Apr 20:54 2016
Picon

Re: [PATCH 1/2] Allow BusyBox to be built without a list of applet names


On 04/29/2016 02:47 PM, Ron Yorston wrote:
> Use a hash of the command name to determine which applet to execute.
> Invalid names will also match.

Hi,
what exactly means:
"Invalid names will also match" ?

Ciao,
Tito

>
> Without applet names the following features don't work:
>
>   - busybox --list
>   - busybox --install
>   - tab completion for applets in standalone shell mode
>   - in standalone shell mode the help builtin doesn't list applets
>
> Compared with the current default configuration, not storing applet
> names gives:
>
> function                                             old     new   delta
> applet_hash                                            -     734    +734
> usr_bin                                               10       -     -10
> usr_sbin                                              11       -     -11
> applet_nameofs                                        14       -     -14
> install_dir                                           20       -     -20
> find_applet_by_name                                  112      69     -43
(Continue reading)

Ron Yorston | 26 Apr 16:23 2016
Picon

[PATCH] vi: remove duplicated code

At worst show_status_line() might be called needlessly when the
user presses ^L/^R, but I don't think we'll get many complaints
about that.

function                                             old     new   delta
do_cmd                                              4592    4558     -34
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-34)             Total: -34 bytes

Signed-off-by: Ron Yorston <rmy <at> pobox.com>
---
 editors/vi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/editors/vi.c b/editors/vi.c
index 974f997..478c785 100644
--- a/editors/vi.c
+++ b/editors/vi.c
 <at>  <at>  -3573,12 +3573,7  <at>  <at>  static void do_cmd(int c)
 		break;
 	case 12:			// ctrl-L  force redraw whole screen
 	case 18:			// ctrl-R  force redraw
-		place_cursor(0, 0);
-		clear_to_eos();
-		//mysleep(10); // why???
-		screen_erase();	// erase the internal screen buffer
-		last_status_cksum = 0;	// force status update
-		refresh(TRUE);	// this will redraw the entire display
+		redraw(TRUE);	// this will redraw the entire display
 		break;
(Continue reading)

Waldemar Brodkorb | 24 Apr 17:31 2016

[PATCH] fix problem with ip on mips64 n64 big endian musl systems

Use designated initializers for struct msghdr.
The struct layout is non-portable and musl libc does not match what busybox expects.

Signed-off-by: Szabolcs Nagy <nsz <at> port70.net>
Tested-by: Waldemar Brodkorb <wbx <at> openadk.org>
---
 networking/libiproute/libnetlink.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c
index c7533a4..f9cd9e5 100644
--- a/networking/libiproute/libnetlink.c
+++ b/networking/libiproute/libnetlink.c
 <at>  <at>  -72,10 +72,10  <at>  <at>  int FAST_FUNC rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, in
 	struct sockaddr_nl nladdr;
 	struct iovec iov[2] = { { &nlh, sizeof(nlh) }, { req, len } };
 	struct msghdr msg = {
-		(void*)&nladdr, sizeof(nladdr),
-		iov,  2,
-		NULL, 0,
-		0
+		.msg_name = (void*)&nladdr, .msg_namelen = sizeof(nladdr),
+		.msg_iov = iov,  .msg_iovlen = 2,
+		.msg_control = NULL, .msg_controllen = 0,
+		.msg_flags = 0
 	};

 	memset(&nladdr, 0, sizeof(nladdr));
 <at>  <at>  -106,10 +106,10  <at>  <at>  static int rtnl_dump_filter(struct rtnl_handle *rth,
 		struct nlmsghdr *h;
(Continue reading)

Denys Vlasenko | 24 Apr 14:23 2016

Decided to put some of my RAM-saving experiments on website

https://busybox.net/use_less_ram.html

How to build a Busybox binary with reduced memory usage

Busybox is designed to be frugal with memory usage. However, it is
still written in C. Compiler and linker are usually not written with a
focus to strongly minimize memory usage.
Overview of RAM usage by Linux binaries

Executables have the following parts: read-only executable code and
constants, also known as "text", read-write initialized data, and
read-write non-initialized (zeroed on demand) data, also known as
"bss".

At runtime, all text pages are mapped RO and executable. A RO mapping,
like any other, can only cover whole pages, not parts of them. What
happens to the last page of text? The entire page is mapped RO,
including the part beyond the last text byte.

Data pages are mapped RW and they are file-backed (this includes a
small portion of bss which may live in the last partial page of data).
Pages which are fully in bss are mapped to anonymous memory: when a
page fault requires kernel to allocate a real page, a free page is
found and zero-filled. No reads from storage are needed.

File-backed RO pages are shared among all copies of running process.
RW pages, both data and bss, exist as separate copies for each
process. (They may be shared as long as they are not modified.
However, well-designed programs don't put constant data into RW
sections, therefore in practice almost all RW data or bss pages which
(Continue reading)

Cristian Ionescu-Idbohrn | 24 Apr 08:37 2016
Picon

[PATCH] common_bufsiz: ignore generated files


Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn <at> axis.com>
---
 include/.gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/.gitignore b/include/.gitignore
index 9d9b6c4..e512886 100644
--- a/include/.gitignore
+++ b/include/.gitignore
 <at>  <at>  -5,6 +5,8  <at>  <at> 
 /autoconf.h
 /bbconfigopts_bz2.h
 /bbconfigopts.h
+/common_bufsiz.h
+/common_bufsiz.h.method
 /NUM_APPLETS.h
 /usage_compressed.h
 /usage.h
--

-- 
2.8.1
Cristian Ionescu-Idbohrn | 23 Apr 22:56 2016
Picon

two new generated files to be ignored?

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        include/common_bufsiz.h
        include/common_bufsiz.h.method

nothing added to commit but untracked files present (use "git add" to track)

Cheers,

--

-- 
Cristian
Maxin B. John | 20 Apr 17:36 2016
Picon

[PATCH] flock: update the behaviour of -c parameter to match upstream

In upstream, -c 'PROG ARGS' means run "sh -c 'PROG ARGS'"

function                                             old     new   delta
flock_main                                           286     377     +91
.rodata                                           155849  155890     +41

Signed-off-by: Maxin B. John <maxin.john <at> intel.com>
---
 util-linux/flock.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/util-linux/flock.c b/util-linux/flock.c
index 05a747f..c85a25d 100644
--- a/util-linux/flock.c
+++ b/util-linux/flock.c
 <at>  <at>  -20,6 +20,7  <at>  <at>  int flock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int flock_main(int argc UNUSED_PARAM, char **argv)
 {
 	int mode, opt, fd;
+    char *cmd_args[4];
 	enum {
 		OPT_s = (1 << 0),
 		OPT_x = (1 << 1),
 <at>  <at>  -57,7 +58,6  <at>  <at>  int flock_main(int argc UNUSED_PARAM, char **argv)
 	/* If it is "flock FILE -c PROG", then -c isn't caught by getopt32:
 	 * we use "+" in order to support "flock -opt FILE PROG -with-opts",
 	 * we need to remove -c by hand.
-	 * TODO: in upstream, -c 'PROG ARGS' means "run sh -c 'PROG ARGS'"
 	 */
 	if (argv[0]
(Continue reading)

Ron Yorston | 19 Apr 14:15 2016
Picon

[PATCH] Compress common substrings in applet names to save space

The string of applet names seems ripe for compression:  it has a limited
range of characters and many common substrings.  If the compression is
too aggressive, though, the code required to handle it causes bloat.

Recursively replace common pairs of characters with a character having
its top bit set; the lower 7 bits being an index into an array of
character pairs.  This is only done if it results in a net saving,
otherwise the current code is used.

Provide an implementation of find_applet_by_name() which uses binary
search:  this reduces the number of string comparisons from an average
of 27.9 per lookup to 7.7.  This is important because of the added cost
of expanding strings before comparison.  (Compressing the input string
is uncompetitive.)

The new version of find_applet_by_name() is about 8% faster than the
old one when strings aren't abbreviated.  It isn't used in that case,
though, as it's larger than the current implementation.

When strings are abbreviated the new find_applet_by_name() is about
34% slower than currently.  (All comparisons are for the default
configuration.)

function                                             old     new   delta
applet_common                                          -     256    +256
find_applet_by_name                                  112     175     +63
expand_char                                            -      40     +40
expand_name                                            -      31     +31
run_applet_and_exit                                  675     697     +22
applet_nameofs                                        14      30     +16
(Continue reading)

Linus Walleij | 13 Apr 14:37 2016

[PATCH v2] mdev: create devices from /sys/dev

Currently some new devices that have a bus but no class will
be missed by mdev coldplug device creation after boot. This
happens because mdev recursively searches /sys/class which will
by definition only find class devices.

Some important devices such as iio and gpiochip does not have
a class. But users will need them.

This switches from using /sys/class as the place to look for
devices to create to using /sys/dev where all char and block
devices are listed.

The subsystem lookup code that provide the G.subsystem
environment variable is changed from using the directory
name of the class device to instead dereference the
"subsystem" symlink for the device, and look at the last
element of the path of the symlink for the subsystem, which
will work with class devices and bus devices alike. (The new
bus-only devices only symlink to the /sys/bus/* hierarchy.)

We delete the legacy kernel v2.6.2x /sys/block device path
code as part of this change. It's too old to be kept alive.

Tested on kernel v4.6-rc2 with a bunch of devices, including
some IIO and gpiochip devices.

With a print inserted before make_device() the log looks
like so:

Create device from "/sys/dev/char/1:1", subsystem "mem"
(Continue reading)

Linus Walleij | 11 Apr 11:09 2016

[PATCH] mdev: create devices from /sys/dev

Currently some new devices that have a bus but no class will
be missed by mdev coldplug device creation after boot. This
happens because mdev recursively searches /sys/class which will
by definition only find class devices.

Some important devices such as iio and gpiochip does not have
a class. But users will need them.

This switches from using /sys/class as the place to look for
devices to create to using /sys/dev where all char and block
devices are listed. We keep /sys/class as a fallback if /sys/dev
is nonexisting.

Tested on kernel v4.6-rc2 with a bunch of devices, including
some IIO and gpiochip devices.

Cc: Isaac Dunham <ibid.ag <at> gmail.com>
Cc: Greg Kroah-Hartman <gregkh <at> linuxfoundation.org>
Cc: Jonathan Cameron <jic23 <at> cam.ac.uk>
Signed-off-by: Linus Walleij <linus.walleij <at> linaro.org>
---
If you prefer that I delete the code searching for devices in
/sys/class with sys/block as fallback, I will happily do so.
---
 util-linux/mdev.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index 37fa56827520..f833d9730ea5 100644
--- a/util-linux/mdev.c
(Continue reading)


Gmane