Comment 7 for bug 1860231

Revision history for this message
Michael Vogt (mvo) wrote :

I was able to reproduce this with the attached snapd which is essentialls PR#7999 plus the following patch:
"""
diff --git a/cmd/snap/cmd_auto_import.go b/cmd/snap/cmd_auto_import.go
index 7408371e11..f6b8f1d0d0 100644
--- a/cmd/snap/cmd_auto_import.go
+++ b/cmd/snap/cmd_auto_import.go
@@ -38,7 +38,6 @@ import (
        "github.com/snapcore/snapd/i18n"
        "github.com/snapcore/snapd/logger"
        "github.com/snapcore/snapd/osutil"
- "github.com/snapcore/snapd/release"
 )

 const autoImportsName = "auto-import.assert"
@@ -264,11 +263,6 @@ func (x *cmdAutoImport) Execute(args []string) error {
                return ErrExtraArgs
        }

- if release.OnClassic && !x.ForceClassic {
- fmt.Fprintf(Stderr, "auto-import is disabled on classic\n")
- return nil
- }
-
        for _, path := range x.Mount {
                // udev adds new /dev/loopX devices on the fly when a
                // loop mount happens and there is no loop device left.
"""

and then running the following spread test as shell code:
"""
    echo "Setup the image as a block device"
    # without -P this test will not work, then /dev/loop1p? will be missing
    losetup -fP fake.img
    losetup -a |grep fake.img|cut -f1 -d: > loop.txt
    LOOP="$(cat loop.txt)"

    echo "Create an empty partition header"
    echo "label: gpt" | sfdisk "$LOOP"

    echo "Get the UC20 gadget"
    snap download --channel=20/edge pc

    unsquashfs -d gadget-dir pc_*.snap
    LOOP="$(cat loop.txt)"
    echo "Run the snap-bootstrap tool"
    /usr/lib/snapd/snap-bootstrap create-partitions --encrypt --mount --key-file keyfile ./gadget-dir "$LOOP"
"""