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

feature: prevent installation of rM2 incompatible apps on rM2 #129

Closed
raisjn opened this issue Oct 18, 2020 · 12 comments · Fixed by #310
Closed

feature: prevent installation of rM2 incompatible apps on rM2 #129

raisjn opened this issue Oct 18, 2020 · 12 comments · Fixed by #310
Assignees

Comments

@raisjn
Copy link
Contributor

raisjn commented Oct 18, 2020

remux package should not recommend people disable xochitl, this caused someone on discord to break their rM2

it should be possible to prevent packages from being installed on rM2 if they are incompatible

@matteodelabre

This comment has been minimized.

@raisjn

This comment has been minimized.

@raisjn raisjn changed the title bug: how-to-enable should not recommend disabling xochitl for remux feature: prevent installation of rM2 incompatible apps on rM2 Oct 18, 2020
@Eeems
Copy link
Member

Eeems commented Oct 18, 2020

So, how do we want to handle this? Separate repository for rm2?

@LinusCDE
Copy link
Member

LinusCDE commented Nov 5, 2020

I propose having two kinda meta packages called rm1-only and rm2-only that have no files but a preinst check that fails when the model is wrong. The packages can also be made to conflict with each other.

Any package that does not support both devices can then just depend on those. In a case of wrong installation, the dependency would either fail in the preinst script (which should also be a fairly descriptive error to the user) or just conflict with the existing other rmx-only package.

To check the model, we could use either

  • /home/root/.config/remarkable/xochitl.confs deviceid= (which is the serial number that includes the model)
  • /sys/devices/soc0/machine

to check the device is the correct one.

@Eeems
Copy link
Member

Eeems commented Nov 5, 2020

I like that solution.

@LinusCDE
Copy link
Member

LinusCDE commented Nov 6, 2020

I created a branch/pr to work on that solution: #136

@matteodelabre
Copy link
Member

matteodelabre commented Nov 7, 2020

Thanks for your suggestion @LinusCDE! I see two drawbacks with your proposed approach:

  1. If a package X needs to be compiled differently for RM1 and RM2 (e.g. it has a compile-time flag to flip to enable support for one or the other framebuffer), then if I understand correctly we’ll need to create two packages X-rm1 and X-rm2 that depend respectively on the rm1-only and rm2-only metapackages.
  2. End users will see incompatible packages as installable in the Opkg package list and will not know that they are not compatible until they try to install them.

IMO, those limitations would be solved with a separate-repositories approach.

@LinusCDE
Copy link
Member

LinusCDE commented Nov 7, 2020

@matteodelabre , those are some good ideas.

1. If a package `X` needs to be compiled differently for RM1 and RM2 (e.g. it has a compile-time flag to flip to enable support for one or the other framebuffer), then if I understand correctly we’ll need to create two packages `X-rm1` and `X-rm2` that depend respectively on the `rm1-only` and `rm2-only` metapackages.

That is certainly a drawback. But as it seems now, we are trying to try to make the new libs support both devices anyway.

I think that binaries that won't work without recompilation will be rare enough that they can solve that on their own to e.g. have a shell-script as binary that runs the correct binary or similar.

@Eeems how would this be done on QT? Can one easily swap the QT plugin for the rM1 to a potential one for the rM2? Even if this weren't possible, I'm sure others will peruse an approach them to have a single plugin work on both devices.

2. End users will see incompatible packages as installable in the Opkg package list and will not know that they are not compatible until they try to install them.

Most users will probably use either https://toltec-dev.org/stable/ or nao to look up packages. The website already having some pretty nice sorting and categorizing going on, we could surely add some badges to signify incompatibilities or just let users filter out incompatible ones. Something similar could be done for nao.

All in all, I think having multiple repositories is not worth the maintenance hassle for supporting the recompile approach of maybe one in 20 packages. Most will either use a library. For the 1/20 package I already proposed a solution above.

@matteodelabre
Copy link
Member

I see your point. I propose we wait on this until we have at least a few apps supporting both devices, so that we can make an informed choice about the best suited strategy.

@LinusCDE
Copy link
Member

LinusCDE commented Nov 7, 2020

Agreed, @matteodelabre 👍

@raisjn
Copy link
Contributor Author

raisjn commented Nov 7, 2020

@Eeems how would this be done on QT? Can one easily swap the QT plugin for the rM1 to a potential one for the rM2? Even if this weren't possible, I'm sure others will peruse an approach them to have a single plugin work on both devices.

the rm2fb shim works with qt apps: oxide, calculator, draft have been tested.

i would like some ideas and help for how to package / move forward with this shim so everyone can use it easily. I can make an issue with open questions to discuss

@Eeems Eeems linked a pull request Jan 10, 2021 that will close this issue
@matteodelabre matteodelabre added this to the Community Rollout milestone Mar 8, 2021
matteodelabre added a commit 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 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 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 matteodelabre self-assigned this Mar 11, 2021
matteodelabre added a commit 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 matteodelabre linked a pull request Mar 11, 2021 that will close this issue
matteodelabre added a commit 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>
@matteodelabre
Copy link
Member

Users who try to install a rM2-only app on rM1 or vice versa will now see an error message (see #310).

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 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants