Skip to content

Commit

Permalink
Add support for limiting packages to OS versions (#759)
Browse files Browse the repository at this point in the history
- Port 3.11 and c-string fixes from toltecmk
- Add rmallos2, rmallos3, rm1os2, rm1os3, rm2os2, and rm2os3 archs for limiting packages to only supporting those versions
- Update documentation
- Update known issues packages to only be for 2.x
- Make toltec-base generate a package for each arch to make sure that the folders always get created
- Added experimental toltec branch for testing purposes. You need to add the experimental tag to a PR, and it will start applying changes to the experimental branch.
- Fix various issues with the install and reenable process
- Update toltecctl output to use the same logging as bootstrap

---------

Co-authored-by: Mattéo Delabre <1370040+matteodelabre@users.noreply.github.com>
Co-authored-by: Mattéo Delabre <git.matteo@delab.re>
  • Loading branch information
3 people authored May 8, 2024
1 parent 2cad2a2 commit d3df6cb
Show file tree
Hide file tree
Showing 26 changed files with 896 additions and 216 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ runs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Cache Python environment
uses: actions/cache@v3
id: cache-python
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/sync-repository/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
echo '${{ inputs.ssh-key }}' > private/id_rsa
echo '${{ inputs.ssh-known-hosts }}' > private/known_hosts
chmod 600 private/*
rsync --archive --verbose --compress --delete \
rsync --archive --verbose --compress --delete --hard-links \
-e "ssh -p ${{ inputs.ssh-port }} -i private/id_rsa -o UserKnownHostsFile=private/known_hosts" \
'${{ inputs.local-path }}' \
'${{ inputs.remote-path }}'
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ jobs:
with:
name: repo
path: build/repo
- name: Build packages for experimental
if: ${{ contains(github.event.pull_request.labels.*.name, 'experimental') }}
run: make repo FLAGS='--remote-repo https://toltec-dev.org/${{ github.base_ref }}'
- name: Sync packages with the remote repository
if: ${{ contains(github.event.pull_request.labels.*.name, 'experimental') }}
uses: ./.github/actions/sync-repository
with:
local-path: build/repo/
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
ssh-port: ${{ secrets.SSH_PORT }}
remote-path: ${{ secrets.REMOTE_SSH }}:/srv/toltec/experimental
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.
`rmallos2` | Packages which work on all reMarkable devices without modification, but only on the 2.x series of operating system.
`rm1os2` | Packages requiring reMarkable 1-specific resources or compilation flags, but only on the 2.x series of operating system.
`rm2os2` | Packages requiring reMarkable 2-specific resources or compilation flags, but only on the 2.x series of operating system.
`rmallos3` | Packages which work on all reMarkable devices without modification, but only on the 3.x series of operating system.
`rm1os3` | Packages requiring reMarkable 1-specific resources or compilation flags, but only on the 3.x series of operating system.
`rm2os3` | 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
70 changes: 70 additions & 0 deletions package/Compatibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
rm1=2.6.1.71
rm1=2.6.2.75
rm1=2.7.0.9
rm1=2.7.0.30
rm1=2.7.0.36
rm1=2.7.0.44
rm1=2.7.0.51
rm1=2.8.0.81
rm1=2.8.0.86
rm1=2.8.0.98
rm1=2.9.0.153
rm1=2.9.0.204
rm1=2.9.0.210
rm1=2.9.1.217
rm1=2.9.1.236
rm1=2.10.2.356
rm1=2.10.3.379
rm1=2.11.0.442
rm1=2.12.1.527
rm1=2.12.2.573
rm1=2.12.3.606
rm1=2.13.0.758
rm1=2.14.0.861
rm1=2.14.1.866
rm1=2.14.3.958
rm1=2.14.3.977
rm1=2.14.3.1005
rm1=2.14.3.1047
rm1=2.15.0.1067
rm1=2.15.1.1189
rm1=3.0.4.1305
rm1=3.2.2.1581
rm1=3.2.3.1595
rm1=3.3.2.1666

rm2=2.6.1.71
rm2=2.6.2.75
rm2=2.7.0.9
rm2=2.7.0.30
rm2=2.7.0.36
rm2=2.7.0.44
rm2=2.7.0.51
rm2=2.7.1.53
rm2=2.8.0.81
rm2=2.8.0.86
rm2=2.8.0.98
rm2=2.9.0.153
rm2=2.9.0.204
rm2=2.9.0.210
rm2=2.9.1.217
rm2=2.9.1.236
rm2=2.10.2.356
rm2=2.10.3.379
rm2=2.11.0.442
rm2=2.12.1.527
rm2=2.12.2.573
rm2=2.12.3.606
rm2=2.13.0.758
rm2=2.14.0.861
rm2=2.14.1.866
rm2=2.14.3.958
rm2=2.14.3.977
rm2=2.14.3.1005
rm2=2.14.3.1047
rm2=2.15.0.1067
rm2=2.15.1.1189
rm2=3.0.4.1305
rm2=3.2.2.1581
rm2=3.2.3.1595
rm2=3.3.2.1666
112 changes: 65 additions & 47 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=(rm1os2 rm2os2)
pkgnames=(ddvk-hacks)
pkgdesc="Enhance Xochitl with additional features"
url=https://github.com/ddvk/remarkable-hacks
pkgver=39.01-2
pkgver=39.01-4
timestamp=2022-11-09T18:31:51Z
section="readers"
maintainer="Mattéo Delabre <spam@delab.re>"
Expand All @@ -20,55 +20,58 @@ sha256sums=(d3b1413bb9219804581afab598e7f5308233e7467d64e8084e67aae7346beaba)
_patches_dir="/opt/share/ddvk-hacks"
_xochitl_path="/usr/bin/xochitl"
_work_dir="/home/root/.local/share/ddvk-hacks"
_info_path="$_work_dir/xochitl.info"
_backup_path="$_work_dir/xochitl.backup"
_old_backup_path="$_backup_path.old"
_patched_path="$_work_dir/xochitl.patched"

package() {
if [[ $arch = rm1 ]]; 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
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/28098_rm1/patch_23.1.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/291236_rm1/patch_24.1.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2100324_rm1/patch_25.1.03
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2102356_rm1/patch_27.1.03
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2103379_rm1/patch_28.1.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2110442_rm1/patch_29.1.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2121527_rm1/patch_30.1.08
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2122573_rm1/patch_31.1.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2123606_rm1/patch_32.1.03
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2140861_rm1/patch_34.1.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2141866_rm1/patch_35.1.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2143977_rm1/patch_36.1.01
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
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
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/27153_rm2/patch_22.2.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/28098_rm2/patch_23.2.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/291217_rm2/patch_24.2.04
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2100324_rm2/patch_25.2.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2101332_rm2/patch_26.2.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2102356_rm2/patch_27.2.05
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2103379_rm2/patch_28.2.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2110442_rm2/patch_29.2.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2121527_rm2/patch_30.2.07
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2122573_rm2/patch_31.2.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2123606_rm2/patch_32.2.02
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2130758_rm2/patch_33.2.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2140861_rm2/patch_34.2.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2141866_rm2/patch_35.2.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/2143977_rm2/patch_36.2.01
install -D -m 644 -t "$pkgdir$_patches_dir" "$srcdir"/patches/21431047_rm2/patch_37.2.01
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
mkdir -p "$pkgdir"/opt/share/toltec/reenable.d
touch "$pkgdir"/opt/share/toltec/reenable.d/"$pkgname"
if [[ $arch = rm1os2 ]]; then
patches_dir="${pkgdir}${_patches_dir}"
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/26171_rm1/patch_19.1.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/26275_rm1/patch_20.1.03
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/27051_rm1/patch_21.1.04
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/28098_rm1/patch_23.1.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/291236_rm1/patch_24.1.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2100324_rm1/patch_25.1.03
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2102356_rm1/patch_27.1.03
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2103379_rm1/patch_28.1.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2110442_rm1/patch_29.1.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2121527_rm1/patch_30.1.08
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2122573_rm1/patch_31.1.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2123606_rm1/patch_32.1.03
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2140861_rm1/patch_34.1.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2141866_rm1/patch_35.1.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2143977_rm1/patch_36.1.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/21431047_rm1/patch_37.1.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/21501067_rm1/patch_38.1.03
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/21511189_rm1/patch_39.1.01
elif [[ $arch = rm2os2 ]]; then
patches_dir="${pkgdir}${_patches_dir}"
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/26171_rm2/patch_19.2.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/26275_rm2/patch_20.2.03
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/27051_rm2/patch_21.2.05
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/27153_rm2/patch_22.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/28098_rm2/patch_23.2.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/291217_rm2/patch_24.2.04
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2100324_rm2/patch_25.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2101332_rm2/patch_26.2.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2102356_rm2/patch_27.2.05
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2103379_rm2/patch_28.2.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2110442_rm2/patch_29.2.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2121527_rm2/patch_30.2.07
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2122573_rm2/patch_31.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2123606_rm2/patch_32.2.02
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2130758_rm2/patch_33.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2140861_rm2/patch_34.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2141866_rm2/patch_35.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/2143977_rm2/patch_36.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/21431047_rm2/patch_37.2.01
install -D -m 644 -t "$patches_dir" "$srcdir"/patches/21501067_rm2/patch_38.2.03
install -D -m 644 -t "$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() {
Expand All @@ -78,7 +81,7 @@ configure() {
local device
local original_hash
local xochitl_version
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1os2 ]]; then
device="reMarkable 1"
case "$build_date" in
"20221026103859")
Expand Down Expand Up @@ -179,7 +182,7 @@ configure() {
exit 1
;;
esac
elif [[ $arch = rm2 ]]; then
elif [[ $arch = rm2os2 ]]; then
device="reMarkable 2"
case "$build_date" in
"20221026104022")
Expand Down Expand Up @@ -328,11 +331,25 @@ configure() {
cp "$_patched_path" "$_xochitl_path"
rm -rf /home/root/.cache/remarkable/xochitl/qmlcache/*

# shellcheck source=../toltec-bootstrap/toltecctl
source /home/root/.local/bin/toltecctl
get-release-version > "$_info_path"

echo "Please restart Xochitl to use the patches"
echo
}

_restore() {
# shellcheck source=../toltec-bootstrap/toltecctl
source /home/root/.local/bin/toltecctl

if ! [ -f "$_info_path" ] \
|| [[ "$(get-release-version)" != "$(cat "$_info_path")" ]] \
|| compare-versions "$(get-release-version)" "3.0"; then
echo "Skipping restore, as you are on a newer OS version"
return
fi

echo
echo "Restoring the original Xochitl binary"

Expand All @@ -342,6 +359,7 @@ _restore() {
else
cp "$_backup_path" "$_xochitl_path"
rm -rf /home/root/.cache/remarkable/xochitl/qmlcache/*
rm "$_info_path"
fi

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

archs=(rm1 rm2)
archs=(rm1os2 rm2os2)
pkgnames=(fuse)
pkgdesc="FUSE (Filesystem in Userspace) Kernel Module"
url=https://github.com/libfuse/libfuse
pkgver=1.0.0-4
pkgver=1.0.0-5
timestamp=2021-04-06T22:16Z
section=kernel
maintainer="plan5 <30434574+plan5@users.noreply.github.com>"
Expand Down Expand Up @@ -51,14 +51,14 @@ build() {
}

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

configure() {
if [[ $arch = rm1 ]]; then
if [[ $arch = rm1os2 ]]; 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 = rm1os2 ]]; 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 = rm1os2 ]]; 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
6 changes: 3 additions & 3 deletions package/kernelctl/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(kernelctl)
pkgdesc="Manage aftermarket kernels"
url=https://toltec-dev.org/
pkgver=0.1-6
pkgver=0.1-7
timestamp=2022-11-12T00:00Z
section="utils"
maintainer="Salvatore Stella <etn45p4m@gmail.com>"
Expand All @@ -19,10 +19,10 @@ sha256sums=(
)

package() {
touch "$srcdir"/emptyfile
install -D -m 744 -t "$pkgdir"/opt/bin "$srcdir"/kernelctl
install -d "$pkgdir"/opt/usr/share/kernelctl
install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/kernelctl "$srcdir"/emptyfile
mkdir -p "$pkgdir"/opt/share/toltec/reenable.d
touch "$pkgdir"/opt/share/toltec/reenable.d/"$pkgname"
}

configure() {
Expand Down
Loading

0 comments on commit d3df6cb

Please sign in to comment.