New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qubes-dom0-update --action={upgrade,...} qubes-template-* fails #3355

Closed
jpouellet opened this Issue Nov 29, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@jpouellet
Contributor

jpouellet commented Nov 29, 2017

Qubes OS version:

R4-rc3

Affected TemplateVMs:

All ;)


Steps to reproduce the behavior:

[user@dom0 ~]$ sudo qubes-dom0-update --action=upgrade qubes-template-fedora-26-minimal
WARNING: Replacing a template will erase all files in template's /home and /rw !
Template VM halted
usage: qvm-prefs [-h] [--verbose] [--quiet] [--help-properties] [--get]
                 [--set] [--default]
                 VMNAME [PROPERTY] [VALUE]
qvm-prefs: error: no such property: 'root_img'

Expected behavior:

The template gets upgraded, discarding any user modifications.

Actual behavior:

qubes-dom0-update first tries to make a backup of the template images, which is an implicit dependency on the old storage subsystem where images were files. This fails.

General notes:

From qubes-dom0-update:

# Prevent implicit update of template - this would override user changes -
# but do allow explicit template upgrade, downgrade, reinstall
if [ "$YUM_ACTION" == "reinstall" ] || [ "$YUM_ACTION" == "upgrade" ] || [ "$YUM_ACTION" == "
upgrade-to" ] \
|| [ "$YUM_ACTION" == "downgrade" ] && [[ "$PKGS" == *"qubes-template-"* ]]; then
    TEMPLATE_EXCLUDE_OPTS=""
    echo "WARNING: Replacing a template will erase all files in template's /home and /rw !"

    ONEPKG=`cut -f 1 -d ' ' <<<$PKGS`
    if [[ "$ONEPKG" == "qubes-template-"* ]] && [[ "$ONEPKG" == "${PKGS#\ }" ]]; then # test "$PKGS" minus space
    # Prepare to backup template root.img in case reinstall doesn't complete.
        ONEPKG=`sed -r 's/-[0-9]+(\.[0-9-]+)+(\.noarch)*$//' <<<$ONEPKG` # Remove version suffix
        TEMPLATE=${ONEPKG#qubes-template-} # Remove prefix
        if qvm-shutdown --wait $TEMPLATE ; then
            echo "Template VM halted"
        fi
        if ! TEMPLATE_NETVM=`qvm-prefs --force-root $TEMPLATE netvm` \
        || ! BAK_TEMPLATE_ROOT=`qvm-prefs --force-root $TEMPLATE root_img` \
        || ! BAK_TEMPLATE_PRIVATE=`qvm-prefs --force-root $TEMPLATE private_img` ; then
            exit 1
        fi
        if [[ "$TEMPLATE_NETVM" == *"(default)" ]] ; then
            TEMPLATE_NETVM="default"
        fi
    else
        echo "ERROR: Specify only one package to reinstall template"
        exit 1
    fi

else
    TEMPLATE_EXCLUDE_OPTS="--exclude=`rpm -qa --qf '%{NAME},' qubes-template-\*`"
fi
@jpouellet

This comment has been minimized.

Show comment
Hide comment
@jpouellet

jpouellet Dec 7, 2017

Contributor

Fixed in QubesOS/qubes-core-admin-linux#33

Forgot to add Fixes: ... to commit msg.

Contributor

jpouellet commented Dec 7, 2017

Fixed in QubesOS/qubes-core-admin-linux#33

Forgot to add Fixes: ... to commit msg.

@jpouellet jpouellet closed this Dec 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment