arch/README.md
2021-06-26 17:39:13 +02:00

90 lines
2.3 KiB
Markdown

# My personalized Arch Linux distribution
## Submodules - Initialization and Updating
There are several AUR packages added as submodules inside [pkg](pkg).
See [build-pkg/pkglist-AUR.txt](build-pkg/pkglist-AUR.txt) for a full list.
They were added in the following manner:
```shell
AUR=(xorg-meta riseup-vpn nordic-kde-git ...)
for pkg in "${AUR[@]}"; do
git submodule add "https://aur.archlinux.org/${pkg}.git" pkg/"${pkg}"
done
```
To initialize the submodules, run
```shell
git submodule init
```
To update all submodules and print a list of those who received an update, run
```shell
if output="$(git submodule update --remote 2>&1)"; then
# We capture only the part after "pkg" until the next "'" using sed
# Source: https://unix.stackexchange.com/a/165590/315162
sed 's|^Submodule path '\''pkg/\([^'\'']*\).*|\1|' <<< "$output"
else
echo "$output"
fi
```
It may happen that some submodules have a detached HEAD (due to local changes, etc.)
and do not get updated with the above command. One can list those submodules as follows:
```shell
git submodule status | grep --invert-match '(heads/master)$'
# One could then reset them to master with e.g.
# git reset --hard
# git checkout master
```
## Build packages from source
Fork this repository.
Then and adjust the following files:
* [pkg/de-p1st-repo/arch-repo.cfg](pkg/de-p1st-repo/arch-repo.cfg)
* For your build-machine, adjust section `LOCAL MACHINE CONFIGURATION`: Add absolute path of folder [build-pkg/out](build-pkg/out) to array `LOCAL_PKG_DIRS`
as the build packages will be stored there.
* For your mirror-server, adjust section `REMOTE MIRROR SERVER CONFIGURATION` accordingly.
* [pkg/de-p1st-pacman/pacman.d/de-p1st](pkg/de-p1st-pacman/pacman.d/de-p1st)
* Add the address of your mirror-server.
Build [de-p1st-repo](pkg/de-p1st-repo):
```shell
cd build-pkg
sudo docker-compose run --rm makepkg de-p1st-repo
```
Install it on your build-machine and your mirror-server:
```shell
# On your local machine
sudo pacman -U out/de-p1st-repo*.pkg.tar.*
# Copy the package to your mirror-server and install it there as well!
```
Then you can start building all packages and adding them to your mirror-server:
```shell
./build-all.sh
```
## Install Arch Linux
See [pkg/de-p1st-installer/README.md](pkg/de-p1st-installer/README.md)
## Notes and TODOs
See [notes.md](notes.md)