jayy001 / codexctl Goto Github PK
View Code? Open in Web Editor NEWAutomated update managment for the ReMarkable tablet
License: GNU General Public License v3.0
Automated update managment for the ReMarkable tablet
License: GNU General Public License v3.0
Cannot roll back from beta version 3.8.2.1961 Error Updating
You can use the following to only run code if it's on windows:
import os
if os.name == 'nt':
You can then use powershell to check the status of a network, and mark is as private:
Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceIndex 13 -NetworkCategory Private
Python can run powershell in a subprocess, which is probably easiest. I've also written code in the past to use Python.NET to run powershell code within a .NET context that I could give you some pointers from, but that adds more dependencies to your code that you probably don't need.
It would be a good idea to verify that the file contents match what is expected after downloading it, and before installing it. A simple hash of the file should be enough. You can then store that in the file version/id table. Maybe store it something like this:
self.id_lookups_rm1 = {
"3.6.1.1894": ("CGaIOXfzAA", "HASH"),
}
You can then get the id and hash from it with the following:
id, hash = self.id_lookups_rm1[version]
Since there is a separate EULA for the beta, that you can't confirm that the user has agreed to, you shouldn't include beta versions in the list.
codexctl/data/version-ids.json
Lines 105 to 108 in f86d77a
It would be nice to add an extract command that can pull the raw image from a downloaded upgrade file.
Are there instructions for putting this on the RM2? I have a bit of a chicken-and-egg problem: no python/git on the RM2. Can you provide instructions for basic installations on vanilla RM2s?
This currently downloads update files to the current working directory. Instead, they should be put in a temporary directory.
https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory
You'll need to disable the update-engine service on the other partition, which is possible by removing the symlink systemd creates.
This way you avoid the issue where someone downgrades, forgets to turn off auto update and then gets updated again.
I was asked by Eeems to submit an Issue request. I have never added anything to github, so my apologies. Running the main.py script was opening cmd prompt in Windows 10, displaying about 4 lines and then closing. Checking the code in IDLE I got this when running the code.
Getting latest toltec supported version Traceback (most recent call last): File "C:\Users\<USER>\Desktop\rm-update-helper-1.0.0\main.py", line 156, in <module> driver = updates_manager() #TODO: Delete file after its done File "C:\Users\<USER>\Desktop\rm-update-helper-1.0.0\main.py", line 42, in __init__ self.latest_toltec_version = self.get_latest_toltec_supported() File "C:\Users\<USER>\Desktop\rm-update-helper-1.0.0\main.py", line 62, in get_latest_toltec_supported return re.search('Toltec only supports OS builds up to and including OS(.*)\. You will soft-brick', site_body_html).group(1).strip() AttributeError: 'NoneType' object has no attribute 'group'
At this point the code would cease. I checked line 62 in the code and found the following:
return re.search('Toltec only supports OS builds up to and including OS(.*)\. You will soft-brick', site_body_html).group(1).strip()
As far as I could tell the .group(1).strip()
did not appear to be used anywhere else (I know very little about Python, so I may have missed something). I removed that part of the code and the module ran correctly when running it again.
The current data structure for latest doesn't work properly when there is a stable release for one device, but not the other.
Ideally, you would just compare the listed version numbers and grab the highest one for latest. That way, there would be no need to keep the value updated.
The toltec value should allow splitting rm1/rm2 values out though, if there is ever another release only for one device.
Currently this tool doesn't allow you to use a SSH key to connect to the device, only the SSH password.
Hello, thanks for the awesome software. It saved me several months ago when I wanted to go back to 2.x version :)
I downloaded the binary for windows today, and after unzipping it, Windows Defender gave me a notification that a threat was found. It's really weird because in Windows Defender main page, it would change to "no threat" in a matter of seconds without me doing anything. Every time the folder is unzipped, the notification pops again, only for the threat to disappear again.
+after unzipping several times, it stopped giving me threat notification
+now the threat doesn't go away automatically
Instead of requiring the user to pass the --rm1 flag, it would be preferable to auto-detect the device where possible.
It would be nice to have a command to bind mount an update file to allow exploring the contents. This would likely depend on #31
When getting it to run I had to install both 'requests' and 'netifaces'.
Thanks for the effort!
I have problems with the macOS binary (latest codexctl release, macOS 12.7 M1 mac)
Currently, we have to manually add the update file IDs for each version, we should have a service to periodically check for new updates and then commit them to the repo
https://github.com/al45tair/netifaces has been archived and is no longer maintained. It also breaks on 3.11. This should be replaced with a new maintained alternative.
Enter path to SSH key: /home/eeems/.ssh/id_rsa
Unknown exception: q must be exactly 160, 224, or 256 bits long
Traceback (most recent call last):
File "/tmp/onefile_30204_1695664194_667846/paramiko/transport.py", line 2185, in run
File "/tmp/onefile_30204_1695664194_667846/paramiko/auth_handler.py", line 404, in _parse_service_accept
File "/tmp/onefile_30204_1695664194_667846/paramiko/dsskey.py", line 112, in sign_ssh_data
File "/tmp/onefile_30204_1695664194_667846/cryptography/hazmat/primitives/asymmetric/dsa.py", line 253, in private_key
File "/tmp/onefile_30204_1695664194_667846/cryptography/hazmat/backends/openssl/backend.py", line 708, in load_dsa_private_numbers
File "/tmp/onefile_30204_1695664194_667846/cryptography/hazmat/primitives/asymmetric/dsa.py", line 294, in _check_dsa_private_numbers
File "/tmp/onefile_30204_1695664194_667846/cryptography/hazmat/primitives/asymmetric/dsa.py", line 286, in _check_dsa_parameters
ValueError: q must be exactly 160, 224, or 256 bits long
Error while connecting to device: {error}
First of all thanks a lot for the great work and collaboration I'm witnessing !
I just downgraded from 3.9.x to 3.8.x and I have a few questions :
Once again thanks a lot!
It would be interesting to have commands to let you quickly explore the contents of an update image. The couple I could think of would be cat
and ls
. This would depend on #31 and #32 most likely, but in this scenario, codexctl would automate extracting and mounting to a temporary location, and then cat/ls the output and unmount. The extracted image would be cleaned up at some point too, but probably not right away, unless that performs well.
Performance on a rM device would not be a good idea for mounting to tmpfs though due to the limited ram, so maybe only extract/mount to a specific location on disk under /opt
on device?
You can use https://github.com/Eeems-Org/remarkable-update-fuse to mount an update file to access the image inside without having to extract it. From there you can either do a loopback mount, or use ext4fuse to mount the image. This will avoid spending the time required to extract the image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.