Skip to content

Commit

Permalink
runme.sh: check for content of /in
Browse files Browse the repository at this point in the history
The user of EVE container can mount their own content into /in to change
/config of the resulting image. This change makes it possible to mount
single files instead of directories. If anything is present in /in - it
will be copied to /config.

`mountpoint -q /in` fails however if the mount path doesn't match "/in"
exactly. Another option would be to use `mount | grep "/in"`, but imo
`ls -A /in`` is simpler and cleaner, since we don't expect any other
files to be present there except the mounted ones.

Signed-off-by: Paul Gaiduk <[email protected]>
  • Loading branch information
europaul authored and eriknordmark committed May 1, 2024
1 parent ff3bea4 commit a6598b8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/eve/runme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ This allows you to overwrite files in the EVE-OS config partition with
your own local modifications of those files (must have the same name).
Example:
docker run -v $HOME/eve-overrides:/in --rm lfedge/eve:latest installer_raw > installer.raw
docker run -v /path/to/eve/conf:/in --rm lfedge/eve:latest installer_raw > installer.raw
or
docker run -v /path/to/eve/conf/server:/in/server -v /path/to/eve/pkg/pillar/conf/root-certificate.pem:/in/root-certificate.pem --rm lfedge/eve:latest installer_raw > installer.raw
Where your local "eve-overrides" directory contains one file "server"
with one text string "some.eve-controller-url.com"
Where your local "conf" directory contains files like server or root-certificate.pem that
you want to use instead of the default ones in the image.
You can also mount (multiple) single files.
-v <full path to new local folder>:/out
Expand Down Expand Up @@ -246,8 +249,8 @@ ACTION="do_$1"
[ "$(type -t "$ACTION")" = "$ACTION" ] || bail "Error: unsupported command '$1' - use 'help' command for more information."
shift

# If /in was provided, for now we assume it was to override configs
if mountpoint -q /in; then
# If /in has content, we assume it was put there to override configs
if [ "$(ls -A /in)" ]; then
mcopy -o -i /bits/config.img -s /in/* ::/
fi

Expand Down

0 comments on commit a6598b8

Please sign in to comment.