ddvk / remarkable2-framebuffer

remarkable2 framebuffer reversing
MIT License
279 stars 22 forks source link

test rm2fb toltec package #35

Closed raisjn closed 3 years ago

raisjn commented 3 years ago

https://github.com/toltec-dev/toltec/pull/143 is the PR for the rm2fb package

the rm2fb package can be found at https://toltec-dev.org/stable/rm2fb_1.0.0-1_armv7-3.2.ipk.

to test the package:

if you run into problems: ssh in with the USB cable, remove rm2fb with opkg remove rm2fb and restart xochitl systemctl restart xochitl. also disable / uninstall other launchers

debugging tips:

for testing rmkit apps: * use toltec's testing repo instead of stable repo or download binaries from https://build.rmkit.dev/master/latest/ update jan 04 2021: rm2fb is in toltec stable repository

danshick commented 3 years ago

Just installed. I'll let you know if I end up with any crashes or bugs. Thanks for everyone's efforts to get this working.

raisjn commented 3 years ago

the remux in toltec stable does not work on rM2 (remux will migrate to toltec stable soon). for now, it's advised to copy the remux binary from https://build.rmkit.dev/master/latest/ into /opt/bin (and make sure to chmod +x it)

EDIT: toltec testing now has a version of remux that works well with rM2

lcpriest commented 3 years ago

It installed very easily.

I have tested draft, KOReader and Plato.

Some very stream-of-thought notes, many may be relevant to the specific app and not this PR, apologies.

Draft

Oxide

Remux

KOReader

Calculator

fingerterm

harmony

recrossable

raisjn commented 3 years ago

Some very stream-of-thought notes, many may be relevant to the specific app and not this PR, apologies.

great notes, thanks! for rmkit apps, you can install them from toltec testing. for remux (assuming you get the latest version), you can launch by swiping up the side of the display

we don't expect plato to work yet, and only recently did ddvks rm2 support patches get merged into koreader (for touch support)

pascalw commented 3 years ago

Installation was very easy indeed! I noticed having rm2fb installed breaks things like https://github.com/rien/reStream/pull/31 and https://gist.github.com/owulveryck/4007cbf14e0028f373e4294f66c4ad07 which are reading xochitl memory directly. I couldn't find any advice how these utilities should be adapted to be compatible with rm2fb, is there any guidance on this?

raisjn commented 3 years ago

Installation was very easy indeed! I noticed having rm2fb installed breaks things like rien/reStream#31 and https://gist.github.com/owulveryck/4007cbf14e0028f373e4294f66c4ad07 which are reading xochitl memory directly. I couldn't find any advice how these utilities should be adapted to be compatible with rm2fb, is there any guidance on this?

