Skip to content

Commit

Permalink
Added untar command to extract root filesystem tarball uploaded by rs…
Browse files Browse the repository at this point in the history
…ync-nfsroot
  • Loading branch information
skoudmar committed Apr 27, 2022
1 parent 56effa4 commit e269127
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/novaboot-shell
Original file line number Diff line number Diff line change
Expand Up @@ -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;;
Expand Down

0 comments on commit e269127

Please sign in to comment.