Merge "init: use init's property expansion code for mount_all"
This commit is contained in:
commit
f5b4607962
1 changed files with 7 additions and 1 deletions
|
|
@ -468,11 +468,17 @@ int do_mount_all(int nargs, char **args)
|
||||||
int child_ret = -1;
|
int child_ret = -1;
|
||||||
int status;
|
int status;
|
||||||
struct fstab *fstab;
|
struct fstab *fstab;
|
||||||
|
char fstabfile[PROP_VALUE_MAX];
|
||||||
|
|
||||||
if (nargs != 2) {
|
if (nargs != 2) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (expand_props(fstabfile, args[1], sizeof(fstabfile)) == -1) {
|
||||||
|
ERROR("mount_all: cannot expand '%s' \n", args[1]);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call fs_mgr_mount_all() to mount all filesystems. We fork(2) and
|
* Call fs_mgr_mount_all() to mount all filesystems. We fork(2) and
|
||||||
* do the call in the child to provide protection to the main init
|
* do the call in the child to provide protection to the main init
|
||||||
|
|
@ -496,7 +502,7 @@ int do_mount_all(int nargs, char **args)
|
||||||
} else if (pid == 0) {
|
} else if (pid == 0) {
|
||||||
/* child, call fs_mgr_mount_all() */
|
/* child, call fs_mgr_mount_all() */
|
||||||
klog_set_level(6); /* So we can see what fs_mgr_mount_all() does */
|
klog_set_level(6); /* So we can see what fs_mgr_mount_all() does */
|
||||||
fstab = fs_mgr_read_fstab(args[1]);
|
fstab = fs_mgr_read_fstab(fstabfile);
|
||||||
child_ret = fs_mgr_mount_all(fstab);
|
child_ret = fs_mgr_mount_all(fstab);
|
||||||
fs_mgr_free_fstab(fstab);
|
fs_mgr_free_fstab(fstab);
|
||||||
if (child_ret == -1) {
|
if (child_ret == -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue