summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua_scripts/create_argvmods_usr_bin_rules.lua2
-rw-r--r--lua_scripts/pathmaps/devel/00_default.lua22
-rw-r--r--modeconf/sb2rc.devel2
-rwxr-xr-xutils/sb22
4 files changed, 20 insertions, 8 deletions
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},
}
}
@@ -396,6 +400,10 @@ devel_mode_rules_usr = {
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
diff --git a/modeconf/sb2rc.devel b/modeconf/sb2rc.devel
index 0209fa3..71d1a90 100644
--- a/modeconf/sb2rc.devel
+++ b/modeconf/sb2rc.devel
@@ -34,7 +34,7 @@ case "$sb2rc_mode" in
# programs that belong to the toolchain.
# Value of this variable will be used as the default
# mapping rule.
- CREATE_ARGVMODS_USR_BIN_RULES="map_to=tools,readonly=true"
+ CREATE_ARGVMODS_USR_BIN_RULES="-- return"
;;
wrapper_list)
diff --git a/utils/sb2 b/utils/sb2
index 1cbff9a..8bbe24f 100755
--- a/utils/sb2
+++ b/utils/sb2
@@ -138,7 +138,7 @@ function create_argvmods_usr_bin_rules()
$SBOX_SESSION_DIR/rules/$SBOX_MAPMODE.lua; do
amm_base=`basename $ammf .lua`
- SBOX_ARGVMODS_USR_BIN_DEFAULT_RULE=$default_rule \
+ SBOX_ARGVMODS_USR_BIN_DEFAULT_RULE="$default_rule" \
SBOX_SESSION_MODE=$amm_base sb2-monitor \
-L $SBOX_LIBSB2 -- $SBOX_DIR/bin/sb2-show \
execluafile \