summaryrefslogtreecommitdiff
path: root/lua_scripts
diff options
context:
space:
mode:
authorLauri Aarnio <Lauri.Aarnio@iki.fi>2008-11-20 11:50:22 +0200
committerLauri Leukkunen <lle@rahina.org>2008-12-07 04:32:47 +0200
commitff0caf88f70ccefff2f2c15bb0aa8ab877735228 (patch)
tree19aa9a8b8c91ebb7e08fecdf1174e6a3f0f9fcc5 /lua_scripts
parentd4d003f10e0048641eb44706848cb43c9ee639dc (diff)
"dpkg-checkbuilddeps" wrapper does not disable mapping anymore
- wrappers/dpkg-checkbuilddeps used to disable mapping temporarily while checking host packages. An unwanted side-effect of that was that some debian package management tools were used from the host, and not from the installed tools collection (tools_root). - Fixed that by switching temporarily to the "tools" mode. That way all required tools and the package db are used from tools_root, automatically. - "tools" mode can now be hijacked to use /var/lib/dpkg/status from any location (needed, when checking the temporary pkg db that is created by sb2) - "tools" mode: don't map /etc/passwd - "devel" mode now automatically makes "tools" available as an alternative mode when "sb2" is initializing a new session.
Diffstat (limited to 'lua_scripts')
-rw-r--r--lua_scripts/pathmaps/tools/00_default.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua_scripts/pathmaps/tools/00_default.lua b/lua_scripts/pathmaps/tools/00_default.lua
index 7f144ec..894d601 100644
--- a/lua_scripts/pathmaps/tools/00_default.lua
+++ b/lua_scripts/pathmaps/tools/00_default.lua
@@ -22,6 +22,14 @@ end
-- those have been installed to tools_root
enable_cross_gcc_toolchain = false
+-- This mode can also be used to redirect /var/lib/dpkg/status to another
+-- location (our dpkg-checkbuilddeps wrapper needs that)
+local var_lib_dpkg_status_location = os.getenv("SBOX_TOOLS_MODE_VAR_LIB_DPKG_STATUS_LOCATION")
+if var_lib_dpkg_status_location == nil or var_lib_dpkg_status_location == "" then
+ -- Use the default location
+ var_lib_dpkg_status_location = tools_root .. "/var/lib/dpkg/status"
+end
+
mapall_chain = {
next_chain = nil,
binary = nil,
@@ -56,6 +64,8 @@ mapall_chain = {
{prefix = "/etc/resolv.conf", use_orig_path = true,
readonly = true},
+ {path = "/etc/passwd",
+ use_orig_path = true, readonly = true},
-- -----------------------------------------------
-- home directories = not mapped, R/W access
@@ -63,6 +73,9 @@ mapall_chain = {
-- -----------------------------------------------
+ {path = "/var/lib/dpkg/status", replace_by = var_lib_dpkg_status_location,
+ readonly = tools_root_is_readonly},
+
-- The default is to map everything to tools_root
{path = "/", use_orig_path = true},