Bug 452 - Avoid running "make" as root
Summary: Avoid running "make" as root
Status: CONFIRMED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL:
Depends on:
Blocks:
 
Reported: 2020-08-08 15:15 BST by Cesar Strauss
Modified: 2022-03-01 20:53 GMT (History)
1 user (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments
proposed fix (919 bytes, patch)
2020-08-08 15:15 BST, Cesar Strauss
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cesar Strauss 2020-08-08 15:15:33 BST
Created attachment 96 [details]
proposed fix

In the dev-env-setup repository, the hdl-tool-yosys script insists on
running "git" and "make" as root.

https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=hdl-tools-yosys;h=23cbd93304876fa421e537ac7f7d674827c625e5;hb=HEAD

But root is only really needed for "apt-get" and "make install".

I believe it is generally good practice to run software as root as
little as possible.

I suggest removing the root detection guard at the top of the script,
inserting "sudo" at appropriate places, instead. As a bonus, the "chown"
and "chgrp" calls at the end are not longer needed and can be removed.

Relevant mailing list discussion:

http://lists.libre-riscv.org/pipermail/libre-soc-dev/2020-August/000071.html