Skip to content

Commit

Permalink
Merge branch 'jb50161' into 'master'
Browse files Browse the repository at this point in the history
Support 32 bit 'tools' accelerating 64 bit binaries

See merge request mer-core/scratchbox2!30
  • Loading branch information
Matti Kosola committed Jun 11, 2020
2 parents 16dd119 + 8747162 commit 7530bee
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 28 deletions.
33 changes: 25 additions & 8 deletions scratchbox2/modes/obs-rpm-build+pp/fs_rules.lua
Expand Up @@ -195,8 +195,6 @@ emulate_mode_rules_bin = {
actions=accelerated_program_actions},
{path="/bin/rmdir",
actions=accelerated_program_actions},
{path="/bin/rpm",
actions=accelerated_program_actions},
{path="/bin/sed",
actions=accelerated_program_actions},
{path="/bin/sh",
Expand Down Expand Up @@ -631,12 +629,31 @@ emulate_mode_rules_usr = {
{if_active_exec_policy_is = "Tools",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib64",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib64",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{ map_to = target_root, protection = readonly_fs_always },
},
},
-- and if the program looks in lib64 and the emulator can't find
-- it (because it's 32 bit) then look in /usr/lib...
{dir = "/usr/lib64", func_class = FUNC_CLASS_DLOPEN,
actions = {
{if_active_exec_policy_is = "Tools",
if_exists_then_replace_by = tools .. "/usr/lib",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Tools",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{ map_to = target_root, protection = readonly_fs_always },
},
},
Expand Down
33 changes: 25 additions & 8 deletions scratchbox2/modes/obs-rpm-build/fs_rules.lua
Expand Up @@ -130,8 +130,6 @@ emulate_mode_rules_bin = {
actions=accelerated_program_actions},
{path="/bin/rmdir",
actions=accelerated_program_actions},
{path="/bin/rpm",
actions=accelerated_program_actions},
{path="/bin/sed",
actions=accelerated_program_actions},
{path="/bin/sh",
Expand Down Expand Up @@ -494,12 +492,31 @@ emulate_mode_rules_usr = {
{if_active_exec_policy_is = "Tools",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib64",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib64",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{ map_to = target_root, protection = readonly_fs_always },
},
},
-- and if the program looks in lib64 and the emulator can't find
-- it (because it's 32 bit) then look in /usr/lib...
{dir = "/usr/lib64", func_class = FUNC_CLASS_DLOPEN,
actions = {
{if_active_exec_policy_is = "Tools",
if_exists_then_replace_by = tools .. "/usr/lib",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Tools",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{ map_to = target_root, protection = readonly_fs_always },
},
},
Expand Down
37 changes: 25 additions & 12 deletions scratchbox2/modes/obs-rpm-install/fs_rules.lua
Expand Up @@ -187,12 +187,6 @@ emulate_mode_rules_bin = {
func_class = FUNC_CLASS_EXEC,
actions = accelerated_program_actions},

-- rpm rules
{path = "/bin/rpm",
func_class = FUNC_CLASS_EXEC,
actions = rpm_program_actions},
-- end of rpm rules

{name = "/bin default rule", dir = "/bin", map_to = target_root,
protection = readonly_fs_if_not_root}
}
Expand Down Expand Up @@ -321,12 +315,31 @@ emulate_mode_rules_usr = {
{if_active_exec_policy_is = "Tools",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib64",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib64",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{ map_to = target_root, protection = readonly_fs_always },
},
},
-- and if the program looks in lib64 and the emulator can't find
-- it (because it's 32 bit) then look in /usr/lib...
{dir = "/usr/lib64", func_class = FUNC_CLASS_DLOPEN,
actions = {
{if_active_exec_policy_is = "Tools",
if_exists_then_replace_by = tools .. "/usr/lib",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Tools",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_replace_by = tools .. "/usr/lib",
protection = readonly_fs_always},
{if_active_exec_policy_is = "Host",
if_exists_then_map_to = tools,
protection = readonly_fs_always},
{ map_to = target_root, protection = readonly_fs_always },
},
},
Expand Down

0 comments on commit 7530bee

Please sign in to comment.