Skip to content

Commit

Permalink
Added support for vendor partition and image
Browse files Browse the repository at this point in the history
Modified fastboot to flash vendor.img as well. Moved symlink
for /vendor to occur after mounting partitions. Changed mount
to also create the mount point.

Change-Id: I78e1ba24e6bb8b4af96a67ee0569af579439e682
Signed-off-by: Daniel Rosenberg <drosen@google.com>
  • Loading branch information
drosen-google committed Jun 24, 2014
1 parent 929842a commit f530c93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
7 changes: 5 additions & 2 deletions fastboot/fastboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ static struct {
char sig_name[13];
char part_name[9];
bool is_optional;
} images[4] = {
} images[] = {
{"boot.img", "boot.sig", "boot", false},
{"recovery.img", "recovery.sig", "recovery", true},
{"system.img", "system.sig", "system", false},
{"vendor.img", "vendor.sig", "vendor", true},
{"tos.img", "tos.sig", "tos", true},
};

Expand All @@ -120,6 +121,8 @@ char *find_item(const char *item, const char *product)
fn = "recovery.img";
} else if(!strcmp(item,"system")) {
fn = "system.img";
} else if(!strcmp(item,"vendor")) {
fn = "vendor.img";
} else if(!strcmp(item,"tos")) {
fn = "tos.img";
} else if(!strcmp(item,"userdata")) {
Expand Down Expand Up @@ -287,7 +290,7 @@ void usage(void)
"\n"
"commands:\n"
" update <filename> reflash device from update.zip\n"
" flashall flash boot, system, and if found,\n"
" flashall flash boot, system, vendor and if found,\n"
" recovery, tos\n"
" flash <partition> [ <filename> ] write a file to a flash partition\n"
" erase <partition> erase a flash partition\n"
Expand Down
3 changes: 2 additions & 1 deletion fs_mgr/fs_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ static int __mount(const char *source, const char *target, const struct fstab_re
unsigned long mountflags = rec->flags;
int ret;
int save_errno;


mkdir(target, 0755);
ret = mount(source, target, rec->fs_type, mountflags, rec->fs_options);
save_errno = errno;
INFO("%s(source=%s,target=%s,type=%s)=%d\n", __func__, source, target, rec->fs_type, ret);
Expand Down
8 changes: 4 additions & 4 deletions rootdir/init.rc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ on init
symlink /system/etc /etc
symlink /sys/kernel/debug /d

# Right now vendor lives on the same filesystem as system,
# but someday that may change.
symlink /system/vendor /vendor

# Create cgroup mount point for cpu accounting
mkdir /acct
mount cgroup none /acct cpuacct
Expand Down Expand Up @@ -184,6 +180,10 @@ on late-init
trigger boot

on post-fs
# Right now vendor lives on the same filesystem as system,
# but someday that may change. If it has, this symlink will fail.
symlink /system/vendor /vendor

# once everything is setup, no need to modify /
mount rootfs rootfs / ro remount
# mount shared so changes propagate into child namespaces
Expand Down

0 comments on commit f530c93

Please sign in to comment.