udhcpc: use readlink rather than realpath

The realpath utility requires all paths exist when canonicalizing
symlinks.  If /etc/resolv.conf points to a tmpfs, then it might
not exist initially.  Use `readlink -f` so that we follow all
symlinks that are available.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
platform: use KERNEL_VERSION to simplify uClibc version checking

This makes reading the logic (as well as adding new code) a lot simpler,
and fixes one or two cases that were broken due to incorrect sub-version
tests.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
readlink: uClibc supports automatic allocation too now

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
readlink: note that our -f is really -e

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
losetup: fix util-linux compatibility

Added -a support. Also made sure -f works as follows:

losetup [-r] [-o offset] {-f|loopdev} file

Removed support for 'losetup -r' with no arguments.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
awk: Fix handling of functions with empty body

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
udhcpd: add -I LOCAL_ADDR option

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
udhcpd: also add -I ADDR to help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
ping[6]: accept and ignore -n. Code shrink

function                                             old     new   delta
print_stats_and_exit                                 270     232     -38

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
nanddump: fix build if nandwrite isn't enabled

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
flash_eraseall: implement -N

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
traceroute: free some memory allocated by xzalloc()

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
sysklogd: trim help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
vi: fix adjustment of buffer on partial file read

The second argument to text_hole_delete was incorrect: it should
be a pointer to the end of the hole.

Signed-off-by: Ron Yorston <rmy@tigress.co.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
vi: code shrink

function                                             old     new   delta
status_line_bold_errno                                 -      32     +32
colon                                               2891    2873     -18
file_insert                                          354     313     -41
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 32/-59)            Total: -27 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
ash: move code to allow setting $HOME in /etc/profile

move HISTFILE=$HOME/.ash_history below reading /etc/profile,
so that /etc/profile can set $HOME. HOME can be unset when
directly invoking ash --login from init without going through
getty.

Signed-off-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
ash: read $HOME/.profile instead of $(pwd)/.profile

ash --login should read ~/.profile instead of .profile in the current
directory. I noticed it while trying to figure out why /root/.profile
is only read sometimes.

function                                             old     new   delta
ash_main                                            1374    1398     +24

Signed-off-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Merge remote-tracking branch 'bb/master' into sm-jb-mr1