Merge branch 'master' into 'master'

updated to use arch bootstrap

See merge request applications/vps2parch!1
This commit is contained in:
Sohrab Behdani 2024-10-04 15:44:48 +00:00
commit 173f28b438

View file

@ -53,11 +53,13 @@ download() {
download2() { aria2c -c -s 16 -x 16 -k 1M -j 1 "$@" ; }
download_and_extract_bootstrap() {
download2 https://github.com/parchlinux/parch-bootstrap/releases/latest/download/sha256sums.txt
download2 https://github.com/parchlinux/parch-bootstrap/releases/latest/download/parchlinux-bootstrap-x86_64.tar.xz
local sha256 filename
download iso/latest/sha256sums.txt | egrep "[[:digit:]]-$cpu_type.tar.zst" > "sha256sums.txt"
read -r sha256 filename < "sha256sums.txt"
download "iso/latest/$filename" > "$filename"
sha256sum -c sha256sums.txt || exit 1
tar -xpJf parchlinux-bootstrap-x86_64.tar.xz
rm -f parchlinux-bootstrap-x86_64.tar.xz
tar -xpf "$filename"
rm -f "$filename"
if grep -E '^nameserver\s+127\.' /etc/resolv.conf > /dev/null; then
echo "nameserver 8.8.8.8" > "/root.$cpu_type/etc/resolv.conf"
@ -90,12 +92,17 @@ chroot_exec() {
}
configure_chroot() {
local m
for m in $mirrors; do
echo 'Server = '"$m"'/$repo/os/$arch'
done >> "/root.$cpu_type/etc/pacman.d/mirrorlist"
# Install and initialize haveged if needed
if ! is_openvz && ! pidof haveged >/dev/null; then
# Disable signature check, install and launch haveged and re-enable signature checks.
sed -i.bak "s/^[[:space:]]*SigLevel[[:space:]]*=.*$/SigLevel = Never/" "/root.$cpu_type/etc/pacman.conf"
chroot_exec 'pacman --needed --noconfirm -Sy haveged && haveged'
mv "/root.$cpu_type/etc/pacman.conf.bak" "/root.$cpu_type/etc/pacman.conf"
echo -e "\n\n[ppr]\nSigLevel = Optional TrustAll\nServer = https://mirror.parchlinux.com/repos/\$repo/\$arch\n\n[pcp]\nSigLevel = Optional TrustAll\nServer = https://mirror.parchlinux.com/repos/\$repo/\$arch" >> "/root.$cpu_type/etc/pacman.conf"
fi
chroot_exec 'pacman-key --init && pacman-key --populate archlinux'
chroot_exec 'pacman --needed --noconfirm -Sy archlinux-keyring'