From 40059885e9db75c721ecfbe9e7b882d4f1ea88f0 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Sat, 18 Mar 2023 19:44:49 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20workaround=20bug=20with=20cachyo?= =?UTF-8?q?s-keyring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the following error indenticate that the entire keyrings for pacman are broken, and that is resulting in broken keyrings after installing CachyOS with the offline install option, which can be fixed manually with keyring reset and locally signing CachyOS key: ``` (520/948) installing cachyos-keyring [-----------------------------------------------------------------------------------------------------------------------] 100% error: config file /etc/pacman.d/cachyos-mirrorlist could not be read: No such file or directory error parsing '/etc/pacman.conf' mkdir: cannot create directory ‘’: No such file or directory gpg: keybox '/root/.gnupg/pubring.kbx' created gpg: /root/.gnupg/trustdb.gpg: trustdb created gpg: no ultimately trusted keys found chmod: cannot access '/trustdb.gpg': No such file or directory ==> Generating pacman master key. This may take some time. gpg: Generating pacman keyring master key... gpg: directory '/root/.gnupg/openpgp-revocs.d' created gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/593A5D4ECDB858180CAE1D681437E851B9F0620B.rev' gpg: Done ==> Updating trust database... gpg: marginals needed: 3 completes needed: 1 trust model: pgp gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u error: config file /etc/pacman.d/cachyos-mirrorlist could not be read: No such file or directory error parsing '/etc/pacman.conf' ==> ERROR: You do not have sufficient permissions to read the pacman keyring. ==> Use 'pacman-key --init' to correct the keyring permissions. error: config file /etc/pacman.d/cachyos-mirrorlist could not be read: No such file or directory error parsing '/etc/pacman.conf' ==> ERROR: You do not have sufficient permissions to read the pacman keyring. ==> Use 'pacman-key --init' to correct the keyring permissions. error: config file /etc/pacman.d/cachyos-mirrorlist could not be read: No such file or directory error parsing '/etc/pacman.conf' ==> ERROR: You do not have sufficient permissions to read the pacman keyring. ==> Use 'pacman-key --init' to correct the keyring permissions. error: command failed to execute correctly ``` was introduced with cleanup commit, removing hardcoded mirrorlist ref: 4750b7ffae95b0febb3ecefb77e11ba6984408e9 --- .gitignore | 1 + util-iso.sh | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index b4b7aef..fcadf9d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ meta-data *.qcow2 archiso/packages.x86_64 archiso/airootfs/etc/gdm/ +archiso/airootfs/etc/pacman.d/ diff --git a/util-iso.sh b/util-iso.sh index 437f070..7d10253 100755 --- a/util-iso.sh +++ b/util-iso.sh @@ -78,6 +78,13 @@ DefaultSession=gnome-xorg.desktop EOF } +fetch_cachyos_mirrorlist() { + mkdir -p ${src_dir}/archiso/airootfs/etc/pacman.d + local _mirrorlist_url="https://github.com/CachyOS/CachyOS-PKGBUILDS/raw/master/cachyos-mirrorlist/cachyos-mirrorlist" + + curl -sSL "${_mirrorlist_url}" > ${src_dir}/archiso/airootfs/etc/pacman.d/cachyos-mirrorlist +} + change_grub_version() { local _version="$1" sed -i "s/CACHYOS_VERSION=\".*\"/CACHYOS_VERSION=\"${_version}\"/" ${src_dir}/archiso/grub/grub.cfg @@ -90,6 +97,9 @@ prepare_profile(){ change_grub_version "$(date +%y%m%d)" + # Fetch up-to-date version of CachyOS repo mirrorlist + fetch_cachyos_mirrorlist + rm -f ${src_dir}/archiso/airootfs/etc/systemd/system/display-manager.service if [ "$profile" == "kde" ]; then cp ${src_dir}/archiso/packages_kde.x86_64 ${src_dir}/archiso/packages.x86_64