Hi people! I am trying to pack a new Snap with bellow yaml:
apps:
forwarder:
command: ./forwarder/lora_pkt_fwd/lora_pkt_fwd
daemon: simple
restart-condition: always
plugs: [home,network,network-bind,spi]
hooks:
configure:
plugs: [home,network,network-bind]
parts:
driver:
source: https://github.com/Lora-net/lora_gateway.git
plugin: make
build-packages:
- build-essential
override-build: |
make all
cp -rf $SNAPCRAFT_PART_INSTALL/../build $SNAPCRAFT_PRIME/driver
forwarder:
source: https://github.com/Lora-net/packet_forwarder.git
plugin: make
after: [driver]
build-packages:
- build-essential
override-build: |
export LGW_PATH="$SNAPCRAFT_PART_INSTALL/../../driver/build/libloragw"
make all
cp -rf $SNAPCRAFT_PART_INSTALL/../build $SNAPCRAFT_PRIME/forwarder
My problem: the hook “configure” not works. I put it in “snap/hooks/configure” (and yaml in root), with a+x permissions and bellow content:
#!/bin/sh -e
id="$(snapctl get id)"
echo "Starting configuration..."
echo $id >> $SNAP_DATA/id
cd $SNAP/forwarder/lora_pkt_fwd
pwd
./update_gwid.sh local_conf.json
echo "Done!"
So, after install it, I call:
sudo snap set bigboxx-lora id="aaaa"
But not work. Nothing is printed and file “/snap/[snap name]/current/id” is not created.
Please, I am trying for two days. Anybody can help me? I am packing Snap in MacOS and installing in Ubuntu Server 18.04 (over VirtualBox).