chirpstack / chirpstack-gateway-os

OpenWrt based gateway images including ChirpStack components.
https://www.chirpstack.io
130 stars 56 forks source link

How can I generate a image file ? #7

Closed ty4tw closed 5 years ago

ty4tw commented 5 years ago

Hi brocaar,

This is my first time to build lora-gateway-os. I could finish to compile all modules but can not create a image file. Error messages are follows:

yocto@f9b041c46386:/build$ /lora-gateway-os/scripts/loraserver-prepare-deploy 
mkdir: cannot create directory ‘/lora-gateway-os/deploy’: Permission denied
find: ‘/build/tmp/raspberrypi/raspberrypi3-glibc/deploy/2.0.0test2/images’: No such file or directory
find: ‘/build/tmp/raspberrypi/raspberrypi3-glibc/deploy/2.0.0test2/images’: No such file or directory
cp: cannot stat '/build/tmp/raspberrypi/raspberrypi3-glibc/deploy/2.0.0test2/licenses': No such file or directory
mkdir: cannot create directory ‘/lora-gateway-os/deploy’: Permission denied
find: ‘/build/tmp/wifx/lorix-one-sd-glibc/deploy/2.0.0test2/images’: No such file or directory
find: ‘/build/tmp/wifx/lorix-one-sd-glibc/deploy/2.0.0test2/images’: No such file or directory
cp: cannot stat '/build/tmp/wifx/lorix-one-sd-glibc/deploy/2.0.0test2/licenses': No such file or directory
mkdir: cannot create directory ‘/lora-gateway-os/deploy’: Permission denied
find: ‘/build/tmp/wifx/lorix-one-512-sd-glibc/deploy/2.0.0test2/images’: No such file or directory
find: ‘/build/tmp/wifx/lorix-one-512-sd-glibc/deploy/2.0.0test2/images’: No such file or directory
cp: cannot stat '/build/tmp/wifx/lorix-one-512-sd-glibc/deploy/2.0.0test2/licenses': No such file or directory

1) Permission denied error : Owner of the /lora-gateway-os is 1000 but yocto is 999. drwxrwxr-x 8 1000 1000 4096 Apr 16 01:54 lora-gateway-os

2) find error : 2.0.0test2 should be 2.0.0test3

So, I tried to change the script but yoct can not change it because permission is denied. Are there any suggestion.

ty4tw commented 5 years ago

Hi,

I made it. 1000 was my user's no. So, I changed mod of lora-gatewy-os directory to 777. And changed loraserver-prepare-deploy script as follows:

#!/bin/bash

do_deploy() {
    SRC_DIR=/build/tmp/$2/$3-glibc/deploy/$1
    DEPLOY_DIR=/lora-gateway-os/deploy/$2/$3/$1

    mkdir -p $DEPLOY_DIR

    find $SRC_DIR/images -type f -name "*.sdimg.gz" -exec cp {} $DEPLOY_DIR \;
    find $SRC_DIR/images -type f -name "*.mender" -exec cp {} $DEPLOY_DIR \;
    cp -R $SRC_DIR/licenses $DEPLOY_DIR
}

VERSION="2.0.0test3"

do_deploy $VERSION "raspberrypi" "raspberrypi3"
do_deploy $VERSION "wifx" "lorix-one-sd"
do_deploy $VERSION "wifx" "lorix-one-512-sd"