Commit Graph

38 Commits

Author SHA1 Message Date
Tobias Mueller
242235757a switch: log when stage1 has finished running 2023-10-17 15:49:41 +02:00
Tobias Mueller
0fa4d89602 switch: do not run the lock contention check in the background
It actually prevents out main script from running because the flock
process is still running in the background.
2023-10-17 15:49:25 +02:00
Tobias Mueller
8053d44ce7 switch: removing stale switch file
We have separated it into stages so we don't need the monolith
2023-10-17 15:48:51 +02:00
Tobias Mueller
0b4b04c48b switch: log in stage2
So that we can notice whether our script has successfully run.
You can read the log with something like
logread -l 10000 -e blue
2023-10-17 15:16:49 +02:00
Tobias Mueller
ed6856c490 switch: split the switch action into separate stages
When toggling the switch, a lock is held for a relatively long time,
preventing another toggling of the switch to be noticed. With this
change, I hope we can first shutdown the modem, wait for a toggle, and
then continue.
We're losing the abort function but I currently don't know how we would
be able to keep that functionality given that the toggle is queued and
we don't get the notification.
2023-10-17 15:15:28 +02:00
Tobias Mueller
eab0633ad9 switch: Asynchronously execute blue merle when toggled
I hope that this allows us to use the toggle again to advance the Blue
Merle logic.
If all goes well, the script finishes execution and the switch lock in
/var/lock/gl-switch.lock is released so that the button can be used
again.
2023-10-17 13:51:51 +02:00
Tobias Mueller
db1c0c4c69 switch: limit execution time to 90 seconds
We don't want to let it run forever because it blocks the toggle from
working. But even if it's not, we wouldn't want to have the script run
eternally.
2023-10-17 13:02:40 +02:00
Tobias Mueller
ae40dcec1f web: weeding out the opkg functionality
We don't need any of that but I let the functions live just in case they
are referenced anywhere.
2023-10-17 13:00:35 +02:00
Tobias Mueller
396ff7ea0e switch: shutdown in time
Now it's more in sync with the display.
2023-10-17 10:16:10 +02:00
Tobias Mueller
2cf6495aad switch: re-format messages to appear more nicely on the screen
We cannot control whitespace :(
2023-10-17 10:12:17 +02:00
Tobias Mueller
6b7e11137b switch: send SIM swap script to background
I think we can only toggle while the handler is not active.
I toggled to ON and got the script running. But then I couldn't toggle
OFF, presumingly because the script was still running.
By sending it to the background I hope it will allow me to toggle OFF.
2023-10-17 09:57:47 +02:00
Tobias Mueller
881e9792c7 switch: call blue-merle-switch when toggling the button to on 2023-10-17 09:23:58 +02:00
Tobias Mueller
29db0fab27 switch: show message on v4 MCU 2023-10-17 09:20:36 +02:00
Tobias Mueller
df8578e402 functions: CHECK_ABORT for v4 MCU 2023-10-17 09:18:00 +02:00
Tobias Mueller
11a8afd0a9 python: Added a --generate-only flag to not set the IMEI
We can probably set the IMEI through the gl_modem command.
Currently, the Web interface times out when calling random-imei. I want
to separate the steps so that each step does not take as long.
2023-10-17 09:05:02 +02:00
Tobias Mueller
53bf156fd0 python: only get the IMSI when in deterministic mode
We don't need the IMSI otherwise so let's not spend the time obtaining
it.
2023-10-17 09:01:31 +02:00
Tobias Mueller
4a16277ac2 python: debug print reading IMSI
It seems to timeout somewhere and I want to know where.
2023-10-17 09:00:56 +02:00
Tobias Mueller
6ac26e1a33 web ui: Fix a syntax error by closing the E() 2023-10-16 17:26:46 +02:00
Tobias Mueller
955d0f993e blue-merle: make it return the new IMEI after generating a random IMEI 2023-10-16 16:58:15 +02:00
Tobias Mueller
3b87b1b8f4 web: offer to shutdown on SIM swap
It currently times out when generating an IMEI.
I wonder what the timeouts are.
2023-10-16 16:57:42 +02:00
Tobias Mueller
b02faa7adb web: stab at a Web UI for SIM swap 2023-10-16 16:36:33 +02:00
Tobias Mueller
fa11fc45ca blue-merle: Display a shutdown message before finally halting the system 2023-10-16 16:25:45 +02:00
Tobias Mueller
259bffc515 switch: show a message on toggling the button
To see more easily whether we have control.
2023-10-16 16:10:17 +02:00
Tobias Mueller
4636d77222 web: rename files from opkg2 to blue-merle
This makes it easier to find our own files...
2023-10-16 16:05:58 +02:00
Tobias Mueller
ce77151081 switch: log action on the toggle
It's a bit easier to follow than looking at the generated files.
2023-10-16 16:03:11 +02:00
Tobias Mueller
55a6f8d10f fix syntax error in web interface
I want to see it in the menu before further developing the
functionality.
2023-10-16 15:54:46 +02:00
Tobias Mueller
4f584b4b6c mac-wipe: avoid accumulating mounts
If we mount over and over again we may consume memory unnecessarily.
2023-10-16 15:15:29 +02:00
Tobias Mueller
4beae781a2 mac-wipe: copy existing database into a volatile memory
rather than deleting everything.
It seems that the device stops working when deleting the database. That
is, the connection to the Internet stops working which is very safe as
it does not leak any data but arguably defeats the purpose of the
device.
2023-10-16 14:51:59 +02:00
Tobias Mueller
e02de82dba mac-wipe: log execution to debug where it's stuck
When installing the package, it appears to be stuck somewhere. I want to
know where and why, so I use the logging facilities.
2023-10-16 14:05:09 +02:00
Tobias Mueller
226687590e adapt opkg luci web interface for blue-merle
This is a snapshot only. It does not work and serves as a prototype
only. Now, we can see how to add a menu item and how to call our
executable on the flash.
2023-10-16 12:49:19 +02:00
Tobias Mueller
ea66e67d07 Merge remote-tracking branch 'origin/main' into luci 2023-10-16 12:39:14 +02:00
Tobias Mueller
3e686c79d3 bridge blue merle functionality to the Web
This follows the pattern of opkg. I took the luci-app-opkg package and
tried to follow its behaviour.
2023-10-16 12:35:55 +02:00
Tobias Mueller
4c29fe2732 removing v3 patches
The switch doesn't work yet but "uci  get switch-button.@main[0].func"
gets the currently active configured action for button.
I guess that /etc/rc.button/switch is called on every press of the
button.
2023-10-16 12:25:19 +02:00
Tobias Mueller
843ddf9e7d switch: attempt to react to the hardware button
I don't know whether this works. On the v4 firmware, we can see files in
/etc/gl-switch.d but I don't know yet how the system determines which
file to choose. I assume it's dependend on the "page" of the display.
But I haven't figured out yet how or rather where those pages are
organised.
2023-10-16 12:14:00 +02:00
Tobias Mueller
1a17e06a12 MAC address removal for v4 firmware
I have rsynced the whole device before associating with a new device and
after. The only file that got modified was /etc/oui-tertf/client.db.
We intend to have it stored in memory rather than on flash. This should
be okay since the kernel also holds the MAC addresses in memory.
2023-10-16 12:09:00 +02:00
Tobias Mueller
9c9ab738ac functions: Remove unsued restore function
This is not referenced anywhere so I guess that we don't need it.
2023-10-16 12:04:46 +02:00
nicholas
187378a1d6 Added IMEI character length validation check in
imei_generate.py which ensures IMEI has 14-char
length, including validation digit
2023-10-13 13:05:40 +02:00
kantorkel
cb4d73731f Initial commit 2022-10-21 10:14:38 +02:00