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"
)
- 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)"
I was able to reproduce this with the attached snapd which is essentialls PR#7999 plus the following patch: cmd_auto_ import. go b/cmd/snap/ cmd_auto_ import. go .f6b8f1d0d0 100644 cmd_auto_ import. go cmd_auto_ import. go
"github. com/snapcore/ snapd/i18n"
"github. com/snapcore/ snapd/logger"
"github. com/snapcore/ snapd/osutil" com/snapcore/ snapd/release"
"""
diff --git a/cmd/snap/
index 7408371e11.
--- a/cmd/snap/
+++ b/cmd/snap/
@@ -38,7 +38,6 @@ import (
- "github.
)
const autoImportsName = "auto-import. assert"
return ErrExtraArgs
@@ -264,11 +263,6 @@ func (x *cmdAutoImport) Execute(args []string) error {
}
- 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 lib/snapd/ snap-bootstrap create-partitions --encrypt --mount --key-file keyfile ./gadget-dir "$LOOP"
LOOP="$(cat loop.txt)"
echo "Run the snap-bootstrap tool"
/usr/
"""