Skip to content

Commit

Permalink
add kas example
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-roos committed Sep 13, 2023
1 parent 86b5504 commit 469b4ae
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/build-image/ubuntu_22_04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN unzip /tmp/awscliv2.zip -d /tmp
RUN /tmp/aws/install

# install kas tool
RUN pip3 install PyYAML==5.3.1 && pip3 install kas==3.0.2
RUN pip3 install PyYAML==5.3.1 && pip3 install kas==4.0.0

RUN locale-gen en_US.UTF-8

Expand Down
2 changes: 2 additions & 0 deletions lib/constructs/source-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export enum ProjectKind {
MetaAwsDemo = 'meta-aws-demo',
/** Build an EC2 AMI */
PokyAmi = 'poky-ami',
/** Build an kas based poky */
PokyKas = 'poky-kas',
}

export interface SourceRepoProps extends cdk.StackProps {
Expand Down
35 changes: 35 additions & 0 deletions source-repo/poky-kas/build.buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 0.2
run-as: yoctouser

env:
shell: bash

phases:
pre_build:
run-as: root
commands:
- chown -R yoctouser /sstate-cache
- chown -R yoctouser /downloads
- chown yoctouser /build-output
- chmod 755 /sstate-cache
- chmod 755 /downloads
- chmod 755 /build-output
build:
commands:
- echo Build started on `date`
- export KAS_WORK_DIR=$TMP_DIR
- kas build kas.yml

post_build:
commands:
- echo Build completed on `date`
- export BUILD_OUTPUT="$(uuidgen -t).tar"
- echo $TMP_DIR
- ls -la $TMP_DIR
- echo $KAS_WORK_DIR
- ls -la $KAS_WORK_DIR

artifacts:
discard-paths: true
files:
- $TMP_DIR/build/tmp/deploy/images/qemux86-64/aws-biga-image-qemux86-64*
34 changes: 34 additions & 0 deletions source-repo/poky-kas/kas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
header:
version: 14

target: aws-biga-image
machine: qemux86-64


local_conf_header:
qemu-config: |
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
IMAGE_INSTALL:append = " greengrass-bin"
repos:
poky:
url: https://git.yoctoproject.org/poky.git
commit: c4e08719a782fd4119eaf643907b80cebf57f88f
layers:
meta:
meta-poky:
meta-aws-demos:
url: https://github.com/aws4embeddedlinux/meta-aws-demos
commit: 2f004d5f7ad576ca6eec3cb2bdd710d352b41823
layers:
meta-aws-demos:
meta-openembedded:
url: https://git.openembedded.org/meta-openembedded
commit: a8055484f2829e8dfd03d5c8520b2c611aa7ebd2
layers:
meta-oe:
meta-networking:
meta-python:
meta-aws:
url: https://github.com/aws4embeddedlinux/meta-aws
commit: 434e85de57c3be735e63754cf75037c3ac249d2b

0 comments on commit 469b4ae

Please sign in to comment.