157 Commits
Author SHA1 Message Date
The Thor Group 0df1ec86ab Add SAS => SATA port shimming -
The Thor Group ccc7acb77b Rename VirtIO storage shim to more universal SATA port shim -
The Thor Group df46c82478 Fix tools exec permission -
The Thor Group c88f772011 Add telnet auto helper -
The Thor Group 19f745a2ad Make ovs locking more robust in race condition scenarios -
The Thor Group 0065c89e10 Make ovs locking more robust on SMP -
The Thor Group 9528a3e83e Add missing double-reg/ureg protection to execve() interceptor -
The Thor Group cdc0e2de92 Change execve() interceptor to properly handle stack frame -
The Thor Group 59bb83acf8 Add better error handling to always_serial -
The Thor Group 122470d611 Separate override syscall from override symbol
Due unique characteristics of stub syscalls
(e.g. fork or execve) a special care needs
to be taken to ensure no compiler
optimizations nor C calling convention will
break the stack and/or registers. In this
commit we separated normal override syscall
routines while adding helper macros to
define syscall shims properly once and for
all (hopefully). They ensure proper linkage
and calling conventions are used (even if
not enforced).

This also adds more documentation to the
override_syscall with hints how to properly
override different syscalls.

Reading of the two following articles is
mandatory:
https://lwn.net/Articles/604287/
https://lwn.net/Articles/604406/
-
The Thor Group 3474d9bc83 Add dated postfix for non-VCS builds -
The Thor Group f3946dceb6 Fix build with HWMON & HWCAP -
The Thor Group 014f70e712 Add HWMON emulation
This commits adds an extensive (yet not full)
hwmon subsystem emulation. It generates a
believable values on-the-fly to match the
target hardware specification (based on the
platform-specific sensors added earlier).
In the future this layer may be fed by the
external source and serve as a simple proxy
between real values gathered by some driver
and structures the mfgBIOS (and its ioctl
callers) expect. This would be similar to the
syno-modfied drivers/hwmon/adt7475.c driver
from the GPLed kernel sources.
-
The Thor Group 7d95ce2ec7 Add emulation of GetHwCapability using internal platform info
Normally GetHwCapability depends on some external
factors and is provided by the mfgBIOS. Instead of
discovering all the peculiarities of every platform
we simply shim the GetHwCapability to provide rest
of the system information about the physical
capabilities of the platform the OS is running on.

