sourcezap/README.md

93 lines
2.7 KiB
Markdown
Raw Normal View History

2024-05-11 21:27:22 +02:00
## About
2024-05-12 01:26:54 +02:00
sourcezap manages a local copy of the
2024-05-11 22:49:13 +02:00
[HardenedBSD source tree](https://git.HardenedBSD.org/HardenedBSD/HardenedBSD).
2024-05-11 21:27:22 +02:00
The copy of the source tree is maintained by members of
2024-05-12 01:26:54 +02:00
the `_sourcezap` group, and a copy of the source tree
2024-05-11 21:43:59 +02:00
can be installed into `/usr/src/` by root.
2024-05-11 21:27:22 +02:00
## Examples
2024-07-20 19:42:39 +02:00
#### CLI: setup-sourcezap
2024-05-11 21:27:22 +02:00
2024-07-26 16:26:27 +02:00
`setup-sourcezap` should be run after installing
sourcezap for the first time. <br> There is no harm in
running `setup-sourcezap` multiple times:
2024-05-11 21:27:22 +02:00
2024-05-12 01:26:54 +02:00
# Add the '_sourcezap' user, group and home directory
2024-05-12 00:40:06 +02:00
# This command requires root privileges
2024-06-01 06:06:14 +02:00
root@localhost# setup-sourcezap
2024-05-11 21:27:22 +02:00
2024-07-20 19:42:39 +02:00
#### CLI: sourcezap
2024-05-11 21:27:22 +02:00
2024-05-12 01:19:45 +02:00
# Clone the HardenedBSD source tree into /home/_sourcezap/src/
# This command is delegated to the '_sourcezap' user
2024-06-01 06:06:14 +02:00
user@localhost$ sourcezap clone
2024-05-11 21:27:22 +02:00
2024-05-12 01:19:45 +02:00
# Pull updates into /home/_sourcezap/src/
# This command is delegated to the '_sourcezap' user
2024-06-01 06:06:14 +02:00
user@localhost$ sourcezap pull
2024-05-11 21:27:22 +02:00
2024-05-12 04:32:08 +02:00
# Checkout a branch other than the default: hardened/14-stable/master
# This command is delegated to the '_sourcezap' user
2024-06-01 06:06:14 +02:00
user@localhost$ sourcezap checkout hardened/13-stable/master
2024-05-12 01:19:45 +02:00
# Install /home/_sourcezap/src/ into /usr/src/
2024-05-12 00:40:06 +02:00
# This command requires root privileges
2024-06-01 06:06:14 +02:00
root@localhost# sourcezap install
2024-05-11 21:27:22 +02:00
2024-05-12 04:55:58 +02:00
# Remove the contents of /usr/src/ and /home/_sourcezap/src/
2024-05-12 00:40:06 +02:00
# This command requires root privileges
2024-06-01 06:06:14 +02:00
root@localhost# sourcezap rm
2024-05-11 21:27:22 +02:00
2024-07-20 19:42:39 +02:00
#### Environment
2024-05-11 21:27:22 +02:00
* __$SOURCEZAP\_CLONEURL__ <br>
2024-06-01 06:06:14 +02:00
The URL of a git repository <br>
2024-07-08 23:57:15 +02:00
Default: https://git.HardenedBSD.org/HardenedBSD/HardenedBSD.git
2024-05-11 21:27:22 +02:00
2024-05-12 01:19:45 +02:00
* __$SOURCEZAP\_INSTALLDIR__ <br>
2024-06-01 06:06:14 +02:00
The directory where the source tree will be installed <br>
Default: /usr/src/
2024-05-11 21:27:22 +02:00
## Install
2024-07-08 23:51:18 +02:00
#### Package
2024-05-11 21:27:22 +02:00
2024-07-08 23:51:18 +02:00
sourcezap is available
2024-07-08 23:53:36 +02:00
[from the HardenedBSD ports tree](https://git.HardenedBSD.org/HardenedBSD/ports/-/tree/HardenedBSD/main/hardenedbsd/sourcezap). <br>
2024-07-08 23:51:18 +02:00
`pkg install sourcezap` should work too but expect slower updates.
#### Git
The most recent version of sourcezap can be installed via git:
2024-05-11 21:27:22 +02:00
2024-07-16 23:13:59 +02:00
# Clone
2024-06-01 08:58:10 +02:00
user@localhost$ git clone https://git.hardenedbsd.org/0x1eef/sourcezap.git
2024-06-01 06:06:14 +02:00
user@localhost$ cd sourcezap
2024-07-16 23:13:59 +02:00
# Install
2024-06-01 06:06:14 +02:00
root@localhost# make install
root@localhost# setup-sourcezap
2024-07-16 23:13:59 +02:00
# Add user to '_sourcezap' group
2024-06-01 06:06:14 +02:00
root@localhost# pw groupmod -n _sourcezap -m <user>
2024-05-11 21:27:22 +02:00
## Requirements
2024-06-01 08:14:32 +02:00
* [doas](https://man.openbsd.org/doas)
* [git](https://www.man7.org/linux/man-pages/man1/git.1.html)
2024-05-11 21:27:22 +02:00
## Sources
2024-05-12 01:19:45 +02:00
* [GitHub](https://github.com/0x1eef/sourcezap)
* [GitLab](https://gitlab.com/0x1eef/sourcezap)
2024-07-08 19:12:25 +02:00
* [git.HardenedBSD.org/@0x1eef](https://git.HardenedBSD.org/0x1eef/sourcezap)
* [brew.bsd.cafe/@0x1eef](https://brew.bsd.cafe/0x1eef/sourcezap)
2024-05-11 21:27:22 +02:00
## License
2024-06-01 06:06:14 +02:00
[BSD Zero Clause](https://choosealicense.com/licenses/0bsd/) <br>
See [LICENSE](./LICENSE)