10 Commits

Author SHA1 Message Date
Miguel Pires
29c9752d66 many: s/ioutil.WriteFile/os.WriteFile (#13217)
Replace ioutil.WriteFile with os.WriteFile since the former has been
deprecated since go1.16 and simply calls the latter.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-09-26 11:38:46 +01:00
Maciej Borzecki
204e43d75a kernel: match with gadget code and allow dashes in asset name, update validation
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-10 10:46:23 +01:00
Michael Vogt
0996eec820 kernel: remove "edition" from kernel.yaml and add "update"
This commit changes the supported yaml for the kernel snap. For
the raspberry pi DTB use case the kernel assets are tightly
coupled with the kernel. So the edition would have to be bumped
everytime the kernel is build. So the edition does not make much
sense in this context. Hence a new "update" field that is boolean
for now but we may expand it later into a map. This map would
allow to specify what content items should get updated and which
should not get updated.
2020-08-28 07:57:58 +02:00
Michael Vogt
a0f21fa8fc Merge remote-tracking branch 'upstream/master' into kernel-validate 2020-08-20 13:11:12 +02:00
Michael Vogt
f3a63d5ef7 kernel: fix typo (thanks to Ian) 2020-08-20 07:22:42 +02:00
Michael Vogt
681bd6aed9 kernel: add basic asset name validation (alphanumeric only for now) 2020-08-14 17:41:19 +02:00
Michael Vogt
d99e0922e6 kernel: add kernel.Validate()
This commit adds validation of the kernel.yaml and if the assets
are actually available.
2020-08-14 16:59:43 +02:00
Michael Vogt
396e18d27c kernel: fix gofmt -s 2020-08-14 15:43:36 +02:00
Michael Vogt
cfe8301d82 kernel: fix "go fmt -s" issue 2020-08-13 13:09:02 +02:00
Michael Vogt
23715d465a gadget,kernel: add new "kernel" and "gadget/edition" packages
This commit moves the kernel.yaml parsing into the kernel package
and extracts the gadget:editionNumber" helper into it's own
gadget/editon packages so that it can be shared between the
kernel and the gadget packages. Because meta/kernel.yaml is
optional it is not an error if it is missing.

Extra tests are also added.
2020-08-13 12:47:27 +02:00