pmb: Set PMBOOTSTRAP_CMD to argv[0] in environment
This allows for scripts run by pmbootstrap to figure out how pmbootstrap was invoked, and with that invoke pmbootstrap even in unconventional setups where "pmbootstrap" isn't an available command in $PATH. Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230325205337.105795-1-newbyte@postmarketos.org%3E
This commit is contained in:
parent
06949ae870
commit
bdbc7b3eb3
|
@ -23,6 +23,9 @@ def main():
|
|||
args = parse.arguments()
|
||||
os.umask(0o22)
|
||||
|
||||
# Store script invocation command
|
||||
os.environ["PMBOOTSTRAP_CMD"] = sys.argv[0]
|
||||
|
||||
# Sanity checks
|
||||
other.check_grsec()
|
||||
if not args.as_root and os.geteuid() == 0:
|
||||
|
|
Loading…
Reference in New Issue