More packages are required but usually installed by default.
-e2factory uses a unix group named ebs by default. All users of e2factory
-must belong to that group. Create the group.
+e2factory requires root permissions to build in a chroot environment.
+It uses the suid helper e2-su-2.2 belonging to the unix group "ebs".
+
+Alernatively users can configure the use of sudo without password and
+set e2-su-2.2 permissions to 755. Check the manual for further details.
+
+All users of e2factory must belong to the ebs group. Create the group.
groupadd ebs
}
},
tools = {
- ["<tool-name>"] = { name="<string>", flags="<string>" },
+ ["<tool-name>"] = { name="<string>", flags="<string>", enable=<bool> },
...
},
cache = {
.br
Flags/arguments to be passed to the tool.
+.TP
+.BR enable
+Type: Boolean
+.br
+Enables or disables the use of an optional tool.
+
.TP
.BR cache
Type: Table
-- @return bool
function e2lib.e2_su_2_2(argv)
assert(type(argv) == "table")
+ local rc, re
+
+ rc, re = e2lib.get_global_config()
+ if not rc then
+ return false, re
+ end
+
+ rc, re = tools.enabled("sudo")
+ if rc then
+ local cmd
- return e2lib.call_tool_argv("e2-su-2.2", argv)
+ cmd, re = tools.get_tool_flags_argv("e2-su-2.2")
+ if not cmd then
+ return false, re
+ end
+
+ for _,arg in ipairs(argv) do
+ table.insert(cmd, arg)
+ end
+
+ table.insert(cmd, 1, "--")
+
+ return e2lib.call_tool_argv("sudo", cmd)
+ else
+ return e2lib.call_tool_argv("e2-su-2.2", argv)
+ end
end
--- call the tar command
unzip = { name = "unzip", flags = "", optional = false },
["e2-su-2.2"] = { name = buildconfig.BINDIR .. "/e2-su-2.2",
flags = "", optional = false },
+ sudo = { name = "sudo", optional = true, enable = false },
}
for name, t in pairs(defaults) do