The framebuffer is exposed as /dev/shm/swtfb.01 - you can point reStream at that location instead of /dev/fb (this is what the person using xofb + color patches in reStream#28 is doing)

For screenshots, you can similarly grab /dev/shm/swtfb.01 and then convert it raw rgb565 -> png. (to convert, you can use a script like iraw2png.pl in https://www.cnx-software.com/2010/07/18/how-to-do-a-framebuffer-screenshot/ or however you were converting previously)

Brandieee commented 3 years ago

No issues with installation. I've only really tried to use Xochitl and KOreader from Oxide.

Getting back to oxide from Xochitl can be accomplished by powering off or restarting via the menu, sometimes this dumps you straight back into Xochitl though.

One problem I've had is that KOreader seems to crash on auto-sleep from Oxide, does not crash on button-sleep.

I'll be trying out Draft as well sometime in the coming days and updating my comment.

Eeems commented 3 years ago

No issues with installation. I've only really tried to use Xochitl and KOreader from Oxide.

Getting back to oxide from Xochitl can be accomplished by powering off or restarting via the menu, sometimes this dumps you straight back into Xochitl though.

Did you disable the xochitl service and enable the tarnish service? Or did you set xochtil as the default startup application in oxide?

One problem I've had is that KOreader seems to crash on auto-sleep from Oxide, does not crash on button-sleep.

@Witos has been having trouble with returning from suspend as well and has a PR in the works to resolve it https://github.com/Eeems/oxide/pull/114

Brandieee commented 3 years ago

No issues with installation. I've only really tried to use Xochitl and KOreader from Oxide. Getting back to oxide from Xochitl can be accomplished by powering off or restarting via the menu, sometimes this dumps you straight back into Xochitl though.

Did you disable the xochitl service and enable the tarnish service? Or did you set xochtil as the default startup application in oxide?

xochitl disabled and enabled tarnish, set no default startup application. Just figured out that it might be that Oxide buffers the input given, past app launches, i.e.

Eeems commented 3 years ago

@Brandieee Oh interesting, I've had others report the same thing on the rM1. I've been unable to replicate on my own rM1, but it's very likely happening. On the rM1 we have to flush out the button press queue before switching applications to avoid the same issue. It might be necessary to also do the same of touch input. Could you open an issue on the Oxide repository about this?

FabrizioRomanoGenovese commented 3 years ago

Hey everyone, first of all thanks for the great work. I've tested the package and it works more or less. Some things are not perfect, e.g. koReader works only with pen input, but I can live with that. The only thing that really is a bummer for me is that reStream does not work. I get the following error from the script I had to move over the reMarkable2: Error: No line containing /dev/fb0 in /proc/xxx/maps file where xxx is some pid number.

A few comments above in the thread, there's this post:

Installation was very easy indeed! I noticed having rm2fb installed breaks things like rien/reStream#31 and https://gist.github.com/owulveryck/4007cbf14e0028f373e4294f66c4ad07 which are reading xochitl memory directly. I couldn't find any advice how these utilities should be adapted to be compatible with rm2fb, is there any guidance on this?

The framebuffer is exposed as /dev/shm/swtfb.01 - you can point reStream at that location instead of /dev/fb (this is what the person using xofb + color patches in reStream#28 is doing)

For screenshots, you can similarly grab /dev/shm/swtfb.01 and then convert it raw rgb565 -> png. (to convert, you can use a script like iraw2png.pl in https://www.cnx-software.com/2010/07/18/how-to-do-a-framebuffer-screenshot/ or however you were converting previously)

...Which I guess would help. Still, I'm not exactly sure where should I replace/dev/fb with /dev/shm/swtfb.01 Do you mean that I have to download the codebase from https://github.com/rien/reStream, spot the relevant place where the substitution has to be made, and recompile? If that's the case, it would be actually better to implement a way to check if rm2fb is installed, and depending on the result, pointing at a different location, which I guess I could do by grepping rmfb2 from opkg list-installed, right?

Eeems commented 3 years ago

@FabrizioRomanoGenovese I believe we have an updated build of KOReader in the works still. Just resolving some other issues on it with how it interacts with the oxide package.

As for reStream, it doesn't currently support rm2fb as you've found out. I believe there are some discussions going on around getting it to work. I believe you can use https://github.com/bordaigorl/rmview though safely, but don't quote me on that, I don't have a rM2 to test on. I would suggest either opening issues on the respective repositories asking for support, or commenting on existing issues mentioning that you would also like proper rm2fb support.

As for you comment about checking to see if rm2fb is installed, yes you can simply run opkg list-installed | grep rm2fb to see if it's installed.

danshick commented 3 years ago

As for reStream, it doesn't currently support rm2fb as you've found out. I believe there are some discussions going on around getting it to work.

If no one gets to it first, I'll push a PR this week to add rm2fb support.

FabrizioRomanoGenovese commented 3 years ago

That would be great! Thanks! Also, is there a reason why reStream isn't available as an opkg package?

Eeems commented 3 years ago

That would be great! Thanks! Also, is there a reason why reStream isn't available as an opkg package?

It's not a reMarkable application, so you don't install it on the reMarkable itself. That said they really should package up the dependencies so you can opkg install restream-deps or something. But nobody has created the packages yet.

FabrizioRomanoGenovese commented 3 years ago

Yeah, part of the application is to be ran on the host PC, but you also need to scp an executable on the remarkable. It would be easier if this could be done with opkg, so that the only thing one has to download on the host PC is a bash script :)

Eeems commented 3 years ago

Yeah, part of the application is to be ran on the host PC, but you also need to scp an executable on the remarkable. It would be easier if this could be done with opkg, so that the only thing one has to download on the host PC is a bash script :)

You should open a PR to add it ;)

danshick commented 3 years ago

Yeah, part of the application is to be ran on the host PC, but you also need to scp an executable on the remarkable. It would be easier if this could be done with opkg, so that the only thing one has to download on the host PC is a bash script :)

This is new as of their rm2 support PR. That small rust binary never used to exist until recently. It'd be great to add it to toltec.

notDavid commented 3 years ago

Hi, after installing rm2fb from toltec on my RM2 my journalctl -f is spammed with this nonstop. Is it a bug or am i using a wrong version or something? Please advise, thanks:

