From 817d61e3147380963342acef5df60acb56d9673e Mon Sep 17 00:00:00 2001 From: Lauri Aarnio Date: Sun, 1 Feb 2009 17:03:13 +0200 Subject: "devel" mode: Changed mapping of /bin, /usr/bin/, /sbin and /usr/sbin - First try to map to tools_root, but if the program does not exist there, the mapping leads to target_root. This makes it possible to use many tools that are not available at all from the tools distro. --- lua_scripts/create_argvmods_usr_bin_rules.lua | 2 +- lua_scripts/pathmaps/devel/00_default.lua | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'lua_scripts') diff --git a/lua_scripts/create_argvmods_usr_bin_rules.lua b/lua_scripts/create_argvmods_usr_bin_rules.lua index d617a5e..ce04823 100644 --- a/lua_scripts/create_argvmods_usr_bin_rules.lua +++ b/lua_scripts/create_argvmods_usr_bin_rules.lua @@ -42,7 +42,7 @@ function argvmods_to_mapping_rules() end if (default_rule ~= nil) then print(" -- default:") - print(" {prefix=\"/usr/bin\",", default_rule, "}") + print(" ", default_rule) end print(" }") print("}") diff --git a/lua_scripts/pathmaps/devel/00_default.lua b/lua_scripts/pathmaps/devel/00_default.lua index 41e3b9c..15f370f 100644 --- a/lua_scripts/pathmaps/devel/00_default.lua +++ b/lua_scripts/pathmaps/devel/00_default.lua @@ -343,8 +343,12 @@ devel_mode_rules_usr_bin = { {prefix = "/usr/bin/perl", actions = perl_bin_test}, {prefix = "/usr/bin/python", actions = python_bin_test}, - -- default: automatically generated rules for /usr/bin: + -- next, automatically generated rules for /usr/bin: {dir = "/usr/bin", chain = argvmods_rules_for_usr_bin}, + + -- and finally, the default: + {dir = "/usr/bin", + actions = test_first_tools_default_is_target}, } } @@ -395,6 +399,10 @@ devel_mode_rules_usr = { {prefix = "/usr/include", map_to = target_root, readonly = true}, + -- ----------------------------------------------- + {dir = "/usr/sbin", + actions = test_first_tools_default_is_target}, + -- ----------------------------------------------- -- 100. DEFAULT RULES: -- the root directory must not be mapped: @@ -602,12 +610,16 @@ simple_chain = { -- the root directory must not be mapped: {path = "/", use_orig_path = true}, - -- "standard" directories are mapped to tools_root, + -- "standard" directories default to tools_root + -- (except that bin and sbin also test for target- + -- specific programs from target_root), -- but everything else defaults to the host system -- (so that things like /mnt, /media and /opt are -- used from the host) - {prefix = "/bin", map_to = tools, readonly = true}, - {prefix = "/sbin", map_to = tools, readonly = true}, + {dir = "/bin", + actions = test_first_tools_default_is_target}, + {dir = "/sbin", + actions = test_first_tools_default_is_target}, -- Default = Host, R/W access {prefix = "/", use_orig_path = true} @@ -629,7 +641,7 @@ devel_exec_policies = { binary = nil, rules = { - -- ~/bin proobably contains programs for the host OS: + -- ~/bin probably contains programs for the host OS: {prefix = sbox_user_home_dir.."/bin", exec_policy = exec_policy_host_os}, -- Other places under the home directory are expected -- cgit v1.2.3