kas-container: mount repos rw when creating lockfile

This patch makes the creation and update of a lockfile more convenient.
When running the dump plugin in inplace mode, a lockfile is created next
to the first file on the kas cmdline. By that, the repo directory also
needs to be mounted rw. Otherwise the kas inside the container cannot
create the file.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Felix Moessbauer 2023-05-03 06:05:56 +02:00 committed by Jan Kiszka
parent 471f5e58d2
commit a206f05616

View File

@ -283,12 +283,22 @@ while [ $# -gt 0 ]; do
shift 1 shift 1
break break
;; ;;
build|checkout|dump|for-all-repos|menu) build|checkout|for-all-repos|menu)
KAS_REPO_MOUNT_OPT_DEFAULT="ro" KAS_REPO_MOUNT_OPT_DEFAULT="ro"
KAS_CMD=$1 KAS_CMD=$1
shift 1 shift 1
break break
;; ;;
dump)
if printf '%s\0' "$@" | grep -xqz -- '--inplace\|-i'; then
KAS_REPO_MOUNT_OPT_DEFAULT="rw"
else
KAS_REPO_MOUNT_OPT_DEFAULT="ro"
fi
KAS_CMD=$1
shift 1
break
;;
*) *)
usage usage
;; ;;