From f97179cf68861222b99a3321b13ae9c61c586d8a Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Tue, 26 Dec 2023 12:47:08 -0700 Subject: [PATCH] Stable merge window for week 49 of 2023 (#782) ### New Packages - `webinterface-onboot` 1.2.2-2 - (#770 #721) - Allows the usb web interface to start without the USB cable being connected. - `webinterface-upload-button` - 1.0.1-1 (#771) - Adds an upload button to the usb web interface. - `signature-rm` - 1.0.2-1 (#772) - Removes the `Sent from my reMarkable` signature from emails sent by the device. ### Updated Packages - `linux-stracciatella` - 5.4.70-3 (#742) - Updated to RM1XX_5.4.70_v1.3.4 tag from upstream kernel. - Added wireguard module. - `wireguard` - 1.0.20210219-4 (#743 #784) - Removed wireguard-tools and wg-quick from wireguard package. These packages are provided by entware already. - `display` and `rm2fb-client` - 1:0.0.32-2 (#758 #721) - Add support for OS 3.3.2.1666 - `rmfm` - 1.5.1-1 (#766) - Fix issue where listing a directory with an invalid symlink would crash the application. - `neofetch` - 1.1.0-1 (#769) - `webinterface-wifi` - 2.0.0-2 (#768 #721) - `micro` - 2.0.13-1 (#738) - `koreader` - 2023.10-2 (#749 #721) - `ddvk-hacks` - 39.01-2 (#720 #778) - Fix issue where `ddvk-hacks` wouldn't be reapplied when using `toltecctl reenable`. - `draft` - 0.2.0-22 (#721) - `erode`, `fret`, `oxide`, `rot`, `tarnish`, `decay`, `corrupt`, `anxiety`, `oxide-utils`, `inject_evdev`, and `liboxide` - 2.6-3 (#721) - `reboot-guard` - 1.0.1-8 (#721) - `rmfakecloud-proxy` - 0.0.3-4 (#721) - `genie` - 0.1.6-3 (#721) - `remux` - 0.2.4-2 (#721) - `tailscale-systemd` - 0.0.0-2 (#721) - `toltec-base` - 1.2-3 (#721) - `xochitl` - 0.0.0-17 (#721) ### Tooling - New `provides=()` field added for packages. - Added `unit-exists` and `disable-unit` methods to install-lib **Note:** This doesn't change what OS version that toltec supports, as full support still requires various packages to be updated, removed, or replaced. Along with proper testing of all packages in the repository, as well as the upgrade process. https://github.com/toltec-dev/toltec/milestone/7 contains the current list of issues and pull requests required for 3.x support. --- docs/package.md | 15 ++++ package/ddvk-hacks/package | 5 +- package/display/package | 14 ++- package/draft/package | 7 +- package/koreader/package | 16 +--- package/linux-stracciatella/package | 30 +++++-- package/micro/package | 8 +- package/neofetch/package | 16 +++- package/oxide/package | 11 +-- package/reboot-guard/package | 11 +-- package/rmfakecloud-proxy/package | 4 +- package/rmfm/package | 8 +- package/rmkit/package | 10 +-- package/signature-rm/package | 61 +++++++++++++ package/tailscale-systemd/package | 12 +-- package/toltec-base/package | 8 +- package/webinterface-onboot/package | 86 +++++++++++++++++++ .../webinterface-onboot-toltec.service | 13 +++ package/webinterface-upload-button/package | 51 +++++++++++ package/webinterface-wifi/package | 64 +++++++++----- .../webinterface-wifi-toltec.service | 5 +- package/wireguard/package | 20 +---- package/xochitl/package | 6 +- scripts/install-lib | 28 ++++++ scripts/toltec/recipe.py | 4 +- 25 files changed, 384 insertions(+), 129 deletions(-) create mode 100644 package/signature-rm/package create mode 100644 package/webinterface-onboot/package create mode 100644 package/webinterface-onboot/webinterface-onboot-toltec.service create mode 100644 package/webinterface-upload-button/package diff --git a/docs/package.md b/docs/package.md index 1342df0ac..72a9bdca8 100644 --- a/docs/package.md +++ b/docs/package.md @@ -405,6 +405,21 @@ A list of packages that the current package replaces. Setting this field allows the current package to overwrite and take ownership of files from other packages. Note that the replaced packages will not be automatically uninstalled unless you also declare a conflict with them using the [`conflicts` field](#conflicts-field). +#### `provides` field + + + + + + + + + +
Required?No, defaults to () +
TypeArray of strings
+ +A list of virtual packages that the current package provides. + #### `package()` function The `package()` function populates the `$pkgdir` directory with the files and directories that need to be installed using artifacts from the `$srcdir` directory. diff --git a/package/ddvk-hacks/package b/package/ddvk-hacks/package index 03fefb82f..70423edd9 100644 --- a/package/ddvk-hacks/package +++ b/package/ddvk-hacks/package @@ -6,12 +6,13 @@ archs=(rm1 rm2) pkgnames=(ddvk-hacks) pkgdesc="Enhance Xochitl with additional features" url=https://github.com/ddvk/remarkable-hacks -pkgver=39.01-1 +pkgver=39.01-2 timestamp=2022-11-09T18:31:51Z section="readers" maintainer="Mattéo Delabre " license=MIT flags=(nostrip) +conflicts=(webinterface-onboot signature-rm) source=(https://github.com/ddvk/remarkable-hacks/archive/90e7e3e7ffc269373de191085453be50c9f8da0c.zip) sha256sums=(d3b1413bb9219804581afab598e7f5308233e7467d64e8084e67aae7346beaba) @@ -66,6 +67,8 @@ package() { install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/21501067_rm2/patch_38.2.03 install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/21511189_rm2/patch_39.2.01 fi + touch "$srcdir"/emptyfile + install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/ddvk-hacks "$srcdir"/emptyfile } configure() { diff --git a/package/display/package b/package/display/package index 9cb5abf8d..affb56eee 100644 --- a/package/display/package +++ b/package/display/package @@ -4,11 +4,11 @@ archs=(rm1 rm2) pkgnames=(display rm2fb-client) -timestamp=2023-04-16T20:53:38Z +timestamp=2023-08-27T02:39:10Z maintainer="raisjn " license=MIT url="https://github.com/ddvk/remarkable2-framebuffer" -pkgver=1:0.0.31-2 +pkgver=1:0.0.32-2 _release="${pkgver%-*}" _release="v${_release#*:}" _libver=1.0.1 @@ -23,7 +23,7 @@ source=( rm2fb-preload.env ) sha256sums=( - c27081be9b4fa000e41489b42d53fb8254bd8bf348a34756799488827dbc0f0b + 603eef1688a8c3adb1df23f4f00fe12b80938fe99801b515cd74f84c8cede5b1 SKIP SKIP SKIP @@ -66,13 +66,13 @@ display() { systemctl daemon-reload if systemctl enable rm2fb --now; then # Restart xochitl if it's running - if systemctl --quiet is-active xochitl; then + if is-active xochitl; then # Reset the crash count so we don't trigger remarkable-fail echo "0" > /tmp/crashnum systemctl restart xochitl fi else - systemctl disable rm2fb --now + disable-unit rm2fb.service echo "Failed to start rm2fb. Keeping it disabled for now." echo "Please check the logs and open an issue:" echo " https://github.com/toltec-dev/toltec/issues/new" @@ -83,9 +83,7 @@ display() { preremove() { if [[ $arch = rm2 ]]; then - if systemctl list-units --full -all | grep -Fq 'rm2fb.service'; then - systemctl disable rm2fb --now - fi + disable-unit rm2fb.service echo -n "make sure " if ! is-enabled xochitl.service; then echo "to re-enable xochitl with 'systemctl enable xochitl --now'" diff --git a/package/draft/package b/package/draft/package index 2234c85f0..aac94f8e6 100644 --- a/package/draft/package +++ b/package/draft/package @@ -5,7 +5,7 @@ pkgnames=(draft) pkgdesc="Launcher which wraps around the standard interface" url=https://github.com/dixonary/draft-reMarkable -pkgver=0.2.0-21 +pkgver=0.2.0-22 timestamp=2020-07-20T10:23Z section="launchers" maintainer="Mattéo Delabre " @@ -60,10 +60,7 @@ configure() { } preremove() { - if systemctl list-units --full -all | grep -Fq "$pkgname.service"; then - echo "Disabling $pkgname" - systemctl disable --now "$pkgname" - fi + disable-unit "$pkgname.service" } postremove() { diff --git a/package/koreader/package b/package/koreader/package index 79e03cdc7..3568eb43a 100644 --- a/package/koreader/package +++ b/package/koreader/package @@ -5,8 +5,8 @@ pkgnames=(koreader) pkgdesc="Ebook reader supporting PDF, DjVu, EPUB, FB2 and many more formats" url=https://github.com/koreader/koreader -pkgver=2023.08-2 -timestamp=2023-08-29T16:21:01Z +pkgver=2023.10-2 +timestamp=2023-10-30T17:19:28Z section="readers" maintainer="raisjn " license=AGPL-3.0-or-later @@ -21,7 +21,7 @@ source=( koreader ) sha256sums=( - 8cc9fad1cbcda5519c20afe6e33c4f80a51587daed7b959ef7284ce8b0c41ec0 + fdb72bdb80c74b6c955ffde8852ce67b77ebc7d88ceb4a439b622aff74ad858e SKIP SKIP SKIP @@ -62,15 +62,7 @@ MSG } preremove() { - if is-active "$pkgname"; then - echo "Stopping $pkgname" - systemctl stop "$pkgname" - fi - - if is-enabled "$pkgname"; then - echo "Disabling $pkgname" - systemctl disable "$pkgname" - fi + disable-unit "$pkgname.service" } postremove() { diff --git a/package/linux-stracciatella/package b/package/linux-stracciatella/package index 74111f4a7..e0fe100eb 100644 --- a/package/linux-stracciatella/package +++ b/package/linux-stracciatella/package @@ -6,17 +6,37 @@ archs=(rm1 rm2) pkgnames=(linux-stracciatella) pkgdesc="RemarkableAS's vanilla kernel with a few extra flakes" url=https://github.com/Etn40ff/linux-remarkable -pkgver=5.4.70-2 -timestamp=2022-09-26T21:23:39Z +pkgver=5.4.70-3 +timestamp=2023-09-23T00:12:00Z section="kernel" maintainer="Salvatore Stella " makedepends=(build:flex build:bison build:libssl-dev build:bc build:lzop build:libgmp-dev build:libmpc-dev build:kmod) license=GPL-2.0-only flags=(nostrip) installdepends=(kernelctl) -image=base:v2.3 -source=(https://github.com/Etn40ff/linux-remarkable/archive/41121ea10ed2235c441cfe717461988859d7f5b6.tar.gz) -sha256sums=(ade87a10bfa7069222cbf8eb1d00ca460d38aab9685223d2fa3ee4f363a75cfa) +image=base:v3.1 +_wireguard_version=1.0.20220627 +source=( + https://github.com/Etn40ff/linux-remarkable/archive/c908b16d6b848964ecc9b116a024f247c290a1bf.tar.gz + "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-$_wireguard_version.tar.xz" +) +sha256sums=( + 2075b9eb69172751b3e8e0d3a40d63c0c05982e79a2724ed7c3bdfc4f7988eea + 362d412693c8fe82de00283435818d5c5def7f15e2433a07a9fe99d0518f63c0 +) +noextract=("wireguard-linux-compat-$_wireguard_version.tar.xz") + +prepare() { + # Jury-rig the wireguard module into sources and enable it + mkdir "$srcdir/net/wireguard" + bsdtar --strip-components 2 -xJ -C "$srcdir/net/wireguard" \ + -f "$srcdir/wireguard-linux-compat-$_wireguard_version.tar.xz" \ + "wireguard-linux-compat-$_wireguard_version/src" + sed -i "/^obj-\\\$(CONFIG_NETFILTER).*+=/a obj-\$(CONFIG_WIREGUARD) += wireguard/" "$srcdir/net/Makefile" + sed -i "/^if INET\$/a source \"net/wireguard/Kconfig\"" "$srcdir/net/Kconfig" + echo "CONFIG_WIREGUARD=m" >> "$srcdir/arch/arm/configs/zero-gravitas_defconfig" + echo "CONFIG_WIREGUARD=m" >> "$srcdir/arch/arm/configs/zero-sugar_defconfig" +} build() { if [[ $arch = rm1 ]]; then diff --git a/package/micro/package b/package/micro/package index e71f429ce..40e2c3377 100644 --- a/package/micro/package +++ b/package/micro/package @@ -5,14 +5,14 @@ pkgnames=(micro) pkgdesc="Modern and intuitive terminal-based text editor" url=https://micro-editor.github.io/ -pkgver=2.0.10-1 -timestamp=2021-08-07T00:57:40Z +pkgver=2.0.13-1 +timestamp=2023-10-21T22:38:29Z section="utils" maintainer="Eeems " license=MIT -source=(https://github.com/zyedidia/micro/releases/download/v2.0.10/micro-2.0.10-linux-arm.tar.gz) -sha256sums=(b60478ac87f41f00d91cf6ca58b6d7e05af99ee5fa73fa8881b140ac428fa278) +source=("https://github.com/zyedidia/micro/releases/download/v2.0.13/micro-2.0.13-linux-arm.tar.gz") +sha256sums=(cbbed4e69567871462464049646dc11fdad8b8c75fde5d75856068c2cfbd2d38) package() { install -Dm644 "$srcdir"/LICENSE "$pkgdir/opt/usr/share/licenses/$pkgname/LICENSE" diff --git a/package/neofetch/package b/package/neofetch/package index 1466ba5ad..ae1da866a 100644 --- a/package/neofetch/package +++ b/package/neofetch/package @@ -5,20 +5,28 @@ pkgnames=(neofetch) pkgdesc="A command-line system information tool" url="https://github.com/rM-self-serve/neofetch-rM" -pkgver=0.0.0-1 -timestamp=2023-02-09T11:43:00Z +pkgver=1.1.0-1 +timestamp=2023-12-06T11:43:00Z section="utils" maintainer="rM-self-serve <122753594+rM-self-serve@users.noreply.github.com>" license=MIT source=( - https://github.com/rM-self-serve/neofetch-rM/archive/c497597ba4b481042cbb48b7c2c55e45dda25543.zip + https://github.com/rM-self-serve/neofetch-rM/archive/955997e4e3b8be682f40ee54366e44337df68959.zip ) sha256sums=( - 06492898eac6fb4f2cc95ca52c65f8f4f580ada57b4fe433722dabeae884b633 + 451017bd2517cf8c124af772e77b316ad784507709219e5831b28f613830f7e5 ) package() { install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/neofetch } + +configure() { + if [ -f '/home/root/.config/neofetch/config.conf' ]; then + echo "" + echo "You may choose to remove ~/.config/neofetch/config.conf" + echo "in order to get the latest default config." + fi +} diff --git a/package/oxide/package b/package/oxide/package index 993d16996..8c2c32049 100644 --- a/package/oxide/package +++ b/package/oxide/package @@ -4,7 +4,7 @@ pkgnames=(erode fret oxide rot tarnish decay corrupt anxiety oxide-utils inject_evdev liboxide libsentry) _oxidever=2.6 -pkgver=$_oxidever-2 +pkgver=$_oxidever-3 _sentryver=0.5.0 timestamp=2023-06-05T23:27:53Z maintainer="Eeems " @@ -98,14 +98,7 @@ tarnish() { fi } preremove() { - if is-active tarnish; then - echo "Stopping tarnish" - systemctl stop tarnish - fi - if is-enabled tarnish; then - echo "Disabling tarnish" - systemctl disable tarnish - fi + disable-unit tarnish.service } postremove() { systemctl daemon-reload diff --git a/package/reboot-guard/package b/package/reboot-guard/package index ef9ceb257..965c8a59b 100644 --- a/package/reboot-guard/package +++ b/package/reboot-guard/package @@ -5,7 +5,7 @@ pkgnames=(reboot-guard) pkgdesc="Block systemd-initiated poweroff/reboot/halt until configurable condition checks pass" url=https://github.com/stephanritscher/reboot-guard -pkgver=1.0.1-7 +pkgver=1.0.1-8 timestamp=2020-05-04T06:16Z section="devel" maintainer="Eeems " @@ -34,14 +34,7 @@ configure() { } preremove() { - if is-active rguard.service; then - echo "Stopping rguard.service" - systemctl stop rguard.service - fi - if is-enabled rguard.service; then - echo "Disabling rguard.service" - systemctl disable rguard.service - fi + disable-unit rguard.service } postremove() { diff --git a/package/rmfakecloud-proxy/package b/package/rmfakecloud-proxy/package index 25b90d9b0..b9f247d55 100644 --- a/package/rmfakecloud-proxy/package +++ b/package/rmfakecloud-proxy/package @@ -7,7 +7,7 @@ pkgdesc="Connect Xochitl to a rmfakecloud server" _url=https://github.com/ddvk/rmfakecloud-proxy url="$_url" _upver=0.0.3 -pkgver="$_upver-3" +pkgver="$_upver-4" timestamp=2022-02-26T22:59Z section="utils" maintainer="Mattéo Delabre " @@ -55,7 +55,7 @@ configure() { install-hosts else uninstall-certificates - systemctl disable --now rmfakecloud-proxy + disable-unit rmfakecloud-proxy.service uninstall-hosts fi diff --git a/package/rmfm/package b/package/rmfm/package index aeeb76484..81c25a3ad 100644 --- a/package/rmfm/package +++ b/package/rmfm/package @@ -5,19 +5,19 @@ pkgnames=(rmfm) pkgdesc="Bare-bones file manager using Node.js and sas" url="https://forgejo.sny.sh/sun/rmFM" -pkgver=1.5.0-2 -timestamp=2023-08-08T22:19:23+02:00 +pkgver=1.5.1-1 +timestamp=2023-12-06T08:51:41+01:00 section=utils maintainer="Sunny " license=Unlicense installdepends=(node simple) source=( - https://forgejo.sny.sh/sun/rmFM/archive/1.5.0.zip + https://forgejo.sny.sh/sun/rmFM/archive/1.5.1.zip path_fix.patch ) sha256sums=( - 515cc1843bf61f628c3a0b2b2dcb3256a0182352c6b491585fd52cf96a554b26 + 054569a5e1f420b9046ee2c4067749a1e0bccd88acc216e485b9665a42f4dd60 SKIP ) diff --git a/package/rmkit/package b/package/rmkit/package index be1585793..f8930555b 100644 --- a/package/rmkit/package +++ b/package/rmkit/package @@ -52,7 +52,7 @@ dumbskull() { genie() { pkgdesc="Gesture engine that connects commands to gestures" url="https://rmkit.dev/apps/genie" - pkgver=0.1.6-2 + pkgver=0.1.6-3 section="utils" package() { @@ -67,8 +67,7 @@ genie() { } preremove() { - echo "Disabling $pkgname" - systemctl disable --now "$pkgname" + disable-unit "$pkgname.service" } postremove() { @@ -146,7 +145,7 @@ nao() { remux() { pkgdesc="Launcher that supports multi-tasking applications" url="https://rmkit.dev/apps/remux" - pkgver=0.2.4-1 + pkgver=0.2.4-2 section="launchers" package() { @@ -166,8 +165,7 @@ remux() { } preremove() { - echo "Disabling $pkgname" - systemctl disable --now "$pkgname" + disable-unit "$pkgname.service" } postremove() { diff --git a/package/signature-rm/package b/package/signature-rm/package new file mode 100644 index 000000000..7c24d8061 --- /dev/null +++ b/package/signature-rm/package @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Copyright (c) 2021 The Toltec Contributors +# SPDX-License-Identifier: MIT + +_pkgname='signature-rm' +pkgnames=("$_pkgname") +pkgdesc="Remove the signature from the bottom of emails" +url="https://github.com/rM-self-serve/signature-rM" +pkgver=1.0.2-1 +timestamp=2023-12-06T11:43:00Z +section="utils" +maintainer="rM-self-serve <122753594+rM-self-serve@users.noreply.github.com>" +license=MIT +image=rust:v3.1 +conflicts=(ddvk-hacks webinterface-onboot) + +source=( + "$url"/archive/b5561af4eb6a0f5aa6e98e1a1279066f0c4bd9b7.zip +) +sha256sums=( + 1a7cc8bf7a3f5a7cc9a10ca968bbb5a0082a065760f4cb7038fdb6b9aed4bb00 +) + +build() { + cargo build --release +} + +package() { + install -D -m 755 -t "$pkgdir"/opt/bin \ + "$srcdir/target/armv7-unknown-linux-gnueabihf/release/$_pkgname" + + touch "$srcdir"/emptyfile + install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/"$_pkgname" "$srcdir"/emptyfile +} + +configure() { + echo + echo "Applying signature-rM" + signature-rm apply -y > /dev/null + echo "Success" + echo +} + +_restore() { + echo "Reverting /usr/bin/xochitl" + if signature-rm has-backup > /dev/null; then + signature-rm revert --backup -y > /dev/null + else + signature-rm revert --reverse -y > /dev/null + fi + echo "Success" + echo +} + +preremove() { + _restore +} + +preupgrade() { + _restore +} diff --git a/package/tailscale-systemd/package b/package/tailscale-systemd/package index 4e7fe832a..e8a7836f4 100644 --- a/package/tailscale-systemd/package +++ b/package/tailscale-systemd/package @@ -5,7 +5,7 @@ pkgnames=(tailscale-systemd) pkgdesc="SystemD configuration for tailscale" url=https://tailscale.com -pkgver=0.0.0-1 +pkgver=0.0.0-2 section="utils" timestamp=2023-07-12T00:00Z maintainer="Kai " @@ -30,15 +30,7 @@ configure() { } preremove() { - if is-active tailscaled; then - echo "Stopping tailscaled" - systemctl stop tailscaled - fi - - if is-enabled tailscaled; then - echo "Disabling tailscaled" - systemctl disable tailscaled - fi + disable-unit "tailscaled.service" } postremove() { diff --git a/package/toltec-base/package b/package/toltec-base/package index 87dd4aa26..b333afb84 100644 --- a/package/toltec-base/package +++ b/package/toltec-base/package @@ -6,7 +6,7 @@ archs=(rm1 rm2) pkgnames=(toltec-base) pkgdesc="Metapackage defining the base set of packages in a Toltec install" url=https://toltec-dev.org/ -pkgver=1.2-2 +pkgver=1.2-3 timestamp=2023-05-08T19:31Z section="utils" maintainer="Eeems " @@ -29,10 +29,8 @@ configure() { sed -i \ -e 's|^export TERM=xterm|if \[ -z "$TERM" \];then export TERM=xterm;fi|' \ /opt/etc/profile - if is-enabled "update-engine.service"; then - echo "Disabling automatic update" - systemctl disable --now update-engine - fi + echo "Disabling automatic update" + disable-unit update-engine.service if [[ "$arch" == "rm1" ]] && ! is-masked sys-subsystem-net-devices-usb1.device; then echo "Disabling usb1 network device to avoid long boots" systemctl mask sys-subsystem-net-devices-usb1.device diff --git a/package/webinterface-onboot/package b/package/webinterface-onboot/package new file mode 100644 index 000000000..1d0613caa --- /dev/null +++ b/package/webinterface-onboot/package @@ -0,0 +1,86 @@ +#!/usr/bin/env bash +# Copyright (c) 2021 The Toltec Contributors +# SPDX-License-Identifier: MIT + +_pkgname='webinterface-onboot' +pkgnames=("$_pkgname") +pkgdesc="Start the web interface without the cable, on boot." +url="https://github.com/rM-self-serve/$_pkgname" +pkgver=1.2.2-2 +timestamp=2023-12-03T11:43:00Z +section="utils" +maintainer="rM-self-serve <122753594+rM-self-serve@users.noreply.github.com>" +license=MIT +conflicts=(ddvk-hacks signature-rm) + +source=( + "$url"/archive/cdfe457435974f7ca309b1ac50f1b2ef67000813.zip + "$_pkgname-toltec.service" +) +sha256sums=( + bad965b923fa0979e7c8b97f6a90a400300ef8461292276e6fa2107a89624c8b + SKIP +) + +package() { + install -D -m 755 -t "$pkgdir/opt/bin" "$srcdir/$_pkgname" + install -D -m 644 "$srcdir/$_pkgname-toltec.service" \ + "$pkgdir/lib/systemd/system/$_pkgname.service" + + touch "$srcdir"/emptyfile + install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/"$_pkgname" "$srcdir"/emptyfile +} + +configure() { + systemctl daemon-reload + + echo + echo "Applying usb0 ip persistence" + webinterface-onboot apply-prstip -y > /dev/null + echo "Success" + if webinterface-onboot is-hack-version > /dev/null; then + echo + echo "Applying binary modification" + webinterface-onboot apply-hack -y > /dev/null + echo "Success" + fi + + echo + echo "Run the following command to use $pkgname" + how-to-enable "$pkgname.service" + echo + echo "Then restart xochitl or the device" +} + +_restore() { + if webinterface-onboot is-prstip-applied > /dev/null; then + echo + echo "Reverting usb0 ip persistence" + webinterface-onboot revert-prstip -y > /dev/null + echo "Success" + fi + + if webinterface-onboot is-hack-applied > /dev/null; then + echo + echo "Reverting binary modification" + if webinterface-onboot has-backup > /dev/null; then + webinterface-onboot revert-hack --backup -y > /dev/null + else + webinterface-onboot revert-hack --reverse -y > /dev/null + fi + echo "Success" + fi +} + +preremove() { + disable-unit "$pkgname.service" + _restore +} + +preupgrade() { + _restore +} + +postremove() { + systemctl daemon-reload +} diff --git a/package/webinterface-onboot/webinterface-onboot-toltec.service b/package/webinterface-onboot/webinterface-onboot-toltec.service new file mode 100644 index 000000000..407d2c0f2 --- /dev/null +++ b/package/webinterface-onboot/webinterface-onboot-toltec.service @@ -0,0 +1,13 @@ +[Unit] +Description=Enable the web interface on boot +StartLimitIntervalSec=600 +StartLimitBurst=4 +After=home.mount + +[Service] +Environment=HOME=/home/root +Type=oneshot +ExecStart=/opt/bin/webinterface-onboot local-exec + +[Install] +WantedBy=multi-user.target diff --git a/package/webinterface-upload-button/package b/package/webinterface-upload-button/package new file mode 100644 index 000000000..8341150ca --- /dev/null +++ b/package/webinterface-upload-button/package @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# Copyright (c) 2021 The Toltec Contributors +# SPDX-License-Identifier: MIT + +_pkgname='webinterface-upload-button' +pkgnames=("$_pkgname") +pkgdesc="A simple upload button for the web interface" +url="https://github.com/rM-self-serve/$_pkgname" +pkgver=1.0.1-1 +timestamp=2023-12-06T11:43:00Z +section="utils" +maintainer="rM-self-serve <122753594+rM-self-serve@users.noreply.github.com>" +license=MIT + +source=( + "$url"/archive/1c69d4fcaa1cb8e2cf4b022a190429dc39946498.zip +) +sha256sums=( + a388d1db49a3c35782600efbd94ee449c59f46c223f14c254cb74d9509255d96 +) + +package() { + install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir/$_pkgname" + + touch "$srcdir"/emptyfile + install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/"$_pkgname" "$srcdir"/emptyfile +} + +configure() { + echo + echo "Applying webinterface-upload-button" + webinterface-upload-button apply -y > /dev/null + echo "Success" + echo +} + +_restore() { + echo + echo "Reverting webinterface-upload-button" + webinterface-upload-button revert -y > /dev/null + echo "Success" + echo +} + +preremove() { + _restore +} + +preupgrade() { + _restore +} diff --git a/package/webinterface-wifi/package b/package/webinterface-wifi/package index e8bdeaff6..655beab42 100644 --- a/package/webinterface-wifi/package +++ b/package/webinterface-wifi/package @@ -2,56 +2,80 @@ # Copyright (c) 2020 The Toltec Contributors # SPDX-License-Identifier: MIT -pkgnames=(webinterface-wifi) +_pkgname="webinterface-wifi" +pkgnames=("$_pkgname") pkgdesc="View the web interface if running, over wifi" -url="https://github.com/rM-self-serve/webinterface-wifi" -pkgver=1.0.2-1 -timestamp=2023-02-06T12:23:17Z +url="https://github.com/rM-self-serve/$_pkgname" +pkgver=2.0.0-2 +timestamp=2023-11-26T00:02:11Z section="utils" maintainer="rM-self-serve <122753594+rM-self-serve@users.noreply.github.com>" license=MIT +image=rust:v3.1 -image=rust:v2.3 +_pkgalias="webint-wifi" +_configdir="/home/root/.config/$_pkgname" +_etcdir="/opt/etc/$_pkgname" source=( - https://github.com/rM-self-serve/webinterface-wifi/archive/2e29855303a0806ee51e71bc836bc4b16204fa14.zip - webinterface-wifi-toltec.service + "$url/archive/4513d5cbc5e323f2959987f3bc9e300b0aaddb19.zip" + "$_pkgname-toltec.service" ) sha256sums=( - 629bab244a387086ce2a8f8118b8d1017cf993bf97b13da72573f52572ed526e + a23c05faf4ccaafea9222255399c8c3a121079dd07970c8768b4315606eb7834 SKIP ) build() { - RUSTFLAGS="-Zcrate-attr=feature(const_fn_trait_bound)" cargo build --release + WIW_DATADIR="/opt/etc" cargo build --release } package() { - install -D -m 755 -t "$pkgdir"/opt/bin \ - "$srcdir"/target/armv7-unknown-linux-gnueabihf/release/webinterface-wifi - install -D -m 644 "$srcdir"/webinterface-wifi-toltec.service "$pkgdir"/lib/systemd/system/webinterface-wifi.service + install -D -m 755 -t "$pkgdir/opt/bin" \ + "$srcdir/target/armv7-unknown-linux-gnueabihf/release/$_pkgname" + ln -s "/opt/bin/$_pkgname" "$pkgdir/opt/bin/$_pkgalias" + + install -D -m 644 "$srcdir/$_pkgname-toltec.service" \ + "$pkgdir/lib/systemd/system/$_pkgname.service" + + install -D -m 644 -t "$pkgdir""$_etcdir/docs" \ + "$srcdir/README.MD" "$srcdir"/config/*.toml + install -D -m 644 -t "$pkgdir""$_etcdir/docs/config_examples" \ + "$srcdir"/config/examples/*.toml + install -D -m 644 -t "$pkgdir""$_etcdir"/assets \ + "$srcdir/assets/favicon.ico" + install -d "$pkgdir""$_etcdir/ssl" \ + "$pkgdir""$_etcdir/auth" \ + "$pkgdir""$_configdir" } configure() { + [[ -f "$_configdir/config.toml" ]] \ + || cp "$_etcdir/docs/config.default.toml" \ + "$_configdir/config.toml" + systemctl daemon-reload + if is-active "$pkgname"; then + echo "Restarting $pkgname" + systemctl restart "$pkgname" + fi + + echo "" + echo "Run '\$ $pkgname' for usage information and a link to" + echo "the documentation. You can also find the documentation locally" + echo "at /opt/etc/webinterface-wifi/docs/" echo "" echo "Run the following command to use $pkgname" how-to-enable "$pkgname.service" } preremove() { - if is-active "$pkgname"; then - echo "Stopping $pkgname" - systemctl stop "$pkgname" - fi - if is-enabled "$pkgname"; then - echo "Disabling $pkgname" - systemctl disable "$pkgname" - fi + disable-unit "$pkgname.service" } postremove() { + rmdir "$_etcdir"/*/* "$_etcdir"/* "$_etcdir" 2> /dev/null || true systemctl daemon-reload } diff --git a/package/webinterface-wifi/webinterface-wifi-toltec.service b/package/webinterface-wifi/webinterface-wifi-toltec.service index b6055fc90..b3efab933 100644 --- a/package/webinterface-wifi/webinterface-wifi-toltec.service +++ b/package/webinterface-wifi/webinterface-wifi-toltec.service @@ -5,9 +5,10 @@ StartLimitBurst=4 After=home.mount [Service] -Environment=HOME=/home/root Type=simple -ExecStart=/opt/bin/webinterface-wifi --run 80 +Environment=HOME=/home/root +Environment=WEBINT_WIFI_RUN_ENV=DAEMON +ExecStart=/opt/bin/webinterface-wifi local-exec Restart=on-failure [Install] diff --git a/package/wireguard/package b/package/wireguard/package index d01ce5f3a..23665bb19 100755 --- a/package/wireguard/package +++ b/package/wireguard/package @@ -5,14 +5,14 @@ pkgnames=(wireguard) pkgdesc="Fast, modern, secure VPN tunnel" url=https://www.wireguard.com -pkgver=1.0.20210219-3 -_wireguardtoolsver=1.0.20210223 +pkgver=1.0.20210219-4 timestamp=2021-02-19T14:08Z section=kernel maintainer="Jonah Weissman " license=GPL-2.0-only makedepends=(build:bc build:lzop build:git) flags=(nostrip) +installdepends=(wireguard-tools) _kernelrepo=https://github.com/remarkable/linux _kernelrevs=( @@ -27,28 +27,14 @@ _defconfigs=( image=base:v2.1 source=( "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${pkgver%-*}.tar.xz" - "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${_wireguardtoolsver}.tar.xz" fix-multiple-yylloc-definitions.patch ) -noextract=("wireguard-tools-${_wireguardtoolsver}.tar.xz") sha256sums=( 99d35296b8d847a0d4db97a4dda96b464311a6354e75fe0bef6e7c4578690f00 - 1f72da217044622d79e0bab57779e136a3df795e3761a3fc1dc0941a9055877c SKIP ) -prepare() { - bsdtar -x \ - --directory "$srcdir" \ - --file "$srcdir/wireguard-tools-${_wireguardtoolsver}.tar.xz" - mv "$srcdir/wireguard-tools-${_wireguardtoolsver}" "$srcdir/wireguard-tools" - # the symlink at src/wg-quick/wg needs something to point to - touch "$srcdir/wireguard-tools/src/wg" -} - build() { - make -C wireguard-tools/src PLATFORM=linux "CC=${CROSS_COMPILE}cc" - mkdir pkg git init linux for i in $(seq 0 1); do @@ -80,8 +66,6 @@ build() { } package() { - make -C "$srcdir/wireguard-tools/src" DESTDIR="$pkgdir" WITH_WGQUICK=yes \ - WITH_SYSTEMDUNITS=yes WITH_BASHCOMPLETION=no install mkdir -p "$pkgdir/lib/modules" cp -r "$srcdir/pkg"/* "$pkgdir/lib/modules" } diff --git a/package/xochitl/package b/package/xochitl/package index 1841988bf..07fa0a042 100644 --- a/package/xochitl/package +++ b/package/xochitl/package @@ -5,7 +5,7 @@ pkgnames=(xochitl) pkgdesc="Read documents and take notes" url=https://remarkable.com -pkgver=0.0.0-16 +pkgver=0.0.0-17 timestamp=2022-11-07T20:19:57Z section="readers" maintainer="Mattéo Delabre " @@ -83,9 +83,7 @@ configure() { } preremove() { - if is-active manual-sync.service; then - systemctl disable --now manual-sync.service - fi + disable-unit manual-sync.service } postremove() { diff --git a/scripts/install-lib b/scripts/install-lib index 59c35e2bb..e5e9f22a4 100644 --- a/scripts/install-lib +++ b/scripts/install-lib @@ -182,3 +182,31 @@ remove-bind-mount() { rm "$unit_path" systemctl daemon-reload } + +# Check to see if a systemd unit exists +# +# Arguments: +# +# $1 - Full name of the systemd unit, e.g. "draft.service" +unit-exists() { + [ "$(systemctl --quiet list-unit-files "${1}" | grep -c "${1}")" -eq 1 ] +} + +# Stops and disabled a unit +# +# Arguments: +# +# $1 - Full name of the systemd unit, e.g. "draft.service" +disable-unit() { + if ! unit-exists "${1}"; then + return + fi + if is-active "$1"; then + echo "Stopping ${1}" + systemctl stop "${1}" + fi + if is-enabled "${1}"; then + echo "Disabling ${1}" + systemctl disable "${1}" + fi +} diff --git a/scripts/toltec/recipe.py b/scripts/toltec/recipe.py index fc1cf9ae0..de3844490 100644 --- a/scripts/toltec/recipe.py +++ b/scripts/toltec/recipe.py @@ -344,6 +344,7 @@ class Package: # pylint:disable=too-many-instance-attributes installdepends: Set[Dependency] conflicts: Set[Dependency] replaces: Set[Dependency] + provides: Set[Dependency] functions: bash.Functions custom_functions: bash.Functions @@ -391,7 +392,7 @@ def _load_fields(self, variables: bash.Variables) -> None: self.license = _pop_field_string(variables, "license") self.variables["license"] = self.license - for field in ("installdepends", "conflicts", "replaces"): + for field in ("installdepends", "conflicts", "replaces", "provides"): field_raw = _pop_field_indexed(variables, field, []) self.variables[field] = field_raw setattr(self, field, set()) @@ -483,6 +484,7 @@ def control_fields(self) -> str: ("Depends", self.installdepends), ("Conflicts", self.conflicts), ("Replaces", self.replaces), + ("Provides", self.provides), ): if field: control += (