Idea

Kevin Windrem avatar image
Kevin Windrem suggested

add auto run to USB sticks

I am getting increased interest in my Venus modifications (mainly GuiMods) from people with no programming experience. I'm looking for a way to automatically install these modifications for those that do not feel comfortable with a command line interface. A missing piece is getting a script to run when a USB stick is inserted in the Venus system.

A mechanism already exists to automatically install things in the /data partition. A scrip named update-data.sh is run during system boot looking for compressed archives and if found unpacks them into the /data partition. mvader used this mechanism to install a rcS.local file that would run on next boot, it destroys any existing rcS.local file. That's OK in his case because the mechanism is designed to remove everything from the /data portion to restore the system to factory defaults.

What I propose is a mechanism similar to autorun.bat in Windows systems:

If an autoRun.sh file was found on the USB stick, update-data.sh could execute that script after it unpacks any archives.

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.

Kevin Windrem avatar image
Kevin Windrem commented

Bump.

@mvader (Victron Energy)

I'm getting more requests for automatic installation of my packages.

Recently, the 123 smart BMS implemented an automatic install based on the update-data.sh mechanism described in my original post. But as indicated, this wipes out any existing rc.local which could be bad for other modifications using this hook to run programs at boot.

A simple addition to /etc/init.d/update-data.sh should have minimal impact to the system and be easy to accomplish:

update_data() {
    for dir in /media/*; do
        for suf in $ARCHIVE_SUF; do
            archive=$dir/$ARCHIVE_NAME.$suf
            if [ -f "$archive" ]; then
                echo "Updating /data with $archive"
                unpack "$archive" /data && return 0
            fi
        done

        # run auto-run script if present
        if [ -f "$dir/autoRun.sh" ]; then
            "$dir/autoRun.sh"
        fi
    done

The addition is shown in bold above

This change would allow automatic installation without stepping on rc.local or rcS.local.


2 |3000

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

Paul B avatar image
Paul B commented

This would be very helpfull as its nice to be able to send a customer a SDcard and they insert it and the script then runs whats needed

most customers do not have the know how nor are they inclined to do logons etc

2 |3000

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

klaus60 avatar image
klaus60 commented

Es würde auch mir sehr Helfen, da ich gerne GuiMods2 in meinem WoMo einsetzen würde und ich mich nicht, mit den vorhandenen Anleitungen, an eine Umsetzung traue. Es würde auch erst einmal Helfen eine bebilderte Anleitung oder ein Video der Installation im Netz zu finden.

2 |3000

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.