Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accelerate sh/bash installed under /usr and more cleanups #31

Merged
merged 6 commits into from Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lua_scripts/add_rules_to_rule_tree.lua
Expand Up @@ -311,6 +311,7 @@ local valid_keywords_in_exec_policy = {
native_app_ld_library_path_prefix = "string",
native_app_ld_library_path_suffix = "string",
native_app_ld_preload_prefix = "string",
native_app_ld_preload_suffix = "string",

native_app_ld_so = "string",
native_app_ld_so_rpath_prefix = "string",
Expand Down
8 changes: 4 additions & 4 deletions modes/accel/exec_rules.lua
Expand Up @@ -72,7 +72,7 @@ exec_policy_tools = {
native_app_ld_library_path_prefix = devel_mode_tools_ld_library_path_prefix,
native_app_ld_library_path_suffix = devel_mode_tools_ld_library_path_suffix,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_locale_path = devel_mode_locale_path,
native_app_gconv_path = devel_mode_gconv_path,
Expand All @@ -94,7 +94,7 @@ exec_policy_tools_perl = {
native_app_ld_library_path_prefix = devel_mode_tools_ld_library_path_prefix,
native_app_ld_library_path_suffix = devel_mode_tools_ld_library_path_suffix,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_locale_path = devel_mode_locale_path,
native_app_gconv_path = devel_mode_gconv_path,
Expand All @@ -116,7 +116,7 @@ exec_policy_tools_python = {
native_app_ld_library_path_prefix = devel_mode_tools_ld_library_path_prefix,
native_app_ld_library_path_suffix = devel_mode_tools_ld_library_path_suffix,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_locale_path = devel_mode_locale_path,
native_app_gconv_path = devel_mode_gconv_path,
Expand Down Expand Up @@ -169,7 +169,7 @@ exec_policy_target = {

native_app_locale_path = conf_target_locale_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_ld_library_path_prefix = devel_mode_target_ld_library_path_prefix,
native_app_ld_library_path_suffix = devel_mode_target_ld_library_path_suffix,
Expand Down
8 changes: 4 additions & 4 deletions modes/emulate+toolchain+utils/exec_rules.lua
Expand Up @@ -11,12 +11,12 @@ rule_file_interface_version = "203"

exec_policy_host = {
name = "Host",
native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

exec_policy_toolchain = {
name = "Toolchain",
native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

-- For target binaries:
Expand Down Expand Up @@ -64,7 +64,7 @@ local exec_policy_target = {
native_app_locale_path = conf_target_locale_path,
native_app_gconv_path = conf_target_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

exec_flags = EXEC_FLAGS_FORCE_CPU_TRANSPARENCY,
}
Expand Down Expand Up @@ -115,7 +115,7 @@ local exec_policy_tools = {
native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}


Expand Down
8 changes: 4 additions & 4 deletions modes/emulate+toolchain/exec_rules.lua
Expand Up @@ -11,12 +11,12 @@ rule_file_interface_version = "203"

exec_policy_host = {
name = "Host",
native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

exec_policy_toolchain = {
name = "Toolchain",
native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

-- For target binaries:
Expand Down Expand Up @@ -64,7 +64,7 @@ local exec_policy_target = {
native_app_locale_path = conf_target_locale_path,
native_app_gconv_path = conf_target_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

exec_flags = EXEC_FLAGS_FORCE_CPU_TRANSPARENCY,
}
Expand Down Expand Up @@ -115,7 +115,7 @@ local exec_policy_tools = {
native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}


Expand Down
6 changes: 3 additions & 3 deletions modes/emulate/exec_rules.lua
Expand Up @@ -11,7 +11,7 @@ rule_file_interface_version = "203"

exec_policy_host = {
name = "Host",
native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

-- For target binaries:
Expand Down Expand Up @@ -59,7 +59,7 @@ local exec_policy_target = {
native_app_locale_path = conf_target_locale_path,
native_app_gconv_path = conf_target_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

exec_flags = EXEC_FLAGS_FORCE_CPU_TRANSPARENCY,
}
Expand Down Expand Up @@ -110,7 +110,7 @@ local exec_policy_tools = {
native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}


Expand Down
12 changes: 6 additions & 6 deletions modes/obs-deb-build/exec_rules.lua
Expand Up @@ -15,12 +15,12 @@ rule_file_interface_version = "203"

exec_policy_host = {
name = "Host",
native_app_ld_preload_prefix = host_ld_preload_libsb2,
native_app_ld_preload_suffix = host_ld_preload_libsb2,
}

exec_policy_toolchain = {
name = "Toolchain",
native_app_ld_preload_prefix = host_ld_preload_libsb2,
native_app_ld_preload_suffix = host_ld_preload_libsb2,
}

-- For target binaries:
Expand Down Expand Up @@ -68,7 +68,7 @@ local exec_policy_target = {
native_app_locale_path = conf_target_locale_path,
native_app_gconv_path = conf_target_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

--
Expand Down Expand Up @@ -121,7 +121,7 @@ local exec_policy_tools = {
native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

script_log_level = "debug",
script_log_message = "SCRIPT from tools",
Expand All @@ -140,7 +140,7 @@ local exec_policy_tools_perl = {
native_app_ld_library_path_prefix = emulate_mode_tools_ld_library_path_prefix,
native_app_ld_library_path_suffix = emulate_mode_tools_ld_library_path_suffix,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,
Expand All @@ -162,7 +162,7 @@ local exec_policy_tools_python = {
native_app_ld_library_path_prefix = emulate_mode_tools_ld_library_path_prefix,
native_app_ld_library_path_suffix = emulate_mode_tools_ld_library_path_suffix,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,
Expand Down
8 changes: 8 additions & 0 deletions modes/obs-deb-build/sb2rc
Expand Up @@ -39,6 +39,14 @@ case "$sb2rc_mode" in
SBOX_WRAPPERS="gdb ldconfig pwd fakeroot"
;;

ldconfig)
# When ldconfig is used at build time, then it must be the case
# that it is used on the build artefacts (with the help of the
# '-n' option), so locking it to the target root would not be
# desired.
sbox_ldconfig_root=/
;;

*)
# Default.
;;
Expand Down
8 changes: 4 additions & 4 deletions modes/obs-deb-install/exec_rules.lua
Expand Up @@ -16,12 +16,12 @@ rule_file_interface_version = "203"

exec_policy_host = {
name = "Host",
native_app_ld_preload_prefix = host_ld_preload_libsb2,
native_app_ld_preload_suffix = host_ld_preload_libsb2,
}

exec_policy_toolchain = {
name = "Toolchain",
native_app_ld_preload_prefix = host_ld_preload_libsb2,
native_app_ld_preload_suffix = host_ld_preload_libsb2,
}

-- For target binaries:
Expand Down Expand Up @@ -69,7 +69,7 @@ local exec_policy_target = {
native_app_locale_path = conf_target_locale_path,
native_app_gconv_path = conf_target_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

--
Expand Down Expand Up @@ -118,7 +118,7 @@ local exec_policy_tools = {
native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}


Expand Down
12 changes: 6 additions & 6 deletions modes/obs-rpm-build+pp/exec_rules.lua
Expand Up @@ -11,12 +11,12 @@ rule_file_interface_version = "203"

exec_policy_host = {
name = "Host",
native_app_ld_preload_prefix = host_ld_preload_libsb2,
native_app_ld_preload_suffix = host_ld_preload_libsb2,
}

exec_policy_toolchain = {
name = "Toolchain",
native_app_ld_preload_prefix = host_ld_preload_libsb2,
native_app_ld_preload_suffix = host_ld_preload_libsb2,
}

-- For target binaries:
Expand Down Expand Up @@ -64,7 +64,7 @@ local exec_policy_target = {
native_app_locale_path = conf_target_locale_path,
native_app_gconv_path = conf_target_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,
}

--
Expand Down Expand Up @@ -117,7 +117,7 @@ local exec_policy_tools = {
native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

script_log_level = "debug",
script_log_message = "SCRIPT from tools",
Expand All @@ -136,7 +136,7 @@ local exec_policy_tools_perl = {
native_app_ld_library_path_prefix = emulate_mode_tools_ld_library_path_prefix,
native_app_ld_library_path_suffix = emulate_mode_tools_ld_library_path_suffix,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,
Expand All @@ -158,7 +158,7 @@ local exec_policy_tools_python = {
native_app_ld_library_path_prefix = emulate_mode_tools_ld_library_path_prefix,
native_app_ld_library_path_suffix = emulate_mode_tools_ld_library_path_suffix,

native_app_ld_preload_prefix = host_ld_preload,
native_app_ld_preload_suffix = host_ld_preload,

native_app_locale_path = conf_tools_locale_path,
native_app_gconv_path = conf_tools_gconv_path,
Expand Down
16 changes: 9 additions & 7 deletions modes/obs-rpm-build+pp/fs_rules.lua
Expand Up @@ -171,9 +171,9 @@ emulate_mode_rules_bin = {
actions=accelerated_program_actions},
{path="/bin/egrep",
actions=accelerated_program_actions},
{path="/bin/false",
{path="/bin/env",
actions=accelerated_program_actions},
{path="/bin/fgrep",
{path="/bin/false",
actions=accelerated_program_actions},
{path="/bin/fgrep",
actions=accelerated_program_actions},
Expand Down Expand Up @@ -213,7 +213,7 @@ emulate_mode_rules_bin = {
actions=accelerated_program_actions},
{path="/bin/sort",
actions=accelerated_program_actions},
{path="/usr/bin/tar",
{path="/bin/tar",
actions=accelerated_program_actions},
{path="/bin/touch",
actions=accelerated_program_actions},
Expand All @@ -240,6 +240,8 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/basename",
actions=accelerated_program_actions},
{path="/usr/bin/bash",
actions=accelerated_program_actions},
{path="/usr/bin/bison",
actions=accelerated_program_actions},
{path="/usr/bin/bzip2",
Expand All @@ -258,8 +260,6 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/diff3",
actions=accelerated_program_actions},
{path="/usr/bin/diff3",
actions=accelerated_program_actions},
{path="/usr/bin/dir",
actions=accelerated_program_actions},
{path="/usr/bin/dircolors",
Expand Down Expand Up @@ -390,6 +390,8 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/seq",
actions=accelerated_program_actions},
{path="/usr/bin/sh",
actions=accelerated_program_actions},
{path="/usr/bin/sha1sum",
actions=accelerated_program_actions},
{path="/usr/bin/sha224sum",
Expand All @@ -416,6 +418,8 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/tail",
actions=accelerated_program_actions},
{path="/usr/bin/tar",
actions=accelerated_program_actions},
{path="/usr/bin/tee",
actions=accelerated_program_actions},
{path="/usr/bin/test",
Expand All @@ -424,8 +428,6 @@ emulate_mode_rules_usr_bin = {
actions=accelerated_program_actions},
{path="/usr/bin/troff",
actions=accelerated_program_actions},
{path="/usr/bin/troff",
actions=accelerated_program_actions},
{path="/usr/bin/tsort",
actions=accelerated_program_actions},
{path="/usr/bin/tty",
Expand Down
8 changes: 8 additions & 0 deletions modes/obs-rpm-build+pp/sb2rc
Expand Up @@ -39,6 +39,14 @@ case "$sb2rc_mode" in
SBOX_WRAPPERS="gdb ldconfig pwd fakeroot"
;;

ldconfig)
# When ldconfig is used at build time, then it must be the case
# that it is used on the build artefacts (with the help of the
# '-n' option), so locking it to the target root would not be
# desired.
sbox_ldconfig_root=/
;;

*)
# Default.
;;
Expand Down