Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90381baf authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

Merge "init: remove last init.cpp global"

parents 21d98807 172c83f9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -89,6 +89,8 @@ using android::fs_mgr::ReadFstabFromFile;
namespace android {
namespace init {

std::vector<std::string> late_import_paths;

static constexpr std::chrono::nanoseconds kCommandRetryTimeout = 5s;

static Result<void> reboot_into_recovery(const std::vector<std::string>& options) {
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ class BuiltinFunctionMap : public KeywordFunctionMap {
    const Map& map() const override;
};

extern std::vector<std::string> late_import_paths;

}  // namespace init
}  // namespace android

+0 −4
Original line number Diff line number Diff line
@@ -39,10 +39,6 @@
#include "selabel.h"
#include "util.h"

#ifdef _INIT_INIT_H
#error "Do not include init.h in files used by ueventd; it will expose init's globals"
#endif

using namespace std::chrono_literals;

using android::base::Basename;
+3 −2
Original line number Diff line number Diff line
@@ -28,9 +28,11 @@
#include <sys/types.h>
#include <unistd.h>

#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <vector>

#include <android-base/chrono_utils.h>
#include <android-base/file.h>
@@ -54,6 +56,7 @@

#include "action_parser.h"
#include "boringssl_self_test.h"
#include "builtins.h"
#include "epoll.h"
#include "first_stage_init.h"
#include "first_stage_mount.h"
@@ -100,8 +103,6 @@ static std::string shutdown_command;
static bool do_shutdown = false;
static bool load_debug_prop = false;

std::vector<std::string> late_import_paths;

static std::vector<Subcontext>* subcontexts;

void DumpState() {
+1 −11
Original line number Diff line number Diff line
@@ -14,14 +14,11 @@
 * limitations under the License.
 */

#ifndef _INIT_INIT_H
#define _INIT_INIT_H
#pragma once

#include <sys/types.h>

#include <functional>
#include <string>
#include <vector>

#include "action.h"
#include "action_manager.h"
@@ -31,11 +28,6 @@
namespace android {
namespace init {

// Note: These globals are *only* valid in init, so they should not be used in ueventd
// or any files that may be included in ueventd, such as devices.cpp and util.cpp.
// TODO: Have an Init class and remove all globals.
extern std::vector<std::string> late_import_paths;

Parser CreateParser(ActionManager& action_manager, ServiceList& service_list);
Parser CreateServiceOnlyParser(ServiceList& service_list);

@@ -53,5 +45,3 @@ int SecondStageMain(int argc, char** argv);

}  // namespace init
}  // namespace android

#endif  /* _INIT_INIT_H */
Loading