dom0-update: fix backup template name calculation
VM name is limited to 31 chars, not 32. Fixes QubesOS/qubes-issues#4829
This commit is contained in:
parent
72a3459119
commit
59ecf8eb83
@ -84,7 +84,7 @@ if [ "$YUM_ACTION" == "reinstall" ] || [ "$YUM_ACTION" == "upgrade" ] || [ "$YUM
|
|||||||
UPDATEVM_TEMPLATE=$(qvm-prefs -- "$UPDATEVM" template 2>/dev/null)
|
UPDATEVM_TEMPLATE=$(qvm-prefs -- "$UPDATEVM" template 2>/dev/null)
|
||||||
if [ X"$UPDATEVM_TEMPLATE" = X"$TEMPLATE" ]; then
|
if [ X"$UPDATEVM_TEMPLATE" = X"$TEMPLATE" ]; then
|
||||||
TEMPLATE_BACKUP="${TEMPLATE}-backup-$(date +%Y%m%d)-$(mktemp -u XXXX)"
|
TEMPLATE_BACKUP="${TEMPLATE}-backup-$(date +%Y%m%d)-$(mktemp -u XXXX)"
|
||||||
TEMPLATE_BACKUP=${TEMPLATE_BACKUP:0:32}
|
TEMPLATE_BACKUP=${TEMPLATE_BACKUP:0:31}
|
||||||
echo "Attempting to operate on template of UpdateVM... backing up $TEMPLATE to $TEMPLATE_BACKUP"
|
echo "Attempting to operate on template of UpdateVM... backing up $TEMPLATE to $TEMPLATE_BACKUP"
|
||||||
if ! qvm-clone -- "$TEMPLATE" "$TEMPLATE_BACKUP"; then
|
if ! qvm-clone -- "$TEMPLATE" "$TEMPLATE_BACKUP"; then
|
||||||
echo "ERROR: Unable to make backup of UpdateVM template!" >&2
|
echo "ERROR: Unable to make backup of UpdateVM template!" >&2
|
||||||
|
Loading…
Reference in New Issue
Block a user