journalctl -f

Details -- Logs begin at Mon 2021-01-11 13:46:35 CET. -- Jan 11 19:07:35 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:36 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:37 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 43. Jan 11 19:07:37 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:37 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:38 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:39 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:40 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:41 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:42 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 44. Jan 11 19:07:42 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:42 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:43 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:44 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:45 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:46 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:47 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 45. Jan 11 19:07:48 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:48 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:48 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:49 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:50 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:51 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:52 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 46. Jan 11 19:07:53 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:53 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:53 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:54 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:55 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:56 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:57 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:58 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 47. Jan 11 19:07:58 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:58 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:59 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:08:00 reMarkable ifplugd(usb0)[243]: upping interface Jan 11 19:08:01 reMarkable ifplugd(usb0)[243]: upping interface
reMarkable: ~/tmp/ opkg list_installed | grep rm2fb
rm2fb - 1.0.0-3

PS. This starts after opkg install rm2fb AND a reboot. It stops when i opkg remove rm2fb (and a reboot i think.)

Eeems commented 3 years ago

Looks like busybox-udhcpd@usb0.service is crashing due to the rm2fb preload?

raisjn commented 3 years ago

I get messages about upping interface but don't have errors about busybox-udhcpcd.

Eeems commented 3 years ago

@notDavid could you check the output of journalctl -u busybox-udhcpd@usb0.service to see if it has more information?

notDavid commented 3 years ago

journalctl -u busybox-udhcpd@usb0.service ( @ same time as the log above) :

Details Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 43. Jan 11 19:07:37 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:37 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:37 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 44. Jan 11 19:07:42 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:42 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:42 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 45. Jan 11 19:07:48 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:48 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:48 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 46. Jan 11 19:07:53 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:53 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 47. Jan 11 19:07:58 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 11 19:07:58 reMarkable systemd[1]: Started udhcpd on usb0. Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 11 19:07:58 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'.
Eeems commented 3 years ago

@notDavid Could you get us the contents of the unit file? You can find the path by checking systemctl status busybox-udhcpd@usb0.service

notDavid commented 3 years ago

I've removed rm2fb now (because of the issues) with opkg remove rm2fb, but i assume that's not relevant... (i can reinstall if needed.)

cat /lib/systemd/system/busybox-udhcpd@.service :

[Unit]
Description=udhcpd on %I
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device systemd-networkd.service
Requires=systemd-networkd.service sys-subsystem-net-devices-%i.device

[Service]
ExecStart=/usr/sbin/udhcpd -f /etc/udhcpd.%i.conf
Restart=on-failure
RestartSec=5
StandardOutput=null
StandardError=journal
LogLevelMax=3

[Install]
WantedBy=multi-user.target
Eeems commented 3 years ago

@raisjn Does this unit exist for you as well? And if so, does it match?

notDavid commented 3 years ago

Okay so, i'm not sure if this is useful to anyone, but just in case;

When i change busybox-udhcpd@.service to LogLevelMax=6 i get 2 extra lines of info:

Jan 14 23:20:05 reMarkable udhcpd[525]: udhcpd: is interface usb0 up and configured?: Cannot assign requested address
Jan 14 23:20:05 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE

So, i tried connecting the USB cable and this happens:

