Commit Graph

8908 Commits

Author SHA1 Message Date
Norman Feske eefe91ee41 depot_download_manager: no mtime update in extract
With the added modification-time support in the libc, the extract tool
requires a timer session, which is not plausible for the purpose of the
program.

This behavior stems from the fact that the libc implicitly writes the
mtime when closing a written file. For this update, it implicitly calls
'clock_gettime', which in turn initializes the timer subsystem within
the libc (creating a timer session).

For the extract tool, the implicitly updated mtime is useless because
the extract tool overwrites this modification time with the mtime stored
in the archive anyway. However, the dependency from a timer service
remains.

This patch explicitly disables the libc's implicit updating of the
file-modification when closing a written file.

Issue #1784
2019-11-19 14:19:34 +01:00
Norman Feske 979d823d85 libc: make mtime update configurable
By specifying <libc update_mtime="no"...>, the modification-time update
on VFS-sync operations (as issued whenever a written file is closed)
can explicitly be disabled.

Issue #1784
2019-11-19 14:19:34 +01:00
Christian Helmuth 76438a3f85 dde_linux: refactor usb arch-dependent includes
Also added arm_64/arm_v8, which fixes building board-independent usb_hid
etc.
2019-11-19 14:19:34 +01:00
Christian Helmuth b0271ae5e1 Fix hard-disk image creation in vfs server tests
The hard-disk image must be created before boot-image creation as it is
used as boot module by variants of the test (use_ram_block=true).
2019-11-19 14:17:30 +01:00
Norman Feske 6a063364da fs_rom: adaptation to added file-modification time
Issue #1784
2019-11-19 14:17:30 +01:00
Josef Söntgen 99b632f86c server/vfs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 180f9e6384 libc: handle modified files
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 94b63924ed noux: add time modification
... and set initial time by using RTC session.

Up to now Noux used a monotic clock whose initial start value always
was '0' (which correlates to the start of the UNIX epoch) to provide
a notion of time. In addition it is now possible to use the RTC
session to set the initial value for use cases where having a proper
real-world time matters.

To use the RTC session the 'rtc' attribute of the '<config>' node
must be set to 'yes'. Thereby the session becomes a mandatory
dependency as Noux will not start without it.

Issue #1784
2019-11-19 14:17:30 +01:00
Josef Söntgen d0bf6d2b52 libc: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 9a82bbb54d vfs: add modification time member to directory_service
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 400039e1b6 rump_fs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 2e5166efd7 lx_fs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 2ec3aaf639 file_system_session: add modification time
* add modification_time member
* add WRITE_TIMESTAMP packet
2019-11-19 14:17:30 +01:00
Norman Feske ab5187d673 libc: resolve symlinks in execve
This patch complements the commit "libc: execve" with the ability to
execute files stored at arbitrary sub directories of the file system.

Issue #3481
Issue #3500
2019-11-19 14:17:29 +01:00
Norman Feske 697d496093 ldso: don't strip leading path from ROM name
This patch removes ldso's builtin policy of removing any path elements
prepending the ROM module name. Instead, the ROM name is used as is.
This clears the way to access different ROM modules that share the same
name but are stored at different directories behind an fs_rom (e.g.,
/bin/bash vs. /usr/local/bin/bash).

Issue #3500
2019-11-19 14:17:29 +01:00
Norman Feske a17c5e30b7 mk/gnu_build.mk: avoid absolute lib paths
This patch changes the way how libraries are specified at the linker
command line from /abs/path/to/library.lib.so

Issue #3500
2019-11-19 14:17:29 +01:00
Christian Helmuth 8d6285927b tools.conf: fix check for arm_64
Before arm matched first resulting in the wrong tool-chain binaries
being used.
2019-11-19 14:17:29 +01:00
Norman Feske 90a91f3536 dde_linux: eliminate global ctors in lx_kit
As the lx_kit library is used by the vfs_lxip plugin, it must not
contain any static global constructor.

Related to issue #3487
2019-11-19 14:17:29 +01:00
Norman Feske c8b7710e5d libc: improve dup/dup2 in vfs_plugin
This patch replaces the naive dup2 implementation (that merely
duplicated the context pointer) by the replication of the original
FD state by re-opening the same file with the same flags and seek
position. This prevents a potential double release of the VFS handle
(the FD context). It also implements 'dup'.

