Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for reMarkable2? #12

Closed
briankaemingk opened this issue Feb 1, 2021 · 2 comments
Closed

Support for reMarkable2? #12

briankaemingk opened this issue Feb 1, 2021 · 2 comments

Comments

@briankaemingk
Copy link

Hi! This works great on reMarkable 1. I'm trying to test it with reMarkable2 paired with a reMarkable 1. It appears to receive information, but I am not able to draw anything. Has anyone else tried?

matteodelabre added a commit to toltec-dev/toltec that referenced this issue Mar 10, 2021
Changed rm2fb
Made rm2-suspend-fix rm2-only

Apps that do not support reMarkable 2:

- appmarkable (LinusCDE/appmarkable#2)
- rmservewacominput (because it depends on appmarkable)
- vnsee (matteodelabre/vnsee#15)
- whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps updated to include the rM2 shim:

- calculator
- chessmarkable
- draft
- fingerterm
- keywriter
- koreader (through setting LD_PRELOAD in the existing wrapper script)
- oxide (also changed the package to build from source)
- plato
- recrossable
- remarkable-splash
- retris
- rmkit
- xochitl (created a wrapper script at /opt/bin/xochitl)
- zshelf
matteodelabre added a commit to toltec-dev/toltec that referenced this issue Mar 11, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be
  incompatible with their device (fixes #129).
* Automatically installs and sets up the rm2fb server when an app that
  uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need
  it. Instead, change their dynamic dependencies to include the shim
  directly. Thanks to this change, we no longer need to set LD_PRELOAD
  globally (fixes #248) and users can launch apps that need the shim
  without prefixing them with `rm2fb-client`.

Tooling changes (more details in the updated docs/package.md):

* Added the `archs` field for declaring which device(s) a recipe is
  compatible with. Supported values are `rmall` (for device-independent
  packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2).
  When multiple arch values are set for a recipe, the recipe is
  generated once per entry, which allows specializing builds for
  specific devices.
* Replaced the `depends` field with an `installdepends` field used for
  declaring install-time dependencies. Previously, dependencies declared
  in the `depends` field were fulfilled both at build time and at
  install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the
  generated package. Used for migrating users from the `rm2fb` package
  to the `display` and `rm2fb-shim` packages (see below).
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures)
  to include download links for each available architecture of each
  package.
* Packages are now stored in subdirectories named after their
  architecture. This is because opkg does not like seeing packages for
  architectures other than the ones it is configured to accept in
  opkg.conf. With this layout change, we can make opkg happy by
  only adding subdirectories for enabled architectures.

Install changes:

* The bootstrap script now adds the `rmall` architecture (and folder) on
  all installs, and the `rm1` or `rm2` architecture (and folder)
  depending on the type of the device it’s executed on. It will fail if
  the device is not of a recognized type (based on the value of
  `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade
  the configuration to use the new architecture subdirectories layout.

rm2fb changes:

* The package is split into two packages, `display` (which provides the
  rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-shim`
  (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being
  that the display server is started from the systemd unit).
* The `rm2fb-client` command is renamed to `rm2fb-shim`, with the
  expectation that users will not need it anymore, unless for
  development purposes.

Apps marked as reMarkable-1-only:

* appmarkable (LinusCDE/appmarkable#2)
* rmservewacominput (because it depends on appmarkable)
* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

Test plan (on rM1 and rM2):

* Starting from a clean stable or testing install of Toltec, download
  the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to
  enable the `rmall` architecture and, depending on the device you’re
  running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines,
  `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`,
  pointing to subfolders of
  `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and
  if you had installed any packages that use the screen, the `display`
  and `rm2fb-shim` packages should get installed. If you previously
  installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a
  reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the
  screen (both on rM1 and rM2) and that you can interact with them
  through the touchscreen and the pen, when applicable.
* In particular, make sure that apps work properly when launched from
  draft, oxide or remux.
matteodelabre added a commit to toltec-dev/toltec that referenced this issue Mar 11, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be
  incompatible with their device (fixes #129).
* Automatically installs and sets up the rm2fb server when an app that
  uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need
  it. Instead, change their dynamic dependencies to include the shim
  directly. Thanks to this change, we no longer need to set LD_PRELOAD
  globally (fixes #248) and users can launch apps that need the shim
  without prefixing them with `rm2fb-client`.

Tooling changes (more details in the updated docs/package.md):

* Added the `archs` field for declaring which device(s) a recipe is
  compatible with. Supported values are `rmall` (for device-independent
  packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2).
  When multiple arch values are set for a recipe, the recipe is
  generated once per entry, which allows specializing builds for
  specific devices.
* Replaced the `depends` field with an `installdepends` field used for
  declaring install-time dependencies. Previously, dependencies declared
  in the `depends` field were fulfilled both at build time and at
  install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the
  generated package. Used for migrating users from the `rm2fb` package
  to the `display` and `rm2fb-shim` packages (see below).
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures)
  to include download links for each available architecture of each
  package.
* Packages are now stored in subdirectories named after their
  architecture. This is because opkg does not like seeing packages for
  architectures other than the ones it is configured to accept in
  opkg.conf. With this layout change, we can make opkg happy by
  only adding subdirectories for enabled architectures.

Install changes:

* The bootstrap script now adds the `rmall` architecture (and folder) on
  all installs, and the `rm1` or `rm2` architecture (and folder)
  depending on the type of the device it’s executed on. It will fail if
  the device is not of a recognized type (based on the value of
  `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade
  the configuration to use the new architecture subdirectories layout.

rm2fb changes:

* The package is split into two packages, `display` (which provides the
  rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-shim`
  (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being
  that the display server is started from the systemd unit).
* The `rm2fb-client` command is renamed to `rm2fb-shim`, with the
  expectation that users will not need it anymore, unless for
  development purposes.

Apps marked as reMarkable-1-only:

* appmarkable (LinusCDE/appmarkable#2)
* rmservewacominput (because it depends on appmarkable)
* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

Test plan (on rM1 and rM2):

* Starting from a clean stable or testing install of Toltec, download
  the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to
  enable the `rmall` architecture and, depending on the device you’re
  running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines,
  `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`,
  pointing to subfolders of
  `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and
  if you had installed any packages that use the screen, the `display`
  and `rm2fb-shim` packages should get installed. If you previously
  installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a
  reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the
  screen (both on rM1 and rM2) and that you can interact with them
  through the touchscreen and the pen, when applicable.
* In particular, make sure that apps work properly when launched from
  draft, oxide or remux.
matteodelabre added a commit to toltec-dev/toltec that referenced this issue Mar 11, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be
  incompatible with their device (fixes #129).
* Automatically installs and sets up the rm2fb server when an app that
  uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need
  it. Instead, change their dynamic dependencies to include the shim
  directly. Thanks to this change, we no longer need to set LD_PRELOAD
  globally (fixes #248) and users can launch apps that need the shim
  without prefixing them with `rm2fb-client`.

Tooling changes (more details in the updated docs/package.md):

* Added the `archs` field for declaring which device(s) a recipe is
  compatible with. Supported values are `rmall` (for device-independent
  packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2).
  When multiple arch values are set for a recipe, the recipe is
  generated once per entry, which allows specializing builds for
  specific devices.
* Replaced the `depends` field with an `installdepends` field used for
  declaring install-time dependencies. Previously, dependencies declared
  in the `depends` field were fulfilled both at build time and at
  install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the
  generated package. Used for migrating users from the `rm2fb` package
  to the `display` and `rm2fb-shim` packages (see below).
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures)
  to include download links for each available architecture of each
  package.
* Packages are now stored in subdirectories named after their
  architecture. This is because opkg does not like seeing packages for
  architectures other than the ones it is configured to accept in
  opkg.conf. With this layout change, we can make opkg happy by
  only adding subdirectories for enabled architectures.

Install changes:

* The bootstrap script now adds the `rmall` architecture (and folder) on
  all installs, and the `rm1` or `rm2` architecture (and folder)
  depending on the type of the device it’s executed on. It will fail if
  the device is not of a recognized type (based on the value of
  `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade
  the configuration to use the new architecture subdirectories layout.

rm2fb changes:

* The package is split into two packages, `display` (which provides the
  rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-shim`
  (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being
  that the display server is started from the systemd unit).
* The `rm2fb-client` command is renamed to `rm2fb-shim`, with the
  expectation that users will not need it anymore, unless for
  development purposes.

Apps marked as reMarkable-1-only:

* appmarkable (LinusCDE/appmarkable#2)
* rmservewacominput (because it depends on appmarkable)
* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

Test plan (on rM1 and rM2):

* Starting from a clean stable or testing install of Toltec, download
  the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to
  enable the `rmall` architecture and, depending on the device you’re
  running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines,
  `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`,
  pointing to subfolders of
  `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and
  if you had installed any packages that use the screen, the `display`
  and `rm2fb-shim` packages should get installed. If you previously
  installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a
  reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the
  screen (both on rM1 and rM2) and that you can interact with them
  through the touchscreen and the pen, when applicable.
* In particular, make sure that apps work properly when launched from
  draft, oxide or remux.
matteodelabre added a commit to toltec-dev/toltec that referenced this issue Mar 11, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be
  incompatible with their device (fixes #129).
* Automatically installs and sets up the rm2fb server when an app that
  uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need
  it. Instead, change their dynamic dependencies to include the shim
  directly. Thanks to this change, we no longer need to set LD_PRELOAD
  globally (fixes #248) and users can launch apps that need the shim
  without prefixing them with `rm2fb-client`.

Tooling changes (more details in the updated docs/package.md):

* Added the `archs` field for declaring which device(s) a recipe is
  compatible with. Supported values are `rmall` (for device-independent
  packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2).
  When multiple arch values are set for a recipe, the recipe is
  generated once per entry, which allows specializing builds for
  specific devices.
* Replaced the `depends` field with an `installdepends` field used for
  declaring install-time dependencies. Previously, dependencies declared
  in the `depends` field were fulfilled both at build time and at
  install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the
  generated package. Used for migrating users from the `rm2fb` package
  to the `display` and `rm2fb-shim` packages (see below).
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures)
  to include download links for each available architecture of each
  package.
* Packages are now stored in subdirectories named after their
  architecture. This is because opkg does not like seeing packages for
  architectures other than the ones it is configured to accept in
  opkg.conf. With this layout change, we can make opkg happy by
  only adding subdirectories for enabled architectures.

Install changes:

* The bootstrap script now adds the `rmall` architecture (and folder) on
  all installs, and the `rm1` or `rm2` architecture (and folder)
  depending on the type of the device it’s executed on. It will fail if
  the device is not of a recognized type (based on the value of
  `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade
  the configuration to use the new architecture subdirectories layout.

rm2fb changes:

* The package is split into two packages, `display` (which provides the
  rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-shim`
  (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being
  that the display server is started from the systemd unit).
* The `rm2fb-client` command is renamed to `rm2fb-shim`, with the
  expectation that users will not need it anymore, unless for
  development purposes.

Apps marked as reMarkable-1-only:

* appmarkable (LinusCDE/appmarkable#2)
* rmservewacominput (because it depends on appmarkable)
* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

Test plan (on rM1 and rM2):

* Starting from a clean stable or testing install of Toltec, download
  the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to
  enable the `rmall` architecture and, depending on the device you’re
  running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines,
  `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`,
  pointing to subfolders of
  `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and
  if you had installed any packages that use the screen, the `display`
  and `rm2fb-shim` packages should get installed. If you previously
  installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a
  reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the
  screen (both on rM1 and rM2) and that you can interact with them
  through the touchscreen and the pen, when applicable.
* In particular, make sure that apps work properly when launched from
  draft, oxide or remux (some issues remain with oxide and remux).
matteodelabre added a commit to toltec-dev/toltec that referenced this issue Apr 3, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be incompatible with their device (fixes #129).
* Automatically installs and sets up the rm2fb server when an app that uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need it. Instead, change their dynamic dependencies to include the shim directly. Thanks to this change, we no longer need to set LD_PRELOAD globally (fixes #248) and users can launch apps that need the shim without prefixing them with `rm2fb-client`.

It replaces the previous PR #136.

#### Tooling changes

More details in the updated [docs/package.md](https://github.com/toltec-dev/toltec/blob/tooling/split-architectures/docs/package.md).

* Added the `archs` field for declaring which device(s) a recipe is compatible with. Supported values are `rmall` (for device-independent packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2). When multiple arch values are set for a recipe, the recipe is generated once per entry, which allows specializing builds for specific devices.
* Replaced the `depends` field with an `installdepends` field used for declaring install-time dependencies. Previously, dependencies declared in the `depends` field were fulfilled both at build time and at install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the generated package. Used for migrating users from the `rm2fb` package to the `display` and `rm2fb-client` packages (see below).
* Added a `patch_rm2fb` flag for recipes to instruct the build system to patch all the generated binaries that use the rM1 framebuffer with the rm2fb client shim.
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures) to include download links for each available architecture of each package.
* Packages are now stored in subdirectories named after their architecture. This is because opkg does not like seeing packages for architectures other than the ones it is configured to accept in opkg.conf. With this layout change, we can make opkg happy by only adding subdirectories for enabled architectures.

#### Install changes

* The bootstrap script now adds the `rmall` architecture (and folder) on all installs, and the `rm1` or `rm2` architecture (and folder) depending on the type of the device it’s executed on. It will fail if the device is not of a recognized type (based on the value of `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade the configuration to use the new architecture subdirectories layout.

#### rm2fb changes

* The package is split into two packages, `display` (which provides the rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-client` (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being that the display server is started from the systemd unit).

#### Apps changes

Apps marked as reMarkable-1-only:

* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* appmarkable
* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* wikipedia
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

#### Test plan

On rM1 and rM2 (system version: 2.5).

* Starting from a clean install of Toltec stable or testing, download the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to enable the `rmall` architecture and, depending on the device you’re running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines, `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`, pointing to subfolders of `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and if you had installed any packages that use the screen, the `display` and `rm2fb-client` packages should get installed. If you previously installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the screen (both on rM1 and rM2) and that you can interact with them through the touchscreen and the pen, when applicable. It is no longer needed to prefix each app invocation with `rm2fb-client` on the command line on reMarkable 2.
* In particular, make sure that apps work properly when launched from draft, oxide or remux (things to check: launching, pausing, killing apps, switching back and forth from xochitl).

#### Rollout plan

When this PR hits testing and stable, existing users will no longer receive updates until they run the new bootstrap script on their existing installs. They will also probably see an error when they do `opkg update`. Figuring out how to automatic transition users is left to a future PR.

Co-authored-by: okay <okay@arkose>
danshick pushed a commit to danshick/toltec that referenced this issue May 5, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be incompatible with their device (fixes toltec-dev#129).
* Automatically installs and sets up the rm2fb server when an app that uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need it. Instead, change their dynamic dependencies to include the shim directly. Thanks to this change, we no longer need to set LD_PRELOAD globally (fixes toltec-dev#248) and users can launch apps that need the shim without prefixing them with `rm2fb-client`.

It replaces the previous PR toltec-dev#136.

#### Tooling changes

More details in the updated [docs/package.md](https://github.com/toltec-dev/toltec/blob/tooling/split-architectures/docs/package.md).

* Added the `archs` field for declaring which device(s) a recipe is compatible with. Supported values are `rmall` (for device-independent packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2). When multiple arch values are set for a recipe, the recipe is generated once per entry, which allows specializing builds for specific devices.
* Replaced the `depends` field with an `installdepends` field used for declaring install-time dependencies. Previously, dependencies declared in the `depends` field were fulfilled both at build time and at install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the generated package. Used for migrating users from the `rm2fb` package to the `display` and `rm2fb-client` packages (see below).
* Added a `patch_rm2fb` flag for recipes to instruct the build system to patch all the generated binaries that use the rM1 framebuffer with the rm2fb client shim.
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures) to include download links for each available architecture of each package.
* Packages are now stored in subdirectories named after their architecture. This is because opkg does not like seeing packages for architectures other than the ones it is configured to accept in opkg.conf. With this layout change, we can make opkg happy by only adding subdirectories for enabled architectures.

#### Install changes

* The bootstrap script now adds the `rmall` architecture (and folder) on all installs, and the `rm1` or `rm2` architecture (and folder) depending on the type of the device it’s executed on. It will fail if the device is not of a recognized type (based on the value of `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade the configuration to use the new architecture subdirectories layout.

#### rm2fb changes

* The package is split into two packages, `display` (which provides the rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-client` (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being that the display server is started from the systemd unit).

#### Apps changes

Apps marked as reMarkable-1-only:

* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* appmarkable
* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* wikipedia
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

#### Test plan

On rM1 and rM2 (system version: 2.5).

* Starting from a clean install of Toltec stable or testing, download the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to enable the `rmall` architecture and, depending on the device you’re running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines, `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`, pointing to subfolders of `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and if you had installed any packages that use the screen, the `display` and `rm2fb-client` packages should get installed. If you previously installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the screen (both on rM1 and rM2) and that you can interact with them through the touchscreen and the pen, when applicable. It is no longer needed to prefix each app invocation with `rm2fb-client` on the command line on reMarkable 2.
* In particular, make sure that apps work properly when launched from draft, oxide or remux (things to check: launching, pausing, killing apps, switching back and forth from xochitl).

#### Rollout plan

When this PR hits testing and stable, existing users will no longer receive updates until they run the new bootstrap script on their existing installs. They will also probably see an error when they do `opkg update`. Figuring out how to automatic transition users is left to a future PR.

Co-authored-by: okay <okay@arkose>
LinusCDE pushed a commit to toltec-dev/toltec that referenced this issue Jun 3, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be incompatible with their device (fixes #129).
* Automatically installs and sets up the rm2fb server when an app that uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need it. Instead, change their dynamic dependencies to include the shim directly. Thanks to this change, we no longer need to set LD_PRELOAD globally (fixes #248) and users can launch apps that need the shim without prefixing them with `rm2fb-client`.

It replaces the previous PR #136.

#### Tooling changes

More details in the updated [docs/package.md](https://github.com/toltec-dev/toltec/blob/tooling/split-architectures/docs/package.md).

* Added the `archs` field for declaring which device(s) a recipe is compatible with. Supported values are `rmall` (for device-independent packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2). When multiple arch values are set for a recipe, the recipe is generated once per entry, which allows specializing builds for specific devices.
* Replaced the `depends` field with an `installdepends` field used for declaring install-time dependencies. Previously, dependencies declared in the `depends` field were fulfilled both at build time and at install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the generated package. Used for migrating users from the `rm2fb` package to the `display` and `rm2fb-client` packages (see below).
* Added a `patch_rm2fb` flag for recipes to instruct the build system to patch all the generated binaries that use the rM1 framebuffer with the rm2fb client shim.
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures) to include download links for each available architecture of each package.
* Packages are now stored in subdirectories named after their architecture. This is because opkg does not like seeing packages for architectures other than the ones it is configured to accept in opkg.conf. With this layout change, we can make opkg happy by only adding subdirectories for enabled architectures.

#### Install changes

* The bootstrap script now adds the `rmall` architecture (and folder) on all installs, and the `rm1` or `rm2` architecture (and folder) depending on the type of the device it’s executed on. It will fail if the device is not of a recognized type (based on the value of `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade the configuration to use the new architecture subdirectories layout.

#### rm2fb changes

* The package is split into two packages, `display` (which provides the rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-client` (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being that the display server is started from the systemd unit).

#### Apps changes

Apps marked as reMarkable-1-only:

* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* appmarkable
* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* wikipedia
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

#### Test plan

On rM1 and rM2 (system version: 2.5).

* Starting from a clean install of Toltec stable or testing, download the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to enable the `rmall` architecture and, depending on the device you’re running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines, `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`, pointing to subfolders of `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and if you had installed any packages that use the screen, the `display` and `rm2fb-client` packages should get installed. If you previously installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the screen (both on rM1 and rM2) and that you can interact with them through the touchscreen and the pen, when applicable. It is no longer needed to prefix each app invocation with `rm2fb-client` on the command line on reMarkable 2.
* In particular, make sure that apps work properly when launched from draft, oxide or remux (things to check: launching, pausing, killing apps, switching back and forth from xochitl).

#### Rollout plan

When this PR hits testing and stable, existing users will no longer receive updates until they run the new bootstrap script on their existing installs. They will also probably see an error when they do `opkg update`. Figuring out how to automatic transition users is left to a future PR.

Co-authored-by: okay <okay@arkose>
matteodelabre added a commit to toltec-dev/build that referenced this issue Jul 31, 2021
This PR improves Toltec’s support for reMarkable 2 in a few ways:

* Prevents users from installing packages that are known to be incompatible with their device (fixes #129).
* Automatically installs and sets up the rm2fb server when an app that uses the framebuffer is installed.
* Stops relying on LD_PRELOAD to load the rm2fb shim into apps that need it. Instead, change their dynamic dependencies to include the shim directly. Thanks to this change, we no longer need to set LD_PRELOAD globally (fixes #248) and users can launch apps that need the shim without prefixing them with `rm2fb-client`.

It replaces the previous PR #136.

#### Tooling changes

More details in the updated [docs/package.md](https://github.com/toltec-dev/toltec/blob/tooling/split-architectures/docs/package.md).

* Added the `archs` field for declaring which device(s) a recipe is compatible with. Supported values are `rmall` (for device-independent packages), `rm1` (for reMarkable 1) and `rm2` (for reMarkable 2). When multiple arch values are set for a recipe, the recipe is generated once per entry, which allows specializing builds for specific devices.
* Replaced the `depends` field with an `installdepends` field used for declaring install-time dependencies. Previously, dependencies declared in the `depends` field were fulfilled both at build time and at install time, with no way of declaring install-time-only dependencies.
* Added a `replaces` field that sets the `Replaces` value in the generated package. Used for migrating users from the `rm2fb` package to the `display` and `rm2fb-client` packages (see below).
* Added a `patch_rm2fb` flag for recipes to instruct the build system to patch all the generated binaries that use the rM1 framebuffer with the rm2fb client shim.
* Changed [the web package listing](https://toltec-dev.org/dev/split-architectures) to include download links for each available architecture of each package.
* Packages are now stored in subdirectories named after their architecture. This is because opkg does not like seeing packages for architectures other than the ones it is configured to accept in opkg.conf. With this layout change, we can make opkg happy by only adding subdirectories for enabled architectures.

#### Install changes

* The bootstrap script now adds the `rmall` architecture (and folder) on all installs, and the `rm1` or `rm2` architecture (and folder) depending on the type of the device it’s executed on. It will fail if the device is not of a recognized type (based on the value of `/sys/devices/soc0/machine`).
* Running the new bootstrap script on an existing install will upgrade the configuration to use the new architecture subdirectories layout.

#### rm2fb changes

* The package is split into two packages, `display` (which provides the rm2fb server on rM2 and is an empty package on rM1) and `rm2fb-client` (which provides the client shim on rM2 and a mock shim on rM1).
* The `rm2fb-server` command is removed (the most common use-case being that the display server is started from the systemd unit).

#### Apps changes

Apps marked as reMarkable-1-only:

* vnsee (matteodelabre/vnsee#15)
* whiteboard-hypercard (fenollp/reMarkable-tools#12)

Apps marked as reMarkable-2-only:

* rm2-suspend-fix

Apps updated to include the rM2 shim:

* appmarkable
* calculator
* chessmarkable
* draft
* fingerterm
* keywriter
* koreader (through setting LD_PRELOAD in the existing wrapper script)
* oxide
* plato
* recrossable
* remarkable-splash
* retris
* rmkit
* wikipedia
* xochitl (through a new wrapper script at /opt/bin/xochitl)
* zshelf

#### Test plan

On rM1 and rM2 (system version: 2.5).

* Starting from a clean install of Toltec stable or testing, download the updated bootstrap script and run:

```console
$ toltec_branch=dev/split-architectures bash bootstrap
```

* This should update the `/opt/etc/opkg.conf` configuration file to enable the `rmall` architecture and, depending on the device you’re running this on, the `rm1` or the `rm2` architecture.
* It should also replace the `src/gz toltec` line with two source lines, `src/gz toltec-rmall` and `src/gz toltec-rm1` or `src/gz toltec-rm2`, pointing to subfolders of `https://toltec-dev.org/dev/split-architectures`.
* Run `opkg upgrade`. Most installed packages should get upgraded, and if you had installed any packages that use the screen, the `display` and `rm2fb-client` packages should get installed. If you previously installed the `rm2fb` package, it should get removed automatically.
* Try installing `rm2-suspend-fix` on a reMarkable 1, or `vnsee` on a reMarkable 2: both operations should fail.
* Test all updated packages to make sure they can properly draw to the screen (both on rM1 and rM2) and that you can interact with them through the touchscreen and the pen, when applicable. It is no longer needed to prefix each app invocation with `rm2fb-client` on the command line on reMarkable 2.
* In particular, make sure that apps work properly when launched from draft, oxide or remux (things to check: launching, pausing, killing apps, switching back and forth from xochitl).

#### Rollout plan

When this PR hits testing and stable, existing users will no longer receive updates until they run the new bootstrap script on their existing installs. They will also probably see an error when they do `opkg update`. Figuring out how to automatic transition users is left to a future PR.

Co-authored-by: okay <okay@arkose>
@fenollp
Copy link
Owner

fenollp commented Oct 22, 2021

Should depend on canselcik/libremarkable#65

@fenollp
Copy link
Owner

fenollp commented Oct 25, 2021

Actually fixed in #19

@fenollp fenollp closed this as completed Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants