Skip to content

Commit

Permalink
Support /usr merge by allowing /bin/perl to be accelerated JB#36606
Browse files Browse the repository at this point in the history
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 <david.greaves@jolla.com>
  • Loading branch information
lbt authored and Thaodan committed Apr 23, 2021
1 parent 3b71b4f commit a7d33af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scratchbox2/modes/obs-rpm-build+pp/config.lua
Expand Up @@ -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"},
Expand Down
12 changes: 12 additions & 0 deletions scratchbox2/modes/obs-rpm-build+pp/fs_rules.lua
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit a7d33af

Please sign in to comment.