Details Jan 14 23:36:42 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:43 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:44 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 14 23:36:44 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 7. Jan 14 23:36:44 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 14 23:36:44 reMarkable systemd[1]: Started udhcpd on usb0. Jan 14 23:36:44 reMarkable udhcpd[322]: udhcpd: started, v1.30.1 Jan 14 23:36:44 reMarkable udhcpd[322]: udhcpd: is interface usb0 up and configured?: Cannot assign requested address Jan 14 23:36:44 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 14 23:36:44 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 14 23:36:44 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:45 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:46 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:47 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:48 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:49 reMarkable kernel: random: crng init done Jan 14 23:36:49 reMarkable kernel: random: 7 urandom warning(s) missed due to ratelimiting Jan 14 23:36:49 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 14 23:36:49 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 8. Jan 14 23:36:49 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 14 23:36:49 reMarkable systemd[1]: Started udhcpd on usb0. Jan 14 23:36:49 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:49 reMarkable udhcpd[323]: udhcpd: started, v1.30.1 Jan 14 23:36:49 reMarkable udhcpd[323]: udhcpd: is interface usb0 up and configured?: Cannot assign requested address Jan 14 23:36:49 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Main process exited, code=exited, status=1/FAILURE Jan 14 23:36:49 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Failed with result 'exit-code'. Jan 14 23:36:50 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:51 reMarkable ifplugd(usb0)[214]: upping interface **-> Connected the USB cable approximately here** Jan 14 23:36:51 reMarkable kernel: g_ether gadget: high-speed config #1: CDC Ethernet (ECM) Jan 14 23:36:51 reMarkable systemd-networkd[139]: usb0: Gained carrier Jan 14 23:36:51 reMarkable systemd-timesyncd[208]: Network configuration changed, trying to establish connection. Jan 14 23:36:51 reMarkable kernel: IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready Jan 14 23:36:50 reMarkable systemd-timesyncd[208]: Synchronized to time server 216.239.35.8:123 (time3.google.com). Jan 14 23:36:51 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:52 reMarkable systemd-networkd[139]: usb0: Gained IPv6LL Jan 14 23:36:52 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:53 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Service hold-off time over, scheduling restart. Jan 14 23:36:53 reMarkable systemd[1]: busybox-udhcpd@usb0.service: Scheduled restart job, restart counter is at 9. Jan 14 23:36:53 reMarkable systemd[1]: Stopped udhcpd on usb0. Jan 14 23:36:53 reMarkable systemd[1]: Started udhcpd on usb0. Jan 14 23:36:53 reMarkable udhcpd[326]: udhcpd: started, v1.30.1 Jan 14 23:36:54 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:55 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:56 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:56 reMarkable udhcpd[326]: udhcpd: sending OFFER of 10.11.99.2 Jan 14 23:36:57 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:58 reMarkable udhcpd[326]: udhcpd: sending ACK to 10.11.99.2 Jan 14 23:36:58 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:36:59 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:00 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:01 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:02 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:03 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:04 reMarkable systemd-networkd[139]: usb0: Configured Jan 14 23:37:04 reMarkable systemd-timesyncd[208]: Network configuration changed, trying to establish connection. Jan 14 23:37:04 reMarkable systemd-networkd-wait-online[152]: ignoring: lo Jan 14 23:37:04 reMarkable systemd[1]: Started Wait for Network to be Configured. Jan 14 23:37:04 reMarkable systemd[1]: Reached target Network is Online. Jan 14 23:37:04 reMarkable systemd[1]: Started A simple mDNS responder. Jan 14 23:37:04 reMarkable systemd-timesyncd[208]: Synchronized to time server 216.239.35.8:123 (time3.google.com). Jan 14 23:37:04 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:05 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:06 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:07 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:08 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:09 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:10 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:11 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:12 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:13 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:14 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:15 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:16 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:17 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:18 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:19 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:20 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:21 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:22 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:23 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:24 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:25 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:26 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:27 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:27 reMarkable udhcpd [326]: udhcpd: sending ACK to 10.11.99.2 Jan 14 23:37:28 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:29 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:30 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:31 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:32 reMarkable systemd[1]: dev-ttyGS0.device: Job dev-ttyGS0.device/start timed out. Jan 14 23:37:32 reMarkable systemd[1]: Timed out waiting for device dev-ttyGS0.device. Jan 14 23:37:32 reMarkable systemd[1]: Dependency failed for Serial Getty on ttyGS0. Jan 14 23:37:32 reMarkable systemd[1]: serial-getty@ttyGS0.service: Job serial-getty@ttyGS0.service/start failed with result 'dependency'. Jan 14 23:37:32 reMarkable systemd[1]: dev-ttyGS0.device: Job dev-ttyGS0.device/start failed with result 'timeout'. Jan 14 23:37:32 reMarkable systemd[1]: Reached target Login Prompts. Jan 14 23:37:32 reMarkable systemd[1]: Reached target Multi-User System. Jan 14 23:37:32 reMarkable systemd[1]: Starting Update UTMP about System Runlevel Changes... Jan 14 23:37:32 reMarkable systemd[1]: Started Update UTMP about System Runlevel Changes. Jan 14 23:37:32 reMarkable systemd[1]: Startup finished in 4.374s (kernel) + 1min 30.559s (userspace) = 1min 34.934s. Jan 14 23:37:32 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:33 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:34 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:35 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:36 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:37 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:38 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:39 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:40 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:41 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:42 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:43 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:44 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:45 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:46 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:47 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:48 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:49 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:50 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:51 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:52 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:53 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:54 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:55 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:56 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:57 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:57 reMarkable udhcpd[326]: udhcpd: sending ACK to 10.11.99.2 Jan 14 23:37:58 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:37:59 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:00 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:01 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:02 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:03 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:04 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:05 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:06 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:07 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:08 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:09 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:10 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:11 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:12 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:13 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:14 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:15 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:16 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:17 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:18 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:19 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:20 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:21 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:22 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:23 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:24 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:25 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:26 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:27 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:27 reMarkable udhcpd[326]: udhcpd: sending ACK to 10.11.99.2 Jan 14 23:38:28 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:29 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:30 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:31 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:32 reMarkable ifplugd(usb0)[214]: upping interface **-> Disconnected the USB cable** Jan 14 23:38:32 reMarkable qmdns-responder[327]: reinitializing sockets Jan 14 23:38:32 reMarkable systemd-networkd[139]: usb0: Lost carrier Jan 14 23:38:32 reMarkable systemd-timesyncd[208]: Network configuration changed, trying to establish connection. Jan 14 23:38:32 reMarkable systemd-timesyncd[208]: Synchronized to time server 216.239.35.8:123 (time3.google.com). Jan 14 23:38:33 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:34 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:35 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:36 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:37 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:38 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:39 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:40 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:41 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:42 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:43 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:44 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:45 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:46 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:47 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:48 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:49 reMarkable ifplugd(usb0)[214]: upping interface Jan 14 23:38:50 reMarkable ifplugd(usb0)[214]: upping interface **-> this keeps going on forever...**
reMarkable: ~/ opkg list_installed | grep -i rm2fb
rm2fb - 1.0.0-5

