Skip to content

Commit 64d19f7

Browse files
committed
meta-lxatac-software: lxatac-core-bundle-base: accept empty migrate.d dir
Prior to this patch the part of the hook script that handles migration of user-specified files will fail if the `/etc/rauc/migrate.d` directory exists but does not contain any `*.conf` files. Make sure that the glob expands to nothing instead of the string `/etc/rauc/migrate.d/*.conf` in this case by setting the `nullglob` option. This also removes the need for the ineffective check for the existance of the `/etc/rauc/migrate.d` directory. This also affects the other for loop with a glob, which searches for available certificate files. The behaviour of this loop also matches the expected behaviour better with the `nullglob` option enabled. Signed-off-by: Leonard Göhrs <[email protected]>
1 parent a8f4390 commit 64d19f7

File tree

1 file changed

+1
-4
lines changed
  • meta-lxatac-software/recipes-core/bundles/files

1 file changed

+1
-4
lines changed

meta-lxatac-software/recipes-core/bundles/files/hook.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
set -exu -o pipefail
4+
shopt -s nullglob
45

56
EXTRA_MIGRATE_LISTS_DIR="/etc/rauc/migrate.d"
67
CERT_AVAILABLE_DIR="${RAUC_SLOT_MOUNT_POINT:?}/etc/rauc/certificates-available"
@@ -47,10 +48,6 @@ function migrate () {
4748
}
4849

4950
function process_migrate_lists () {
50-
if [[ ! -d "${EXTRA_MIGRATE_LISTS_DIR}" ]]; then
51-
return
52-
fi
53-
5451
for migrate_list in "${EXTRA_MIGRATE_LISTS_DIR}"/*.conf; do
5552
# Migrate files in the list line by line
5653
while read -r line; do

0 commit comments

Comments
 (0)