Skip to content

Commit

Permalink
Merge branch 'master' into build-system-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroReflex authored Aug 25, 2024
2 parents 6c953ea + 9544020 commit 6083094
Show file tree
Hide file tree
Showing 31 changed files with 255 additions and 348 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ jobs:
name: Build base docker image
runs-on: ubuntu-latest
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build-system-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ jobs:
display_version: ${{ steps.build_image.outputs.display_version }}
image_filename: ${{ steps.build_image.outputs.image_filename }}
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- name: Maximize build space
run: |
df -h
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ jobs:
aur-pkgs: ${{ steps.set-aur-pkgs.outputs.matrix }}
pkgs: ${{ steps.set-pkgs.outputs.matrix }}
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
- id: set-aur-pkgs
run: source ./manifest ; echo "matrix=$(echo ${AUR_PACKAGES} | jq -R -s -c 'split(" ")')" >> $GITHUB_OUTPUT
shell: bash
- id: set-pkgs
run: echo "matrix=$(ls -d pkgs/*/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
shell: bash

aur-pkgbuild:
needs:
- build-docker-image
Expand All @@ -41,6 +49,15 @@ jobs:
matrix:
package: ${{ fromJson(needs.list-pkgbuilds.outputs.aur-pkgs) }}
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
Expand Down Expand Up @@ -69,6 +86,15 @@ jobs:
matrix:
package: ${{ fromJson(needs.list-pkgbuilds.outputs.pkgs) }}
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
- name: Read version
id: set-version
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ jobs:
aur-pkgs: ${{ steps.set-aur-pkgs.outputs.matrix }}
pkgs: ${{ steps.set-pkgs.outputs.matrix }}
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -43,6 +52,15 @@ jobs:
matrix:
package: ${{ fromJson(needs.list-pkgbuilds.outputs.aur-pkgs) }}
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
with:
submodules: recursive
Expand Down Expand Up @@ -73,6 +91,15 @@ jobs:
matrix:
package: ${{ fromJson(needs.list-pkgbuilds.outputs.pkgs) }}
steps:
- name: Set 8.8.8.8 as dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- run: |
sudo prlimit --pid $$ --nofile=500000:500000
ulimit -a
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
Expand Down
31 changes: 21 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM archlinux:base-devel
LABEL contributor="[email protected]"
COPY rootfs/etc/pacman.conf /etc/pacman.conf
RUN echo -e "keyserver-options auto-key-retrieve" >> /etc/pacman.d/gnupg/gpg.conf && \
# Cannot check space in chroot
sed -i '/CheckSpace/s/^/#/g' /etc/pacman.conf && \
pacman-key --init && \
COPY rootfs/etc/resolv.conf /etc/resolv.conf
RUN echo -e "keyserver-options auto-key-retrieve" >> /etc/pacman.d/gnupg/gpg.conf

# Cannot check space in chroot
RUN sed -i '/CheckSpace/s/^/#/g' /etc/pacman.conf

RUN pacman-key --init && \
pacman --noconfirm -Syyuu && \
pacman --noconfirm -S \
arch-install-scripts \
Expand All @@ -20,12 +23,20 @@ RUN echo -e "keyserver-options auto-key-retrieve" >> /etc/pacman.d/gnupg/gpg.con
python-markdown-it-py \
python-setuptools \
python-wheel \
sudo \
&& \
pacman --noconfirm -S --needed git && \
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
useradd build -G wheel -m && \
su - build -c "git clone https://aur.archlinux.org/pikaur.git /tmp/pikaur" && \
sudo

RUN pacman --noconfirm -S --needed git

# No password asked for wheel group
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

# The makepkg tool cannot use root: add a temp user to build packages
# and add that user to wheel group so that it can install packages
# without being asked for a password
RUN useradd build -G wheel -m

# Build and install pikaur
RUN su - build -c "git clone https://aur.archlinux.org/pikaur.git /tmp/pikaur" && \
su - build -c "cd /tmp/pikaur && makepkg -f" && \
pacman --noconfirm -U /tmp/pikaur/pikaur-*.pkg.tar.zst

Expand Down
4 changes: 3 additions & 1 deletion aur-pkgs/build-aur-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ sudo chown build:build /workdir/aur-pkgs

git clone --depth=1 https://aur.archlinux.org/${1}.git /temp/package

pikaur --noconfirm -S inputplumber-bin

