Merge "Rename system/core/rootdir/Android.mk to create_root_structure.mk" into main
diff --git a/init/README.md b/init/README.md
index 1e15765..de57208 100644
--- a/init/README.md
+++ b/init/README.md
@@ -745,6 +745,9 @@
fstab.${ro.hardware} or fstab.${ro.hardware.platform} will be scanned for
under /odm/etc, /vendor/etc, or / at runtime, in that order.
+`swapoff <path>`
+> Stops swapping to the file or block device specified by path.
+
`symlink <target> <path>`
> Create a symbolic link at _path_ with the value _target_
@@ -788,7 +791,6 @@
If the file does not exist, it will be created. If it does exist,
it will be truncated. Properties are expanded within _content_.
-
Imports
-------
`import <path>`
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 3f3bec6..c4af5b5 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -36,6 +36,7 @@
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/swap.h>
#include <sys/syscall.h>
#include <sys/system_properties.h>
#include <sys/time.h>
@@ -1270,6 +1271,13 @@
return {};
}
+static Result<void> do_swapoff(const BuiltinArguments& args) {
+ if (!swapoff(args[1].c_str())) {
+ return ErrnoError() << "swapoff() failed";
+ }
+ return {};
+}
+
// Builtin-function-map start
const BuiltinFunctionMap& GetBuiltinFunctionMap() {
constexpr std::size_t kMax = std::numeric_limits<std::size_t>::max();
@@ -1325,6 +1333,7 @@
{"start", {1, 1, {false, do_start}}},
{"stop", {1, 1, {false, do_stop}}},
{"swapon_all", {0, 1, {false, do_swapon_all}}},
+ {"swapoff", {1, 1, {false, do_swapoff}}},
{"enter_default_mount_ns", {0, 0, {false, do_enter_default_mount_ns}}},
{"symlink", {2, 2, {true, do_symlink}}},
{"sysclktz", {1, 1, {false, do_sysclktz}}},
diff --git a/trusty/gatekeeper/android.hardware.gatekeeper-service.trusty.rc b/trusty/gatekeeper/android.hardware.gatekeeper-service.trusty.rc
index 66ecbd1..2c9bd83 100644
--- a/trusty/gatekeeper/android.hardware.gatekeeper-service.trusty.rc
+++ b/trusty/gatekeeper/android.hardware.gatekeeper-service.trusty.rc
@@ -1,4 +1,5 @@
-service vendor.gatekeeper_default /vendor/bin/hw/android.hardware.gatekeeper-service.trusty
+service vendor.gatekeeper_default /vendor/bin/hw/android.hardware.gatekeeper-service.trusty \
+ --dev ${ro.hardware.trusty_ipc_dev.gatekeeper:-/dev/trusty-ipc-dev0}
class hal
user system
group system
diff --git a/trusty/keymaster/keymint/android.hardware.security.keymint-service.trusty.rc b/trusty/keymaster/keymint/android.hardware.security.keymint-service.trusty.rc
index 389af41..0ceb584 100644
--- a/trusty/keymaster/keymint/android.hardware.security.keymint-service.trusty.rc
+++ b/trusty/keymaster/keymint/android.hardware.security.keymint-service.trusty.rc
@@ -1,4 +1,5 @@
-service vendor.keymint-trusty /vendor/bin/hw/android.hardware.security.keymint-service.trusty
+service vendor.keymint-trusty /vendor/bin/hw/android.hardware.security.keymint-service.trusty \
+ --dev ${ro.hardware.trusty_ipc_dev.keymint:-/dev/trusty-ipc-dev0}
class early_hal
user nobody
group drmrpc
diff --git a/trusty/keymint/android.hardware.security.keymint-service.rust.trusty.rc b/trusty/keymint/android.hardware.security.keymint-service.rust.trusty.rc
index e3d94c6..3e3f2a5 100644
--- a/trusty/keymint/android.hardware.security.keymint-service.rust.trusty.rc
+++ b/trusty/keymint/android.hardware.security.keymint-service.rust.trusty.rc
@@ -1,7 +1,8 @@
-service vendor.keymint.rust-trusty /vendor/bin/hw/android.hardware.security.keymint-service.rust.trusty
+service vendor.keymint.rust-trusty /vendor/bin/hw/android.hardware.security.keymint-service.rust.trusty \
+ --dev ${ro.hardware.trusty_ipc_dev.keymint:-/dev/trusty-ipc-dev0}
class early_hal
user nobody
group drmrpc
# The keymint service is not allowed to restart.
# If it crashes, a device restart is required.
- oneshot
\ No newline at end of file
+ oneshot