Add an installd command to mark the end of boot.

bug: 18280671

(cherry picked from commit b1a6c2f95a)

Change-Id: I97542875ffff1b68ab324e9b04fb9266c82633cc
This commit is contained in:
Narayan Kamath 2014-11-10 15:03:46 +00:00
parent 947a6adf97
commit 091ea779d4
3 changed files with 23 additions and 1 deletions

View File

@ -1076,6 +1076,21 @@ fail:
return -1; return -1;
} }
int mark_boot_complete(const char* instruction_set)
{
char boot_marker_path[PKG_PATH_MAX];
sprintf(boot_marker_path,"%s%s/.booting", DALVIK_CACHE_PREFIX, instruction_set);
ALOGV("mark_boot_complete : %s", boot_marker_path);
if (unlink(boot_marker_path) != 0) {
ALOGE("Unable to unlink boot marker at %s, error=%s", boot_marker_path,
strerror(errno));
return -1;
}
return 0;
}
void mkinnerdirs(char* path, int basepos, mode_t mode, int uid, int gid, void mkinnerdirs(char* path, int basepos, mode_t mode, int uid, int gid,
struct stat* statbuf) struct stat* statbuf)
{ {

View File

@ -42,7 +42,12 @@ static int do_dexopt(char **arg, char reply[REPLY_MAX] __unused)
return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], atoi(arg[5]), 0); return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], atoi(arg[5]), 0);
} }
static int do_move_dex(char **arg, char reply[REPLY_MAX] __unused) static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX])
{
return mark_boot_complete(arg[0] /* instruction set */);
}
static int do_move_dex(char **arg, char reply[REPLY_MAX])
{ {
return move_dex(arg[0], arg[1], arg[2]); /* src, dst, instruction_set */ return move_dex(arg[0], arg[1], arg[2]); /* src, dst, instruction_set */
} }
@ -160,6 +165,7 @@ struct cmdinfo cmds[] = {
{ "ping", 0, do_ping }, { "ping", 0, do_ping },
{ "install", 4, do_install }, { "install", 4, do_install },
{ "dexopt", 6, do_dexopt }, { "dexopt", 6, do_dexopt },
{ "markbootcomplete", 1, do_mark_boot_complete },
{ "movedex", 3, do_move_dex }, { "movedex", 3, do_move_dex },
{ "rmdex", 2, do_rm_dex }, { "rmdex", 2, do_rm_dex },
{ "remove", 2, do_remove }, { "remove", 2, do_remove },

View File

@ -221,6 +221,7 @@ int get_size(const char *pkgname, userid_t userid, const char *apkpath, const ch
int free_cache(int64_t free_size); int free_cache(int64_t free_size);
int dexopt(const char *apk_path, uid_t uid, bool is_public, const char *pkgName, int dexopt(const char *apk_path, uid_t uid, bool is_public, const char *pkgName,
const char *instruction_set, bool vm_safe_mode, bool should_relocate); const char *instruction_set, bool vm_safe_mode, bool should_relocate);
int mark_boot_complete(const char *instruction_set);
int movefiles(); int movefiles();
int linklib(const char* target, const char* source, int userId); int linklib(const char* target, const char* source, int userId);
int idmap(const char *target_path, const char *overlay_path, uid_t uid); int idmap(const char *target_path, const char *overlay_path, uid_t uid);