diff options
author | David P <megver83@parabola.nu> | 2020-08-26 16:18:05 -0400 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2020-08-26 16:27:37 -0400 |
commit | 0d5c488921e1911a5ebaf5d1a9ac3eeb1e72b188 (patch) | |
tree | f9c52ed87dec3e5a2b61bac3178d3a989ce31d84 /configs/lxde-openrc/airootfs/etc | |
parent | ebbfe24e975da3783b85ab3f2e4a4c8227a3b9ea (diff) |
[openrc] airootfs: add/modify scripts to emulate its systemd counterparts, better than beforev47.1
New:
* add choose-mirror to openrc profiles
* add choose-mirror.start and etc-pacman.d-gnupg.start to openrc profiles
* enable haveged in openrc profiles
Fixed:
* read the kernel cmdline in reflector NM dispatcher script and pacman-init.start
* talkingparabola: a little improvement in .zlogin, discovered by shellcheck
* Makefile: add talkingparabola's choose-mirror to the shellcheck'ed files
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'configs/lxde-openrc/airootfs/etc')
5 files changed, 25 insertions, 3 deletions
diff --git a/configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector b/configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector index a186bbf..17ba099 100755 --- a/configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector +++ b/configs/lxde-openrc/airootfs/etc/NetworkManager/dispatcher.d/reflector @@ -2,6 +2,9 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -if [ "$2" = up ]; then - /usr/bin/reflector --protocol https --age 1 --sort rate --save /etc/pacman.d/mirrorlist +if [ "$2" == up ] && ! grep -qoP 'mirror=\K\S+' /proc/cmdline; then + # shellcheck disable=SC2034 + XDG_CACHE_HOME=/var/cache/reflector + umask 177 + /usr/bin/reflector --protocol https --latest 15 --sort rate --save /etc/pacman.d/mirrorlist fi diff --git a/configs/lxde-openrc/airootfs/etc/local.d/choose-mirror.start b/configs/lxde-openrc/airootfs/etc/local.d/choose-mirror.start new file mode 100755 index 0000000..fea21b8 --- /dev/null +++ b/configs/lxde-openrc/airootfs/etc/local.d/choose-mirror.start @@ -0,0 +1,6 @@ +#!/bin/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# Choose mirror from the kernel command line +grep -qoP 'mirror=\K\S+' /proc/cmdline && /usr/local/bin/choose-mirror diff --git a/configs/lxde-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start b/configs/lxde-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start new file mode 100755 index 0000000..f705ece --- /dev/null +++ b/configs/lxde-openrc/airootfs/etc/local.d/etc-pacman.d-gnupg.start @@ -0,0 +1,11 @@ +#!/bin/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# Temporary /etc/pacman.d/gnupg directory +fstype="$(findmnt /etc/pacman.d/gnupg -o FSTYPE -Un)" + +test -d /etc/pacman.d/gnupg || mkdir /etc/pacman.d/gnupg +if ! [[ "$fstype" == tmpfs ]]; then + mount -o mode=0755 -t tmpfs tmpfs /etc/pacman.d/gnupg +fi diff --git a/configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start b/configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start index b57d737..41c6166 100755 --- a/configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start +++ b/configs/lxde-openrc/airootfs/etc/local.d/pacman-init.start @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -if ! [ -d /etc/pacman.d/gnupg ]; then +# Initializes Pacman keyring +if ! find /etc/pacman.d/gnupg -mindepth 1 2>/dev/null | read -r; then pacman-key --init pacman-key --populate archlinux archlinux32 parabola fi diff --git a/configs/lxde-openrc/airootfs/etc/runlevels/default/haveged b/configs/lxde-openrc/airootfs/etc/runlevels/default/haveged new file mode 120000 index 0000000..0ec5343 --- /dev/null +++ b/configs/lxde-openrc/airootfs/etc/runlevels/default/haveged @@ -0,0 +1 @@ +/etc/init.d/haveged
\ No newline at end of file |