From e2691276b462b62a625adc7235fad4f36f581840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0koudlil?= Date: Wed, 27 Apr 2022 11:16:15 +0200 Subject: [PATCH] Added untar command to extract root filesystem tarball uploaded by rsync-nfsroot --- server/novaboot-shell | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/novaboot-shell b/server/novaboot-shell index 7666917..ec34696 100755 --- a/server/novaboot-shell +++ b/server/novaboot-shell @@ -199,6 +199,18 @@ run_subcommand() { cd "$HOME/nfsroot/${NB_USER:?}" shift exec rsync "$@";; + "untar "*) + # untar command is used to extract root filesystem tarball. + mkdir -p "$HOME/nfsroot/${NB_USER:?}" + cd "$HOME/nfsroot/${NB_USER:?}" + if ! [ $# -eq 2 -a "$2" -ef $(basename "$2") ]; then + die "Unexpected untar invocation: $*" + fi + # remove the old contents + rm -rf root + mkdir root + + exec tar -xvf "$2" -C root;; "on") power on exit;;