summaryrefslogtreecommitdiffstats
path: root/roots.h
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-04 04:28:42 +0100
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-04 04:28:42 +0100
commitc24a8e688a6312764254beac2b2520bb0c5e998d (patch)
tree7df23711566b358047301d8413ee399105546e8b /roots.h
parentauto import from //depot/cupcake/@135843 (diff)
downloadandroid_bootable_recovery-c24a8e688a6312764254beac2b2520bb0c5e998d.tar
android_bootable_recovery-c24a8e688a6312764254beac2b2520bb0c5e998d.tar.gz
android_bootable_recovery-c24a8e688a6312764254beac2b2520bb0c5e998d.tar.bz2
android_bootable_recovery-c24a8e688a6312764254beac2b2520bb0c5e998d.tar.lz
android_bootable_recovery-c24a8e688a6312764254beac2b2520bb0c5e998d.tar.xz
android_bootable_recovery-c24a8e688a6312764254beac2b2520bb0c5e998d.tar.zst
android_bootable_recovery-c24a8e688a6312764254beac2b2520bb0c5e998d.zip
Diffstat (limited to 'roots.h')
-rw-r--r--roots.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/roots.h b/roots.h
new file mode 100644
index 000000000..bc847ea67
--- /dev/null
+++ b/roots.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef RECOVERY_ROOTS_H_
+#define RECOVERY_ROOTS_H_
+
+#include "minzip/Zip.h"
+#include "mtdutils/mtdutils.h"
+
+/* Any of the "root_path" arguments can be paths with relative
+ * components, like "SYSTEM:a/b/c".
+ */
+
+/* Associate this package with the package root "PKG:".
+ */
+int register_package_root(const ZipArchive *package, const char *package_path);
+
+/* Returns non-zero iff root_path points inside a package.
+ */
+int is_package_root_path(const char *root_path);
+
+/* Takes a string like "SYSTEM:lib" and turns it into a string
+ * like "/system/lib". The translated path is put in out_buf,
+ * and out_buf is returned if the translation succeeded.
+ */
+const char *translate_root_path(const char *root_path,
+ char *out_buf, size_t out_buf_len);
+
+/* Takes a string like "PKG:lib/libc.so" and returns a pointer to
+ * the containing zip file and a path like "lib/libc.so".
+ */
+const char *translate_package_root_path(const char *root_path,
+ char *out_buf, size_t out_buf_len, const ZipArchive **out_package);
+
+/* Returns negative on error, positive if it's mounted, zero if it isn't.
+ */
+int is_root_path_mounted(const char *root_path);
+
+int ensure_root_path_mounted(const char *root_path);
+
+int ensure_root_path_unmounted(const char *root_path);
+
+const MtdPartition *get_root_mtd_partition(const char *root_path);
+
+/* "root" must be the exact name of the root; no relative path is permitted.
+ * If the named root is mounted, this will attempt to unmount it first.
+ */
+int format_root_device(const char *root);
+
+#endif // RECOVERY_ROOTS_H_