PIKAUR_CMD="PKGDEST=/workdir/aur-pkgs pikaur --noconfirm --build-gpgdir /etc/pacman.d/gnupg -S -P /temp/package/PKGBUILD"
PIKAUR_RUN=(bash -c "${PIKAUR_CMD}")
"${PIKAUR_RUN[@]}"
Expand All @@ -20,4 +22,4 @@ if [ $? -ne 0 ]; then
exit -1
fi
# remove any epoch (:) in name, replace with -- since not allowed in artifacts
find /workdir/aur-pkgs/*.pkg.tar* -type f -name '*:*' -execdir bash -c 'mv "$1" "${1//:/--}"' bash {} \;
find /workdir/aur-pkgs/*.pkg.tar* -type f -name '*:*' -execdir bash -c 'mv "$1" "${1//:/--}"' bash {} \;
2 changes: 2 additions & 0 deletions aur-pkgs/build-aur-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ source manifest;
sudo mkdir -p /workdir/aur-pkgs
sudo chown build:build /workdir/aur-pkgs

pikaur --noconfirm -S inputplumber-bin

PIKAUR_CMD="PKGDEST=/workdir/aur-pkgs pikaur --noconfirm -Sw ${AUR_PACKAGES}"
PIKAUR_RUN=(bash -c "${PIKAUR_CMD}")
"${PIKAUR_RUN[@]}"
20 changes: 11 additions & 9 deletions build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,17 @@ Subsystem sftp /usr/lib/ssh/sftp-server
" > /etc/ssh/sshd_config
# Write the fstab file
# NOTE: gid=379 is the group ID of the frzr group
# WARNING: mounting partitions using LABEL exposes us to a bug where multiple disks cannot have frzr systems and how to solve this still is an open question
echo "
LABEL=frzr_root /frzr_root btrfs defaults,x-initrd.mount,subvolid=5,rw,noatime,nodatacow 0 2
LABEL=frzr_root /home btrfs defaults,x-systemd.rw-only,subvol=/home,rw,noatime,nodatacow,nofail 0 0
overlay /root overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,lowerdir=/sysroot/root,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/root_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/root_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=rootoverlay 0 0
overlay /boot overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,lowerdir=/sysroot/frzr_root/kernels/boot:/sysroot/frzr_root/device_quirks/${SYSTEM_NAME}-${VERSION}/boot:/sysroot/boot,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/boot_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/boot_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=bootoverlay 0 0
overlay /usr overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,lowerdir=/sysroot/frzr_root/kernels/usr:/sysroot/frzr_root/device_quirks/${SYSTEM_NAME}-${VERSION}/usr:/sysroot/usr,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/usr_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/usr_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=usroverlay 0 0
overlay /etc overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,x-systemd.rw-only,lowerdir=/sysroot/frzr_root/kernels/etc:/sysroot/frzr_root/device_quirks/${SYSTEM_NAME}-${VERSION}/etc:/sysroot/etc,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/etc_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/etc_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=etcoverlay 0 0
overlay /var overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,x-systemd.rw-only,lowerdir=/sysroot/frzr_root/kernels/var:/sysroot/frzr_root/device_quirks/${SYSTEM_NAME}-${VERSION}/var:/sysroot/var,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/var_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/var_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=varoverlay 0 0
LABEL=frzr_efi /efi vfat uid=0,gid=379,fmask=0077,dmask=0077,rw,noatime,nofail 0 2
LABEL=frzr_root /frzr_root btrfs defaults,x-initrd.mount,subvolid=5,rw,noatime,nodatacow 0 2
LABEL=frzr_root /home btrfs defaults,x-systemd.rw-only,subvol=/home,rw,noatime,nodatacow,nofail 0 0
overlay /root overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,lowerdir=/sysroot/root,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/root_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/root_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=rootoverlay 0 0
overlay /boot overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,lowerdir=/sysroot/boot,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/boot_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/boot_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=bootoverlay 0 0
overlay /usr overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,lowerdir=/sysroot/usr,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/usr_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/usr_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=usroverlay 0 0
overlay /etc overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,x-systemd.rw-only,lowerdir=/sysroot/etc,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/etc_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/etc_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=etcoverlay 0 0
overlay /var overlay defaults,x-systemd.requires-mounts-for=/frzr_root,x-systemd.requires-mounts-for=/sysroot/frzr_root,x-initrd.mount,x-systemd.rw-only,lowerdir=/sysroot/var,upperdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/var_overlay/upperdir,workdir=/sysroot/frzr_root/deployments_data/${SYSTEM_NAME}-${VERSION}/var_overlay/workdir,index=off,metacopy=off,xino=off,redirect_dir=off,comment=varoverlay 0 0
" > /etc/fstab
echo "
Expand Down Expand Up @@ -209,8 +211,8 @@ postinstallhook
pacman -Q > /manifest
# preserve installed package database
mkdir -p /usr/var/lib/pacman
cp -a /var/lib/pacman/local /usr/var/lib/pacman/
mkdir -p /usr/var/lib/
mv /var/lib/pacman /usr/var/lib/
# Remove the fallback: it is never used and takes up space
if [ -e "/boot/initramfs-${KERNEL_PACKAGE}-fallback.img" ]; then
Expand Down
Loading

0 comments on commit 6083094

Please sign in to comment.