From a7d33afbb011644fd41f19288ec6e6cbfdcf9571 Mon Sep 17 00:00:00 2001 From: David Greaves Date: Mon, 13 Jan 2020 14:51:05 +0000 Subject: [PATCH] Support /usr merge by allowing /bin/perl to be accelerated JB#36606 Now that /bin is a symlink to /usr/bin it seems that sometimes perl is found as /bin/perl. This can manifest in things like autoreconf having a shebang of #!/bin/perl (Speculatively because of PATH having /bin first?) This misses the /usr/bin/perl rules in a way which means that the ARM perl tries to load x86 .so extensions. Signed-off-by: David Greaves --- scratchbox2/modes/obs-rpm-build+pp/config.lua | 4 ++++ scratchbox2/modes/obs-rpm-build+pp/fs_rules.lua | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/scratchbox2/modes/obs-rpm-build+pp/config.lua b/scratchbox2/modes/obs-rpm-build+pp/config.lua index 2f61379c..6f8380c3 100644 --- a/scratchbox2/modes/obs-rpm-build+pp/config.lua +++ b/scratchbox2/modes/obs-rpm-build+pp/config.lua @@ -14,8 +14,12 @@ exec_policy_selection = { -- Tools. at least qemu might be used from there. {prefix = tools_prefix .. "/usr/bin/perl", exec_policy_name = "Tools-perl"}, + {prefix = tools_prefix .. "/bin/perl", + exec_policy_name = "Tools-perl"}, {prefix = tools_prefix .. "/usr/bin/python", exec_policy_name = "Tools-python"}, + {prefix = tools_prefix .. "/bin/python", + exec_policy_name = "Tools-python"}, -- the toolchain, if not from Tools: {dir = sbox_target_toolchain_dir, exec_policy_name = "Toolchain"}, diff --git a/scratchbox2/modes/obs-rpm-build+pp/fs_rules.lua b/scratchbox2/modes/obs-rpm-build+pp/fs_rules.lua index 502175e7..d5daf174 100644 --- a/scratchbox2/modes/obs-rpm-build+pp/fs_rules.lua +++ b/scratchbox2/modes/obs-rpm-build+pp/fs_rules.lua @@ -62,9 +62,14 @@ perl_lib_test = { perl_bin_test = { { if_redirect_ignore_is_active = "/usr/bin/perl", map_to = target_root, readonly = true }, + { if_redirect_ignore_is_active = "/bin/perl", + map_to = target_root, readonly = true }, { if_redirect_force_is_active = "/usr/bin/perl", map_to = tools, readonly = true, exec_policy_name = "Tools-perl" }, + { if_redirect_force_is_active = "/bin/perl", + map_to = tools, readonly = true, + exec_policy_name = "Tools-perl" }, { if_active_exec_policy_is = "Target", map_to = target_root, readonly = true }, { if_active_exec_policy_is = "Tools-perl", @@ -79,9 +84,14 @@ perl_bin_test = { python_bin_test = { { if_redirect_ignore_is_active = "/usr/bin/python", map_to = target_root, readonly = true }, + { if_redirect_ignore_is_active = "/bin/python", + map_to = target_root, readonly = true }, { if_redirect_force_is_active = "/usr/bin/python", map_to = tools, readonly = true, exec_policy_name = "Tools-python" }, + { if_redirect_force_is_active = "/bin/python", + map_to = tools, readonly = true, + exec_policy_name = "Tools-python" }, { if_active_exec_policy_is = "Target", map_to = target_root, readonly = true }, { if_active_exec_policy_is = "Tools-python", @@ -471,7 +481,9 @@ emulate_mode_rules_usr_bin = { -- (these are real prefixes, version number may -- be included in the name (/usr/bin/python2.5 etc)) {prefix = "/usr/bin/perl", actions = perl_bin_test}, + {prefix = "/bin/perl", actions = perl_bin_test}, {prefix = "/usr/bin/python", actions = python_bin_test}, + {prefix = "/bin/python", actions = python_bin_test}, {path = "/usr/bin/sb2-show", use_orig_path = true, protection = readonly_fs_always},