I’m trying to build an ubuntu core system image for pi4 arm64, using the ubuntu-image tool.
I already have this working for pi3 arm32.
However, when trying to build the pi4 image, I get this error:
$ ./buildimage_pi4.sh
Fetching snapd
Fetching pi-kernel
Fetching core20
Fetching pi
Fetching core18
Fetching capturegrid4
panic: runtime error: slice bounds out of range [recovered]
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
main.main.func1()
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/cmd/snap/main.go:477 +0x84
panic(0xaaaad27c9280, 0xaaaad2b934b0)
/usr/lib/go-1.10/src/runtime/panic.go:502 +0x1e8
github.com/snapcore/snapd/bootloader/ubootenv.OpenWithFlags(0x4420112900, 0x32, 0x1, 0x0, 0x0, 0x0)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/bootloader/ubootenv/env.go:105 +0x3b4
github.com/snapcore/snapd/bootloader.(*uboot).SetBootVars(0x4420496020, 0x442034a1b0, 0x44200384b0, 0x49)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/bootloader/uboot.go:98 +0x3c
github.com/snapcore/snapd/boot.makeBootable16(0x44202de700, 0x4420149440, 0x1d, 0x44206318c8, 0x0, 0x44200dc0f0)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/boot/makebootable.go:136 +0x538
github.com/snapcore/snapd/boot.MakeBootable(0x44202de700, 0x4420149440, 0x1d, 0x44206318c8, 0x0, 0x0)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/boot/makebootable.go:57 +0xf8
github.com/snapcore/snapd/image.setupSeed(0x4420372060, 0x44202de700, 0x442035bc70, 0x1, 0x44201d1968)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/image/image.go:423 +0x1334
github.com/snapcore/snapd/image.Prepare(0x442035bc70, 0xaaaad2bf6888, 0x0)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/image/image.go:104 +0x2e8
main.(*cmdPrepareImage).Execute(0x442031ae00, 0x4420360a50, 0x0, 0x3, 0x442031ae00, 0x1)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/cmd/snap/cmd_prepare_image.go:116 +0x408
github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags.(*Parser).ParseArgs(0x44202fd180, 0x44200c0050, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags/parser.go:333 +0x678
github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags.(*Parser).Parse(0x44202fd180, 0x44202fd180, 0xaaaad2bd99a0, 0xffff9dcf66c8, 0x0, 0x442010f8f8)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags/parser.go:190 +0x70
main.run(0x4400000000, 0xaaaad28972c0)
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/cmd/snap/main.go:515 +0x3c
main.main()
/build/snapd/parts/snapd-deb/build/_build/src/github.com/snapcore/snapd/cmd/snap/main.go:482 +0x2a0
COMMAND FAILED: snap prepare-image /home/francis/code/repo/smartshooter4/smartshooter/installer/snap/image/capturegrid4-pi4-arm64.model /tmp/tmpv5yai8et/unpack
Here is the model I’m using for the image:
{
"type": "model",
"authority-id": "...",
"brand-id": "...",
"series": "16",
"model": "capturegrid4-pi4-arm64",
"architecture": "arm64",
"base": "core20",
"gadget": "pi=20",
"kernel": "pi-kernel=20",
"timestamp": "2020-05-05T10:20:00+00:00",
"required-snaps": ["core18", "capturegrid4"]
}
I’m not really sure where to begin trying to fix this.
Can anyone give me some guidance?