Skip to content

Commit

Permalink
Add *-2.x and *-3.x arch support
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Dec 3, 2023
1 parent 6780441 commit ea1b4dc
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 31 deletions.
16 changes: 11 additions & 5 deletions docs/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@ You can also declare custom variables to reduce repetition but make sure to pref
The list of devices that are compatible with this package.
The following values are accepted:

Name | Meaning
--------|-------------------------------------------------------------------------
`rmall` | Packages which work on all reMarkable devices without modification.
`rm1` | Packages requiring reMarkable 1-specific resources or compilation flags.
`rm2` | Packages requiring reMarkable 2-specific resources or compilation flags.
Name | Meaning
------------|-------------------------------------------------------------------------
`rmall` | Packages which work on all reMarkable devices without modification.
`rm1` | Packages requiring reMarkable 1-specific resources or compilation flags.
`rm2` | Packages requiring reMarkable 2-specific resources or compilation flags.
`rmall-2.x` | Packages which work on all reMarkable devices without modification, but only on the 2.x series of operating system.
`rm1-2.x` | Packages requiring reMarkable 1-specific resources or compilation flags, but only on the 2.x series of operating system.
`rm2-2.x` | Packages requiring reMarkable 2-specific resources or compilation flags, but only on the 2.x series of operating system.
`rmall-3.x` | Packages which work on all reMarkable devices without modification, but only on the 3.x series of operating system.
`rm1-3.x` | Packages requiring reMarkable 1-specific resources or compilation flags, but only on the 3.x series of operating system.
`rm2-3.x` | Packages requiring reMarkable 2-specific resources or compilation flags, but only on the 3.x series of operating system.

For example, use `archs=(rm1)` for a package that only works on reMarkable 1, or `archs=(rm1 rm2)` for a package that works both on reMarkable 1 and reMarkable 2 but needs different dependencies or compilation flags for each of those.

Expand Down
12 changes: 6 additions & 6 deletions package/ddvk-hacks/package
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# Copyright (c) 2021 The Toltec Contributors
# SPDX-License-Identifier: MIT

archs=(rm1 rm2)
archs=(rm1-2.x rm2-2.x)
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 <[email protected]>"
Expand All @@ -24,7 +24,7 @@ _old_backup_path="$_backup_path.old"
_patched_path="$_work_dir/xochitl.patched"

package() {
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1-2.x ]]; then
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/26171_rm1/patch_19.1.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/26275_rm1/patch_20.1.03
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/27051_rm1/patch_21.1.04
Expand All @@ -43,7 +43,7 @@ package() {
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/21431047_rm1/patch_37.1.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/21501067_rm1/patch_38.1.03
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/21511189_rm1/patch_39.1.01
elif [[ $arch = rm2 ]]; then
elif [[ $arch = rm2-2.x ]]; then
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/26171_rm2/patch_19.2.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/26275_rm2/patch_20.2.03
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/27051_rm2/patch_21.2.05
Expand Down Expand Up @@ -75,7 +75,7 @@ configure() {
local device
local original_hash
local xochitl_version
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1-2.x ]]; then
device="reMarkable 1"
case "$build_date" in
"20221026103859")
Expand Down Expand Up @@ -176,7 +176,7 @@ configure() {
exit 1
;;
esac
elif [[ $arch = rm2 ]]; then
elif [[ $arch = rm2-2.x ]]; then
device="reMarkable 2"
case "$build_date" in
"20221026104022")
Expand Down
4 changes: 2 additions & 2 deletions package/display/package
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sha256sums=(
)

