Commit Graph

71 Commits

Author SHA1 Message Date
Tobias Mueller
db8de09293 web: remove unused handleRemove function 2023-10-17 19:59:18 +02:00
Tobias Mueller
8b4d371c9f functions: Do not automatically restart the wifi on RESET_BSSIDS
Instead of restarting the service we have the service started *after*
our modification to its configuration.
This makes it slightly more inconvenient to reset the WiFi BSSIDs while
the device is booted but that capability can be restored and made better
through an executable, say, /usr/bin/reset-wifi-bssids or something.

We also split the volatile client MACs into its own service to have
a bit of a clearer separation of duties. This will allow us to eventually
split the package more easily into sub-packages with finer-grained control.
2023-10-17 19:52:11 +02:00
Tobias Mueller
1c3c5f79e1 web: fix syntax error for missing comma 2023-10-17 17:20:26 +02:00
Tobias Mueller
0fbb00612c blue-merle: provide a somewhat interactive way to set a new IMEI via SSH
This can currently only provide a random IMEI only. But we could easily
recover the deleted script. But it'd be nicer to have a central
configuration for the mode.
2023-10-17 17:18:08 +02:00
Tobias Mueller
c88d04003b web: forcefully timout the python script
sometimes it has a hickup.
2023-10-17 16:54:43 +02:00
Tobias Mueller
f7a9494a0c web: logging calls to helper binary 2023-10-17 16:54:18 +02:00
Tobias Mueller
958a0ecc99 web: actually changing the UI when the script returns
When it doesn't time out it seems to be working. Weird.
2023-10-17 16:51:51 +02:00
Tobias Mueller
580d456ed1 web: try calling random-imei
It fails from the "SIM Swap" button, I don't know yet, why.
2023-10-17 16:38:57 +02:00
Tobias Mueller
fa8e630714 web: remove unused functions
they are not referenced from the rest of the file.
2023-10-17 16:37:55 +02:00
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
b15a9390ec Install Python script as executable
This makes it a tiny bit easier to develop on the device because we can
execute the script directly rather than having to prefix it.
2023-10-16 16:25:23 +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
119a287304 postinst: show a brief message
Somehow it disconnects me from the wifi, I guess it's related to
restarting the gl-tertf service. I wonder whether the installation
completes so I make a message appear.
2023-10-16 16:09:55 +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
9bd78b4a1d postinst: Define button action after install
I've seen this in /etc/rc.button/switch
2023-10-16 15:16:51 +02:00
Tobias Mueller
4a4b5a4e0b dependencies: Depend on python3-serial only to avoid heavy python package
python3-serial depends on python3-light which is hopefully, well,
lighter.
2023-10-16 15:16:00 +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
6137fc0ea7 remove bash and patch dependency
I couldn't find a file requiring bash. And we don't patch anything
during installation so I hope we can live without those dependencies.
2023-10-16 14:21:56 +02:00
Tobias Mueller
8327c706d6 EXTRA_DEPENDS with comma and space
So with the commas only, it installed without complaining. Which is
weird, because what does it recognise as dependency that it think is
fulfilled? The long name with all the commas?
2023-10-16 14:16:09 +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
0e6af2eb77 install: make script in /etc/gl-switch.d/ executable
Then we should be able to have it executed when the button is switched.
2023-10-16 14:03:10 +02:00
Tobias Mueller
7531d2b691 encode dependencies with commas
The intention is to have the system recognise our dependencies and to
reject installation if the dependencies are not met. Better yet, have it
install the dependencies!
2023-10-16 13:57:26 +02:00
Tobias Mueller
e867547c4f preinst: remove MCU version check
The gl-sdk4-mcu looks sufficiently recent so we skip the MCU parts in
the preinst. This makes the code easier and less error-prone.
2023-10-16 13:37:49 +02:00
Tobias Mueller
04b1e6dfcb Depend on luci rather than GL
In v4 firmware neither gl-ui nor gl-e750-mcu exists.
2023-10-16 13:28:13 +02:00
Tobias Mueller
6e6a7fdca6 Merge branch 'main' of https://github.com/srlabs/blue-merle into luci 2023-10-16 12:49:22 +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