Etienne CHAMPETIER [Wed, 1 Apr 2015 23:14:01 +0000 (01:14 +0200)]
logread: add support for non-transparent-framing for Syslog over TCP
https://tools.ietf.org/html/rfc6587#section-3.4.2
the idea is to add \n or \0 as message trailer so it's easier
to find message end
v2: simplify, use \n by default, with optional \0
Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
John Crispin [Sat, 28 Mar 2015 14:38:09 +0000 (15:38 +0100)]
properly handle return codes
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Sat, 28 Mar 2015 06:59:38 +0000 (07:59 +0100)]
properly handle return code of pipe() syscall
Signed-off-by: John Crispin <blogic@openwrt.org>
Christian Mehlis [Thu, 26 Mar 2015 13:51:21 +0000 (14:51 +0100)]
syslog: use appropriate levels for logging
Signed-off-by: Christian Mehlis <christian@m3hlis.de>
Jo-Philipp Wich [Thu, 26 Feb 2015 21:17:31 +0000 (22:17 +0100)]
kmodloader: initialize module folders in insmod
Fixes a segmentation fault in 'insmod' operation mode, due to uninitialized
path list.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich [Wed, 25 Feb 2015 20:48:05 +0000 (21:48 +0100)]
kmodloader: convert to ulog() api
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich [Tue, 24 Feb 2015 22:55:09 +0000 (23:55 +0100)]
kmodloader: search kmods relative to LD_LIBRARY_PATH
When LD_LIBRARY_PATH is set, then scan for kmods in each directory pointed to
by it. This is mainly useful for early boot invocations of kmodloader, e.g.
during the extroot setup phase.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
John Crispin [Fri, 3 Oct 2014 15:54:19 +0000 (17:54 +0200)]
hw_detect replaces this old code
Signed-off-by: John Crispin <blogic@openwrt.org>
Michel Stam [Thu, 2 Oct 2014 11:42:45 +0000 (11:42 +0000)]
Use different loglevels
Ubox logs various messages during OpenWRT boot which are not
very interesting, such as the number of iterations made. This
fix implements several loglevels for debug/info/error so that
more useful messages are shown.
Signed-off-by: Michel Stam <m.stam@fugro.nl>
John Crispin [Tue, 16 Sep 2014 12:20:30 +0000 (14:20 +0200)]
RFC 3164 compliant remote logging
When logread daemon send a syslog message to another host, time, severity and facility are cut off.
The message contains only text. This patch adds time, severity and facility in the message as described in the RFC 3164.
Signed-off-by: Belkov Max <belkov-max@mail.ru>
Alexandru Ardelean [Fri, 8 Aug 2014 07:48:52 +0000 (07:48 +0000)]
ubox: exit(1) in logd if registering log object with ubus fails
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Luka Perkov [Fri, 27 Jun 2014 14:23:43 +0000 (14:23 +0000)]
validate: return error on failed validation
In the procd script (/lib/functions/procd.sh) uci_validate_section is in charge
of validating the uci config files. The uci_validate_section function checks
return code of validate_data tool; without this change in case of invalid
config values the function is not able to catch errors.
Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov [Fri, 27 Jun 2014 08:09:04 +0000 (08:09 +0000)]
validate: add missing yes/no boolean values
Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov [Fri, 27 Jun 2014 08:09:03 +0000 (08:09 +0000)]
validate: add valid bool types enabled/disabled
They are already supported in config_get_bool function found in OpenWrt
base-package.
Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov [Fri, 27 Jun 2014 08:09:02 +0000 (08:09 +0000)]
validate: fix indentation
Signed-off-by: Luka Perkov <luka@openwrt.org>
Felix Fietkau [Wed, 28 May 2014 21:28:28 +0000 (23:28 +0200)]
kmodloader: force size argument for syscall to unsigned long to fix issues with musl
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 25 May 2014 20:00:58 +0000 (22:00 +0200)]
ubox: only link libraries that are actually used
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
John Crispin [Thu, 27 Mar 2014 12:04:24 +0000 (12:04 +0000)]
log: remove superflous client_close call
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 26 Mar 2014 14:48:24 +0000 (14:48 +0000)]
mount_root/block: these tools were moved to the fstools repo
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Tue, 18 Mar 2014 06:58:38 +0000 (06:58 +0000)]
logd: fix time passed via unix fd
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 12 Mar 2014 07:00:11 +0000 (07:00 +0000)]
logd: fix internal buffer size
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 12 Mar 2014 04:01:42 +0000 (04:01 +0000)]
logd: fix pipe close
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 26 Feb 2014 02:57:30 +0000 (02:57 +0000)]
logd: transport log data via the new ubus fd api
this fixes the size limitation patch.
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 26 Feb 2014 06:02:07 +0000 (06:02 +0000)]
kmodloader: fix insmod when the passed parameter is a valid path
Signed-off-by: John Crispin <blogic@openwrt.org>
Jo-Philipp Wich [Fri, 21 Feb 2014 15:29:11 +0000 (16:29 +0100)]
validate: range and base arguments for numeric types, new types hexstring, regexp and uci
- make uinteger and integer types more strict, they will not accept
leading spaces or plus signs anymore
- add optional base argument to uinteger and integer data types, e.g.
integer(16) will accept -af or 0xaf, a base of 0 (the default) will
use the underlying heuristics of strtol() / strtoul()
- add optional min and max options to string() datatype, e.g.
string(3) only accepts strings longer than 3 chars, string(8, 63)
will accept strings between 8 and 63 characters in length
- add hexstring([minlen [, maxlen]]) type which will accept
long hex encoded strings whose length must be a multiple of 2
- add regexp(pattern) type which applies an extended POSIX regular
expression on the value to test. The given pattern is implicitely
anchored, e.g. regexp("[a-z]+") will match /^[a-z]+$/
- add uci(package, {@type|name}[, option]) type which tests the input
against selected uci values, e.g.
* uci("network", "@interface") would allow values that match
the name of any section of type "interface" in /e/c/network
* uci("network", "@interface", "ifname") would allow any value
that matches one of the ifnames in any section of type
interface in /e/c/network
* uci("system", "ntp", "server") would allow any value that
matches on of the servers in the "server" option of the "ntp"
section in /e/c/system
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich [Wed, 4 Dec 2013 16:34:43 +0000 (16:34 +0000)]
block: add more diagnostic messages
Jo-Philipp Wich [Wed, 4 Dec 2013 16:34:23 +0000 (16:34 +0000)]
mount_root: add more diagnostic messages
Jo-Philipp Wich [Tue, 3 Dec 2013 18:14:48 +0000 (18:14 +0000)]
mount_root: try both $prefix/sbin/block and /sbin/block, fixes extroot with builtin block-mount
John Crispin [Wed, 22 Jan 2014 17:57:09 +0000 (17:57 +0000)]
kmodloader: allow /etc/modules.d/ files to pass options
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 22 Jan 2014 16:35:21 +0000 (16:35 +0000)]
ubox: make logd use new ubus autoconnect
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 22 Jan 2014 13:57:07 +0000 (13:57 +0000)]
logd: revert the log size changes
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Tue, 21 Jan 2014 13:00:19 +0000 (13:00 +0000)]
logd: prevent the buffer from being bigger than the maximum ubus size
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Sun, 19 Jan 2014 18:32:58 +0000 (18:32 +0000)]
logd: allow setting the buffer size from the command line
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Thu, 16 Jan 2014 00:29:16 +0000 (00:29 +0000)]
kmodloader: fix elf header parsing on 64bit machines
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Wed, 15 Jan 2014 22:23:04 +0000 (22:23 +0000)]
block: remove duplicate block device wildcard
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Sun, 12 Jan 2014 13:07:18 +0000 (14:07 +0100)]
fix bogus kmodloader warning
https://dev.openwrt.org/ticket/14659
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Mon, 9 Dec 2013 18:12:15 +0000 (19:12 +0100)]
logread: fix initial connect. we really need a better reconnect logic
Signed-off-by: John Crispin <blogic@openwrt.org>
Jo-Philipp Wich [Sat, 30 Nov 2013 17:35:08 +0000 (17:35 +0000)]
validate: properly deal with datatype expressions containing escaped colons
Jo-Philipp Wich [Sat, 30 Nov 2013 16:47:08 +0000 (16:47 +0000)]
validate: fix length calculation of string literals and store value type for literal comparisations
Jo-Philipp Wich [Sat, 30 Nov 2013 14:53:39 +0000 (14:53 +0000)]
validate: fix return type of dt_parse() call
Jo-Philipp Wich [Thu, 28 Nov 2013 21:20:08 +0000 (21:20 +0000)]
validate: support uci lists in cli client and use dt_parse() return value to decide whether an option should be handled as bool
Jo-Philipp Wich [Thu, 28 Nov 2013 21:19:34 +0000 (21:19 +0000)]
validate: change dt_parse() to return an enum indicating the kind of value that was matched (bool, number, string)
John Crispin [Wed, 20 Nov 2013 22:54:14 +0000 (23:54 +0100)]
add a c version of the current uci_valisate call to the cli
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Tue, 19 Nov 2013 19:58:38 +0000 (20:58 +0100)]
make use of the md5.c inside libubox
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Sat, 16 Nov 2013 19:55:14 +0000 (20:55 +0100)]
revert
2fdd374f4214129d93f10b7001adece9239752a2
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Thu, 14 Nov 2013 12:48:48 +0000 (13:48 +0100)]
update gitignore
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Thu, 14 Nov 2013 12:47:18 +0000 (13:47 +0100)]
add log daemon
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Thu, 14 Nov 2013 12:43:19 +0000 (13:43 +0100)]
add validation code
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Fri, 8 Nov 2013 21:59:58 +0000 (22:59 +0100)]
kmod-loader: fix module options support when using modprobe
Signed-off-by: John Crispin <blogic@openwrt.org>
Jo-Philipp Wich [Wed, 6 Nov 2013 12:54:16 +0000 (12:54 +0000)]
block: support extroot and overlay mounts by device
Jo-Philipp Wich [Wed, 6 Nov 2013 12:48:01 +0000 (12:48 +0000)]
block: fix find_block_info() by label
Nathan Hintz [Sat, 2 Nov 2013 17:31:41 +0000 (17:31 +0000)]
support specifying swap priority from the command line
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Luka Perkov [Tue, 9 Jul 2013 23:50:48 +0000 (01:50 +0200)]
close file pointer before exiting function
Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov [Thu, 24 Oct 2013 00:28:20 +0000 (02:28 +0200)]
fix typo
Signed-off-by: Luka Perkov <luka@openwrt.org>
John Crispin [Mon, 7 Oct 2013 15:46:45 +0000 (17:46 +0200)]
add support for patched rootfs
Signed-off-by: John Crispin <blogic@openwrt.org>
Jo-Philipp Wich [Mon, 14 Oct 2013 14:13:40 +0000 (14:13 +0000)]
kmodloader: respect global directory prefix in scan_module_folder()
Jo-Philipp Wich [Sat, 28 Sep 2013 16:32:29 +0000 (16:32 +0000)]
kmodloader: use the name of the found module struct for modinfo
The module .ko file might be called differently than the name used
by the kernel internally, e.g. "nls_iso8859-1.ko" is called
"nls_iso8859_1" in lsmmod. The print_modinfo() procedure expects the
filename spelling in order to successfully resolve the full module path.
After this change, "modinfo" supports printing module info even if the
user gives the kernel internal spelling instead of the file name one,
so that e.g. "modinfo "nls_iso8859_1" and "modinfo nls_iso8859-1.ko" will
both succeed.
Jo-Philipp Wich [Sat, 28 Sep 2013 16:25:47 +0000 (16:25 +0000)]
kmodloader: use the name of the module struct when unloading modules
The module .ko file might be called differently than the name used
by the kernel internally, e.g. "nls_iso8859-1.ko" is called
"nls_iso8859_1" in lsmmod. The module removal syscall expects the
latter as well.
After this change, "rmmod" supports unloading the module even if the
user gives the file name spelling instead of the kernel internal one,
so that e.g. "rmmod nls_iso8859-1.ko" and "rmmod nls_iso8859_1" will
both succeed.
Jo-Philipp Wich [Sat, 28 Sep 2013 14:41:50 +0000 (14:41 +0000)]
kmodloader: properly handle modules with both underscores and dashes in their name
John Crispin [Thu, 19 Sep 2013 13:15:09 +0000 (15:15 +0200)]
fix hyphen substitution in path
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Tue, 17 Sep 2013 21:27:58 +0000 (23:27 +0200)]
cosmetic cleanup of - vs _ patch
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Fri, 13 Sep 2013 18:15:15 +0000 (20:15 +0200)]
fix _ vs - bug
Signed-off-by: John Crispin <blogic@openwrt.org>
Jo-Philipp Wich [Thu, 5 Sep 2013 15:21:09 +0000 (17:21 +0200)]
kmodloader: don't free memory allocated with alloca()
Jo-Philipp Wich [Thu, 5 Sep 2013 15:19:41 +0000 (17:19 +0200)]
block: properly handle vlist_add() for label, uuid and device cases
John Crispin [Mon, 19 Aug 2013 19:41:48 +0000 (21:41 +0200)]
add proper modprobe support
Signed-off-by: John Crispin <blogic@openwrt.org>
Jo-Philipp Wich [Fri, 16 Aug 2013 13:04:59 +0000 (15:04 +0200)]
block: do a final round of swapfile mounting in main_mount()
This allows reenabling swap after "swapoff -a" when all other partitions are mounted already.
Jo-Philipp Wich [Fri, 16 Aug 2013 13:04:34 +0000 (15:04 +0200)]
block: support mounting swap by label
Jo-Philipp Wich [Fri, 16 Aug 2013 12:56:20 +0000 (14:56 +0200)]
block: remove debug prints
Jo-Philipp Wich [Fri, 16 Aug 2013 12:28:54 +0000 (14:28 +0200)]
block: add support for mounting swap files
Jo-Philipp Wich [Fri, 16 Aug 2013 11:52:51 +0000 (13:52 +0200)]
libblkid-tiny: allow probing files
Jo-Philipp Wich [Fri, 16 Aug 2013 10:22:34 +0000 (12:22 +0200)]
block: add support for generic mount options
Not all mount options are to be passed directly to the filesystem driver,
some of them are generic VFS flags that must be passed as bitfield to the
mount() syscall.
Add a new option parsing implementation that properly divides the user
sepcified mount options into flags and fs specific arguments.
Jo-Philipp Wich [Wed, 31 Jul 2013 10:42:42 +0000 (12:42 +0200)]
block: enlarge uuid buffer when writing extroot tag file, some uuids exceed 32 byte in size
Jo-Philipp Wich [Fri, 26 Jul 2013 09:05:37 +0000 (11:05 +0200)]
block: suggest a default delay_root value of 5 seconds, since it is almost always needed when running block from jffs2
Jo-Philipp Wich [Fri, 26 Jul 2013 09:03:26 +0000 (11:03 +0200)]
mount_root: umount /tmp/overlay in external root case as well
Jo-Philipp Wich [Fri, 26 Jul 2013 08:58:14 +0000 (10:58 +0200)]
mount_root: support extroot from block-mount on jffs2
- retry extroot after mounting jffs2
- look for /sbin/block in jffs2
- load all kmods from jffs2
- cleanup temporary directories after extroot
Jo-Philipp Wich [Fri, 26 Jul 2013 08:57:30 +0000 (10:57 +0200)]
block: stage extroot mounts in /tmp/extroot since /tmp/overlay might be in use by jffs2 already
Jo-Philipp Wich [Fri, 26 Jul 2013 08:57:01 +0000 (10:57 +0200)]
kmodloader: support loading modules from a different prefix
Jo-Philipp Wich [Thu, 25 Jul 2013 14:17:52 +0000 (16:17 +0200)]
block: restore support for using swap files
Jo-Philipp Wich [Thu, 25 Jul 2013 12:23:07 +0000 (14:23 +0200)]
block: discard vfat labels with only spaces
Jo-Philipp Wich [Wed, 24 Jul 2013 18:11:19 +0000 (20:11 +0200)]
block: strip trailing spaces from vfat labels
Strip trailing spaces from vfat labels to mimic the behaviour of "blkid"
Jo-Philipp Wich [Wed, 24 Jul 2013 18:10:09 +0000 (20:10 +0200)]
block: use dynamically sized probe buffer in libblkid-tiny
This fixes label extraction on vfat partitions with large cluster sizes,
the previous statically sized buffer of 4096 bytes was too small.
Jo-Philipp Wich [Wed, 24 Jul 2013 10:03:45 +0000 (12:03 +0200)]
block: remove uneeded le32_to_cpu() calls in vfat probe function - the call is not required due to direct memcmp() and actually breaks the filesystem signature
John Crispin [Tue, 23 Jul 2013 11:43:10 +0000 (13:43 +0200)]
allow mtd devices to be mounted by block tool
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Tue, 23 Jul 2013 11:23:52 +0000 (13:23 +0200)]
fix swapoff help text
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Tue, 23 Jul 2013 09:27:43 +0000 (11:27 +0200)]
add a -s option to swapon
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Mon, 22 Jul 2013 06:17:58 +0000 (08:17 +0200)]
fix m5sum / uuid of squshfs devices
Signed-off-by: John Crispin <blogic@openwrt.org>
Jo-Philipp Wich [Fri, 19 Jul 2013 14:43:35 +0000 (16:43 +0200)]
block: fix possible NULL pointer dereference in mount_device()
Jo-Philipp Wich [Fri, 19 Jul 2013 13:44:46 +0000 (15:44 +0200)]
block: also handle /dev/mdX (softraid) and /dev/mapper/* (LVM2) devices
Jo-Philipp Wich [Fri, 19 Jul 2013 13:43:37 +0000 (15:43 +0200)]
block: ignore probe entries without id
Felix Fietkau [Mon, 15 Jul 2013 08:17:43 +0000 (10:17 +0200)]
kmodloader: fix path printf handling
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 12 Jul 2013 15:54:29 +0000 (17:54 +0200)]
kmodloader: eliminate some hardcoded buffer sizes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 12 Jul 2013 15:10:41 +0000 (17:10 +0200)]
kmodloader: reduce indentation depth
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 12 Jul 2013 15:01:56 +0000 (17:01 +0200)]
kmodloader: use avl tree and calloc_a
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 12 Jul 2013 14:25:56 +0000 (16:25 +0200)]
add block to .gitignore
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
John Crispin [Thu, 11 Jul 2013 16:31:40 +0000 (18:31 +0200)]
make block handle the same block device types as luci
Signed-off-by: John Crispin <blogic@openwrt.org>
Peter Wagner [Thu, 11 Jul 2013 10:02:06 +0000 (10:02 +0000)]
ubox fix extroot delay
This patches fixes the extroot delay. It creates the devicefiles again
when no device was found and updates the device list afterwards.
Signed-off-by: Peter Wagner <tripolar@gmx.at>
John Crispin [Tue, 9 Jul 2013 12:30:39 +0000 (14:30 +0200)]
improve e2fsck handling
Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin [Tue, 9 Jul 2013 12:29:40 +0000 (14:29 +0200)]
run basename() on user provided device names
Signed-off-by: John Crispin <blogic@openwrt.org>
Peter Wagner [Mon, 1 Jul 2013 20:22:21 +0000 (20:22 +0000)]
add option to check ext* partitions before mounting V3
UpdatesV2: Check for e2fsck before calling it.
fix whitespace
Updates V3: fix another whitespace
This patch adds a new option called check_fs to /etc/config/fstab, if set to '1' every partition with ext* fs
will be checked before it gets mounted.
Signed-off-by: Peter Wagner <tripolar@gmx.at>
with minor changes to http://patchwork.openwrt.org/patch/3791/
Signed-off-by: John Crispin <blogic@openwrt.org>
Peter Wagner [Sat, 29 Jun 2013 15:42:11 +0000 (15:42 +0000)]
add delay for root partition when extroot is used
This patch adds a new option called delay_root to /etc/config/fstab. This option defines
how long mount_root should wait (in seconds) for an external storage to show up.
Signed-off-by: Peter Wagner <tripolar@gmx.at>