build() {
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1 ]] || [[ $arch = rm1-2.x ]]; then
# Create an empty client library for rM1
pushd src/client
echo | "${CROSS_COMPILE}gcc" \
Expand All @@ -52,7 +52,7 @@ display() {
replaces=(rm2fb)

package() {
if [[ $arch = rm2 ]]; then
if [[ $arch = rm2 ]] || [[ $arch = rm2-2.x ]]; then
libname="librm2fb_server.so.$_libver"
install -D -m 644 -t "$pkgdir"/opt/lib "$srcdir"/src/server/"$libname"
ln -s "$libname" "$pkgdir"/opt/lib/"${libname%.*.*}"
Expand Down
10 changes: 5 additions & 5 deletions package/fuse/package
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2020 The Toltec Contributors
# SPDX-License-Identifier: MIT

archs=(rm1 rm2)
archs=(rm1-2.x rm2-2.x)
pkgnames=(fuse)
pkgdesc="FUSE (Filesystem in Userspace) Kernel Module"
url=https://github.com/libfuse/libfuse
Expand Down Expand Up @@ -51,14 +51,14 @@ build() {
}

package() {
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1-2.x ]]; then
mkdir -p "$pkgdir/lib/modules"
cp -r "$srcdir/pkg"/* "$pkgdir/lib/modules"
fi
}

configure() {
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1-2.x ]]; then
# Regenerate /lib/modules/[ver]/modules.devname to request the
# creation of /dev/fuse used for on-demand loading of fuse
depmod -a
Expand All @@ -72,7 +72,7 @@ configure() {
}

postremove() {
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1-2.x ]]; then
echo 'Fuse (Kernel Module) has been removed.'
echo 'The kernel module will remain loaded until you reboot, or you can attempt'
echo 'to manually remove it by running "modprobe -r fuse".'
Expand All @@ -81,7 +81,7 @@ postremove() {
}

postupgrade() {
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1-2.x ]]; then
echo 'Fuse (Kernel Module) has been upgraded.'
echo 'The old kernel module will remain loaded until you reboot, or you can'
echo 'attempt to manually remove it by running "modprobe -r fuse".'
Expand Down
16 changes: 15 additions & 1 deletion package/toltec-bootstrap/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(toltec-bootstrap)
pkgdesc="Manage your Toltec install"
url=https://toltec-dev.org/
pkgver=0.3.0-1
pkgver=0.4.0-1
timestamp=2023-11-27T00:34Z
section="utils"
maintainer="Eeems <[email protected]>"
Expand Down Expand Up @@ -64,3 +64,17 @@ configure() {
fi
fi
}

postupgrade() {
# shellcheck source=toltecctl
source /home/root/.local/bin/toltecctl
set-path
switch-branch "$(get-branch)"
echo "Your Opkg configuration has been upgraded"
if generate-opkg-conf; then
echo
echo "! The upgrade is not finished! Please run \`opkg update\`"
echo "! and \`opkg upgrade\` once more to complete it."
echo
fi
}
4 changes: 2 additions & 2 deletions package/wireguard/package
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
# Copyright (c) 2021 The Toltec Contributors
# SPDX-License-Identifier: MIT

archs=(rm1-2.x rm2-2.x)
pkgnames=(wireguard)
pkgdesc="Fast, modern, secure VPN tunnel"
url=https://www.wireguard.com
pkgver=1.0.20210219-3
pkgver=1.0.20210219-4
_wireguardtoolsver=1.0.20210223
timestamp=2021-02-19T14:08Z
section=kernel
Expand Down
11 changes: 1 addition & 10 deletions scripts/toltec/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,7 @@ def _build(self, recipe: Recipe, src_dir: str) -> None:
)
)

if recipe.arch in ("rm1", "rm2"):
pre_script.extend(
(
f'echo -n "arch {recipe.arch} 250',
f"src/gz toltec-{recipe.arch} file:///repo/{recipe.arch}",
f'" >> "{opkg_conf_path}"',
)
)

if recipe.arch in ("2.x", "3.x"):
if recipe.arch != "rmall":
pre_script.extend(
(
f'echo -n "arch {recipe.arch} 250',
Expand Down

0 comments on commit ea1b4dc

Please sign in to comment.