Merge changes Ice594cce,I9a87f988
* changes: init: Fix ordering of second-stage snapuserd transition. init: Pass a uevent regen callback to libsnapshot.
This commit is contained in:
commit
d7f31801c0
4 changed files with 13 additions and 4 deletions
|
@ -40,8 +40,8 @@ bool BlockDevInitializer::InitDeviceMapper() {
|
|||
return InitMiscDevice("device-mapper");
|
||||
}
|
||||
|
||||
bool BlockDevInitializer::InitDmUser() {
|
||||
return InitMiscDevice("dm-user");
|
||||
bool BlockDevInitializer::InitDmUser(const std::string& name) {
|
||||
return InitMiscDevice("dm-user!" + name);
|
||||
}
|
||||
|
||||
bool BlockDevInitializer::InitMiscDevice(const std::string& name) {
|
||||
|
|
|
@ -27,7 +27,7 @@ class BlockDevInitializer final {
|
|||
BlockDevInitializer();
|
||||
|
||||
bool InitDeviceMapper();
|
||||
bool InitDmUser();
|
||||
bool InitDmUser(const std::string& name);
|
||||
bool InitDevices(std::set<std::string> devices);
|
||||
bool InitDmDevice(const std::string& device);
|
||||
|
||||
|
|
|
@ -343,6 +343,15 @@ bool FirstStageMount::CreateLogicalPartitions() {
|
|||
if (!InitRequiredDevices({"userdata"})) {
|
||||
return false;
|
||||
}
|
||||
sm->SetUeventRegenCallback([this](const std::string& device) -> bool {
|
||||
if (android::base::StartsWith(device, "/dev/block/dm-")) {
|
||||
return block_dev_init_.InitDmDevice(device);
|
||||
}
|
||||
if (android::base::StartsWith(device, "/dev/dm-user/")) {
|
||||
return block_dev_init_.InitDmUser(android::base::Basename(device));
|
||||
}
|
||||
return block_dev_init_.InitDevices({device});
|
||||
});
|
||||
return sm->CreateLogicalAndSnapshotPartitions(super_path_);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -875,13 +875,13 @@ int SecondStageMain(int argc, char** argv) {
|
|||
SetProperty(gsi::kGsiInstalledProp, is_installed);
|
||||
|
||||
am.QueueBuiltinAction(SetupCgroupsAction, "SetupCgroups");
|
||||
am.QueueBuiltinAction(TransitionSnapuserdAction, "TransitionSnapuserd");
|
||||
am.QueueBuiltinAction(SetKptrRestrictAction, "SetKptrRestrict");
|
||||
am.QueueBuiltinAction(TestPerfEventSelinuxAction, "TestPerfEventSelinux");
|
||||
am.QueueEventTrigger("early-init");
|
||||
|
||||
// Queue an action that waits for coldboot done so we know ueventd has set up all of /dev...
|
||||
am.QueueBuiltinAction(wait_for_coldboot_done_action, "wait_for_coldboot_done");
|
||||
am.QueueBuiltinAction(TransitionSnapuserdAction, "TransitionSnapuserd");
|
||||
// ... so that we can start queuing up actions that require stuff from /dev.
|
||||
am.QueueBuiltinAction(MixHwrngIntoLinuxRngAction, "MixHwrngIntoLinuxRng");
|
||||
am.QueueBuiltinAction(SetMmapRndBitsAction, "SetMmapRndBits");
|
||||
|
|
Loading…
Reference in a new issue