Problem 1:
Hi, I try to create multiple architectures snap app on AMD64.
the followed is the main part of snapcraft.yaml(please ignore the plugs).
name: test-app
version: '1.2.3'
architectures:
- build-on: amd64
run-on: arm64
summary: test
description: |
no desc
grade: stable
confinement: strict
plugs:
run-app:
interface: system-files
write:
[/run/lvm,/run/lock/lvm,/dev]
read:
[/dev]
parts:
test-app:
plugin: dump
integration:
plugin: nil
stage-packages:
- on amd64 to arm64: [snap,dmsetup,lvm2,dmidecode,libdevmapper1.02.1,dosfstools]
apps:
start:
plugs:
[home,steam-support,hardware-observe,mount-observe,desktop,dm-crypt,block-devices,network-bind,run-lvm,network,system-observe]
command: bin/run.sh start $SNAP_DATA
stop:
plugs:
[system-observe]
command: bin/run.sh stop $SNAP_DATA
restart:
plugs:
[home,steam-support,hardware-observe,mount-observe,desktop,dm-crypt,block-devices,network-bind,run-lvm,network,system-observe]
command: bin/run.sh restart $SNAP_DATA
...
The snap app was generated and install ok. But when I try to test on arm64. It always fails
root@arm64-ubuntu-test:~# snap run --shell test-app.start
root@arm64-ubuntu-test:/root# fdisk
bash: /sbin/fdisk: Permission denied
The snappy-debug shows
= AppArmor =
Time: Jan 7 01:50:07
Log: apparmor="DENIED" operation="exec" profile="snap.test-app.start" name="/sbin/fdisk" pid=5075 comm="sh" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
File: /sbin/fdisk (exec)
Suggestions:
* adjust snap to ship 'fdisk'
* adjust program to use relative paths if the snap already ships 'fdisk'
and run dmidecode, it shows
root@arm64-ubuntu-test:/root# dmidecode -s system-serial-number
dmidecode: command not found
Who knows why? Thanks!
=======================================================
Problem 2:
How to ship packages in one snap for all architectures?
Thank you