From 148f602f2388dde03b06c59a491c527ba7e46017 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 19 Aug 2024 14:29:04 +0900 Subject: [PATCH] init: clean up unused Service[List]::post_data post_data was used by Userspace Reboot, which was removed. Bug: 293377020 Test: atest CtsInitTestCases Change-Id: I1a5bf328f62b8afbe58eef62c64689471e6b018c --- init/README.md | 2 +- init/builtins.cpp | 3 +-- init/service.cpp | 2 -- init/service.h | 4 ---- init/service_list.cpp | 8 -------- init/service_list.h | 5 ----- rootdir/init.rc | 2 -- 7 files changed, 2 insertions(+), 24 deletions(-) diff --git a/init/README.md b/init/README.md index 0bb26e891..1e1576514 100644 --- a/init/README.md +++ b/init/README.md @@ -636,7 +636,7 @@ provides the `aidl_lazy_test_1` interface. Properties are expanded within _level_. `mark_post_data` -> Used to mark the point right after /data is mounted. +> (This action is deprecated and no-op.) `mkdir [] [] [] [encryption=] [key=]` > Create a directory at _path_, optionally with the given mode, owner, and diff --git a/init/builtins.cpp b/init/builtins.cpp index 1e81692e7..3f3bec6df 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -1171,8 +1171,7 @@ static Result do_init_user0(const BuiltinArguments& args) { } static Result do_mark_post_data(const BuiltinArguments& args) { - ServiceList::GetInstance().MarkPostData(); - + LOG(INFO) << "deprecated action `mark_post_data` called."; return {}; } diff --git a/init/service.cpp b/init/service.cpp index 31308a036..d76a5d5e0 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -653,8 +653,6 @@ Result Service::Start() { SetMountNamespace(); } - post_data_ = ServiceList::GetInstance().IsPostData(); - LOG(INFO) << "starting service '" << name_ << "'..."; std::vector descriptors; diff --git a/init/service.h b/init/service.h index 5e9af25db..ae75553d3 100644 --- a/init/service.h +++ b/init/service.h @@ -144,8 +144,6 @@ class Service { std::optional timeout_period() const { return timeout_period_; } const std::vector& args() const { return args_; } bool is_updatable() const { return updatable_; } - bool is_post_data() const { return post_data_; } - bool is_from_apex() const { return base::StartsWith(filename_, "/apex/"); } void set_oneshot(bool value) { if (value) { flags_ |= SVC_ONESHOT; @@ -244,8 +242,6 @@ class Service { std::optional mount_namespace_; - bool post_data_ = false; - std::optional on_failure_reboot_target_; std::string filename_; diff --git a/init/service_list.cpp b/init/service_list.cpp index 1c56e8a59..e6cc2c98f 100644 --- a/init/service_list.cpp +++ b/init/service_list.cpp @@ -68,14 +68,6 @@ void ServiceList::DumpState() const { } } -void ServiceList::MarkPostData() { - post_data_ = true; -} - -bool ServiceList::IsPostData() { - return post_data_; -} - void ServiceList::StartDelayedServices() { for (const auto& name : delayed_service_names_) { Service* service = FindService(name); diff --git a/init/service_list.h b/init/service_list.h index 44e84535c..fd7fc05cd 100644 --- a/init/service_list.h +++ b/init/service_list.h @@ -83,19 +83,14 @@ class ServiceList { auto end() const { return services_.end(); } const std::vector services_in_shutdown_order() const; - void MarkPostData(); - bool IsPostData(); void DelayService(const Service& service); void StartDelayedServices(); - void ResetState() { post_data_ = false; } - auto size() const { return services_.size(); } private: std::vector> services_; - bool post_data_ = false; std::vector delayed_service_names_; }; diff --git a/rootdir/init.rc b/rootdir/init.rc index b96783158..7b2b96a7d 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -696,8 +696,6 @@ on property:ro.product.cpu.abilist64=* && property:bootreceiver.enable=1 on post-fs-data - mark_post_data - # Start checkpoint before we touch data exec - system system -- /system/bin/vdc checkpoint prepareCheckpoint