Technically it's possible to extend capabilities
beyond what the original platform support but it's
not recommended as the original mfgBIOS for the
given platform may have some unknown assumptions
hardcoded in its closed-source implementation.
-
The Thor Group 169c444244 Refactor mfgBIOS shims collection to allow for easier extension -
The Thor Group 278ee99a4d Add support for SMART log directory
We've observed that 918 platform likes
to optimize calls by asking for the log
directory from time to time, instead of
pulling the logs right away. This call
wasn't implemented original.
If that call is not implemented errors
are logged as this isn't technically a
requirement in the ATAPI spec but normal
drives which support SMART logging also
support the log directory. A classic
example of spec vs. real life.
-
The Thor Group 80a2879aae Fix RTC auto power-on scheduling save with no schedules set -
The Thor Group 16adab519d Add HWMON definitions to platforms
Every hardware platform contains a more or
less extensive monitoring capabilities. Most
use what's called hwmon, which through
multiple layers lands data in /run/hwmon.
This commit introduces definitions of supported
sensors and configuration for each of the
platforms currently defined. This is necessary
to properly support v7 release (it was mostly
ignored in v6).
-
The Thor Group 72cb5c3620 Change mfgBIOS structures to fit the real v6 & v7 state
The original header for mfgBIOS contain some
degree of information which can be simply included.
However, there are bunch of things which are
missing. We're attempting to avoid duplication
here.
Due to how synobios_ops (our VTK_*) were silently
changed between v6 and v7 forced us to introduce
a change we hate - v6/v7 designation during
compile time. Unfortunately, some structures
have been rearranged without any ifdefs so we
will be shimming wrong things depending on the
OS version. However, such huge change isn't
going to happen often.
-
The Thor Group d79ede5f8f Extract platform config from main runtime config -
The Thor Group ecb212e276 Add mathematics helper lib -
The Thor Group dee97680c1 Add override_symbol() error handling helper -
The Thor Group 4ebcb10bfb Add external override_symbol reset -
The Thor Group aaa5847c58 Prevent "I/O scheduler not found" errors -
The Thor Group f3fcc22e6a Fix broken mfgc_set_hdd_led_cb definition on port_mapping_v2 platforms -
The Thor Group f486cc8c87 Dial back ioctl() logging -
The Thor Group 021ed51e7f Fix broken rebase... again -
The Thor Group d366278c29 Fix small memory leak -
The Thor Group 47de12555d Fix broken rebase causing NULL ptr -
The Thor Group 15243b0acc Add small tool to make working with serials on proxmox easier -
The Thor Group 061b3e643d Rename ambiguous "SATA boot shim" to "native SATA boot shim"
Since the introduction of "fake SATA boot shim",
emulating cut-out SATA DOM functionality on some
platforms this SATA shim became ambiguous. This
commit fixes it by clearly indicating what it is.
-
The Thor Group 4a993bdf6b Update build config for all recent commits -
The Thor Group de5099c015 Add experimental support for SATA boot on system lacking native SATA DOM support
This method is rather hacky and may be unstable in the future.
There's no danger of using it, but it may simply not work on
boot. Despite all the safeguards in place it's recommended to
use USB boot when possible over the fake-SATA boot device.
Unlike native SATA DOM shimming this method is not officially
supported by the syno kernel and relies on clever assumptions.
-
The Thor Group 1a3039f3b0 Refactor native SATA boot shim to use SCSI notifier & follow DRY
SATA boot shim contains a lot of moving parts. It
housed private overrides for its own functions,
conflicted with the SCSI notifier (and duplicated
its functionality partially) and many others. This
commit removes all duplicated code and changes the
logic to use already existing components available
in this module to make the shim simple and easy
to follow.
-
The Thor Group 90acf3407e Extract USB boot low-level manipulations to a base submodule -
The Thor Group 4b59050398 Fix CLion include paths -
The Thor Group 2ce06db3ef Add support for SCSI VirtIO disks
VirtIO is natively supported by the kernel, with
modules provided in the boot disks. However, VIO
disks can be attached via SATA or SCSI. The major
advantage of using SCSI is the number of disks
possible. However, they're not considered as SATA
complaint disks (i.e. normal disks) in the syno
kernel if not running VDSM. This commits adds
that (natively supported) feature back for all
platforms.
-
The Thor Group 9ed56540fd Fix memory management in symbol override -
The Thor Group 098bae23fe Add SCSI notifications subsystem
Linux kernel contains a lot of standardized pub/sub
notification chains. SCSI layer, as a very old one,
lacks the support for any form of notifications. We
need the information about devices coming and going
so we added the SCSI notification layer ourselves,
plugging into the standard Linux notifications
library.
-
The Thor Group d032ac48c0 Implement SMART emulation for drives without it
SMART is often needed to determine the health of a disk and
subsystems (rightfully so) expect it to always be present
in a modern system. When it's not present some of the tools
may not work properly or refuse to operate at all. That's
we added a transparent SMART autogeneration. While it does
not replace the real deal (=no real drive monitoring), it
provides a set of believable values to SMART monitoring
tools.

We've identified, as of now, three cases where this layer
is needed:
  - running under ESXi (it doesn't support SMART at all)
  - running VirtIO disks connected to SCSI ports
  - using RAID cards which don't work in a real HBA mode
-
The Thor Group ccc58c0883 Extract common SCSI operations into a separate submodule -
The Thor Group ca34ebdd92 Rename memory.c to memory_helper.c & move it to a consistent place -
The Thor Group e42a0e6c3b Minor logging & syntax improvements -
The Thor Group e66f4acc67 Make kernel_has_symbol() work with unexplorted ksyms & extract it to a separate submodule -
The Thor Group 29637db757 Fix RTC proxy memory reservation on scheduling change -
The Thor Group acfc6f924d Move kernel options to a separate file -
The Thor Group 8347a41162 Remove duplicated CMake definition (causing problems in CLion EAP) -
The Thor Group 140118a4d0 Cleanup call_protected submodule -
The Thor Group 1a49d82ba4 Extract memory operations to a submodule -
The Thor Group 1a6665bc71 Make execve() debugging more robust -