From a206f05616265438a6510f711229156b7b419bcd Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Wed, 3 May 2023 06:05:56 +0200 Subject: [PATCH] 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 Signed-off-by: Jan Kiszka --- kas-container | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kas-container b/kas-container index c74caf7..aa446b7 100755 --- a/kas-container +++ b/kas-container @@ -283,12 +283,22 @@ while [ $# -gt 0 ]; do shift 1 break ;; - build|checkout|dump|for-all-repos|menu) + build|checkout|for-all-repos|menu) KAS_REPO_MOUNT_OPT_DEFAULT="ro" KAS_CMD=$1 shift 1 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 ;;