Initial commit, syncing up to v115
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
From 30aec8035b43d5fd912995ca2e8a756d2c4ec847 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sat, 17 Feb 2018 19:39:38 +0100
|
||||
Subject: [PATCH 1/5] Allow deletion of symlink
|
||||
|
||||
Change-Id: I9731895f88729072297f753088583aabbe6990f4
|
||||
---
|
||||
Ext4Crypt.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
|
||||
index 67b7e90..99a63b4 100644
|
||||
--- a/Ext4Crypt.cpp
|
||||
+++ b/Ext4Crypt.cpp
|
||||
@@ -221,6 +221,7 @@ static bool prepare_dir(const std::string& dir, mode_t mode, uid_t uid, gid_t gi
|
||||
static bool destroy_dir(const std::string& dir) {
|
||||
LOG(DEBUG) << "Destroying: " << dir;
|
||||
if (rmdir(dir.c_str()) != 0 && errno != ENOENT) {
|
||||
+ if(unlink(dir.c_str()) == 0) return true;
|
||||
PLOG(ERROR) << "Failed to destroy " << dir;
|
||||
return false;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From 1dd37cd4657bf21e8e1db83edb44916efbfeaf49 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 20:53:12 +0200
|
||||
Subject: [PATCH] Don't set reserved_disk group, it panics old inits
|
||||
|
||||
---
|
||||
vold.rc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/vold.rc b/vold.rc
|
||||
index 93d8786..bba44e4 100644
|
||||
--- a/vold.rc
|
||||
+++ b/vold.rc
|
||||
@@ -5,4 +5,4 @@ service vold /system/bin/vold \
|
||||
ioprio be 2
|
||||
writepid /dev/cpuset/foreground/tasks
|
||||
shutdown critical
|
||||
- group root reserved_disk
|
||||
+ group root
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From bf2c32c1645ca6ceb30c9ce132888233f8e3b705 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 20:54:08 +0200
|
||||
Subject: [PATCH 3/5] Create vendor_de. This is done by /init.rc on
|
||||
system-as-root device
|
||||
|
||||
---
|
||||
Ext4Crypt.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
|
||||
index 99a63b4..090532f 100644
|
||||
--- a/Ext4Crypt.cpp
|
||||
+++ b/Ext4Crypt.cpp
|
||||
@@ -667,6 +667,8 @@ bool e4crypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_
|
||||
auto vendor_de_path = android::vold::BuildDataVendorDePath(user_id);
|
||||
auto user_de_path = android::vold::BuildDataUserDePath(volume_uuid, user_id);
|
||||
|
||||
+ prepare_dir(android::vold::BuildDataPath("") + "/vendor_de", 0771, 0, 0);
|
||||
+
|
||||
if (volume_uuid.empty()) {
|
||||
if (!prepare_dir(system_legacy_path, 0700, AID_SYSTEM, AID_SYSTEM)) return false;
|
||||
#if MANAGE_MISC_DIRS
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 0eaff7949121b468bc50e1171fad679f9a383fd5 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 20 Aug 2018 22:37:54 +0200
|
||||
Subject: [PATCH 4/5] Support Samsung's implementation of exfat, called sdfat
|
||||
|
||||
---
|
||||
fs/Exfat.cpp | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/fs/Exfat.cpp b/fs/Exfat.cpp
|
||||
index 5c15075..5e23a79 100644
|
||||
--- a/fs/Exfat.cpp
|
||||
+++ b/fs/Exfat.cpp
|
||||
@@ -35,7 +35,7 @@ static const char* kFsckPath = "/system/bin/fsck.exfat";
|
||||
|
||||
bool IsSupported() {
|
||||
return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 &&
|
||||
- IsFilesystemSupported("exfat");
|
||||
+ (IsFilesystemSupported("exfat") || IsFilesystemSupported("sdfat"));
|
||||
}
|
||||
|
||||
status_t Check(const std::string& source) {
|
||||
@@ -60,13 +60,16 @@ status_t Mount(const std::string& source, const std::string& target, int ownerUi
|
||||
auto mountData = android::base::StringPrintf("uid=%d,gid=%d,fmask=%o,dmask=%o", ownerUid,
|
||||
ownerGid, permMask, permMask);
|
||||
|
||||
- if (mount(source.c_str(), target.c_str(), "exfat", mountFlags, mountData.c_str()) == 0) {
|
||||
+ const char *fs = "exfat";
|
||||
+ if(IsFilesystemSupported("sdfat"))
|
||||
+ fs = "sdfat";
|
||||
+ if (mount(source.c_str(), target.c_str(), fs, mountFlags, mountData.c_str()) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PLOG(ERROR) << "Mount failed; attempting read-only";
|
||||
mountFlags |= MS_RDONLY;
|
||||
- if (mount(source.c_str(), target.c_str(), "exfat", mountFlags, mountData.c_str()) == 0) {
|
||||
+ if (mount(source.c_str(), target.c_str(), fs, mountFlags, mountData.c_str()) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 0db3adc78adb5f2a1bec10dc6824a26b6dada9b6 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 20 Aug 2018 22:38:08 +0200
|
||||
Subject: [PATCH 5/5] Also create vendor_ce (same reason as vendor_de)
|
||||
|
||||
---
|
||||
Ext4Crypt.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
|
||||
index 090532f..6b60796 100644
|
||||
--- a/Ext4Crypt.cpp
|
||||
+++ b/Ext4Crypt.cpp
|
||||
@@ -706,6 +706,8 @@ bool e4crypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_
|
||||
auto media_ce_path = android::vold::BuildDataMediaCePath(volume_uuid, user_id);
|
||||
auto user_ce_path = android::vold::BuildDataUserCePath(volume_uuid, user_id);
|
||||
|
||||
+ prepare_dir(android::vold::BuildDataPath("") + "/vendor_ce", 0771, 0, 0);
|
||||
+
|
||||
if (volume_uuid.empty()) {
|
||||
if (!prepare_dir(system_ce_path, 0770, AID_SYSTEM, AID_SYSTEM)) return false;
|
||||
if (!prepare_dir(misc_ce_path, 01771, AID_SYSTEM, AID_MISC)) return false;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Reference in New Issue
Block a user