question

Kevin Windrem avatar image
Kevin Windrem asked

Notification on GUI from shell script

I have a shell script that needs to put up a warning on the GUI (like "toast" used in the QML code).

Is there a way??

I am using a blind install mechanism to install my SetupHelper package. It turns out people inadvertently leave the SD card/USB stick containing the venus-data.tar.tz file on it inserted in the GX device, so the next reboot steps on the work just done.

Short of removing venus-data.tar.gz from the media I can't figure out a way to prevent the mechanism from activating again on the next boot. I hate do be that drastic because installers may wish to use the same USB stick on several GX devices.

I'm open to ideas.

Venus OS
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
bathnm avatar image
bathnm answered Ā·

@Kevin Windrem If there is no ability to send a message to the GUI, rather than delete how about....

1) Write the devices serial number or something unique as an empty file on the sd-card. Then check if that file exists and if it does do not re-run. A re-install can then be triggered by deleting the file for that device from the sd-card

OR

2) putting a version number on the file name, then check the file name version against the installed version.

None are ideal....

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image Kevin Windrem commented Ā·

The venus-data.tgz mechanism has no control. It unpacks the archive and places everything in /data. What Victron and others including myself have done is include an rcS.local file in the archive, so a second reboot does something. But the first boot has already done "damage".

I have implemented a workaround that no longer requires a notification: I changed my archive to include include an alternate directory for SetupHelper (SetupHelper-blind), so the original folder is not touched by the mechanism. I then run a script that does version checks and only updates SetupHelper if SetupHelper-blind is a newer version.

0 Likes 0 Ā·
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered Ā·
4 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image Kevin Windrem commented Ā·

Not sure. I can't get to https://victrondevelopment.slack.com


I did propose a change a while back that would provide a mechanism with more control:


modify /etc/init.d/update-data.sh to look for a program to run so we didn't need to use the venus-data.tgz mechanism at all.


if update-data.sh checked for and ran an AutoRun.sh file on the media, then we would have control of what happened.

0 Likes 0 Ā·
mvader (Victron Energy) avatar image mvader (Victron Energy) ā™¦ā™¦ Kevin Windrem commented Ā·
Yes, you wonā€™t need to see the slack, see my comment under the main issue. Looks like exactly your suggestion- right?
0 Likes 0 Ā·
Kevin Windrem avatar image Kevin Windrem mvader (Victron Energy) ā™¦ā™¦ commented Ā·
Yes, if the main issue is upon inserting SD/USB media, that is exactly my suggestion as well.
0 Likes 0 Ā·
mvader (Victron Energy) avatar image mvader (Victron Energy) ā™¦ā™¦ Kevin Windrem commented Ā·
Hi it will most likely be on boot; not on insertion; since iirc we donā€™t detect insertion properly on all hardware. But Iā€™ll leave that decision to the experts.

Another possible advantage fr during boot is that youā€™d know the state of venus os when the script is called (booting)

0 Likes 0 Ā·

Related Resources