From c49608827a26460a294831c92ffe41b26e1efd75 Mon Sep 17 00:00:00 2001 From: Kai Date: Tue, 17 Dec 2024 12:10:41 -0500 Subject: [PATCH 1/2] Add package for keyd (#744) * Add keyd --------- Co-authored-by: Nathaniel van Diepen --- package/keyd/default.conf | 4 +++ package/keyd/package | 59 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 package/keyd/default.conf create mode 100644 package/keyd/package diff --git a/package/keyd/default.conf b/package/keyd/default.conf new file mode 100644 index 000000000..8547f3aee --- /dev/null +++ b/package/keyd/default.conf @@ -0,0 +1,4 @@ +[ids] +# 2edd:0001 # type folio + +[main] diff --git a/package/keyd/package b/package/keyd/package new file mode 100644 index 000000000..ce9523a42 --- /dev/null +++ b/package/keyd/package @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# Copyright (c) 2020 The Toltec Contributors +# SPDX-License-Identifier: MIT + +archs=(rmallos3) +pkgnames=(keyd) +pkgdesc="A key remapping daemon for linux" +url="https://github.com/rvaiya/keyd" +pkgver=2.4.3-1 +timestamp=2023-05-16T10:11Z +section=utils +maintainer="Kai " +license=MIT + +image=base:v3.1 +source=( + https://github.com/rvaiya/keyd/archive/refs/tags/v2.4.3.zip + default.conf +) +sha256sums=( + cdfcc2cf0518b9a2d292ebac17b18f78548b92803e2a9deeb9f18c9641bf80e5 + SKIP +) + +build() { + make PREFIX=/opt CONFIG_DIR=/opt/etc/keyd "CC=${CROSS_COMPILE}cc" + sed -i 's|ExecStart=/usr/bin/keyd|ExecStart=/opt/bin/keyd|' keyd.service +} + +package() { + cd "$srcdir" + make PREFIX=/opt CONFIG_DIR=/opt/etc/keyd DESTDIR="$pkgdir" install + rmdir "$pkgdir"/etc/keyd + install -D -m 644 -t "$pkgdir"/etc/systemd/system "$srcdir"/keyd.service + install -D -m 644 -t "$pkgdir"/opt/etc/keyd "$srcdir"/default.conf +} + +configure() { + addgroup keyd + systemctl daemon-reload + if is-active keyd; then + systemctl restart keyd + elif ! is-enabled "$pkgname.service"; then + echo "" + echo "Run the following command(s) to enable the keyd service" + how-to-enable "$pkgname.service" + echo "" + echo "You will need to modify /opt/etc/keyd/default.conf before starting the service" + fi +} + +preremove() { + disable-unit keyd + delgroup keyd +} + +postremove() { + systemctl daemon-reload +} From 66c02ec34b6b0e19bacac400ef590426c8061149 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Tue, 17 Dec 2024 14:52:22 -0700 Subject: [PATCH 2/2] Add debootstrap and debian-chroot packages (#799) * Add debian-chroot and debootstrap --- package/debian-chroot/debian-chroot.conf | 1 + package/debian-chroot/package | 80 ++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 package/debian-chroot/debian-chroot.conf create mode 100644 package/debian-chroot/package diff --git a/package/debian-chroot/debian-chroot.conf b/package/debian-chroot/debian-chroot.conf new file mode 100644 index 000000000..1910a84a4 --- /dev/null +++ b/package/debian-chroot/debian-chroot.conf @@ -0,0 +1 @@ +chroot_path="/home/root/.local/share/debian" diff --git a/package/debian-chroot/package b/package/debian-chroot/package new file mode 100644 index 000000000..41f422ace --- /dev/null +++ b/package/debian-chroot/package @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# Copyright (c) 2023 The Toltec Contributors +# SPDX-License-Identifier: MIT + +pkgnames=(debian-chroot debootstrap) +section="utils" +# Each package has it's own timestamp override below +timestamp=2023-12-22T19:37Z +maintainer="Eeems " +installdepends=(display) +flags=(nostrip) + +source=( + https://github.com/Eeems-org/remarkable-debian-chroot/archive/ea12a1bf851f412e8df4b59fe072bce26bb72571.zip + https://salsa.debian.org/installer-team/debootstrap/-/archive/1.0.133/debootstrap-1.0.133.tar.gz + debian-chroot.conf +) +sha256sums=( + 3fcd571ba1aa1a5c55a32767c34e6939e0c0e8ad9213425c6d66d25300fe24b8 + 734af3492eea99de940853e2c00e1a9ebd65c463362155f613aa24b9cc3336a0 + SKIP +) + +debian-chroot() { + pkgdesc="A minimal Debian chroot for the reMarkable tablet" + url=https://github.com/Eeems-Org/remarkable-debian-chroot + pkgver=0.0.0-1 + timestamp=2023-12-22T19:37Z + license=MIT + installdepends=(debootstrap lsof) + package() { + install -D -m 755 \ + "$srcdir"/bin/debian-chroot \ + "$pkgdir"/opt/bin/debian-chroot + install -D -m 655 \ + "$srcdir"/debian-chroot.conf \ + "$pkgdir"/home/root/.config/debian-chroot.conf + mkdir -p "$pkgdir"/opt/etc/ + ln -s /home/root/.config/debian-chroot.conf \ + "$pkgdir"/opt/etc/debian-chroot.conf + source "$srcdir"/debian-chroot.conf + mkdir -p "$pkgdir"/opt/lib/ + ln -s "$chroot_path" "$pkgdir"/opt/lib/debian-chroot + } + configure() { + # Force debian chroot to install iteself + debian-chroot true + } + preremove() { + source /home/root/.config/debian-chroot.conf + if lsof "$chroot_path" 2> /dev/null | grep "$chroot_path"; then + echo "Error: debian-chroot has running processes" + exit 1 + fi + if grep -q "$chroot_path " /proc/mounts; then + /bin/umount -R "$chroot_path" + fi + cp /home/root/.config/debian-chroot.conf /tmp/_debian-chroot.conf + } + postremove() { + source /tmp/_debian-chroot.conf + rm -rf "$chroot_path" + rm /tmp/_debian-chroot.conf + } +} + +debootstrap() { + pkgdesc="debootstrap is a tool which will install a Debian base system into a subdirectory of another, already installed system." + installdepends=(perl ar) + url=https://wiki.debian.org/Debootstrap + pkgver=1.0.133-1 + timestamp=2023-10-21T11:38Z + license=MIT + package() { + cd "$srcdir" + sed -i 's|/usr/sbin|/sbin|' Makefile + make DESTDIR="$pkgdir"/opt install + sed -i 's|DEBOOTSTRAP_DIR=/usr/share/debootstrap|DEBOOTSTRAP_DIR=/opt/usr/share/debootstrap|' "$pkgdir"/opt/sbin/debootstrap + } +}