makepac/Makefile

47 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2022-07-27 22:45:40 -04:00
.PHONY: help
help: ## Show this help
2022-08-15 21:01:09 -04:00
@echo 'makepac'
2022-07-27 22:45:40 -04:00
@echo '--------'
2022-08-17 00:14:42 -04:00
@echo 'Simple configuration manager'
2022-07-27 22:45:40 -04:00
@echo ''
2022-08-17 00:14:42 -04:00
@echo 'See https://gitlab.com/balki/makepac for usage'
2022-07-27 22:45:40 -04:00
@echo ''
@#https://stackoverflow.com/a/47107132
@sed -ne '/@sed/!s/## //p' $(MAKEFILE_LIST) | column -tl 2
.PHONY: install
2022-12-14 14:44:13 -05:00
install: ## Installs files in root/ to real root
2022-07-28 14:55:41 -04:00
sudo ./makepac/install.sh
2022-07-27 22:45:40 -04:00
.PHONY: sd-reload
sd-reload: ## Run this after editing systemd service/timer files
sudo systemctl daemon-reload
.PHONY: sd-users
sd-users: ## Run this after adding new users
2023-10-10 11:16:39 -04:00
sudo systemctl restart systemd-sysusers.service
2022-07-27 22:45:40 -04:00
2024-05-09 12:13:08 -04:00
.PHONY: tmpfiles
tmpfiles: ## Run this after editing files under tmpfiles.d
sudo systemd-tmpfiles --create
2022-07-27 22:45:40 -04:00
.PHONY: save-perms
save-perms: ## Saves the file permissions to ./acl. Run this after adding new files with correct permissions
2023-02-13 18:23:46 -05:00
getfacl --recursive root | ./makepac/sort_acl.sh > acl
2022-07-27 22:45:40 -04:00
.PHONY: set-perms
2022-08-17 00:14:42 -04:00
set-perms: ## Restores permissions of all files from ./acl
2022-07-27 22:45:40 -04:00
sudo setfacl --restore acl
2023-10-10 11:16:39 -04:00
.PHONY: user-perms
2024-05-09 12:13:08 -04:00
user-perms: ## Grant running user all permissions. Need for git operations. Does not get copied to real filesystem
2023-10-10 11:16:39 -04:00
find root -type f | xargs sudo setfacl -m "u:${USER}:r"
find root -type d | xargs sudo setfacl -m "u:${USER}:rwx"
2022-07-27 22:45:40 -04:00
.PHONY: skel
skel: ## Creates common directories needed
mkdir -p root/etc/
mkdir -p root/usr/local/bin
mkdir -p root/usr/local/lib/systemd/system
mkdir -p root/usr/local/lib/sysusers.d