Commit Graph

48 Commits

Author SHA1 Message Date
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
muelli
5163b47811
Merge pull request #14 from rieck-srlabs/ci-dev
Initial CI implementation
2023-10-16 12:46:14 +02:00
Tobias Mueller
9894f936e0 Prepare for a new version with v4 compatibility 2023-10-16 12:44:11 +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
Tobias Mueller
61a7466117 initial PoC for a Web interface 2023-10-16 11:53:08 +02:00
muelli
406360fad2
Merge pull request #11 from srlabs/verifyimei_len
Added IMEI character length validation check
2023-10-16 09:51:31 +02:00
Jakob Rieck
862ad1f7e3 Fixes Makefile (EXTRA_DEPENDS) 2023-10-16 09:12:23 +02:00
Jakob Rieck
ef35ca9899 Initial CI implementation
- Triggers on push events to any branch
- Builds the blue-merle package using the 23.05.0 SDK
- Currently does not sign the package
- Adapts Makefile: switches from Runtime + Buildtime dependencies
  to Runtime dependencies only
2023-10-14 11:27:31 +02:00
Tobias Mueller
da1a2f071c luci: first customisation of the Web UI
This is a very small baby step towards our own page.
2023-10-13 13:13:30 +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
Tobias Mueller
75b1291e00 vendorise upstream opkg app
This is for experimenting with building a LuCI app.
I hope we can take this as a base and extend it to our needs.
The source is
https://github.com/openwrt/luci/raw/openwrt-22.03/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
2023-10-13 12:48:20 +02:00
Linuzifer
09d2f8c087
Merge pull request #10 from muelli/v4-bail
hard fail on v4 and soft-fail on v3 of the firmwares
2023-09-12 15:00:14 +02:00
Tobias Mueller
928d4360ca depend on gl-ui and gl-e750-mcu because we modify those packages
We do need the MCU package and we modify the web UI so let's actually
depend on the relevant packages.
2023-08-28 10:41:13 +02:00
Tobias Mueller
d934a6c028 check for the actual version 3.215
I've made a typo in the previous attempt. Now I'm checking for the
correct version and it works much better.
2023-08-28 10:39:49 +02:00
Tobias Mueller
7aaf65e8bd support a clean uninstall of blue-merle
Before this change, uninstalling the package would complain about
/tmp/sim_change_start not existing:

root@GL-E750:/tmp# opkg remove blue-merle
Removing package blue-merle from root...
The /tmp/ directory exists.
The /etc/ directory exists.
killall: gltertf: no process killed
No file found within /tmp/tertf. No shredding to be done there.
No file found within /etc/tertf. No shredding to be done there.
Looks like /tmp/ is clean!
Looks like /etc/ is clean!
rm: can't remove '/tmp/sim_change_start': No such file or directory
rm: can't remove '/tmp/sim_change_switch': No such file or directory
No packages removed.
Collected errors:
 * pkg_run_script: package "blue-merle" postrm script returned status 1.
root@GL-E750:/tmp#

So we use -f to not raise an error if the file does not exist.
2023-08-28 09:55:41 +02:00
Tobias Mueller
0f2b358b31 Makefile: detect version 4 and bail out while soft-failing for version 3
We assume that the version 3 series is compatible, but still prompt the
user if they are using a version that we have not yet tested.

We know that version 4 is not compatible, so we bail out directly.

The double-dollar is for escaping the Makefile.
2023-08-28 09:33:28 +02:00
kantorkel
cb4d73731f Initial commit 2022-10-21 10:14:38 +02:00