Can you add busybox-extras

Hi,

I run hass.io

I use telnet to manually trigger zoneminder events from home assistant. For this I need the busybox-extras package installed.

Imagine my surprise when it disappeared after a reboot… seems rather limiting to me, wish I’d of known this before moving my whole setup to hass.io, thought I was doing the smart thing when I did it.

For now I’ve set up an automation that executes on hass start and calls a shell command that installs the packages… dirty but hope it works.

- alias: do stuff when hass started
  trigger:
    - platform: homeassistant
    event: start
  action:
    - service: shell_command.hass_start

Hey how does your shell command hass_start look like?
how do you install extra packages?

Well below is my current hass_start script if that helps… it installs the extra packages (telnet is part of busybox-extras) and even sets up a mount point for a remote samba share.

#!/bin/bash
sudo apk add mc
sudo apk add busybox-extras
sudo apk add cifs-utils
sudo echo "//192.168.1.124/music /config/media/music cifs guest,rw,file_mode=0777,dir_mode=0777 0 0" >> /etc/fstab
#sudo mkdir -p /mnt/filesvr1/music
#sudo chmod a+wrx -R /mnt/filesvr1
sudo mount /config/media/music

exit 0

yes, thx, i indeed figured it out that i had to use “apk add” :slight_smile:

packages are persistent untill a new core update, right?

correct… but once you have the script its easy enough to run

1 Like

hmm, tried it today, verry simple

created an requirements.sh with this as content and did a chmod +x on it :slight_smile:

#!/bin/bash
sudo apk add can-utils

if i run it from putty, then it works, it installs that package

bash /config/python_scripts/requirements.sh

if i run it from the automation

- alias: Dobiss Server
  initial_state: 'on'
  trigger:
    - platform: homeassistant
      event: start
  action:
    - service: shell_command.requirements

shell_command:
requirements: bash /config/python_scripts/requirements.sh

then i receve error below

2021-02-17 09:35:51 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: bash /config/python_scripts/requirements.sh, return code: 127

if i remove the sudo from the .sh script, i get error 1 instead of error 127

any idea?

it has todo with environment, i know the yaml code is correct, because if i try something simple in the bash script, it creates the abc.txt file, so everything is fired

it has something todo with rights i think of installing an file , with maybe the user that runs teh script not able to install apk files? with or without sudo gives me another error 1 or 127

#!/bin/bash
apk add can-utils
#echo abc > abc.txt

return code: 1 

############

#!/bin/bash
sudo apk add can-utils
#echo abc > abc.txt

return code: 127

chmod a+x doesnt help either

Have you seen the Run on Startup.d add-on? I think that might be an easier way to do what you’re trying to do here. I haven’t used it myself but installing additional packages on HA startup seems like the kind of task it was made for.

1 Like

I figured it out , see here…

1 Like