system/corennnnn
リビジョン | 58ebdb6ad9d8f0391e74f20ac83cd2f6dbfce026 (tree) |
---|---|
日時 | 2016-08-18 17:04:52 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
コミッター | Chih-Wei Huang |
init: expand variables on mount_all command
This allows mount_all to handle fstab.${ro.hardware} instead
of hardcoding the file name.
@@ -528,9 +528,14 @@ static int do_mount_all(const std::vector<std::string>& args) { | ||
528 | 528 | ret = -1; |
529 | 529 | } |
530 | 530 | } else if (pid == 0) { |
531 | + std::string filename_val; | |
532 | + if (!expand_props(args[1], &filename_val)) { | |
533 | + ERROR("mount_all: cannot expand '%s'\n", fstabfile); | |
534 | + _exit(-1); | |
535 | + } | |
531 | 536 | /* child, call fs_mgr_mount_all() */ |
532 | 537 | klog_set_level(6); /* So we can see what fs_mgr_mount_all() does */ |
533 | - fstab = fs_mgr_read_fstab(fstabfile); | |
538 | + fstab = fs_mgr_read_fstab(filename_val.c_str()); | |
534 | 539 | child_ret = fs_mgr_mount_all(fstab); |
535 | 540 | fs_mgr_free_fstab(fstab); |
536 | 541 | if (child_ret == -1) { |