Isaac Dunham | 26 Aug 19:18 2015
Picon

[PATCH] libbb: shrink is_suffixed_with()

By my test (Debian Jessie, GCC 4.9.2, glibc shared build), the results are:
function                                             old     new   delta
is_suffixed_with                                      61      45     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-16)             Total: -16 bytes
   text	   data	    bss	    dec	    hex	filename
 760460	   2092	   9080	 771632	  bc630	busybox_old
 760444	   2092	   9080	 771616	  bc620	busybox_unstripped
---
 libbb/compare_string_array.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index 3dbd3eb..2a46e62 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
 <at>  <at>  -35,17 +35,12  <at>  <at>  char* FAST_FUNC is_prefixed_with(const char *string, const char *key)
  */
 char* FAST_FUNC is_suffixed_with(const char *string, const char *key)
 {
-	size_t key_len = strlen(key);
-	ssize_t len_diff = strlen(string) - key_len;
+	char *ret;

-	if (len_diff >= 0) {
-		string += len_diff;
-		if (strcmp(string, key) == 0) {
-			return (char*)string;
-		}
-	}
(Continue reading)

Bartosz Golaszewski | 25 Aug 15:39 2015
Picon

[PATCH v2] inotifyd: -x: new option

Add -x option which allows to specify the exit status of PROG for which
inotifyd should exit.

An example use case for this change is writing parallel system startup
scripts with busybox' runit: inotifyd can be used to wait for a specific
pid-file to appear in /var/run and then exit, allowing the blocked script
to proceed.

function                                             old     new   delta
inotifyd_main                                        653     742     +89
.rodata                                           157197  157261     +64
packed_usage                                       30460   30516     +56
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 209/0)             Total: 209 bytes

Signed-off-by: Bartosz Golaszewski <bartekgola <at> gmail.com>
---
v2:
- don't call xstrtol_range() if -x is not specified

v1:
http://lists.busybox.net/pipermail/busybox/2015-August/083219.html

 miscutils/inotifyd.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/miscutils/inotifyd.c b/miscutils/inotifyd.c
index 7a1a6a2..e142668 100644
--- a/miscutils/inotifyd.c
+++ b/miscutils/inotifyd.c
(Continue reading)

Bartosz Gołaszewski | 25 Aug 15:17 2015
Picon

Linking errors when compiling with debug symbols

I'm unable to compile current git with debugging symbols.

networking/lib.a(ping.o): In function `ping6':
/home/brgl/workspace/gitbook/busybox/networking/ping.c:773: undefined
reference to `BUG_bad_offsetof_icmp6_cksum'
collect2: error: ld returned 1 exit status

Bisect points at commit c52cbea2.

BUG_bad_offsetof_icmp6_cksum is declared at ./networking/ping.c:735
but not defined. Has been for some time apparently but said commit
seems to have triggered this failure.

--

-- 
Best regards,
Bartosz Golaszewski
Bartosz Golaszewski | 25 Aug 13:09 2015
Picon

[RFC/PATCH v3 0/8] readahead: daemon mode

While working on an embedded system running several big services, X-org,
fluxbox, Qt5 etc. where the boot-time was awful, it turned out that the
readahead implementation from systemd (the one that was nuked in 2014)
improves the time needed to start all the programs by a few seconds.

This series introduces a small (LOC < 500) readahead daemon implementation
based on fanotify and readahead syscalls.

This series is also available at:

    https://github.com/brgl/busybox  readahead

v1:
http://lists.busybox.net/pipermail/busybox/2015-August/083236.html

v2:
- made daemon mode optional and disabled by default
- removed patches implementing system calls in busybox

v3:
- reworked the ends_with() function which is now called is_suffixed_with()
  for consistency with is_prefixed_with() and returns char* instead of int
- added unit tests for is_prefixed_with() that also test corner cases
- updated unit tests for is_suffixed_with()
- added detailed comments for both functions
- removed unused code from is_prefixed_with() (any reason to keep it?)
- removed global stopped condition from readahead since signals are handled
  by signalfd, not signal handlers

Bartosz Golaszewski (8):
(Continue reading)

Sören Tempel | 24 Aug 20:50 2015
Picon

[PATCH] Don't print motd if .hushlogin exists

Hi,

I don't know if you are interested at all in this, but I wrote a little
patch which modifies login(1) to ensure that the message of the day
isn't printed if a file called '.hushlogin' exists in the users home
directory.

This is the default behaviour of many login implementations including
OpenBSDs, FreeBSDs, and pkg-shadows implementation. As I said I don't
know if you are interested in it but I personally find it somewhat
useful.

I am also not particularly good at C but the patch works for me.

Sören.
From e15ac2903cc769e17dd2269753ebc08d7cda93c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git <at> soeren-tempel.net>
Date: Wed, 19 Aug 2015 20:58:06 +0200
Subject: [PATCH 49/53] login: don't print motd if .hushlogin exists in users
 home

The .hushlogin file is already used by a bunch of other implementations
such as pkg-shadow or OpenBSDs and FreeBSDs login implementation.

Its purpose is quite simple, if the file exists the message of the day
isn't printed.
---
 loginutils/login.c | 6 +++++-
(Continue reading)

Peter Korsgaard | 24 Aug 15:54 2015

[PATCH] dmesg: add -r option to print raw format even when FEATURE_DMESG_PRETTY is enabled

Similar to the "big" util-linux version. For !DMESG_PRETTY, the option is accepted
(but ignored) as well, for compatibility reasons.

Signed-off-by: Peter Korsgaard <peter <at> korsgaard.com>
---
 util-linux/dmesg.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 81ba1c9..e543446 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
 <at>  <at>  -16,6 +16,7  <at>  <at> 
 //usage:     "\n	-c		Clear ring buffer after printing"
 //usage:     "\n	-n LEVEL	Set console logging level"
 //usage:     "\n	-s SIZE		Buffer size"
+//usage:     "\n	-r		Print raw message buffer"

 #include <sys/klog.h>
 #include "libbb.h"
 <at>  <at>  -29,11 +30,12  <at>  <at>  int dmesg_main(int argc UNUSED_PARAM, char **argv)
 	enum {
 		OPT_c = 1 << 0,
 		OPT_s = 1 << 1,
-		OPT_n = 1 << 2
+		OPT_n = 1 << 2,
+		OPT_r = 1 << 3
 	};

 	opt_complementary = "s+:n+"; /* numeric */
(Continue reading)

Bartosz Golaszewski | 21 Aug 16:23 2015
Picon

[RFC/PATCH v2 0/5] readahead: daemon mode

While working on an embedded system running several big services, X-org,
fluxbox, Qt5 etc. where the boot-time was awful, it turned out that the
readahead implementation from systemd (the one that was nuked in 2014)
improves the time needed to start all the programs by a few seconds.

This series introduces a small (LOC < 500) readahead daemon implementation
based on fanotify and readahead syscalls.

This series is also available at:

    https://github.com/brgl/busybox  readahead

v1:
http://lists.busybox.net/pipermail/busybox/2015-August/083236.html

v2:
- made daemon mode optional and disabled by default
- removed patches implementing system calls in busybox

Bartosz Golaszewski (5):
  libbb: add str_isblank() macro
  libbb: add DECIMAL_STR_MAX macro
  libbb: add ends_with() function
  libbb: add config_from_fp() and config_free() functions
  readahead: applet extension

 docs/readahead.txt           |  39 +++
 include/libbb.h              |  13 +
 libbb/compare_string_array.c |  30 ++
 libbb/parse_config.c         |  27 +-
(Continue reading)

linuxcbon linuxcbon | 15 Aug 09:28 2015
Picon

mdev : How to have kernel do modprobes ?

Hi,

I need the kernel to "auto" modprobe ("radeon" for example)

What my rc.sysinit has  :
- mount : /dev , /proc, /sys, /tmp, /var and / as root
- "mdev -s" , which only creates /dev files

I don't know what's missing so the kernel does "radeon" and all needed
modprobes...

Thanks in advance
Bartosz Golaszewski | 14 Aug 08:50 2015
Picon

[PATCH] Makefile: add missing libraries to LDLIBS

Static build with CONFIG_PAM fails on Debian Jessie due to undefined
references to libdl and libaudit.

Static build without pam, but with libcrypt required fails as well due
to undefined references to libpthread.

Fix these two cases by adding the missing libraries to LDLIBS when
appropriate.

Signed-off-by: Bartosz Golaszewski <bartekgola <at> gmail.com>
---
 Makefile.flags | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile.flags b/Makefile.flags
index a1ed148..bb90a08 100644
--- a/Makefile.flags
+++ b/Makefile.flags
 <at>  <at>  -121,20 +121,20  <at>  <at>  endif
 # fall back to using a temp file:
 CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o
/dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c)
 ifeq ($(CRYPT_AVAILABLE),y)
-LDLIBS += m crypt
+LDLIBS += m crypt pthread
 else
 LDLIBS += m
 endif

 ifeq ($(CONFIG_PAM),y)
(Continue reading)

Bartosz Golaszewski | 13 Aug 15:57 2015
Picon

[RFC/PATCH 00/10] readahead: daemon mode

While working on an embedded system running several big services, X-org,
fluxbox, Qt5 etc. where the boot-time was awful, it turned out that the
readahead implementation from systemd (the one that was nuked in 2014)
improves the time needed to start all the programs by a few seconds.

This series introduces a small (LOC < 500) readahead daemon implementation
based on fanotify and readahead/posix_fadvise syscalls.

I mark this as RFC to get some feedback first, but I hope this can get
merged too in the future.

Other patches in this series add some new functions/macros needed by
readahead, remove unneeded code or fix compilation issues in different
parts of code.

This series is also available at:

    https://github.com/brgl/busybox  readahead

Bartosz Golaszewski (10):
  unit-tests: remove unnecesary field from struct bbunit_listelem
  unit-tests: remove code depending on WANT_TIMING
  libbb: add str_isblank() macro
  libbb: add DECIMAL_STR_MAX macro
  libbb: add ends_with() function
  libbb: add fanotify support on uClibc
  libbb: add syncfs() support for uClibc
  libbb: add config_from_fp() and config_free() functions
  readahead: applet extension
  config: remove readahead from defconfig
(Continue reading)

Bastian Bittorf | 13 Aug 12:36 2015

ash: rm -f can fail

maybe this is a race?

root <at> box:~ rm -fR /tmp/dbcache
rm: can't remove '/tmp/dbcache': Directory not empty
root <at> box:~ echo $?
1
root <at> box:~ rm -fR /tmp/dbcache
root <at> box:~ echo $?
0

so it worked on the 2nd try. ideas?
this is v1.23.2 on OpenWrt with kernel 3.18.18

bye, bastian

Gmane