diff options
author | Lauri Aarnio <Lauri.Aarnio@iki.fi> | 2008-10-27 12:44:53 +0200 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2008-11-02 18:59:55 +0200 |
commit | 91f1ee5cd17f011ea73a5cefe038881f09a9e5ea (patch) | |
tree | 55ad7951d5ded251b9fc4529956bc4d40f749b74 | |
parent | 5c3432418c315c24f738e3146a079098047c7f0c (diff) |
sb2 command: New option -O for setting mode-specific options (for debugging) - New option "-O options" can be used to set a string which is available to the mapping mode scripts; that can be used for debugging. - emulate mode now has option "use-global-tmp": If that is activated, /tmp won't be mapped (the default is to map it to the session-specific tmp directory) - This feature is currently needed for debugging, because there seems to be problems mapping some things with binaries that run under qemu.
-rw-r--r-- | docs/sb2.1 | 5 | ||||
-rw-r--r-- | lua_scripts/pathmaps/emulate/00_default.lua | 10 | ||||
-rwxr-xr-x | utils/sb2 | 7 |
3 files changed, 19 insertions, 3 deletions
@@ -3,7 +3,7 @@ sb2 \- crosscompiling environment .SH SYNOPSIS .B sb2 -[ \-r ] [ \-R ] [ \-v ] [ \-d ] [ \-h ] [ \-t TARGET ] [ \-e ] [ \-m MODE ] [ -s DIRECTORY] [command] [arguments] [...] +[options] [command] [arguments] [...] .SH DESCRIPTION .B sb2 Runs command in scratchbox2. If no command is given, a bash shell @@ -47,6 +47,9 @@ check if the session is still in use! \-r Don't create reverse mapping rules: functions like getcwd() and realpath() will always return the real path. +.TP +\-O options +Set options for the selected mapping mode ("options" is a mode-specific string) .SH ENVIRONMENT There are quite many environment variables being used. Since sb2 is still diff --git a/lua_scripts/pathmaps/emulate/00_default.lua b/lua_scripts/pathmaps/emulate/00_default.lua index a92d790..f0ae06f 100644 --- a/lua_scripts/pathmaps/emulate/00_default.lua +++ b/lua_scripts/pathmaps/emulate/00_default.lua @@ -17,6 +17,14 @@ else unmapped_workdir = sbox_workdir end +-- use "==" to test options as long as there is only one possible option, +-- string.match() is slow.. +if sbox_mode_specific_options == "use-global-tmp" then + tmp_dir_dest = "/tmp" +else + tmp_dir_dest = session_dir .. "/tmp" +end + -- disable the gcc toolchain tricks. gcc & friends will be available, if -- those have been installed to target_root (but then they will probably run -- under cpu transparency = very slowly..) @@ -40,7 +48,7 @@ mapall_chain = { -- {prefix = session_dir, use_orig_path = true}, - {prefix = "/tmp", map_to = session_dir}, + {prefix = "/tmp", replace_by = tmp_dir_dest}, -- {prefix = "/dev", use_orig_path = true}, @@ -30,6 +30,8 @@ Options: -Q BUGLIST emulate bugs of the old scratchbox 1 (BUGLIST consists of letters: 'x' enables exec permission checking bug emulation) -r do not create reverse mapping rules + -O options set options for the selected mapping mode ("options" is + a mode-specific string) -R use simulated root permissions (currently activates "fakeroot" for this functionality) -p Preserve session directories (including the directory @@ -227,6 +229,7 @@ sbox_user_home_dir="$sbox_user_home_dir" sbox_target_toolchain_dir="$SBOX_TARGET_TOOLCHAIN_DIR" sbox_mapmode="$SBOX_MAPMODE" +sbox_mode_specific_options="$SBOX_MODE_SPECIFIC_OPTIONS" sbox_target_root="$SBOX_TARGET_ROOT" sbox_tools_root="$SBOX_TOOLS_ROOT" @@ -581,8 +584,9 @@ SBOX_DIR=$(readlink -f $(dirname $(readlink -f $my_path))/..) SBOX_WORKDIR=$(readlink -f $PWD) SBOX_FAKEROOT_PREFIX="" SBOX_CREATE_REVERSE_RULES="y" +SBOX_MODE_SPECIFIC_OPTIONS="" -while getopts vdht:em:s:L:Q:pM:ZrRS:J:D: foo +while getopts vdht:em:s:L:Q:pM:ZrRS:J:D:O: foo do case $foo in (v) version ;; @@ -604,6 +608,7 @@ do (S) SBOX_WRITE_SESSION_INFO_TO_FILE=$OPTARG ;; (J) SBOX_JOIN_SESSION_FILE=$OPTARG ;; (D) SBOX_DELETE_SESSION_FILE=$OPTARG ;; + (O) SBOX_MODE_SPECIFIC_OPTIONS=$OPTARG ;; (*) usage ;; esac done |