Verified Commit deb40297 authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Re-add reflector and pacman-init.service

parent 7afa711f
Pipeline #1027 passed with stages
in 17 minutes and 12 seconds
......@@ -38,15 +38,51 @@ Name=eth0
DHCP=ipv4
EOF
# Setup pacman-init.service for clean pacman keyring initialization
cat <<EOF >/etc/systemd/system/pacman-init.service
[Unit]
Description=Initializes Pacman keyring
Wants=haveged.service
After=haveged.service
Before=sshd.service
ConditionFirstBoot=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/pacman-key --init
ExecStart=/usr/bin/pacman-key --populate archlinux
[Install]
WantedBy=multi-user.target
EOF
# Add service for running reflector on first boot
cat <<EOF >/etc/systemd/system/reflector-init.service
[Unit]
Description=Initializes mirrors for the VM
After=network-online.target
Wants=network-online.target
Before=sshd.service
ConditionFirstBoot=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=reflector --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
[Install]
WantedBy=multi-user.target
EOF
# enabling important services
systemctl daemon-reload
systemctl enable sshd
systemctl enable haveged
systemctl enable systemd-networkd
systemctl enable systemd-resolved
pacman-key --init
pacman-key --populate archlinux
systemctl enable pacman-init.service
systemctl enable reflector-init.service
if [ -b "/dev/sda" ]; then
grub-install /dev/sda
......
......@@ -26,6 +26,6 @@ mkfs.btrfs /dev/disk/by-partlabel/root
mount -o compress-force=zstd PARTLABEL=root /mnt
echo "Server = ${MIRROR}" >/etc/pacman.d/mirrorlist
pacstrap /mnt base linux grub openssh sudo polkit haveged netctl python btrfs-progs
pacstrap /mnt base linux grub openssh sudo polkit haveged netctl python btrfs-progs reflector
arch-chroot /mnt /bin/bash
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment