With custom kernel in AMD64 architecture, snap command not found

Hi,

I am testing ubuntu core 18 in an x86VM by simply re- complying the standard amd64 gadget and kernel18 gadget.

When I boot the image on x86 box via VM, the image prints the below error and allows to “press enter to configure”
/usr/share/subiquity/console-conf-wrapper: line 13: snap: command not found

"
Press enter to configure.
Mounting Make the snapd snap tooling available for the system…
[ OK ] Mounted Make the snapd snap tooling available for the system.
Starting Wait until snapd is fully seeded…
Starting Automatically repair incor…ner/permissions on core devices…
[ OK ] Started Automatically repair incorr…owner/permissions on core devices.
[ OK ] Started Timer to automatically fetch and run repair assertions.
Starting Socket activation for snappy daemon.
[ OK ] Listening on Socket activation for snappy daemon.
Starting Snappy daemon…
[ OK ] Started Snappy daemon.
[ OK ] Stopped Snappy daemon.
Starting Snappy daemon…
[ OK ] Stopped Getty on tty1.
[ OK ] Started Getty on tty1.
[ OK ] Stopped Serial Getty on ttyS0.
[ OK ] Started Serial Getty on ttyS0.
[ OK ] Closed /tmp/tmp.IcVlRJ85bQ/usr/lib/snapd/snapd.
[ OK ] Started Snappy daemon.
2019-08-01T10:07:03Z INFO Waiting for restart…
Mount snap “core18” (1066) | Mounting Mount unit for core18, revision 1066…
Mount snap “core18” (1066) -[ OK ] Mounted Mount unit for core18, revision 1066.
Mount snap “core18” (1066) \ Unmounting Make the snapd snap tooling available for the system…
[ OK ] Unmounted Make the snapd snap tooling available for the system.
[ OK ] Started Start the snapd services from the snapd snap.
[ OK ] Started Ubuntu Core Firstboot Configuration ttyS0.
[ OK ] Started Ubuntu Core Firstboot Configuration tty1.

/usr/share/subiquity/console-conf-wrapper: line 13: snap: command not found
Press enter to configure.

Thereafter it is constantly printing the error “snap: command not found” on every attempt to network login and doesn’t allow to connect

The Seed.manifest of the image is

pc-kernel x1
core18 1066
9004gadget x1
snapd 3646

The gadget snapcraft.yaml is

type: gadget
base: core18
summary: PC gadget for generic devices
description: |
    This gadget enables generic pc devices to work with Ubuntu Core
grade: stable
confinement: strict
icon: icon.png

parts:
  grub-prepare:
    plugin: nil
    stage-packages:
      - grub-efi-amd64-signed
      - grub-pc-bin
      - shim-signed
    prime: [ -* ]
  grub:
    source: .
    build-packages:
      - grub-common
    plugin: make
    after: [grub-prepare]

Kernel Snapcraft.yaml is

version: git
version-script: |
    . debian/debian.env
    dpkg-parsechangelog -l $DEBIAN/changelog -S version
summary: The Ubuntu generic Linux kernel
description: This aruba version of Ubuntu generic Linux kernel
grade: stable
confinement: strict
type: kernel
base: core18

parts:
  kernel:
    plugin: kernel
    source: .
    source-type: git
    kconfigflavour: generic
    kconfigs:
      - CONFIG_DEBUG_INFO=n
    override-build: |
      cp debian/scripts/retpoline-extract-one \
        $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
      snapcraftctl build
    kernel-with-firmware: false
  firmware:
    plugin: nil
    stage-packages:
      - linux-firmware
    organize:
      lib/firmware: firmware
    prime:
      - -usr
      - -lib
    build-packages:
      - cpio
      - libssl-dev
                     

Build Infra
ubuntu 16.04 

Thanks and regards,
Muthiah

it would help if you could put three backticks around the pasted code so it does not lose the formatting

so it will look
   like 
      this 

what kernel tree did you base on, that snapcraft.yaml is pretty ubuntu specific (using the “generic” defconfig) ?

Yes Ogra will do next time.

Kernel is based out Ubuntu-4.15.0-55.60 head. No changes to the source.

I am testing just local complication of standard gadget and kernel snaps and building an image and testing in VM

VM command
sudo qemu-system-x86_64
-m 2048
-drive file=pc.img,format=raw,if=none,id=drive-sata0-0-0
-device ide-hd,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1
-device virtio-net-pci,netdev=net00
-netdev type=user,id=net00
-nographic

version: git
version-script: |
    . debian/debian.env
    dpkg-parsechangelog -l $DEBIAN/changelog -S version
summary: The Ubuntu generic Linux kernel
description: This aruba version of Ubuntu generic Linux kernel
grade: stable
confinement: strict
type: kernel
base: core18

parts:
  kernel:
    plugin: kernel
    source: .
    source-type: git
    kconfigflavour: generic
    kconfigs:
      - CONFIG_DEBUG_INFO=n
    override-build: |
      cp debian/scripts/retpoline-extract-one \
        $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
      snapcraftctl build
    kernel-with-firmware: false
  firmware:
    plugin: nil
    stage-packages:
      - linux-firmware
    organize:
      lib/firmware: firmware
    prime:
      - -usr
      - -lib
    build-packages:
      - cpio
      - libssl-dev

you can just edit the existing posts, no need to re-post the stuff :wink:

Version details

$snapcraft --version
snapcraft, version 3.7

$ ubuntu-image --version
ubuntu-image 1.7+snap1

$ snap --version
snap 2.39.3
snapd 2.39.3
series 16
ubuntu 16.04
kernel 4.15.0-1037-gcp

do you still have the ubuntu-image command you used at hand ?

(and the model file too)

yes here you go

sudo UBUNTU_STORE_ID=<> UBUNTU_STORE_AUTH_DATA_FILENAME=store.auth ubuntu-image
snap --snap 9004gadget* --snap pc-kernel_*.snap -O 9004_m
9004.model

type: model
authority-id: <>
series: 16
brand-id: <>
model:
architecture: amd64
base: core18
gadget: 9004gadget
kernel: pc-kernel=18
store: <>
timestamp: 2019-08-01T10:01:12Z

aha, it might be related to the store …
(i’m trying to collect some info)

i think @wililupy might be able to help you (but he might not be up yet being in the US)

Ok thanks very much Ogra.

I assume the model: field is blank just for the paste here. Naturally it does need a value that will match your SV config.

Hi Muthiah,

I see that the system starts the console-conf for configuration of the device. Can you import your ssh key to the device and login via ssh?

I sent you via email a system-user assertion that you can try to seed a system-user to the device so that you can use that to login to the device locally. Please let me know if this works. If you can login to the device, please forward me the journalctl -xe and tail /var/log/syslog and we can see what is going on with snapd snap

Thanks,
Luke

image

I am still getting this error and from the subiquity logs I see the attached error message.
Any suggestion to solve this issue.

Perhaps @mwhudson can take a look at the console-conf back trace here?

Any other suggestion to look out for