opkg remove rm2fb and a reboot = no more errors.

Eeems commented 3 years ago

Hmm, I'm thinking the preload isn't playing well with it. Perhaps we shouldn't have rm2fb auto add to environment for all services and have it be a bit more selective?

raisjn commented 3 years ago

It should be possible to disable the LD_PRELOAD directly in the systemd unit by adding a line to [Service] section like Environment=LD_PRELOAD= (but maybe need to play around with it)

some options for rm2fb:

danshick commented 3 years ago

If rm2fb is failing based on the versions of libs a binary is using, can't we use ldd to figure out if a binary links against the remarkable libs and LD_PRELOAD conditionally?

raisjn commented 3 years ago

If rm2fb is failing based on the versions of libs a binary is using, can't we use ldd to figure out if a binary links against the remarkable libs and LD_PRELOAD conditionally?

that sounds nice - how would we do that for systemd services?

danshick commented 3 years ago

If rm2fb is failing based on the versions of libs a binary is using, can't we use ldd to figure out if a binary links against the remarkable libs and LD_PRELOAD conditionally?

that sounds nice - how would we do that for systemd services?

Well, for any one service, you could override the Exec line and use a conditional expression when launching. It'd be nicer to have something globally applicable though. I'll do some searching.

Edit:

You could have a Before relationship to a unit that creates an EnvironmentFile, and use systemd specifiers to let this specialized Before unit know which other unit it is being called about. You'd need a pretty clever script to extract the actual executable from the target unit in order to run ldd on it and conditionally write an EnvironmentFile. I hope that word salad makes some sense.

Edit2:

You'd still need to add this Before unit to every existing unit, as well as the EnvironmentFile config.

Edit3:

Before and After work differently than I thought. There may be some other unit relationship we could use instead, but I'm not sure.

Eeems commented 3 years ago

Before and After work differently than I thought. There may be some other unit relationship we could use instead, but I'm not sure.

@danshick There is a weaker version of After that can be used. Can't remember what it was called though.

danshick commented 3 years ago

Before and After work differently than I thought. There may be some other unit relationship we could use instead, but I'm not sure.

@danshick There is a weaker version of After that can be used. Can't remember what it was called though.

I think we need Wants= and After= to get both order and weak requirement. Then we could remove the global DefaultEnvironment setting. But this still needs to be overridden into every unit I think.

raisjn commented 3 years ago

@notDavid I modified two files, /lib/systemd/system/busybox-udhcpd@.service and busybox-ifplugd@.service and added Environment="LD_PRELOAD=" to the [Service] section which had the effect of quieting the logs down.

If that works for you, the next question is how to set that up automatically when installing rm2fb (and maybe do it for all services that are really busybox files)

notDavid commented 3 years ago

@raisjn Great, i just tested it and it works 👌🏼 No more errors.

raisjn commented 3 years ago

thanks for all the testing and help, everyone! rm2fb has been in toltec for a while now, going to close out