Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvements on 04_install_qubes template script #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions template_archlinux/04_install_qubes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ fi
export PACMAN_CACHE_DIR PACMAN_CUSTOM_REPO_DIR "ALL_PROXY=$REPO_PROXY"

echo " --> Enabling x86 repos..."
su -c "echo '[multilib]' >> $INSTALL_DIR/etc/pacman.conf"
su -c "echo 'SigLevel = PackageRequired' >> $INSTALL_DIR/etc/pacman.conf"
su -c "echo 'Include = /etc/pacman.d/mirrorlist' >> $INSTALL_DIR/etc/pacman.conf"
sed -i '/\[multilib]/,+1 s/^#//' "${INSTALL_DIR}/etc/pacman.conf"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How [multilib] is added there? I don't see it in mine default pacman.conf.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default pacman.conf in bootstrap includes multilib commented out:

# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

#[core-testing]
#Include = /etc/pacman.d/mirrorlist

[core]
Include = /etc/pacman.d/mirrorlist

#[extra-testing]
#Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.

#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist

#[multilib]
#Include = /etc/pacman.d/mirrorlist

Also the wiki has an entry for enabling multilib which uncomments these 2 lines.

sudo sed -Ei 's,^#(Server *= *https://mirrors\.kernel\.org/),\1,' "$INSTALL_DIR/etc/pacman.d/mirrorlist"

echo " --> Updating Qubes custom repository..."
# Repo Add need packages to be added in the right version number order as it only keeps the last entered package version
# shellcheck disable=SC2016


"${TEMPLATE_CONTENT_DIR}/arch-chroot-lite" "$INSTALL_DIR" /bin/sh -c \
'mkdir -p /tmp/qubes-packages-mirror-repo/pkgs'

Expand All @@ -42,17 +37,21 @@ if [ "0${IS_LEGACY_BUILDER}" -eq 0 ]; then
"cd /tmp/qubes-packages-mirror-repo && find . -name '*.pkg.tar.*' -print0 | xargs -0 -I {} mv {} pkgs/"
fi

# shellcheck disable=SC2016
"${TEMPLATE_CONTENT_DIR}/arch-chroot-lite" "$INSTALL_DIR" /bin/sh -c \
'cd /tmp/qubes-packages-mirror-repo && repo-add pkgs/qubes.db.tar.gz; for pkg in `ls -v pkgs/*.pkg.tar.zst`; do [ -f "$pkg" ] && repo-add pkgs/qubes.db.tar.gz "$pkg"; done;'

chown -R --reference="$PACMAN_CUSTOM_REPO_DIR" "$PACMAN_CUSTOM_REPO_DIR"

echo " --> Registering Qubes custom repository..."
echo "[qubes] " | sudo tee -a "$INSTALL_DIR/etc/pacman.conf"
echo "SigLevel = Never " | sudo tee -a "$INSTALL_DIR/etc/pacman.conf"
echo "Server = file:///tmp/qubes-packages-mirror-repo/pkgs " | sudo tee -a "$INSTALL_DIR/etc/pacman.conf"
cat >> "$INSTALL_DIR/etc/pacman.conf" <<EOF
[qubes]
SigLevel = Never
Server = file:///tmp/qubes-packages-mirror-repo/pkgs
EOF

run_pacman () {
# shellcheck disable=SC2016
"${TEMPLATE_CONTENT_DIR}/arch-chroot-lite" "$INSTALL_DIR" /bin/sh -c \
'proxy=$1; shift; for i in 1 2 3 4 5; do ALL_PROXY=$proxy http_proxy=$proxy https_proxy=$proxy "$@" && exit; done; exit 1' sh "$REPO_PROXY" pacman "$@"
}
Expand Down