Fixes #3505
Fixes #3477
2019-11-19 14:10:55 +01:00
Norman Feske 59c60b8031 test-libc: test double dup2, dup
Issue #3477
Issue #3505
2019-11-19 14:10:55 +01:00
Norman Feske 9500e8b6e1 lwip: remove use of global constructor
Related to issue #3487
2019-11-19 14:10:55 +01:00
Norman Feske e0ee56275e vfs_lwip: fix switch fall-through
Pointed out by a compiler warning.
2019-11-19 14:10:55 +01:00
Norman Feske 418ac4c560 libc: remove global watch() function
This patch replaces the function with a 'Watch' interface to be
explicitly passed to the caller (currently only time.cc).

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske 5f5d709c07 libc: remove global libc_config()
Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske 89a38723bd libc: reimplement passwd handling
- Eliminate call of global libc_config()
- Remove dynamic memory allocation, const cast
- Prepare for moving the state from compilation unit to header
- Fix run/libc_getpwent.run

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske 648bcd1505 libc: unify use of namespaces
This patch unifies the patterns of using the 'Genode' and 'Libc'
namespaces.

Types defined in the 'internal/' headers reside in the 'Libc'
namespace. The code in the headers does not need to use the
'Libc::' prefix.

Compilation units import the 'Libc' namespace after the definition of
local types. Local types reside in the 'Libc' namespace (and should
eventually move to an 'internal/' header).

Since the 'Libc' namespace imports the 'Genode' namespace, there is
no need to use the 'Genode::' prefix. Consequently, code in the
compilation units rarely need to qualify the 'Genode' or 'Libc'
namespaces.

There are a few cases where the 'Libc', the 'Genode', and the global
(libc) namespaces are ambigious. In these cases, an explicit
clarification is needed:

- 'Genode::Allocator' differs from 'Libc::Allocator'.
- 'Genode::Env' differs from 'Libc::Env'.
- Genode's string functions (strcmp, memcpy, strcpy) conflict
  with the names of the (global) libc functions.
- There exist both 'Genode::uint64_t' and the libc'c 'uint64_t'.

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske bf92232698 libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.

The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.

The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.

There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.

Issue #3497
2019-11-19 14:10:55 +01:00
Emery Hemingway c6c7870a29 Fix bad include path in genode-base.pc
Add the top-level of include to the search path, not include/base.
2019-11-14 08:56:19 +01:00
Emery Hemingway 0b427b65aa Tup: build vfs_import 2019-11-10 13:41:49 +01:00
Emery Hemingway c2a543ed20 test/log: exit when complete 2019-11-10 13:40:40 +01:00
Emery Hemingway 1dc25293b8 Startup library header path must be overriden
The startup library might fail at runtime if local headers are included
rather than headers from somewhere else.
2019-10-28 15:25:18 +01:00
Emery Hemingway 3bf1cc09eb Move startup library to a Tup group 2019-10-28 11:32:29 +01:00
Emery Hemingway fa0c527732 Revert changes to closing of remote VFS handles 2019-10-28 11:32:29 +01:00
Emery Hemingway 29613c217b Tup: increase default optimization level to -O2 2019-10-28 11:32:29 +01:00
Emery Hemingway be04cfe899 Remove spec_includes replacements from pkg-config 2019-10-28 11:32:29 +01:00
Emery Hemingway f037044ec5 Move Tup rules local to this repo to "repos"
Make the top-level Tuprules.tup generic enough to be shared with other projects.
2019-10-28 11:32:29 +01:00
Emery Hemingway ecd0252b40 Publish core-nova.o in dev output 2019-10-28 11:32:29 +01:00
Emery Hemingway 4921168eda test/vfs_stress: annotate switch label fall-throughs
This test was written for speed, not correctness.

Fixes #3516
2019-10-28 11:32:29 +01:00
Emery Hemingway af52274972 Tup: add x86 drivers from os repo 2019-10-28 11:32:29 +01:00
Emery Hemingway f931ce2e19 Clang: address of packed member 2019-10-28 11:32:29 +01:00
Emery Hemingway ac8fb6702a Clang: do not use angle brackets for local includes 2019-10-28 11:32:29 +01:00
Emery Hemingway c67d81dc99 Tup: rename INCLUDES to CPPFLAGS 2019-10-28 11:32:29 +01:00
Emery Hemingway 3c8117e555 Clang: uninitialized 2019-10-28 11:32:29 +01:00
Emery Hemingway a7a0d3fe63 Refactor Tup, flatten output directories
Make no attempt to replicate the depot layout.
2019-10-28 11:32:29 +01:00
Emery Hemingway d348e96b84 base-common: copy all sparse ELF segments, including read-only 2019-10-28 11:32:29 +01:00
Emery Hemingway 5e87eee9b8 Genode::Capability_space: bypass static constructor where possible 2019-10-04 00:52:03 +02:00
Emery Hemingway 6e9f9ce3a8 Core includes untangling
Express convoluted include walks directly in code, do not hide them
in build scripts.
2019-10-04 00:52:02 +02:00
Emery Hemingway a83ffd4821 Multiple inheritance considered harmful 2019-10-04 00:52:02 +02:00
Emery Hemingway d07ff84f5c Tup: remove gems 2019-10-04 00:52:02 +02:00
Emery Hemingway 790b82a88d Tup: reduce output path variables 2019-10-04 00:52:02 +02:00