bootctl: add --install-source=auto|image|host

When using --root=/--image= the binaries to install/update will be
picked from the directory/image. Add an option to let the caller
choose.
By default (auto) the image is tried first, and if nothing is found
then the host. The other options allow to strictly try the image
or host and ignore the other.
This commit is contained in:
Luca Boccassi
2022-07-08 16:58:51 +01:00
parent 80a2381d5c
commit 02d06ba180
4 changed files with 53 additions and 6 deletions
+4 -1
View File
@@ -32,7 +32,7 @@ _bootctl() {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-h --help -p --print-esp-path -x --print-boot-path --version --no-variables --no-pager --graceful'
[ARG]='--esp-path --boot-path --make-machine-id-directory --root --image'
[ARG]='--esp-path --boot-path --make-machine-id-directory --root --image --install-source'
)
if __contains_word "$prev" ${OPTS[ARG]}; then
@@ -52,6 +52,9 @@ _bootctl() {
compopt -o nospace
comps=$( compgen -A file -- "$cur" )
;;
--install-source)
comps="image host auto"
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0