Commit Graph
34 Commits
Author SHA1 Message Date
Joachim Nilsson 1909dd475c progress(): Very simple ASCII progress bar from troglobit/toolbox@f98c5d0
This patch adds a very simple progress bar I wrote once.  It's revision
f98c5d0 from https://github.com/troglobit/toolbox

Also included in this patch is conio.h, a neat little set of macros for
manipulating your terminal using ANSI escape seequences.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-23 13:07:03 +02:00
Joachim Nilsson 1f1e88a640 New function: tree(), simple /bin/tree replacement.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-23 05:12:38 +02:00
Joachim Nilsson e8ff38ad6a Add autotest for fisdir()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 23:26:41 +02:00
Joachim Nilsson 1138822d19 Add autotest for fexist()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 23:22:38 +02:00
Joachim Nilsson de8f2b087c Add autotest for tempfile()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 23:08:22 +02:00
Joachim Nilsson 57c49bfe0c Add autotest for mkpath() and makepath()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 23:01:15 +02:00
Joachim Nilsson b59249714b Add autotest for fsendfile()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 22:49:48 +02:00
Joachim Nilsson 36da3aa35e Add autotest for dir
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 22:46:42 +02:00
Joachim Nilsson ab2b0f00fa Add autotest for pidfilefn et al.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 22:41:34 +02:00
Joachim Nilsson bd69aad13a Add autotest for copyfile et al.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 22:22:14 +02:00
Joachim Nilsson ebe2ad4a4c Add autotest for chomp
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 22:08:25 +02:00
Joachim Nilsson 2ea2357b62 Lay foundation for unit test build framework.
GNU Make double colon rules, rule ;-)

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-08-22 21:59:52 +02:00
Joachim Nilsson 61b1b5b457 Add support for 'make distdir' used by GNU configure and build.
This patch adds support for being called with "make distdir" from a GNU
configure and build based project.  This was a requirement to get the
Inadyn v1.99.14 release out.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-14 17:26:32 +02:00
Joachim Nilsson 4005dd5e2c Add simple IPv4 only ifconfig() function from Finit
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-10 18:28:57 +02:00
Joachim Nilsson 5a50a6add1 Add client side pidfile functions: pidfile_read(), pidfile_signal().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 01:36:58 +02:00
Joachim Nilsson 9ed00baa94 Add pidfile() from NetBSD/OpenBSD, missing in GLIBC.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 01:25:19 +02:00
Joachim Nilsson 1561e7567e Add recursive mkpath() and makepath(), works like mkdir -p
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-09 01:25:19 +02:00
Tobias Waldekranz 1423edc044 Factor out fsendfile() to reduce overall size when linking.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-05 15:21:55 +02:00
Joachim Nilsson c48ce14739 Default to silent build, use V=1 to get verbose mode.
Use kernel standard silent mode instead, and adopt kernel nomenclature
for enabling verbose mode.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-05 11:46:48 +02:00
Joachim Nilsson 6f19d1407a Default to verbose style build, use SILENT=1 to get silent mode.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-05 11:28:03 +02:00
Joachim Nilsson 436a07ee06 Remove STATIC ifdef, always build .a and .so files
Using libite as a GIT submodule in a autoconf/automake based project it
is non-trivial to set a separate environment variable when descending
into the libite subdirectory.

It is better to instead simplify the build process and always build both
.a and .so files.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-07-05 11:06:33 +02:00
Joachim Nilsson 35b43c5c56 Handle missing O_TMPFILE gracefully and document tempfile() in README
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-22 22:02:39 +02:00
Joachim Nilsson c5434a4bc0 Add tempfile() - a secure tmpfile() replacement using O_TMPFILE.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-22 21:42:38 +02:00
Joachim Nilsson 84c3667eba Default to -fPIC, bloats archives slightly, but works for everyone.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-18 02:24:17 +02:00
Joachim Nilsson 262f8b8936 Cleanup: Fix install/uninstall of both static and dynamic builds.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-18 02:14:55 +02:00
Tobias Waldekranz 121e8ee888 Add Westermo chomp() function, slightly improved from Finit original.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-17 22:07:10 +02:00
Joachim Nilsson 22a79ee947 Make libite standalone
Add basic .gitignore, cleanup inherited Makefile from Finit
and add a small rules.mk from libuEv.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-17 21:13:02 +02:00
Joachim Nilsson f35f64f06f Fix last part of issue #8: Libite install problem with --enable-static
Skip install of .so libs when user has configured with --enable-static

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-03-10 22:12:26 +01:00
Joachim Nilsson 8b7eb36d2a Overhaul build system and add support for disabling inetd support.
This patch adds support for a configure script and with it
support for disabling inetd support.  See the output from

    ./configure --help

