Skip to content

Commit

Permalink
Rework archzfs by moving mirrors to dedicated mirrorlist
Browse files Browse the repository at this point in the history
  • Loading branch information
stevleibelt committed Sep 23, 2024
1 parent 09c6903 commit 5d1ee56
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build.sh.log
configuration/*.sh
dynamic_data/*
software/
48 changes: 14 additions & 34 deletions bin/installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,17 @@ function _initialize_archzfs ()
pacman-key -r DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76

#adding repository
cat >> /etc/pacman.conf <<"DELIM"
[archzfs]
#creating mirrorlist
cat >> /etc/pacman.d/archzfs <<"DELIM"
Server = http://archzfs.com/archzfs/x86_64
Server = http://mirror.sum7.eu/archlinux/archzfs/archzfs/x86_64
Server = https://mirror.biocrafting.net/archlinux/archzfs/archzfs/x86_64
DELIM

#adding repository
cat >> /etc/pacman.conf <<"DELIM"
[archzfs]
Include = /etc/pacman.d/archzfs
DELIM

#updating packages
Expand Down Expand Up @@ -689,34 +694,6 @@ DELIM

_echo_if_be_verbose " Chroot and configure system"
arch-chroot /mnt /bin/bash -xe <<DELIM
### Reinit keyring
# As keyring is initialized at boot, and copied to the install dir with pacstrap, and ntp is running
# Time changed after keyring initialization, it leads to malfunction
# Keyring needs to be reinitialised properly to be able to sign archzfs key.
rm -Rf /etc/pacman.d/gnupg
pacman-key --init
pacman-key --populate archlinux
pacman-key -r DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman -S archlinux-keyring --noconfirm
cat >> /etc/pacman.conf <<"EOSF"
||||||| 6049dc2
_echo_if_be_verbose ":: Chroot and configure system"
arch-chroot /mnt /bin/bash -xe <<DELIM
### Reinit keyring
# As keyring is initialized at boot, and copied to the install dir with pacstrap, and ntp is running
# Time changed after keyring initialization, it leads to malfunction
# Keyring needs to be reinitialised properly to be able to sign archzfs key.
rm -Rf /etc/pacman.d/gnupg
pacman-key --init
pacman-key --populate archlinux
pacman-key -r DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman -S archlinux-keyring --noconfirm
cat >> /etc/pacman.conf <<"EOSF"
=======
_echo_if_be_verbose ":: Chroot and configure system"
arch-chroot /mnt /bin/bash -xe <<DELIM
### Reinit keyring
# As keyring is initialized at boot, and copied to the install dir with pacstrap, and ntp is running
# Time changed after keyring initialization, it leads to malfunction
Expand All @@ -729,12 +706,15 @@ pacman-key -r DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman -S archlinux-keyring --noconfirm
cat >> /etc/pacman.conf <<"EOSF"
>>>>>>> b4746763ae94d6b9bf73864bae34181e15a6f2b3
[archzfs]
cat >> /etc/pacman.d/archzfs <<"EOSF"
Server = http://archzfs.com/archzfs/x86_64
Server = http://mirror.sum7.eu/archlinux/archzfs/archzfs/x86_64
Server = https://mirror.biocrafting.net/archlinux/archzfs/archzfs/x86_64
EOSF
cat >> /etc/pacman.conf <<"EOSF"
[archzfs]
Include = /etc/pacman.d/archzfs
EOSF
pacman -Syu --noconfirm zfs-utils
Expand Down
14 changes: 10 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ function add_packages_and_repository ()
local REPO_INDEX_OR_EMPTY_STRING
local PATH_TO_THE_PACKAGES_FILE
local PATH_TO_THE_PACMAN_CONF_FILE
local PATH_TO_THE_PACMAN_D_ARCHZFS_FILE

PATH_TO_THE_ARCHLIVE=${1:-""}
REPO_INDEX_OR_EMPTY_STRING=${2:-""}

PATH_TO_THE_PACKAGES_FILE="${PATH_TO_THE_ARCHLIVE}/packages.x86_64"
PATH_TO_THE_PACMAN_CONF_FILE="${PATH_TO_THE_ARCHLIVE}/pacman.conf"
PATH_TO_THE_PACMAN_D_ARCHZFS_FILE="${PATH_TO_THE_ARCHLIVE}/pacman.d/archzfs"
#eo: variable

#bo: argument validation
Expand Down Expand Up @@ -177,14 +179,18 @@ function add_packages_and_repository ()

if [[ ${IS_DRY_RUN} -ne 1 ]];
then
_echo_if_be_verbose " Adding archzfs repositories to PATH_TO_THE_PACMAN_CONF_FILE >>${PATH_TO_THE_PACMAN_CONF_FILE}<<."
_echo_if_be_verbose " Creating archzfs mirrorlist file >>${PATH_TO_THE_PACMAN_D_ARCHZFS_FILE}<<."

#bo: adding repository
echo "Server = http://archzfs.com/\$repo/\$arch" >> ${PATH_TO_THE_PACMAN_D_ARCHZFS_FILE}
echo "Server = http://mirror.sum7.eu/archlinux/archzfs/\$repo/\$arch" >> ${PATH_TO_THE_PACMAN_D_ARCHZFS_FILE}
echo "Server = https://mirror.biocrafting.net/archlinux/archzfs/\$repo/\$arch" >> ${PATH_TO_THE_PACMAN_D_ARCHZFS_FILE}

_echo_if_be_verbose " Adding archzfs repositories to PATH_TO_THE_PACMAN_CONF_FILE >>${PATH_TO_THE_PACMAN_CONF_FILE}<<."

echo "" >> ${PATH_TO_THE_PACMAN_CONF_FILE}
echo "[archzfs]" >> ${PATH_TO_THE_PACMAN_CONF_FILE}
echo "Server = http://archzfs.com/\$repo/\$arch" >> ${PATH_TO_THE_PACMAN_CONF_FILE}
echo "Server = http://mirror.sum7.eu/archlinux/archzfs/\$repo/\$arch" >> ${PATH_TO_THE_PACMAN_CONF_FILE}
echo "Server = https://mirror.biocrafting.net/archlinux/archzfs/\$repo/\$arch" >> ${PATH_TO_THE_PACMAN_CONF_FILE}
echo "Include = /etc/pacman.d/archzfs" >> ${PATH_TO_THE_PACMAN_CONF_FILE}
#eo: adding repository

_echo_if_be_verbose " Adding packages."
Expand Down

0 comments on commit 5d1ee56

Please sign in to comment.