diff options
37 files changed, 1407 insertions, 4 deletions
@@ -1,4 +1,8 @@ -*.pkg.tar.xz -*.pkg.tar.zst -pkg/ -src/ +src +pkg +*.zip +*.tar +*.xz +*.gz +*.zst +*.log @@ -0,0 +1,4 @@ +This is my personal collection of Arch Linux PKGBUILDs, including packages I +maintain. + +What is dead may never die. diff --git a/arch-system/.SRCINFO b/arch-system/.SRCINFO new file mode 100644 index 0000000..1daa4d8 --- /dev/null +++ b/arch-system/.SRCINFO @@ -0,0 +1,68 @@ +pkgbase = arch-system + pkgdesc = Arch Linux system configuration + pkgver = 2023.04.14 + pkgrel = 1 + arch = any + license = custom + source = etc-pacman.conf + source = etc-locale.gen + source = etc-vconsole.conf + source = mirrorupgrade.hook + source = sudoers-wheel + source = etc-nsswitch.conf + source = 90-modprobe-d.hook + source = etc-yubikey.rules + source = sudoers-borgbackup + source = backup-sudo + source = borg-backup.service + source = borg-backup.timer + source = borgbackup + source = intel-undervolt.conf + source = xps13-i915.conf + source = xps13-pci_pm.rules + sha256sums = 271d6a7ac30da0d2ba055067d4ebbab76812c1735e4c2b45c619e004edc1fbba + sha256sums = b11ab0ea3d5c300afa0fb877d1f367993425a3fda0382f50f0e122625154f566 + sha256sums = 978271534da06356159eb24c0cee32b0024029d41df836ab76a964dfd7d36447 + sha256sums = 79ba5fdf0c69686ea0f2770c9b49b58ca26ebcce15e346d5bd56a442e684896e + sha256sums = 62c1a085f7a9d1c5d57b40516fea5d7e8dfb3593d5c0a713cd571c8e5bae2584 + sha256sums = 9c1648e1e9219efbe1e4098952f7595f1ebb0eca629d2c8957079186c56d1822 + sha256sums = 7467bb40e7d404ed249b34a0e410b8d452ebc4b90588d7e210bfa47011b5981d + sha256sums = dd84877b7f6f4330da489fa33f843c9a7c862562a3d78dc2feea5116ac846a79 + sha256sums = 483a7d9350653c2cf22f36f67f1a83cc5c95232dfc10642a20d76e3c32c9e2e3 + sha256sums = d39732bec90036020ad94d52cb34b6215801a82595f7fb30f8c5e0a7f1eb9b1e + sha256sums = 94c06cbf7304996b0503cace9394c2dbc0150bc045fd30cc402e3d943a8c8abd + sha256sums = e1bf3dc5978a7641f86975b7ee770a6914b30a8e4b7e3be2f1b07eaa7098591d + sha256sums = 276a79a04359ffae6ddf597d060278f6f58890ce2d5f6c185948b31c7a5c8927 + sha256sums = 895305808aa91be3294dbaeb7840e38497fb8dbcd6309cc95c417e1a0379e596 + sha256sums = 5613c98d32e513a973e8a0e250ab0b267882a73615f507b6208d4a5f21487fe6 + sha256sums = 4aa61e0833083d0d90e1b732374bfa5da6aa8e86aa291ab1299fc4e87e70f4e0 + +pkgname = base-system + install = base-system.install + depends = gvim + depends = zsh + depends = tmux + depends = htop + depends = git + depends = reflector + depends = sudo + depends = avahi + depends = nss-mdns + depends = ttf-dejavu + depends = chromium + depends = ttf-liberation + +pkgname = backup-system + depends = libnotify + depends = bash + depends = borg + depends = sudo + +pkgname = xps13 + depends = mesa + depends = lib32-mesa + depends = vulkan-intel + depends = libva-intel-driver + depends = lib32-libva-intel-driver + depends = libvdpau-va-gl + depends = intel-undervolt diff --git a/arch-system/90-modprobe-d.hook b/arch-system/90-modprobe-d.hook new file mode 100644 index 0000000..90a035f --- /dev/null +++ b/arch-system/90-modprobe-d.hook @@ -0,0 +1,11 @@ +[Trigger] +Type = File +Operation = Install +Operation = Upgrade +Operation = Remove +Target = etc/modprobe.d/* + +[Action] +Description = Rebuilding initcpios +When = PostTransaction +Exec = /usr/bin/mkinitcpio -P diff --git a/arch-system/PKGBUILD b/arch-system/PKGBUILD new file mode 100644 index 0000000..9098788 --- /dev/null +++ b/arch-system/PKGBUILD @@ -0,0 +1,82 @@ +# Maintainer: Tharre <tharre3@gmail.com> + +pkgbase=arch-system +pkgname=('base-system' 'backup-system' 'xps13') +pkgver=$(printf '%(%Y.%m.%d)T') +pkgrel=1 +pkgdesc="Arch Linux system configuration" +arch=("any") +url="" +license=('custom') +source=('etc-pacman.conf' 'etc-locale.gen' 'etc-vconsole.conf' + 'mirrorupgrade.hook' 'sudoers-wheel' 'etc-nsswitch.conf' + '90-modprobe-d.hook' 'etc-yubikey.rules' + + 'sudoers-borgbackup' 'backup-sudo' 'borg-backup.service' + 'borg-backup.timer' 'borgbackup' + + 'intel-undervolt.conf' 'xps13-i915.conf' 'xps13-pci_pm.rules') +sha256sums=('271d6a7ac30da0d2ba055067d4ebbab76812c1735e4c2b45c619e004edc1fbba' + 'b11ab0ea3d5c300afa0fb877d1f367993425a3fda0382f50f0e122625154f566' + '978271534da06356159eb24c0cee32b0024029d41df836ab76a964dfd7d36447' + '79ba5fdf0c69686ea0f2770c9b49b58ca26ebcce15e346d5bd56a442e684896e' + '62c1a085f7a9d1c5d57b40516fea5d7e8dfb3593d5c0a713cd571c8e5bae2584' + '9c1648e1e9219efbe1e4098952f7595f1ebb0eca629d2c8957079186c56d1822' + '7467bb40e7d404ed249b34a0e410b8d452ebc4b90588d7e210bfa47011b5981d' + 'dd84877b7f6f4330da489fa33f843c9a7c862562a3d78dc2feea5116ac846a79' + '483a7d9350653c2cf22f36f67f1a83cc5c95232dfc10642a20d76e3c32c9e2e3' + 'd39732bec90036020ad94d52cb34b6215801a82595f7fb30f8c5e0a7f1eb9b1e' + '94c06cbf7304996b0503cace9394c2dbc0150bc045fd30cc402e3d943a8c8abd' + 'e1bf3dc5978a7641f86975b7ee770a6914b30a8e4b7e3be2f1b07eaa7098591d' + '276a79a04359ffae6ddf597d060278f6f58890ce2d5f6c185948b31c7a5c8927' + '895305808aa91be3294dbaeb7840e38497fb8dbcd6309cc95c417e1a0379e596' + '5613c98d32e513a973e8a0e250ab0b267882a73615f507b6208d4a5f21487fe6' + '4aa61e0833083d0d90e1b732374bfa5da6aa8e86aa291ab1299fc4e87e70f4e0') + +package_base-system() { + depends=('gvim' 'zsh' 'tmux' 'htop' 'git' 'reflector' 'sudo' 'avahi' + 'nss-mdns' 'ttf-dejavu' 'chromium' 'ttf-liberation') + install="$pkgname.install" + + install -Dm0644 etc-pacman.conf "$pkgdir"/etc/pacman.conf + install -Dm0644 /dev/stdin "$pkgdir"/etc/locale.conf <<EOF +LANG=en_GB.UTF-8 +LC_TIME=de_DE.UTF-8 +LC_COLLATE="C" +EOF + install -Dm0644 etc-locale.gen "$pkgdir"/etc/locale.gen + install -Dm0644 etc-vconsole.conf "$pkgdir"/etc/vconsole.conf + install -Dm0644 mirrorupgrade.hook -t "$pkgdir"/usr/share/libalpm/hooks/ + install -dm0750 "$pkgdir"/etc/sudoers.d/ + install -Dm0644 sudoers-wheel "$pkgdir"/etc/sudoers.d/00_wheel + install -Dm0644 etc-nsswitch.conf "$pkgdir"/etc/nsswitch.conf + install -Dm0644 /dev/stdin "$pkgdir"/usr/lib/sysctl.d/99-sysctl.conf <<EOF +kernel.sysrq = 1 +EOF + install -Dm0644 90-modprobe-d.hook -t "$pkgdir"/usr/share/libalpm/hooks/ + install -Dm0644 etc-yubikey.rules -t "$pkgdir"/usr/lib/udev/rules.d + + ln -s /usr/share/zoneinfo/Europe/Berlin "$pkgdir"/etc/localtime +} + +package_backup-system() { + depends=('libnotify' 'bash' 'borg' 'sudo') + + install -dm0750 "$pkgdir"/etc/sudoers.d/ + install -Dm0644 sudoers-borgbackup "$pkgdir"/etc/sudoers.d/70_borgbackup + install -Dm0644 borg-backup.service -t "$pkgdir"/usr/lib/systemd/user/ + install -Dm0644 borg-backup.timer -t "$pkgdir"/usr/lib/systemd/user/ + install -Dm0755 borgbackup backup-sudo -t "$pkgdir"/usr/bin/ +} + +package_xps13() { + depends=('mesa' 'lib32-mesa' 'vulkan-intel' 'libva-intel-driver' + 'lib32-libva-intel-driver' 'libvdpau-va-gl' 'intel-undervolt') + + install -Dm0644 xps13-i915.conf "$pkgdir"/etc/modprobe.d/i915.conf + install -Dm0644 intel-undervolt.conf -t "$pkgdir"/etc/ + install -Dm0644 xps13-pci_pm.rules \ + "$pkgdir"/usr/lib/udev/rules.d/99-pci_pm.rules +} + +# TODO: docker, vagrant, devtools diff --git a/arch-system/backup-sudo b/arch-system/backup-sudo new file mode 100755 index 0000000..90590e0 --- /dev/null +++ b/arch-system/backup-sudo @@ -0,0 +1,40 @@ +#!/bin/bash -e + +validate_path() { + # validate path + targetpath="$(realpath -m -- "$1")" + if [[ "$targetpath" != /.snapshots/* ]]; then + echo "Invalid path given." >&2 + exit 2 + fi +} + +case "$1" in + snapshot) + validate_path "$2" + # small race, but shouldn't matter + if ! btrfs subvolume show "$3" > /dev/null 2>&1; then + echo "Not a btrfs subvolume." >&2 + exit 3 + fi + touch -c -- "$3" + btrfs subvolume snapshot -r -- "$3" "$2" + ;; + delete_snapshot) + validate_path "$2" + btrfs subvolume delete -- "$2" + ;; + mount) + validate_path "$2" + mkdir -p /backup + mount --bind -- "$2" /backup + ;; + cleanup) + umount /backup 2> /dev/null || true + rm -df /backup + ;; + *) + echo "No command specified." >&2 + exit 1 + ;; +esac diff --git a/arch-system/base-system.install b/arch-system/base-system.install new file mode 100644 index 0000000..ee56a6e --- /dev/null +++ b/arch-system/base-system.install @@ -0,0 +1,16 @@ +post_upgrade() { + # in case it wasn't already run by glibc + locale-gen + + systemctl enable --now avahi-daemon.service + mount | grep -q "on / type btrfs" && systemctl enable --now btrfs-scrub@-.timer +} + +post_install() { + post_upgrade +} + +pre_remove() { + systemctl disable avahi-daemon.service + systemctl disable btrfs-scrub@-.timer +} diff --git a/arch-system/borg-backup.service b/arch-system/borg-backup.service new file mode 100644 index 0000000..b5a4a52 --- /dev/null +++ b/arch-system/borg-backup.service @@ -0,0 +1,15 @@ +[Unit] +Description=Borg backup service for /home (BTRFS) +Wants=network-online.target +After=network-online.target + +[Service] +RuntimeMaxSec=1800 +Nice=19 +IOSchedulingClass=3 +IOSchedulingPriority=7 +ExecStart=/usr/bin/borgbackup +Type=simple + +[Install] +WantedBy=multi-user.target diff --git a/arch-system/borg-backup.timer b/arch-system/borg-backup.timer new file mode 100644 index 0000000..0ac9096 --- /dev/null +++ b/arch-system/borg-backup.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Runs backups every hour + +[Timer] +OnCalendar=hourly +OnBootSec=5min +RandomizedDelaySec=5min +Unit=borg-backup.service + +[Install] +WantedBy=timers.target diff --git a/arch-system/borgbackup b/arch-system/borgbackup new file mode 100755 index 0000000..c813fcc --- /dev/null +++ b/arch-system/borgbackup @@ -0,0 +1,86 @@ +#!/bin/bash + +set -o errexit -o errtrace + +source /etc/borg_env.sh + +export BORG_RSH="$BORG_RSH -o ConnectionAttempts=20 -o ServerAliveInterval=30" +export LC_COLLATE=C + +SNAPSHOT_TARGET="/.snapshots/$SNAPSHOT_PREFIX-$(date "+%Y-%m-%dT%H:%M:%S")" + +cleanup() { + cd / + sudo -n /usr/bin/backup-sudo cleanup +} + +handle_failure() { + notify_user -u critical "Backup failed!" + + echo "Backup failed!" >&2 + exit 2 +} + +trap cleanup EXIT +trap handle_failure INT TERM ERR + +backup() { + # borg's caching of 'known' files is really dumb - it takes the full + # canonical path to check if it has already seen a file. This means that the + # path of files must never change if you want fast backups. + # As symlinks won't work, we use mount(8) to ensure the paths stay the same. + sudo -n backup-sudo mount "$1" + + if [ -t 1 ]; then + borg_progress="--progress" + fi + + cd /backup + + BACKUP_TARGET="$SNAPSHOT_PREFIX"-"$(date -r . "+%Y-%m-%dT%H:%M:%S")" + borg create --stats $borg_progress \ + --patterns-from ~/.borg_pattern \ + --timestamp . \ + --show-rc \ + ::"$BACKUP_TARGET" . && rc=$? || rc=$? + if [ $rc -eq 1 ]; then + # borg defines return code 1 as warning, usually permission stuff + notify_user "Warning: borgbackup returned 1. Check logs" + elif [ $rc -gt 1 ]; then + borg list --short | grep -q "$BACKUP_TARGET" || false + fi + + cleanup + sudo -n backup-sudo delete_snapshot "$1" +} + +if [ ! -d "$SNAPSHOT_TARGET" ]; then + sudo -n backup-sudo snapshot "$SNAPSHOT_TARGET" "$SNAPSHOT_MOUNTPOINT" +fi + +cleanup + +$BORG_RSH "$BORG_HOST" -f -N || rc=$? +if [ ${rc-0} -eq 255 ]; then + notify_user "Backup: upload skipped" + echo "SSH server not reachable, skipping upload" >&2 + exit 0 +elif [ ${rc-0} -ne 0 ]; then + false +fi + +for d in /.snapshots/*/ ; do + echo "Now working on: $d" + backup "$d" +done + +echo "Pruning repository." + +borg prune --show-rc --list \ + --keep-last 20 \ + --keep-hourly 72 \ + --keep-daily 7 \ + --keep-weekly 4 \ + --keep-monthly 6 + +echo "Backup finished." diff --git a/arch-system/etc-locale.gen b/arch-system/etc-locale.gen new file mode 100644 index 0000000..a68f87c --- /dev/null +++ b/arch-system/etc-locale.gen @@ -0,0 +1,26 @@ +# Configuration file for locale-gen +# +# lists of locales that are to be generated by the locale-gen command. +# +# Each line is of the form: +# +# <locale> <charset> +# +# where <locale> is one of the locales given in /usr/share/i18n/locales +# and <charset> is one of the character sets listed in /usr/share/i18n/charmaps +# +# Examples: +# en_US ISO-8859-1 +# en_US.UTF-8 UTF-8 +# de_DE ISO-8859-1 +# de_DE@euro ISO-8859-15 +# +# The locale-gen command will generate all the locales, +# placing them in /usr/lib/locale. +# +# A list of supported locales is included in this file. +# Uncomment the ones you need. +# +en_US.UTF-8 UTF-8 +en_GB.UTF-8 UTF-8 +de_DE.UTF-8 UTF-8 diff --git a/arch-system/etc-nsswitch.conf b/arch-system/etc-nsswitch.conf new file mode 100644 index 0000000..007d207 --- /dev/null +++ b/arch-system/etc-nsswitch.conf @@ -0,0 +1,18 @@ +# Name Service Switch configuration file. +# See nsswitch.conf(5) for details. + +passwd: files mymachines systemd +group: files mymachines systemd +shadow: files + +publickey: files + +hosts: files mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname +networks: files + +protocols: files +services: files +ethers: files +rpc: files + +netgroup: files diff --git a/arch-system/etc-pacman.conf b/arch-system/etc-pacman.conf new file mode 100644 index 0000000..f649764 --- /dev/null +++ b/arch-system/etc-pacman.conf @@ -0,0 +1,100 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +IgnorePkg = linux linux-headers linux-lts linux-lts-headers +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +Color +#NoProgressBar +CheckSpace +#VerbosePkgLists +#ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# 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. + +#[testing] +#Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +#[community-testing] +#Include = /etc/pacman.d/mirrorlist + +[community] +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 + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/arch-system/etc-vconsole.conf b/arch-system/etc-vconsole.conf new file mode 100644 index 0000000..c1e444e --- /dev/null +++ b/arch-system/etc-vconsole.conf @@ -0,0 +1 @@ +KEYMAP=de-latin1 diff --git a/arch-system/etc-yubikey.rules b/arch-system/etc-yubikey.rules new file mode 100644 index 0000000..6d8238b --- /dev/null +++ b/arch-system/etc-yubikey.rules @@ -0,0 +1,13 @@ +# Yubico Yubikey +# +# This is a ugly hack to prevent scdaemon from locking up after suspend. +# Note that more civil methods, like gpgconf --kill scdaemon or just sending a +# normal TERM doesn't work. +# see https://wiki.gnupg.org/SmartCard#Known_problem_of_Yubikey +ATTRS{idVendor}=="1050", \ +ATTRS{idProduct}=="0010|0405|0110|0111|0116", \ +ENV{ID_SECURITY_TOKEN}="1", \ +RUN+="/usr/bin/killall -9 scdaemon", \ +TAG+="uaccess" + +LABEL="yubico_end" diff --git a/arch-system/intel-undervolt.conf b/arch-system/intel-undervolt.conf new file mode 100644 index 0000000..2070f66 --- /dev/null +++ b/arch-system/intel-undervolt.conf @@ -0,0 +1,52 @@ +# Enable or Disable Triggers (elogind) +# Usage: enable [yes/no] + +enable no + +# CPU Undervolting +# Usage: undervolt ${index} ${display_name} ${undervolt_value} +# Example: undervolt 2 'CPU Cache' -25.84 + +undervolt 0 'CPU' -95 +undervolt 1 'GPU' 0 +undervolt 2 'CPU Cache' -95 +undervolt 3 'System Agent' 0 +undervolt 4 'Analog I/O' 0 + +# Power Limits Alteration +# Usage: power ${domain} ${short_power_value} ${long_power_value} +# Power value: ${power}[/${time_window}][:enabled][:disabled] +# Domains: package +# Example: power package 45 35 +# Example: power package 45/0.002 35/28 +# Example: power package 45/0.002:disabled 35/28:enabled + +# Critical Temperature Offset Alteration +# Usage: tjoffset ${temperature_offset} +# Example: tjoffset -20 + +# Energy Versus Performance Preference Switch +# Usage: hwphint ${mode} ${algorithm} ${load_hint} ${normal_hint} +# Hints: see energy_performance_available_preferences +# Modes: switch, force +# Load algorithm: load:${capture}:${threshold} +# Power algorithm: power[:${domain}:[gt/lt]:${value}[:[and/or]]...] +# Capture: single, multi +# Threshold: CPU usage threshold +# Domain: RAPL power domain, check with `intel-undervolt measure` +# Example: hwphint force load:single:0.8 performance balance_performance +# Example: hwphint switch power:core:gt:8 performance balance_performance + +# Daemon Update Interval +# Usage: interval ${interval_in_milliseconds} + +interval 5000 + +# Daemon Actions +# Usage: daemon action[:option...] +# Actions: undervolt, power, tjoffset +# Options: once + +daemon undervolt:once +daemon power +daemon tjoffset diff --git a/arch-system/mirrorupgrade.hook b/arch-system/mirrorupgrade.hook new file mode 100644 index 0000000..7adfe8d --- /dev/null +++ b/arch-system/mirrorupgrade.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Upgrade +Type = Package +Target = pacman-mirrorlist + +[Action] +Description = Updating pacman-mirrorlist with reflector and removing pacnew... +When = PostTransaction +Depends = reflector +Exec = /usr/bin/reflector -p https -l 30 -f 10 -a 24 --score 100 --save /etc/pacman.d/mirrorlist diff --git a/arch-system/sudoers-borgbackup b/arch-system/sudoers-borgbackup new file mode 100644 index 0000000..a6f40b0 --- /dev/null +++ b/arch-system/sudoers-borgbackup @@ -0,0 +1,4 @@ +# /etc/sudoers.d/borgbackup + +# allow systemd service files to call backup-sudo +%wheel ALL=(root) NOPASSWD: /usr/bin/backup-sudo diff --git a/arch-system/sudoers-wheel b/arch-system/sudoers-wheel new file mode 100644 index 0000000..8912b8c --- /dev/null +++ b/arch-system/sudoers-wheel @@ -0,0 +1,4 @@ +# /etc/sudoers.d/wheel + +# Allow members of group wheel to execute any command +%wheel ALL=(ALL) ALL diff --git a/arch-system/xps13-i915.conf b/arch-system/xps13-i915.conf new file mode 100644 index 0000000..6bbe131 --- /dev/null +++ b/arch-system/xps13-i915.conf @@ -0,0 +1 @@ +options i915 enable_guc=3 enable_psr=2 diff --git a/arch-system/xps13-pci_pm.rules b/arch-system/xps13-pci_pm.rules new file mode 100644 index 0000000..8a59bbf --- /dev/null +++ b/arch-system/xps13-pci_pm.rules @@ -0,0 +1,16 @@ +# whitelist for pci autosuspend + +# Intel Sunrise PCI Express Port #1 +SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9d10", ATTR{power/control}="auto" + +# Intel Xeon E3-1200 v6/7th Gen +SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x5914", ATTR{power/control}="auto" + +# Intel Sunrise Point LPC Controller/eSPI Controller +SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9d4e", ATTR{power/control}="auto" + +# SK hynix PC300 NVMe SSD +SUBSYSTEM=="pci", ATTR{vendor}=="0x1c5c", ATTR{device}=="0x1283", ATTR{power/control}="auto" + +# Qualcomm Atheros QCA6174 802.11ac Wireless Adapter +SUBSYSTEM=="pci", ATTR{vendor}=="0x168c", ATTR{device}=="0x003e", ATTR{power/control}="auto" diff --git a/diod/.SRCINFO b/diod/.SRCINFO new file mode 100644 index 0000000..e777dec --- /dev/null +++ b/diod/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = diod + pkgdesc = A multi-threaded, user space file server that speaks 9P2000.L + pkgver = 1.0.24 + pkgrel = 2 + url = https://github.com/chaos/diod + arch = i686 + arch = x86_64 + license = GPL2 + makedepends = git + depends = libcap + depends = lua + provides = diod + conflicts = diod + source = https://github.com/chaos/diod/releases/download/1.0.24/diod-1.0.24.tar.gz + source = 0001-FreeBSD-port.patch + source = 0002-diod-ops.c-add-header-file-for-makedev.patch + source = 0003-Diod-Lua-detection-fix-and-replacing-deprecated-func.patch + sha256sums = f41d2b91c1a712132f5457d9d1c3caca985f069bdc8ef27bf4c148ac1d9f8c9f + sha256sums = a06021fbc278be5a1cf13b3d072a2d5d17ce3c22c984b1cbe4fe63b31e8d00c8 + sha256sums = 37c60fde16505d031733a2f79b31f5acbf6b70aec486c7635be6e3de6896958d + sha256sums = 0438654256a42125a06182ee4ffa7c49de040f4eb419547de258794f0a9f21dc + +pkgname = diod diff --git a/diod/0001-FreeBSD-port.patch b/diod/0001-FreeBSD-port.patch new file mode 100644 index 0000000..8860735 --- /dev/null +++ b/diod/0001-FreeBSD-port.patch @@ -0,0 +1,543 @@ +From 5d6c5a171bd5561e3ff1f4a1cc71ee80b3edaaf9 Mon Sep 17 00:00:00 2001 +From: Daniel Verite <dverite@gmail.com> +Date: Tue, 19 Apr 2016 15:58:45 +0200 +Subject: [PATCH 1/3] FreeBSD port + +- deal with lack of dirent.d_off on FreeBSD +- make xattr* functions essentially no-ops +- skip prctl() and setrlimit() +- some differences in struct statfs +- some mount options lacking +- replace SOL_TCP by IPPROTO_TCP +- use linux value for errno EOPNOTSUPP +--- + diod/Makefile.am | 3 ++- + diod/diod.c | 8 +++++- + diod/diod_dir.h | 12 +++++++++ + diod/fid.c | 2 -- + diod/ioctx.c | 24 ++++++++++++++--- + diod/ioctx.h | 6 +++-- + diod/ops.c | 61 +++++++++++++++++++++++++++++++++++-------- + diod/xattr.c | 17 +++++++++--- + libdiod/diod_auth.c | 1 - + libdiod/diod_sock.c | 6 ++--- + libnpclient/readdir.c | 2 ++ + libnpfs/fcall.c | 10 +++++++ + libnpfs/user.c | 8 ++++++ + 13 files changed, 132 insertions(+), 28 deletions(-) + create mode 100644 diod/diod_dir.h + +diff --git a/diod/Makefile.am b/diod/Makefile.am +index 1926402..7644be7 100644 +--- a/diod/Makefile.am ++++ b/diod/Makefile.am +@@ -24,7 +24,8 @@ diod_SOURCES = \ + fid.c \ + fid.h \ + xattr.c \ +- xattr.h ++ xattr.h \ ++ diod_dir.h + + man8_MANS = \ + diod.8 +diff --git a/diod/diod.c b/diod/diod.c +index 02a41a1..af22ffc 100644 +--- a/diod/diod.c ++++ b/diod/diod.c +@@ -46,7 +46,9 @@ + #include <sys/stat.h> + #include <sys/param.h> + #include <sys/resource.h> ++#ifndef __FreeBSD__ + #include <sys/prctl.h> ++#endif + #include <string.h> + #include <signal.h> + #include <pthread.h> +@@ -323,9 +325,10 @@ _setrlimit (void) + err_exit ("setrlimit RLIMIT_NOFILE"); + + r.rlim_cur = r.rlim_max = RLIM_INFINITY; ++#ifndef __FreeBSD__ + if (setrlimit (RLIMIT_LOCKS, &r) < 0) + err_exit ("setrlimit RLIMIT_LOCKS"); +- ++#endif + r.rlim_cur = r.rlim_max = RLIM_INFINITY; + if (setrlimit (RLIMIT_CORE, &r) < 0) + err_exit ("setrlimit RLIMIT_CORE"); +@@ -400,6 +403,7 @@ _sighand (int sig) + } + } + ++ + /* Thread to handle SIGHUP, SIGTERM, and new connections on listen ports. + */ + static void * +@@ -619,8 +623,10 @@ _service_run (srvmode_t mode, int rfdno, int wfdno) + * Set it here, then maintain it in user.c::np_setfsid () as uids are + * further manipulated. + */ ++#ifndef __FreeBSD__ + if (prctl (PR_SET_DUMPABLE, 1, 0, 0, 0) < 0) + err_exit ("prctl PR_SET_DUMPABLE failed"); ++#endif + + if (!diod_conf_get_userdb ()) + flags |= SRV_FLAGS_NOUSERDB; +diff --git a/diod/diod_dir.h b/diod/diod_dir.h +new file mode 100644 +index 0000000..49ca478 +--- /dev/null ++++ b/diod/diod_dir.h +@@ -0,0 +1,12 @@ ++#ifndef INC_DIOD_DIRENT ++#define INC_DIOD_DIRENT ++ ++#include <dirent.h> ++ ++struct diod_dirent ++{ ++ struct dirent dir_entry; ++ /* for when ! _DIRENT_HAVE_D_OFF */ ++ off_t d_off; ++}; ++#endif +diff --git a/diod/fid.c b/diod/fid.c +index c930f26..828555f 100644 +--- a/diod/fid.c ++++ b/diod/fid.c +@@ -36,10 +36,8 @@ + #include <sys/types.h> + #include <sys/file.h> + #include <sys/stat.h> +-#include <sys/statfs.h> + #include <sys/socket.h> + #include <sys/time.h> +-#include <sys/fsuid.h> + #include <sys/mman.h> + #include <pwd.h> + #include <grp.h> +diff --git a/diod/ioctx.c b/diod/ioctx.c +index b970c8c..aabf367 100644 +--- a/diod/ioctx.c ++++ b/diod/ioctx.c +@@ -36,10 +36,8 @@ + #include <sys/types.h> + #include <sys/file.h> + #include <sys/stat.h> +-#include <sys/statfs.h> + #include <sys/socket.h> + #include <sys/time.h> +-#include <sys/fsuid.h> + #include <pwd.h> + #include <grp.h> + #include <dirent.h> +@@ -292,9 +290,27 @@ ioctx_seekdir (IOCtx ioctx, long offset) + } + + int +-ioctx_readdir_r(IOCtx ioctx, struct dirent *entry, struct dirent **result) ++ioctx_readdir_r(IOCtx ioctx, struct diod_dirent *entry, struct diod_dirent **result) + { +- return ioctx->dir ? readdir_r (ioctx->dir, entry, result) : EINVAL; ++ int r; ++ struct dirent* rd_result; ++ if (!ioctx->dir) ++ return EINVAL; ++ ++ r = readdir_r (ioctx->dir, &entry->dir_entry, &rd_result); ++ if (r==0) { /* success */ ++ /* Does the same to diod_dirent as readdir_r() does to dirent */ ++ if (rd_result == NULL) ++ *result = NULL; ++ else ++ *result = entry; ++#ifdef _DIRENT_HAVE_D_OFF ++ entry->d_off = entry->dir_entry.d_off; ++#else ++ entry->d_off = telldir (ioctx->dir); ++#endif ++ } ++ return r; + } + + int +diff --git a/diod/ioctx.h b/diod/ioctx.h +index 185ab68..5372893 100644 +--- a/diod/ioctx.h ++++ b/diod/ioctx.h +@@ -1,3 +1,5 @@ ++#include "diod_dir.h" ++ + typedef struct path_struct *Path; + typedef struct ioctx_struct *IOCtx; + +@@ -14,8 +16,8 @@ int ioctx_open (Npfid *fid, u32 flags, u32 mode); + int ioctx_close (Npfid *fid, int seterrno); + int ioctx_pread (IOCtx ioctx, void *buf, size_t count, off_t offset); + int ioctx_pwrite (IOCtx ioctx, const void *buf, size_t count, off_t offset); +-int ioctx_readdir_r(IOCtx ioctx, struct dirent *entry, +- struct dirent **result); ++int ioctx_readdir_r(IOCtx ioctx, struct diod_dirent *entry, ++ struct diod_dirent **result); + void ioctx_rewinddir (IOCtx ioctx); + void ioctx_seekdir (IOCtx ioctx, long offset); + int ioctx_fsync (IOCtx ioctx); +diff --git a/diod/ops.c b/diod/ops.c +index 7f0288a..17aeaa5 100644 +--- a/diod/ops.c ++++ b/diod/ops.c +@@ -56,9 +56,14 @@ + #if HAVE_CONFIG_H + #include "config.h" + #endif ++ ++#ifndef __FreeBSD__ + #define _XOPEN_SOURCE 600 /* pread/pwrite */ + #define _BSD_SOURCE /* makedev, st_atim etc */ ++#endif ++ + #define _ATFILE_SOURCE /* utimensat */ ++ + #include <stdlib.h> + #include <unistd.h> + #include <stdio.h> +@@ -69,12 +74,25 @@ + #include <pthread.h> + #include <errno.h> + #include <sys/types.h> ++ ++#ifdef __FreeBSD__ ++#if !__BSD_VISIBLE ++typedef unsigned int u_int; ++#endif ++#endif ++ + #include <sys/file.h> + #include <sys/stat.h> ++ ++#ifdef __FreeBSD__ ++#include <sys/param.h> ++#include <sys/mount.h> ++#else + #include <sys/statfs.h> ++#endif ++ + #include <sys/socket.h> + #include <sys/time.h> +-#include <sys/fsuid.h> + #include <sys/mman.h> + #include <pwd.h> + #include <grp.h> +@@ -98,6 +116,7 @@ + #include "diod_conf.h" + #include "diod_log.h" + #include "diod_auth.h" ++#include "diod_dir.h" + + #include "ops.h" + #include "exp.h" +@@ -215,8 +234,10 @@ diod_ustat2qid (struct stat *st, Npqid *qid) + } + + static void +-_dirent2qid (struct dirent *d, Npqid *qid) ++_dirent2qid (struct diod_dirent *d1, Npqid *qid) + { ++ struct dirent* d = &(d1->dir_entry); ++ + NP_ASSERT (d->d_type != DT_UNKNOWN); + qid->path = d->d_ino; + qid->version = 0; +@@ -591,14 +612,24 @@ diod_statfs (Npfid *fid) + goto error; + } + ++#ifdef __FreeBSD__ ++ fsid = (u64)sb.f_fsid.val[0] | ((u64)sb.f_fsid.val[1] << 32); ++#else + fsid = (u64)sb.f_fsid.__val[0] | ((u64)sb.f_fsid.__val[1] << 32); ++#endif + if (diod_conf_get_statfs_passthru ()) + type = sb.f_type; +- ++#ifdef __FreeBSD__ ++ if (!(ret = np_create_rstatfs(type, sb.f_bsize, sb.f_blocks, ++ sb.f_bfree, sb.f_bavail, sb.f_files, ++ sb.f_ffree, fsid, ++ sb.f_namemax))) { ++#else + if (!(ret = np_create_rstatfs(type, sb.f_bsize, sb.f_blocks, + sb.f_bfree, sb.f_bavail, sb.f_files, + sb.f_ffree, fsid, + sb.f_namelen))) { ++#endif + np_uerror (ENOMEM); + goto error; + } +@@ -632,13 +663,19 @@ _remap_oflags (int flags) + { O_TRUNC, P9_DOTL_TRUNC }, + { O_APPEND, P9_DOTL_APPEND }, + { O_NONBLOCK, P9_DOTL_NONBLOCK }, ++#ifndef __FreeBSD__ + { O_DSYNC, P9_DOTL_DSYNC }, ++#endif + { FASYNC, P9_DOTL_FASYNC }, + { O_DIRECT, P9_DOTL_DIRECT }, ++#ifndef __FreeBSD__ + { O_LARGEFILE, P9_DOTL_LARGEFILE }, ++#endif + { O_DIRECTORY, P9_DOTL_DIRECTORY }, + { O_NOFOLLOW, P9_DOTL_NOFOLLOW }, ++#ifndef __FreeBSD__ + { O_NOATIME, P9_DOTL_NOATIME }, ++#endif + { O_CLOEXEC, P9_DOTL_CLOEXEC }, + { O_SYNC, P9_DOTL_SYNC}, + }; +@@ -1065,15 +1102,15 @@ error_quiet: + } + + static u32 +-_copy_dirent_linux (Fid *f, struct dirent *dp, u8 *buf, u32 buflen) ++_copy_dirent_linux (Fid *f, struct diod_dirent *dp, u8 *buf, u32 buflen) + { + Npqid qid; + u32 ret = 0; + +- if (dp->d_type == DT_UNKNOWN) { ++ if (dp->dir_entry.d_type == DT_UNKNOWN) { + char path[PATH_MAX + 1]; + struct stat sb; +- snprintf (path, sizeof(path), "%s/%s", path_s (f->path), dp->d_name); ++ snprintf (path, sizeof(path), "%s/%s", path_s (f->path), dp->dir_entry.d_name); + if (lstat (path, &sb) < 0) { + np_uerror (errno); + goto done; +@@ -1082,8 +1119,8 @@ _copy_dirent_linux (Fid *f, struct dirent *dp, u8 *buf, u32 buflen) + } else { + _dirent2qid (dp, &qid); + } +- ret = np_serialize_p9dirent(&qid, dp->d_off, dp->d_type, +- dp->d_name, buf, buflen); ++ ret = np_serialize_p9dirent(&qid, dp->d_off, dp->dir_entry.d_type, ++ dp->dir_entry.d_name, buf, buflen); + done: + return ret; + } +@@ -1091,7 +1128,7 @@ done: + static u32 + _read_dir_linux (Fid *f, u8* buf, u64 offset, u32 count) + { +- struct dirent dbuf, *dp; ++ struct diod_dirent dbuf, *dp; + int i, n = 0, err; + + if (offset == 0) +@@ -1106,8 +1143,8 @@ _read_dir_linux (Fid *f, u8* buf, u64 offset, u32 count) + } + if (err == 0 && dp == NULL) + break; +- if ((f->flags & DIOD_FID_FLAGS_MOUNTPT) && strcmp (dp->d_name, ".") +- && strcmp (dp->d_name, "..")) ++ if ((f->flags & DIOD_FID_FLAGS_MOUNTPT) && strcmp (dp->dir_entry.d_name, ".") ++ && strcmp (dp->dir_entry.d_name, "..")) + continue; + i = _copy_dirent_linux (f, dp, buf + n, count - n); + if (i == 0) +@@ -1354,8 +1391,10 @@ diod_xattrwalk (Npfid *fid, Npfid *attrfid, Npstr *name) + goto error; + } + if (xattr_open (attrfid, name, &size) < 0) { ++#ifndef __FreeBSD__ + if (np_rerror () == ENODATA) + goto error_quiet; ++#endif + goto error; + } + nf->flags |= DIOD_FID_FLAGS_XATTR; +diff --git a/diod/xattr.c b/diod/xattr.c +index e2bc8c1..58aee14 100644 +--- a/diod/xattr.c ++++ b/diod/xattr.c +@@ -39,12 +39,15 @@ + #include <errno.h> + #include <sys/types.h> + #include <sys/file.h> +-#include <attr/xattr.h> +-#include <sys/stat.h> ++#ifndef __FreeBSD__ ++#include <sys/xattr.h> + #include <sys/statfs.h> ++#include <sys/fsuid.h> ++#endif ++#include <sys/stat.h> + #include <sys/socket.h> + #include <sys/time.h> +-#include <sys/fsuid.h> ++ + #include <pwd.h> + #include <grp.h> + #include <dirent.h> +@@ -157,6 +160,9 @@ xattr_pread (Xattr x, void *buf, size_t count, off_t offset) + static int + _lgetxattr (Xattr x, const char *path) + { ++#ifdef __FreeBSD__ ++ return 0; ++#else + ssize_t len; + + if (x->name) +@@ -182,6 +188,7 @@ _lgetxattr (Xattr x, const char *path) + return -1; + } + return 0; ++#endif + } + + int +@@ -219,6 +226,9 @@ error: + int + xattr_close (Npfid *fid) + { ++#ifdef __FreeBSD__ ++ return 0; ++#else + Fid *f = fid->aux; + int rc = 0; + +@@ -240,6 +250,7 @@ xattr_close (Npfid *fid) + _xattr_destroy (&f->xattr); + } + return rc; ++#endif + } + + +diff --git a/libdiod/diod_auth.c b/libdiod/diod_auth.c +index 9f391e9..c7fe441 100644 +--- a/libdiod/diod_auth.c ++++ b/libdiod/diod_auth.c +@@ -49,7 +49,6 @@ + #include <stdarg.h> + #include <pthread.h> + #include <unistd.h> +-#include <sys/fsuid.h> + #include <string.h> + #include <pwd.h> + #include <grp.h> +diff --git a/libdiod/diod_sock.c b/libdiod/diod_sock.c +index 0489cbe..69aa31d 100644 +--- a/libdiod/diod_sock.c ++++ b/libdiod/diod_sock.c +@@ -102,19 +102,19 @@ _enable_keepalive(int fd) + goto done; + } + i = 120; +- ret = setsockopt (fd, SOL_TCP, TCP_KEEPIDLE, &i, len); ++ ret = setsockopt (fd, IPPROTO_TCP, TCP_KEEPIDLE, &i, len); + if (ret < 0) { + err ("setsockopt SO_KEEPIDLE"); + goto done; + } + i = 120; +- ret = setsockopt (fd, SOL_TCP, TCP_KEEPINTVL, &i, len); ++ ret = setsockopt (fd, IPPROTO_TCP, TCP_KEEPINTVL, &i, len); + if (ret < 0) { + err ("setsockopt SO_KEEPINTVL"); + goto done; + } + i = 9; +- ret = setsockopt (fd, SOL_TCP, TCP_KEEPCNT, &i, len); ++ ret = setsockopt (fd, IPPROTO_TCP, TCP_KEEPCNT, &i, len); + if (ret < 0) { + err ("setsockopt SO_KEEPCNT"); + goto done; +diff --git a/libnpclient/readdir.c b/libnpclient/readdir.c +index e9220d8..5debdab 100644 +--- a/libnpclient/readdir.c ++++ b/libnpclient/readdir.c +@@ -132,7 +132,9 @@ npc_readdir_r (Npcfid *fid, struct dirent *entry, struct dirent **result) + fid->buf_len - fid->buf_used); + if (res == 0) + return EIO; ++#ifdef _DIRENT_HAVE_D_OFF + entry->d_off = offset; ++#endif + entry->d_type = type; + entry->d_ino = qid.path; + //entry->d_reclen +diff --git a/libnpfs/fcall.c b/libnpfs/fcall.c +index c676fad..80c2bfd 100644 +--- a/libnpfs/fcall.c ++++ b/libnpfs/fcall.c +@@ -1243,7 +1243,12 @@ np_renameat (Npreq *req, Npfcall *tc) + if (np_setfsid (req, newdirfid->user, -1) < 0) + goto done; + if (!req->conn->srv->renameat) { ++#ifdef __FreeBSD__ ++ /* hardcoded linux errno for EOPNOTSUPP */ ++ np_uerror (95); /* v9fs expects this not ENOSYS for this op */ ++#else + np_uerror (EOPNOTSUPP); /* v9fs expects this not ENOSYS for this op */ ++#endif + goto done; + } + rc = (*req->conn->srv->renameat)(olddirfid, &tc->u.trenameat.oldname, +@@ -1276,7 +1281,12 @@ np_unlinkat (Npreq *req, Npfcall *tc) + if (np_setfsid (req, dirfid->user, -1) < 0) + goto done; + if (!req->conn->srv->unlinkat) { ++#ifdef __FreeBSD__ ++ /* hardcoded linux errno for EOPNOTSUPP */ ++ np_uerror (95); /* v9fs expects this not ENOSYS for this op */ ++#else + np_uerror (EOPNOTSUPP); /* v9fs expects this not ENOSYS for this op */ ++#endif + goto done; + } + rc = (*req->conn->srv->unlinkat)(dirfid, &tc->u.tunlinkat.name); +diff --git a/libnpfs/user.c b/libnpfs/user.c +index ba31345..572cd28 100644 +--- a/libnpfs/user.c ++++ b/libnpfs/user.c +@@ -34,13 +34,17 @@ + #include <errno.h> + #include <unistd.h> + #include <sys/syscall.h> ++#ifndef __FreeBSD__ + #include <sys/fsuid.h> ++#endif + #include <pwd.h> + #include <grp.h> + #if HAVE_LIBCAP + #include <sys/capability.h> + #endif ++#ifndef __FreeBSD__ + #include <sys/prctl.h> ++#endif + + #include "9p.h" + #include "npfs.h" +@@ -574,6 +578,9 @@ done: + int + np_setfsid (Npreq *req, Npuser *u, u32 gid_override) + { ++#if __FreeBSD__ ++ return 0; ++#else + Npwthread *wt = req->wthread; + Npsrv *srv = req->conn->srv; + int i, n, ret = -1; +@@ -684,4 +691,5 @@ done: + if (dumpclrd && prctl (PR_SET_DUMPABLE, 1, 0, 0, 0) < 0) + np_logerr (srv, "prctl PR_SET_DUMPABLE failed"); + return ret; ++#endif + } +-- +2.21.0 + diff --git a/diod/0002-diod-ops.c-add-header-file-for-makedev.patch b/diod/0002-diod-ops.c-add-header-file-for-makedev.patch new file mode 100644 index 0000000..60deb3a --- /dev/null +++ b/diod/0002-diod-ops.c-add-header-file-for-makedev.patch @@ -0,0 +1,35 @@ +From 1c0a6a8b5698a49054cfebb6a670649b6e31f3db Mon Sep 17 00:00:00 2001 +From: "Hongzhi.Song" <hongzhi.song@windriver.com> +Date: Thu, 13 Sep 2018 09:05:11 -0400 +Subject: [PATCH 2/3] diod/ops.c: add header file for makedev + +Error: +diod/ops.c:845: undefined reference to `makedev' + +Fixed: +Glibc removes sys/sysmacros.h which defines makedev from sys/types.h +since v2.28. [Commit ID: e16deca62e16f] + +And then glibc suggestions us to include <sys/sysmacros.h> directly if +code needs it. + +Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> +--- + diod/ops.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/diod/ops.c b/diod/ops.c +index 17aeaa5..c7fa80b 100644 +--- a/diod/ops.c ++++ b/diod/ops.c +@@ -74,6 +74,7 @@ + #include <pthread.h> + #include <errno.h> + #include <sys/types.h> ++#include <sys/sysmacros.h> + + #ifdef __FreeBSD__ + #if !__BSD_VISIBLE +-- +2.21.0 + diff --git a/diod/0003-Diod-Lua-detection-fix-and-replacing-deprecated-func.patch b/diod/0003-Diod-Lua-detection-fix-and-replacing-deprecated-func.patch new file mode 100644 index 0000000..6211113 --- /dev/null +++ b/diod/0003-Diod-Lua-detection-fix-and-replacing-deprecated-func.patch @@ -0,0 +1,46 @@ +From 732367504feefb8462f50ff68abe73085bd35559 Mon Sep 17 00:00:00 2001 +From: Leonid Bloch <leonid@daynix.com> +Date: Mon, 20 Jul 2015 14:02:02 +0300 +Subject: [PATCH 3/3] Diod: Lua detection fix and replacing deprecated function + +lua_open was replaced with luaL_newstate, which succeeded it in Lua 5.2. +lua_open was already deprecated in Lua 5.1. +Also, in order to check for Lua during config, a test for luaL_newstate +is used, which works for both Lua 5.1 and 5.2, instead of testing for +lua_call, which does not work for Lua 5.2. + +Signed-off-by: Leonid Bloch <leonid@daynix.com> +--- + config/ax_lua.m4 | 2 +- + libdiod/diod_conf.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/config/ax_lua.m4 b/config/ax_lua.m4 +index e389876..9c1415f 100644 +--- a/config/ax_lua.m4 ++++ b/config/ax_lua.m4 +@@ -164,7 +164,7 @@ AC_DEFUN([AX_LUA_LIBS], + AC_CHECK_LIB([m], [exp], [lua_extra_libs="$lua_extra_libs -lm"], []) + AC_CHECK_LIB([dl], [dlopen], [lua_extra_libs="$lua_extra_libs -ldl"], []) + AC_CHECK_LIB([lua$with_lua_suffix], +- [lua_call], ++ [luaL_newstate], + [LIBLUA="$LUA_LIB -llua$with_lua_suffix $lua_extra_libs"], + [], + [$LIBLUA $lua_extra_libs]) +diff --git a/libdiod/diod_conf.c b/libdiod/diod_conf.c +index 19bd280..03c5a9a 100644 +--- a/libdiod/diod_conf.c ++++ b/libdiod/diod_conf.c +@@ -629,7 +629,7 @@ diod_conf_init_config_file (char *path) /* FIXME: ENOMEM is fatal */ + path = config.configpath; /* missing default file is not fatal */ + } + if (path) { +- lua_State *L = lua_open (); ++ lua_State *L = luaL_newstate (); + + luaopen_base (L); + luaopen_table (L); +-- +2.21.0 + diff --git a/diod/PKGBUILD b/diod/PKGBUILD new file mode 100644 index 0000000..011b449 --- /dev/null +++ b/diod/PKGBUILD @@ -0,0 +1,50 @@ +# Maintainer: Tharre <tharre3@gmail.com> + +pkgname=diod +pkgver=1.0.24 +pkgrel=2 +pkgdesc="A multi-threaded, user space file server that speaks 9P2000.L" +url="https://github.com/chaos/diod" +arch=('i686' 'x86_64') +license=('GPL2') +depends=('libcap' 'lua') +makedepends=('git') +provides=("$pkgname") +conflicts=("$pkgname") +source=("https://github.com/chaos/diod/releases/download/${pkgver}/diod-${pkgver}.tar.gz" + "0001-FreeBSD-port.patch" + "0002-diod-ops.c-add-header-file-for-makedev.patch" + "0003-Diod-Lua-detection-fix-and-replacing-deprecated-func.patch") +sha256sums=('f41d2b91c1a712132f5457d9d1c3caca985f069bdc8ef27bf4c148ac1d9f8c9f' + 'a06021fbc278be5a1cf13b3d072a2d5d17ce3c22c984b1cbe4fe63b31e8d00c8' + '37c60fde16505d031733a2f79b31f5acbf6b70aec486c7635be6e3de6896958d' + '0438654256a42125a06182ee4ffa7c49de040f4eb419547de258794f0a9f21dc') + +prepare() { + cd "${pkgname}-${pkgver}" + patch -p1 -i ../0001-FreeBSD-port.patch + patch -p1 -i ../0002-diod-ops.c-add-header-file-for-makedev.patch + patch -p1 -i ../0003-Diod-Lua-detection-fix-and-replacing-deprecated-func.patch + + # regenerate, since we patched stuff + aclocal -I config + automake --copy --add-missing + autoconf +} + +build() { + cd "${pkgname}-${pkgver}" + + ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --with-ncurses + make +} + +package() { + cd "${pkgname}-${pkgver}" + make "DESTDIR=$pkgdir" install + + ln -s diodmount "${pkgdir}/usr/bin/mount.diod" + + install -Dm644 scripts/diod.service -t "${pkgdir}/usr/lib/systemd/system" + rm -rf "$pkgdir/etc/systemd" +} diff --git a/grokmirror/.SRCINFO b/grokmirror/.SRCINFO new file mode 100644 index 0000000..07aa9e8 --- /dev/null +++ b/grokmirror/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = grokmirror + pkgdesc = Framework to smartly mirror git repositories + pkgver = 2.0.11 + pkgrel = 1 + url = https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git + arch = any + license = GPL3 + makedepends = python-setuptools + depends = python-requests + depends = python-packaging + source = https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git/snapshot/grokmirror-2.0.11.tar.gz + source = https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git/snapshot/grokmirror-2.0.11.tar.asc + validpgpkeys = DE0E66E32F1FDD0902666B96E63EDCA9329DD07E + sha256sums = SKIP + sha256sums = SKIP + +pkgname = grokmirror diff --git a/grokmirror/PKGBUILD b/grokmirror/PKGBUILD new file mode 100644 index 0000000..b547964 --- /dev/null +++ b/grokmirror/PKGBUILD @@ -0,0 +1,27 @@ +# Maintainer: Tharre <tharre3@gmail.com> + +pkgname=grokmirror +pkgver=2.0.11 +pkgrel=1 +pkgdesc='Framework to smartly mirror git repositories' +url='https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git' +arch=('any') +license=('GPL3') +depends=('python-requests' 'python-packaging') +makedepends=('python-setuptools') +source=(https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git/snapshot/grokmirror-${pkgver}.tar.{gz,asc}) +validpgpkeys=('DE0E66E32F1FDD0902666B96E63EDCA9329DD07E') # Konstantin Ryabitsev +sha256sums=('SKIP' + 'SKIP') + +build() { + cd "${pkgname}-${pkgver}" + python setup.py build +} + +package() { + cd "${pkgname}-${pkgver}" + python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build + + install -Dm644 -t "${pkgdir}/usr/share/man/man1/" "man/"*.1 +} diff --git a/.SRCINFO b/mkinitcpio-pkcs11/.SRCINFO index 1810e67..1810e67 100644 --- a/.SRCINFO +++ b/mkinitcpio-pkcs11/.SRCINFO diff --git a/mkinitcpio-pkcs11/.gitignore b/mkinitcpio-pkcs11/.gitignore new file mode 100644 index 0000000..37d234f --- /dev/null +++ b/mkinitcpio-pkcs11/.gitignore @@ -0,0 +1,4 @@ +*.pkg.tar.xz +*.pkg.tar.zst +pkg/ +src/ diff --git a/PKGBUILD b/mkinitcpio-pkcs11/PKGBUILD index d75729a..d75729a 100644 --- a/PKGBUILD +++ b/mkinitcpio-pkcs11/PKGBUILD diff --git a/opensc.module b/mkinitcpio-pkcs11/opensc.module index fd1c1d9..fd1c1d9 100644 --- a/opensc.module +++ b/mkinitcpio-pkcs11/opensc.module diff --git a/pkcs11_install b/mkinitcpio-pkcs11/pkcs11_install index 0643423..0643423 100644 --- a/pkcs11_install +++ b/mkinitcpio-pkcs11/pkcs11_install diff --git a/st-custom/.SRCINFO b/st-custom/.SRCINFO new file mode 100644 index 0000000..9a083d1 --- /dev/null +++ b/st-custom/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = st-custom + pkgdesc = Simple virtual terminal emulator for X + pkgver = 0.7.r93.g97418a4 + pkgrel = 1 + url = http://git.suckless.org/st/ + arch = i686 + arch = x86_64 + arch = armv7h + license = MIT + makedepends = ncurses + makedepends = libxext + makedepends = git + depends = libxft + depends = adobe-source-code-pro-fonts + depends = ttf-dejavu + provides = st + conflicts = st + source = st::git+https://github.com/Tharre/st-transparency.git#branch=custom_config + source = st-terminal.desktop + sha256sums = SKIP + sha256sums = ec9f8e5505f13b450ef180edf3596de4d528fe507fbd1aed7fa715221e64770f + +pkgname = st-custom diff --git a/st-custom/.gitignore b/st-custom/.gitignore new file mode 100644 index 0000000..5979724 --- /dev/null +++ b/st-custom/.gitignore @@ -0,0 +1 @@ +st/ diff --git a/st-custom/PKGBUILD b/st-custom/PKGBUILD new file mode 100644 index 0000000..2752371 --- /dev/null +++ b/st-custom/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: Tharre <tharre3@gmail.com> + +pkgname=st-custom +_pkgname=st +pkgver=0.7.r93.g97418a4 +pkgrel=1 +pkgdesc='Simple virtual terminal emulator for X' +url='http://git.suckless.org/st/' +arch=('i686' 'x86_64' 'armv7h') +license=('MIT') +depends=('libxft' 'adobe-source-code-pro-fonts' 'ttf-dejavu') +makedepends=('ncurses' 'libxext' 'git') +provides=("${_pkgname}") +conflicts=("${_pkgname}") +source=('st::git+https://github.com/Tharre/st-transparency.git#branch=custom_config' + 'st-terminal.desktop') +sha256sums=('SKIP' + 'ec9f8e5505f13b450ef180edf3596de4d528fe507fbd1aed7fa715221e64770f') + +pkgver() { + cd "${_pkgname}" + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd "${_pkgname}" + ln -sf config.def.h config.h +} + +build() { + cd "${_pkgname}" + make +} + +package() { + cd "${_pkgname}" + make PREFIX=/usr DESTDIR="${pkgdir}" install + install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" + install -Dm644 README FAQ -t "${pkgdir}/usr/share/doc/${pkgname}" + install -Dm644 "${srcdir}/st-terminal.desktop" -t "${pkgdir}/usr/share/applications" +} diff --git a/st-custom/st-terminal.desktop b/st-custom/st-terminal.desktop new file mode 100644 index 0000000..c1910b1 --- /dev/null +++ b/st-custom/st-terminal.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=st +Comment=A simple virtual terminal emulator for X. +GenericName=Terminal Emulator +Exec=st +Icon=utilities-terminal +Terminal=false +Type=Application +Categories=System;TerminalEmulator; +StartupNotify=true |