* Add configure script
* Sprinkle #ifdef fairy dust on svc.c when inetd support is disabled
* Use GCC built-in autodep calculator (-MMD -MP)
* Fix name space issue with include files, use relative paths
* Disable username/group name to uid/gid functions in static builds
* Bug out (error) if a user tries to build the bootmisc plugin static

Possibly fixes GitHub issue #5 and issue #6.

NOTE: The static build has not received any testing at all!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-03-10 10:25:46 +01:00
Joachim Nilsson 5e31d05110 Initial support for building Finit statically (incomplete)
This patch adresses issue #5.  However, there still remains a few issues
to work around before Finit can be built completely standalone.

    $ make clean all STATIC=1
    LINK    finit
    helpers.o: In function `getgroup':
    helpers.c:(.text+0x10a7): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    helpers.o: In function `getuser':
    helpers.c:(.text+0x108e): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    inetd.o: In function `getent':
    inetd.c:(.text+0x127): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    inetd.c:(.text+0xce): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

The problem is the NSS plugins and similar issues that prevent static
linking when using the above functions.  See issue #5 for more on this.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-03-06 21:58:56 +01:00
Joachim Nilsson 949d0a020f Bump version for release and update copyright years.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2014-04-21 16:03:54 +02:00
Joachim Nilsson 499f4d45d3 libite: Add strtonum() from OpenBSD
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-05-21 19:55:41 +02:00
Mattias Walström 77971a31b2 libite: Add strlcat and strlcpy.
These function only exist on uClibc and BSD, so if they
not already defined in string.h, define them here.
2013-01-29 13:29:45 +01:00
Joachim Nilsson 777502f175 Fix I/O plugin watcher, load plugins earlier to enable a new early hook!
Restructure start by calling the plugin loader earlier. This makes it
possible to run hooks even earlier.  This also adds a new hook:
HOOK_ROOTFS_UP which runs as soon as the system root (/) is available.

Another very notable change is the slow refactor of helpers.c into a finit
helper library called libite.so (-lite). This is a light-weight

Also, lots of misc. fixes all over the place. Signal handling still really
needs to be looked into once more!

Makefile:
        Add dependency handling for parallell build
        Add libite library

ChangeLog:
        Update with new 1.4 release. There is a lot of fixes!

libite/:
        Collection of utility functions and C library extensions for
        finit & its plugins

reboot.c:
        New reboot tool. Simply sends SIGINT to PID 1

finit.h:
        Cleanup old LISTEN_INITCTL define, code is in an optional plugin now

finit.c:
        Let mdev/udev run *after* cls()
        Add useful debug statement for /proc/cmdline
        Earlier plugin load => new early hook point
        Show OK/FAIL for total plugin load, not for each plugin => speedup

helpers.h:
        Rename syslog macros to prevent common name clashes (DEBUG/ERROR)
        Add __FILE__ to _e(), _d() and _pe() macros

helpers.c:
        In ifconfig() the addr and mask arguments are now optional
        The copyfile() has been moved to libite.so
        Temporarily remove const directive from some functions to build
        Use DFLSIG() macro in run_getty() to simplify code

plugin.h:
        Add new HOOK_ROOTFS_UP hook

plugin.c:
        Fix init_plugins() to actually register the plugin's I/O fd
        Skip verbose listing of all plugins in plugin_load_all()

svc.c:
        svc_start(): Dito

plugins/Makefile:
        Inherit CFLAGS and LDFLAGS, but make sure to filter out -rdynamic
        from LDFLAGS, it's used by the daemon, only

plugins/initctl.c:
        New includes after helpers.h refactor

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2012-10-02 08:25:50 +02:00