├── .github ├── dependabot.yml └── workflows │ ├── build-gg-artifacts │ ├── ec2 │ │ └── create-ec2-ami.sh │ ├── readme-greengrass-lite-template.txt │ ├── readme-greengrass-template.txt │ └── readme-license.txt │ ├── build-gg-lite.yml │ ├── build-gg.yml │ └── ff-merge.yml ├── .gitignore ├── .gitmodules ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── init-build-env ├── layers └── bsp │ └── meta-rauc-aws-ec2 │ ├── COPYING.MIT │ ├── README.rst │ ├── conf │ └── layer.conf │ ├── recipes-bsp │ ├── boot-image │ │ └── boot-image.bb │ └── grub │ │ ├── files │ │ ├── grub.cfg.in │ │ └── grubenv │ │ └── rauc-qemu-grubconf.bb │ ├── recipes-core │ ├── bundles │ │ └── ec2-demo-bundle.bb │ ├── images │ │ └── core-image-minimal.bbappend │ └── rauc │ │ ├── files │ │ ├── ca.cert.pem │ │ ├── rauc-grow-data-partition.service │ │ └── system.conf │ │ ├── rauc-conf.bbappend │ │ ├── rauc-conf_rauc.inc │ │ └── rauc_%.bbappend │ ├── recipes-extended │ └── cloud-utils │ │ └── cloud-utils_0.33.bb │ └── wic │ └── ec2_partition.wks.in └── meta-aws-demos ├── conf ├── devices │ ├── aws-ec2-arm64 │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── aws-ec2-x86-64 │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── imx8m │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── qemuarm │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── qemuarm64 │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── qemux86-64 │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── raspberrypi-64 │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── raspberrypi0-wifi │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── raspberrypi2 │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── rockchip-rv1106 │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── stm32mp13-disco │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ ├── ti-am572x-idk │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf │ └── xilinx-zcu104-zynqmp │ │ ├── README.md │ │ ├── config.conf │ │ └── layers.conf ├── layer.conf └── templates │ └── default │ ├── bblayers.conf.sample │ └── local.conf.sample ├── recipes-core └── images │ ├── aws-demo-image │ ├── README.md │ ├── aws-demo-image.bb │ └── layers.conf │ ├── aws-iot-device-client-demo-image │ ├── README.md │ ├── aws-iot-device-client-demo-image.bb │ └── layers.conf │ ├── aws-iot-fleetwise-test-image-agl │ ├── README.md │ ├── aws-iot-fleetwise-test-image-agl.bb │ ├── config.conf │ └── layers.conf │ ├── aws-iot-fleetwise-test-image │ ├── README.md │ ├── aws-iot-fleetwise-test-image.bb │ ├── config.conf │ └── layers.conf │ ├── aws-iot-greengrass-demo-image │ ├── README.md │ ├── aws-iot-greengrass-demo-bundle.bb │ ├── aws-iot-greengrass-demo-image.bb │ ├── config.conf │ ├── files │ │ ├── development-1.cert.pem │ │ └── development-1.key.pem │ ├── layers.conf │ ├── new_gg_core_device.sh │ └── wic │ │ └── sdimage-aws-iot-greengrass-demo_partition.wks.in │ ├── aws-iot-greengrass-demo-simple-image │ ├── README.md │ ├── aws-iot-greengrass-demo-simple-image.bb │ ├── config.conf │ └── layers.conf │ ├── aws-iot-greengrass-lite-container-demo-image │ ├── README.md │ ├── aws-iot-greengrass-lite-container-demo-image.bb │ ├── config.conf │ ├── container-base.bb │ ├── container-systemd-base.inc │ └── layers.conf │ ├── aws-iot-greengrass-lite-demo-ec2-image │ ├── README.md │ ├── aws-iot-greengrass-lite-demo-ec2-bundle.bb │ ├── aws-iot-greengrass-lite-demo-ec2-image.bb │ ├── config.conf │ ├── files │ │ ├── development-1.cert.pem │ │ └── development-1.key.pem │ └── layers.conf │ ├── aws-iot-greengrass-lite-demo-image │ ├── README.md │ ├── aws-iot-greengrass-lite-demo-bundle.bb │ ├── aws-iot-greengrass-lite-demo-image.bb │ ├── config.conf │ ├── files │ │ ├── development-1.cert.pem │ │ └── development-1.key.pem │ ├── layers.conf │ └── wic │ │ └── sdimage-aws-iot-greengrass-lite-demo_partition.wks.in │ ├── aws-iot-greengrass-lite-demo-simple-image │ ├── README.md │ ├── aws-iot-greengrass-lite-demo-simple-image.bb │ ├── config.conf │ └── layers.conf │ ├── aws-iot-greengrass-lite-demo-tiny-image │ ├── README.md │ ├── aws-iot-greengrass-lite-demo-tiny-image.bb │ ├── config.conf │ └── layers.conf │ ├── aws-iot-greengrass-lite-walltablet-demo-image │ ├── README.md │ ├── aws-iot-greengrass-lite-walltablet-demo-bundle.bb │ ├── aws-iot-greengrass-lite-walltablet-demo-image.bb │ ├── config.conf │ ├── layers.conf │ └── wic │ │ └── sdimage-aws-iot-greengrass-lite-demo_partition.wks.in │ ├── aws-iot-greengrass-lite-webrtc-demo-image │ ├── README.md │ ├── aws-iot-greengrass-lite-webrtc-demo-bundle.bb │ ├── aws-iot-greengrass-lite-webrtc-demo-image.bb │ ├── config.conf │ ├── files │ │ ├── development-1.cert.pem │ │ └── development-1.key.pem │ ├── layers.conf │ └── wic │ │ └── sdimage-aws-iot-greengrass-lite-demo_partition.wks.in │ └── aws-webrtc-demo-image │ ├── README.md │ ├── aws-webrtc-demo-image.bb │ ├── config.conf │ └── layers.conf ├── recipes-iot └── aws-iot-greengrass │ ├── greengrass-bin │ ├── greengrass-classic.yaml │ └── greengrass.service.template │ ├── greengrass-bin_%.bbappend │ ├── greengrass-config-init.bb │ └── greengrass-config-init │ ├── greengrass-config-init.service │ ├── greengrass-config-init.sh │ └── wlan.network └── recipes-multimedia └── libcamera ├── libcamera └── 0001-media_device-Add-bool-return-type-to-unlock.patch └── libcamera_0.4.0.bb /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gitsubmodule 4 | directory: "/" 5 | commit-message: 6 | prefix: "meta-*: " 7 | schedule: 8 | interval: "daily" 9 | groups: 10 | layers: 11 | patterns: 12 | - "poky" 13 | - "meta-*" 14 | target-branch: "master-next" 15 | -------------------------------------------------------------------------------- /.github/workflows/build-gg-artifacts/ec2/create-ec2-ami.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | # SPDX-License-Identifier: MIT-0 4 | set -ex 5 | [ "$DEBUG" == 'true' ] && set -x 6 | 7 | ARGC=$# 8 | if [ $ARGC -lt 3 ]; then 9 | echo "ERROR: Please inform import bucket name as first argument and AMI disk size in GB as second, IMAGE_NAME as third and MACHINE_NAME as last." 10 | echo "E.g.:" 11 | echo "$0 my-test-bucket 4 core-image-minimal aws-ec2-arm64" 12 | exit 1 13 | fi 14 | IMPORT_BUCKET_NAME=$1 15 | AMI_DISK_SIZE_GB=$2 16 | IMAGE_NAME=$3 17 | MACHINE_NAME=$4 18 | 19 | # validation steps 20 | # AMI_DISK_SIZE_GB 21 | re='^[0-9]+$' 22 | if ! [[ $AMI_DISK_SIZE_GB =~ $re ]] ; then 23 | echo "AMI_DISK_SIZE needs to be a number only without unit. E.g. '4'." >&2 24 | exit 1 25 | fi 26 | 27 | #IMG_DIR=$(bitbake-getvar --value -q DEPLOY_DIR_IMAGE) 28 | 29 | #TESTDATA_JSON="${IMG_DIR}/${IMAGE_NAME}-${MACHINE_NAME}.rootfs.testdata.json" 30 | TESTDATA_JSON="${IMAGE_NAME}-${MACHINE_NAME}.rootfs.testdata.json" 31 | 32 | DISTRO=$(jq -r '.DISTRO' $TESTDATA_JSON) 33 | DISTRO_CODENAME=$(jq -r '.DISTRO_CODENAME' $TESTDATA_JSON) 34 | DISTRO_NAME=$(jq -r '.DISTRO_NAME' $TESTDATA_JSON) 35 | DISTRO_VERSION=$(jq -r '.DISTRO_VERSION' $TESTDATA_JSON) 36 | BUILDNAME=$(jq -r '.BUILDNAME' $TESTDATA_JSON) 37 | TARGET_ARCH=$(jq -r '.TARGET_ARCH' $TESTDATA_JSON) 38 | # IMAGE_NAME=$(jq -r '.IMAGE_NAME' $TESTDATA_JSON) 39 | IMAGE_ROOTFS_SIZE=$(jq -r '.IMAGE_ROOTFS_SIZE' $TESTDATA_JSON) 40 | 41 | echo IMG_DIR=$IMG_DIR 42 | echo DISTRO=$DISTRO 43 | echo DISTRO_CODENAME=$DISTRO_CODENAME 44 | echo DISTRO_NAME=$DISTRO_NAME 45 | echo DISTRO_VERSION=$DISTRO_VERSION 46 | echo BUILDNAME=$BUILDNAME 47 | echo TARGET_ARCH=$TARGET_ARCH 48 | echo IMAGE_ROOTFS_SIZE=$IMAGE_ROOTFS_SIZE 49 | echo AMI_DISK_SIZE_GB=$AMI_DISK_SIZE_GB 50 | 51 | echo "Pushing image ${IMAGE_NAME}.wic.vhd to s3://${IMPORT_BUCKET_NAME}" 52 | #aws s3 cp ${IMG_DIR}/${IMAGE_NAME}.wic.vhd s3://${IMPORT_BUCKET_NAME} 53 | aws s3 cp ${IMAGE_NAME}.wic.vhd s3://${IMPORT_BUCKET_NAME} 54 | 55 | cat < image-import.json 56 | { 57 | "Description": "yocto image", 58 | "Format": "vhd", 59 | "UserBucket": { 60 | "S3Bucket": "${IMPORT_BUCKET_NAME}", 61 | "S3Key": "${IMAGE_NAME}.wic.vhd" 62 | } 63 | } 64 | EOF 65 | echo "Importing image file into snapshot " 66 | IMPORT_TASK_ID=$(aws ec2 import-snapshot --disk-container "file://image-import.json" | jq -r '.ImportTaskId') 67 | 68 | IMPORT_STATUS=$(aws ec2 describe-import-snapshot-tasks --import-task-ids $IMPORT_TASK_ID | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.Status') 69 | x=0 70 | # rm image-import.json 71 | while [ "$IMPORT_STATUS" = "active" ] && [ $x -lt 120 ] 72 | do 73 | IMPORT_STATUS=$(aws ec2 describe-import-snapshot-tasks --import-task-ids $IMPORT_TASK_ID | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.Status') 74 | IMPORT_STATUS_MSG=$(aws ec2 describe-import-snapshot-tasks --import-task-ids $IMPORT_TASK_ID | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.StatusMessage') 75 | echo "Import Status: ${IMPORT_STATUS} / ${IMPORT_STATUS_MSG}" 76 | x=$(( $x + 1 )) 77 | sleep 15 78 | done 79 | if [ $x -eq 120 ]; then 80 | echo "ERROR: Import task taking too long, exiting..."; exit 1; 81 | elif [ "$IMPORT_STATUS" = "completed" ]; then 82 | echo "Import completed Successfully" 83 | else 84 | echo "Import Failed, exiting"; exit 2; 85 | fi 86 | 87 | SNAPSHOT_ID=$(aws ec2 describe-import-snapshot-tasks --import-task-ids $IMPORT_TASK_ID | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.SnapshotId') 88 | 89 | aws ec2 wait snapshot-completed --snapshot-ids $SNAPSHOT_ID 90 | 91 | if [[ "$TARGET_ARCH" == "x86_64" ]]; then 92 | ARCHITECTURE="x86_64" 93 | elif [[ "$TARGET_ARCH" == "aarch64" ]]; then 94 | ARCHITECTURE="arm64" 95 | else 96 | echo "Architecture not supported" 97 | exit 1 98 | fi 99 | DESCRIPTION=$(echo "DISTRO=$DISTRO;DISTRO_CODENAME=$DISTRO_CODENAME;DISTRO_NAME=$DISTRO_NAME;DISTRO_VERSION=$DISTRO_VERSION;BUILDNAME=$BUILDNAME;TARGET_ARCH=$ARCHITECTURE;IMAGE_NAME=$IMAGE_NAME" | cut -c -255) 100 | 101 | cat < register-ami.json 102 | { 103 | "Architecture": "$ARCHITECTURE", 104 | "BlockDeviceMappings": [ 105 | { 106 | "DeviceName": "/dev/sda1", 107 | "Ebs": { 108 | "DeleteOnTermination": true, 109 | "SnapshotId": "$SNAPSHOT_ID", 110 | "VolumeSize": ${AMI_DISK_SIZE_GB}, 111 | "VolumeType": "gp2" 112 | } 113 | } 114 | ], 115 | "Description": "$DESCRIPTION", 116 | "RootDeviceName": "/dev/sda1", 117 | "BootMode": "uefi", 118 | "VirtualizationType": "hvm", 119 | "EnaSupport": true 120 | } 121 | EOF 122 | 123 | AMI_NAME=$(echo "${IMAGE_NAME}-${DISTRO}-${DISTRO_CODENAME}-${DISTRO_VERSION}-${BUILDNAME}-${ARCHITECTURE}" | cut -c -128 | sed -e s/+/-/g) 124 | IMAGE_ID=$(aws ec2 describe-images --filters Name=name,Values=${AMI_NAME} | jq -r '.Images[].ImageId') 125 | if [ "$IMAGE_ID" != "" ]; then 126 | echo "Deregistering existing image $IMAGE_ID" 127 | aws ec2 deregister-image --image-id ${IMAGE_ID} 2>&1 > /dev/null 128 | fi 129 | echo "Registering AMI with Snapshot $SNAPSHOT_ID" 130 | AMI_ID=$(aws ec2 register-image --name ${AMI_NAME} --cli-input-json="file://register-ami.json" | jq -r '.ImageId') 131 | echo "AMI name: $AMI_NAME" 132 | echo "AMI ID: $AMI_ID" 133 | rm register-ami.json 134 | -------------------------------------------------------------------------------- /.github/workflows/build-gg-artifacts/readme-greengrass-lite-template.txt: -------------------------------------------------------------------------------- 1 | AWS IoT Greengrass is software that extends cloud capabilities to local 2 | devices. This enables devices to collect and analyze data closer to the 3 | source of information, react autonomously to local events, and communicate 4 | securely with each other on local networks. Local devices can also 5 | communicate securely with AWS IoT Core and export IoT data to the AWS Cloud. 6 | AWS IoT Greengrass developers can use AWS Lambda functions and prebuilt 7 | connectors to create serverless applications that are deployed to devices 8 | for local execution. 9 | 10 | AWS Greengrass Lite is the AWS IoT Greengrass runtime for constrained devices. 11 | 12 | The Greengrass Lite nucleus provides a smaller alternative to the 13 | Classic nucleus for Greengrass v2 deployments. 14 | 15 | Greengrass Lite aims to maintain compatibility with the Classic nucleus, 16 | and implements a subset of its functionality. 17 | 18 | This zip file contains a demo image that allow you to start quick with 19 | AWS Greengrass. The image is build to work on Raspberry PI 3,4,5 as it is 64bit. 20 | 21 | For the latest version of this image look here, also see options to 22 | build, extend it yourself: 23 | https://github.com/aws4embeddedlinux/meta-aws-demos/releases 24 | 25 | For other installation possibilities look here: 26 | https://github.com/aws-greengrass/aws-greengrass-lite 27 | 28 | This image has been build from this source: 29 | {{ VERSION_LINK }} 30 | 31 | The Greengrass Lite package version in this image: {{ GREENGRASS_PV }} 32 | Build from source code revision: {{ GREENGRASS_SRCREV }} 33 | 34 | ############################################################################### 35 | # 36 | # INSTALLATION 37 | # 38 | ############################################################################### 39 | 40 | 1. Download rpi imager for your OS (mac, win, linux) 41 | https://www.raspberrypi.com/documentation/computers/getting-started.html#raspberry-pi-imager 42 | 43 | 2. Select “use custom img” and flash demo image contained in this zip file 44 | on your SD-Card. The RPI imager auto rejects the SD card after it completes flashing the image, 45 | you need to uncheck this option or need to plug in again to transfer the unzipped connection kit. 46 | 47 | 3. Mount the boot fat partition and copy Connection Kit Zip onto it. 48 | - This needs to be done after you flashed your SD-Card. (Step 2) 49 | - This is done depending on your OS in Explorer, nemo, bash, Finder. 50 | - It is the only fat partition on the sd card 51 | 52 | 4a) You can configure the ethernet adapter ip address by editing the cmdline.txt 53 | file on the fat partition to append eg.: ip=192.168.0.69::192.168.0.1:255.255.255.0:rpi:eth0:off 54 | 55 | 4b) You can create a wpa_supplicant.conf file in the fat partition to configure your WIFI. 56 | It uses this https://linux.die.net/man/5/wpa_supplicant.conf format. 57 | 58 | network={ 59 | ssid="" 60 | psk="" 61 | } 62 | 63 | 4c) You can create a wlan.network file in the fat partition to do the ip configuration of your wlan, 64 | default is this, DHCP. It uses this https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html 65 | format. 66 | 67 | [Match] 68 | Name=wl* 69 | 70 | [Network] 71 | DHCP=ipv4 72 | 73 | [DHCP] 74 | RouteMetric=20 75 | ClientIdentifier=mac 76 | 77 | 78 | static ip example: 79 | 80 | [Match] 81 | Name=wl* 82 | 83 | [Network] 84 | DHCP=no 85 | Address=192.168.0.123/24 86 | Gateway=192.168.0.1 87 | DNS=8.8.8.8 8.8.4.4 88 | 89 | 90 | 5. Unmount, remove sd-card, put in Raspberry Pi and boot. 91 | 92 | 6. Password for "root" user is empty. Please note that this can be a security risk and should be changed 93 | when using device in a public environment! SSH is enabled by default to connect over the network! 94 | You can use the thing name to connect to the device via ssh, this is set as hostname, 95 | and announced by mdns. Note that underscores in a thing name will be removed! 96 | 97 | Login: root 98 | Password: 99 | 100 | 7. When logged in you can check the status of the installation by running 101 | systemctl status --with-dependencies greengrass-lite.target 102 | 103 | 104 | ############################################################################### 105 | # 106 | # LICENSE 107 | # 108 | ############################################################################### 109 | -------------------------------------------------------------------------------- /.github/workflows/build-gg-artifacts/readme-greengrass-template.txt: -------------------------------------------------------------------------------- 1 | AWS IoT Greengrass is software that extends cloud capabilities to local 2 | devices. This enables devices to collect and analyze data closer to the 3 | source of information, react autonomously to local events, and communicate 4 | securely with each other on local networks. Local devices can also 5 | communicate securely with AWS IoT Core and export IoT data to the AWS Cloud. 6 | AWS IoT Greengrass developers can use AWS Lambda functions and prebuilt 7 | connectors to create serverless applications that are deployed to devices 8 | for local execution. 9 | 10 | This zip file contains a demo image that allow you to start quick with 11 | AWS Greengrass. The image is build to work on Raspberry PI 3,4,5 as it is 64bit. 12 | 13 | For the latest version of this image look here, also see options to 14 | build, extend it yourself: 15 | https://github.com/aws4embeddedlinux/meta-aws-demos/releases 16 | 17 | For other installation possibilities look here: 18 | https://aws.amazon.com/greengrass/ 19 | 20 | This image has been build from this source: 21 | {{ VERSION_LINK }} 22 | 23 | The Greengrass package version in this image: {{ GREENGRASS_PV }} 24 | 25 | ############################################################################### 26 | # 27 | # INSTALLATION 28 | # 29 | ############################################################################### 30 | 31 | 1. Download rpi imager for your OS (mac, win, linux) 32 | https://www.raspberrypi.com/documentation/computers/getting-started.html#raspberry-pi-imager 33 | 34 | 2. Select “use custom img” and flash demo image contained in this zip file 35 | on your SD-Card. The RPI imager auto rejects the SD card after it completes flashing the image, 36 | you need to uncheck this option or need to plug in again to transfer the unzipped connection kit. 37 | 38 | 3. Mount the boot fat partition and copy Connection Kit Zip onto it. 39 | - This needs to be done after you flashed your SD-Card. (Step 2) 40 | - This is done depending on your OS in Explorer, nemo, bash, Finder. 41 | - It is the only fat partition on the sd card 42 | 43 | 4a) You can configure the ethernet adapter ip address by editing the cmdline.txt 44 | file on the fat partition to append eg.: ip=192.168.0.69::192.168.0.1:255.255.255.0:rpi:eth0:off 45 | 46 | 4b) You can create a wpa_supplicant.conf file in the fat partition to configure your WIFI. 47 | It uses this https://linux.die.net/man/5/wpa_supplicant.conf format. 48 | 49 | network={ 50 | ssid="" 51 | psk="" 52 | } 53 | 54 | 4c) You can create a wlan.network file in the fat partition to do the ip configuration of your wlan, 55 | default is this, DHCP. It uses this https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html 56 | format. 57 | 58 | [Match] 59 | Name=wl* 60 | 61 | [Network] 62 | DHCP=ipv4 63 | 64 | [DHCP] 65 | RouteMetric=20 66 | ClientIdentifier=mac 67 | 68 | 69 | static ip example: 70 | 71 | [Match] 72 | Name=wl* 73 | 74 | [Network] 75 | DHCP=no 76 | Address=192.168.0.123/24 77 | Gateway=192.168.0.1 78 | DNS=8.8.8.8 8.8.4.4 79 | 80 | 81 | 5. Unmount, remove sd-card, put in Raspberry Pi and boot. 82 | 83 | 6. Password for "root" user is empty. Please note that this can be a security risk and should be changed 84 | when using device in a public environment! SSH is enabled by default to connect over the network! 85 | You can use the thing name to connect to the device via ssh, this is set as hostname, 86 | and announced by mdns. Note that underscores in a thing name will be removed! 87 | 88 | Login: root 89 | Password: 90 | 91 | 7. When logged in you can check the status of the installation by running 92 | systemctl status greengrass 93 | 94 | 95 | ############################################################################### 96 | # 97 | # LICENSE 98 | # 99 | ############################################################################### 100 | -------------------------------------------------------------------------------- /.github/workflows/build-gg-artifacts/readme-license.txt: -------------------------------------------------------------------------------- 1 | 2 | Third Party Licenses: The demo images include third-party libraries and software 3 | that are subject to respective licenses that can be found inside the image in 4 | the /usr/share/common-licenses directory. It is your responsibility to review 5 | those licenses to make sure that you are accepting of and compliant with the 6 | terms and conditions of those licenses for your use case. 7 | 8 | The source code to build demo images is available under the MIT license 9 | (SPDX-License-Identifier: MIT) and can be downloaded here: 10 | https://github.com/aws4embeddedlinux/meta-aws-demos/releases. 11 | 12 | THE DEMO IMAGES ARE EXPERIMENTAL AND ARE NOT INTENDED FOR PRODUCTION USE. AS 13 | SUCH THE IMAGES ARE PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL AMAZON OR ANY OF 16 | AMAZON’S AFFILIATES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE IMAGES OR THE USE OR OTHER DEALINGS IN THE IMAGES. 19 | -------------------------------------------------------------------------------- /.github/workflows/ff-merge.yml: -------------------------------------------------------------------------------- 1 | name: ff-merge 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | branch: 7 | description: 'branch to ff merge branch-next into' 8 | default: 'master' 9 | required: true 10 | 11 | jobs: 12 | ff-merge: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: clone meta-aws-demos ${{ github.event.inputs.branch }} branch 16 | uses: actions/checkout@v3 17 | with: 18 | ref: ${{ github.event.inputs.branch }} 19 | path: meta-aws-demos 20 | submodules: true 21 | fetch-depth: 0 22 | 23 | - name: merge ${{ github.event.inputs.branch }}-next into ${{ github.event.inputs.branch }} 24 | working-directory: meta-aws-demos 25 | run: | 26 | git config --global user.name aws-iot-embedded-linux-ci 27 | git config --global user.email aws-iot-embedded-linux-ci@users.noreply.github.com 28 | git merge --ff-only origin/${{ github.event.inputs.branch }}-next 29 | 30 | - name: push ${{ github.event.inputs.branch }} 31 | working-directory: meta-aws-demos 32 | run: | 33 | git push -u origin ${{ github.event.inputs.branch }} 34 | 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | *.pyc 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "poky"] 2 | path = poky 3 | url = git://git.yoctoproject.org/poky 4 | branch = scarthgap 5 | [submodule "meta-virtualization"] 6 | path = layers/sw/meta-virtualization 7 | url = git://git.yoctoproject.org/meta-virtualization 8 | branch = scarthgap 9 | [submodule "meta-openembedded"] 10 | path = layers/sw/meta-openembedded 11 | url = https://github.com/openembedded/meta-openembedded.git 12 | branch = scarthgap 13 | [submodule "meta-aws"] 14 | path = layers/sw/meta-aws 15 | url = https://github.com/aws4embeddedlinux/meta-aws.git 16 | branch = scarthgap 17 | [submodule "meta-freescale"] 18 | path = layers/bsp/meta-freescale 19 | url = https://github.com/Freescale/meta-freescale.git 20 | branch = scarthgap 21 | [submodule "meta-raspberrypi"] 22 | path = layers/bsp/meta-raspberrypi 23 | url = https://github.com/agherzan/meta-raspberrypi.git 24 | branch = scarthgap 25 | [submodule "meta-freescale-distro"] 26 | path = layers/bsp/meta-freescale-distro 27 | url = https://github.com/Freescale/meta-freescale-distro.git 28 | branch = scarthgap 29 | [submodule "meta-qt5"] 30 | path = layers/sw/meta-qt5 31 | url = https://github.com/meta-qt5/meta-qt5.git 32 | branch = scarthgap 33 | [submodule "meta-clang"] 34 | path = layers/sw/meta-clang 35 | url = https://github.com/kraj/meta-clang.git 36 | branch = scarthgap 37 | [submodule "meta-flutter"] 38 | path = layers/sw/meta-flutter 39 | url = https://github.com/meta-flutter/meta-flutter.git 40 | branch = scarthgap 41 | [submodule "meta-agl"] 42 | path = layers/agl/meta-agl 43 | url = https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl 44 | branch = ricefish 45 | [submodule "meta-agl-demo"] 46 | path = layers/agl/meta-agl-demo 47 | url = https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl-demo 48 | branch = ricefish 49 | [submodule "meta-agl-devel"] 50 | path = layers/agl/meta-agl-devel 51 | url = https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl-devel 52 | branch = ricefish 53 | [submodule "meta-xilinx-tools"] 54 | path = layers/bsp/meta-xilinx-tools 55 | url = https://git.yoctoproject.org/meta-xilinx-tools 56 | branch = scarthgap 57 | [submodule "meta-xilinx"] 58 | path = layers/bsp/meta-xilinx 59 | url = https://github.com/Xilinx/meta-xilinx.git 60 | branch = scarthgap 61 | [submodule "meta-ti"] 62 | path = layers/bsp/meta-ti 63 | url = https://git.yoctoproject.org/meta-ti 64 | branch = scarthgap 65 | [submodule "meta-arm"] 66 | path = layers/bsp/meta-arm 67 | url = https://git.yoctoproject.org/meta-arm 68 | branch = scarthgap 69 | [submodule "meta-agl-refhw"] 70 | path = layers/agl/meta-agl-refhw 71 | url = https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl-refhw 72 | branch = octopus 73 | [submodule "layers/bsp/meta-ampliphy"] 74 | path = layers/bsp/meta-ampliphy 75 | url = https://github.com/phytec/meta-ampliphy.git 76 | branch = scarthgap 77 | [submodule "layers/sw/meta-rauc"] 78 | path = layers/sw/meta-rauc 79 | url = https://github.com/rauc/meta-rauc.git 80 | branch = scarthgap 81 | [submodule "layers/bsp/meta-st-stm32mp"] 82 | path = layers/bsp/meta-st-stm32mp 83 | url = https://github.com/STMicroelectronics/meta-st-stm32mp.git 84 | branch = scarthgap 85 | [submodule "layers/bsp/meta-rauc-community"] 86 | path = layers/bsp/meta-rauc-community 87 | url = https://github.com/rauc/meta-rauc-community.git 88 | branch = scarthgap 89 | [submodule "layers/bsp/meta-lts-mixins"] 90 | path = layers/bsp/meta-lts-mixins 91 | url = https://git.yoctoproject.org/meta-lts-mixins 92 | branch = scarthgap/u-boot 93 | [submodule "layers/bsp/meta-rockchip"] 94 | path = layers/bsp/meta-rockchip 95 | url = https://git.yoctoproject.org/meta-rockchip 96 | branch = scarthgap 97 | [submodule "layers/bsp/rockchip-rv1106-dev"] 98 | path = layers/bsp/rockchip-rv1106-dev 99 | url = https://github.com/thomas-roos/rockchip-rv1106-dev.git 100 | branch = scarthgap 101 | [submodule "layers/sw/meta-ptx"] 102 | path = layers/sw/meta-ptx 103 | url = https://git.pengutronix.de/git/meta-ptx 104 | branch = scarthgap 105 | [submodule "layers/sw/meta-clang"] 106 | path = layers/sw/meta-clang 107 | url = https://github.com/kraj/meta-clang.git 108 | branch = scarthgap 109 | [submodule "layers/sw/meta-browser"] 110 | path = layers/sw/meta-browser 111 | url = https://github.com/OSSystems/meta-browser.git 112 | branch = scarthgap 113 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional 4 | documentation, we greatly value feedback and contributions from our community. 5 | 6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary 7 | information to effectively respond to your bug report or contribution. 8 | 9 | 10 | ## Reporting Bugs/Feature Requests 11 | 12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 13 | 14 | When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already 15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 16 | 17 | * A reproducible test case or series of steps. 18 | * The version of our code being used. 19 | * Any modifications you've made relevant to the bug. 20 | * Anything unusual about your environment or deployment. 21 | 22 | 23 | ## Contributing via Pull Requests 24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 25 | 26 | 1. You are working against the latest source on the *master* branch. 27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. 29 | 30 | To send us a pull request, please: 31 | 32 | 1. Fork the repository. 33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 34 | 3. Ensure local tests pass. 35 | 4. Commit to your fork using clear commit messages. 36 | 5. Send us a pull request, answering any default questions in the pull request interface. 37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 38 | 39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and 40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 41 | 42 | 43 | ## Finding contributions to work on 44 | Looking at the existing issues is a great way to find something to contribute to. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. 45 | 46 | 47 | ## Code of Conduct 48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 50 | opensource-codeofconduct@amazon.com with any additional questions or comments. 51 | 52 | 53 | ## Security issue notifications 54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. 55 | 56 | 57 | ## Licensing 58 | 59 | See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. 60 | 61 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Amazon.com, Inc. All Rights Reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Demonstrations for the **[meta-aws](https://github.com/aws/meta-aws)** project 2 | 3 | [meta-aws](https://github.com/aws/meta-aws) is a [Yocto 4 | Project](https://www.yoctoproject.org/) Bitbake Metadata Layer. It 5 | accelerates building [Amazon Web Services](https://aws.amazon.com) 6 | (AWS) software you can install to [Embedded 7 | Linux](https://elinux.org/Main_Page). You can use this to build IoT 8 | solutions on AWS. 9 | 10 | In this repository, you will find 11 | [meta-aws](https://github.com/aws/meta-aws) demonstrations. These 12 | demos are based on both Poky (the Yocto Project reference implementation) 13 | and real hardware. Many times, the hardware will be 14 | representative of actual uses of hardware listed in the [AWS Device 15 | Catalog](https://devices.amazonaws.com). 16 | 17 | The number of demonstrations will increase over time and your 18 | contributions are very welcome! 19 | 20 | ## Demonstration environments 21 | 22 | The DEMOs consist of a combination of a DEVICE, which represent a hardware and an IMAGE showcasing a use-case. 23 | 24 | ## Device 25 | 26 | Select your desired target environment. These are listed below in 27 | alphabetical order for ease of selection, no preference should be inferred. 28 | 29 | - [`aws-ec2-arm64` / AWS EC2](meta-aws-demos/conf/devices/aws-ec2-arm64/README.md) 30 | - [`aws-ec2-x86-64` / AWS EC2](meta-aws-demos/conf/devices/aws-ec2-x86-64/README.md) 31 | - [`imx8m` / NXP](meta-aws-demos/conf/devices/imx8m/README.md) 32 | - [`qemuarm`](meta-aws-demos/conf/devices/qemuarm/README.md) 33 | - [`qemuarm64`](meta-aws-demos/conf/devices/qemuarm64/README.md) 34 | - [`qemux86-64`](meta-aws-demos/conf/devices/qemux86-64/README.md) 35 | - [`raspberrypi-64` / Raspberry Pi Foundation](meta-aws-demos/conf/devices/raspberrypi-64/README.md) 36 | - [`raspberrypi2` / Raspberry Pi Foundation](meta-aws-demos/conf/devices/raspberrypi2/README.md) 37 | - [`raspberrypi0-wifi` / Raspberry Pi Foundation](meta-aws-demos/conf/devices/raspberrypi0-wifi/README.md) 38 | - [`rockchip-rv1106`](meta-aws-demos/conf/devices/rockchip-rv1106/README.md) 39 | - [`stm32mp13-disco` / STM](meta-aws-demos/conf/devices/stm32mp13-disco/README.md) 40 | - [`ti-am572x-idk` / Texas Instruments](meta-aws-demos/conf/devices/ti-am572x-idk/README.md) 41 | - [`xilinx-zcu104-zynqmp` / Xilinx](meta-aws-demos/conf/devices/xilinx-zcu104-zynqmp/README.md) 42 | 43 | ## Images 44 | 45 | Generally you can build all images for all "Devices", but some combinations do not work or do not make sense! 46 | 47 | - [aws-demo-image](meta-aws-demos/recipes-core/images/aws-demo-image/README.md) 48 | - [aws-iot-device-client-demo-image](meta-aws-demos/recipes-core/images/aws-iot-device-client-demo-image/README.md) 49 | - [aws-iot-fleetwise-test-image-agl](meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image-agl/README.md) 50 | - [aws-iot-fleetwise-test-image](meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image/README.md) 51 | - [aws-iot-greengrass-demo-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/README.md) 52 | - [aws-iot-greengrass-demo-simple-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-simple-image/README.md) 53 | - [aws-iot-greengrass-lite-container-demo-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/README.md) 54 | - [aws-iot-greengrass-lite-demo-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/README.md) 55 | - [aws-iot-greengrass-lite-demo-ec2-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/README.md) 56 | - [aws-iot-greengrass-lite-demo-simple-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-simple-image/README.md) 57 | - [aws-iot-greengrass-lite-demo-tiny-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-tiny-image/README.md) 58 | - [aws-iot-greengrass-lite-webrtc-demo-image](meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/README.md) 59 | - [aws-webrtc-demo-image](meta-aws-demos/recipes-core/images/aws-webrtc-demo-image/README.md) 60 | 61 | > [!IMPORTANT] 62 | > Be careful some of the images require additional local.conf entries, those config.conf files are located in the respective image. 63 | > They are automatically included if the correct environment variables (IMAGE + DEVICE) are set! 64 | 65 | ## Quick Start 66 | 67 | To try out this project in QEMU (default device is `qemuarm64`), run the following commands: 68 | 69 | ```bash 70 | git submodule update --init --recursive 71 | . init-build-env 72 | export IMAGE=aws-demo-image 73 | bitbake $IMAGE 74 | runqemu slirp nographic 75 | ``` 76 | 77 | ## Build requirements 78 | 79 | Please also consider these build host [requirements](https://docs.yoctoproject.org/ref-manual/system-requirements.html#required-packages-for-the-build-host). 80 | -> At least 100GB of free hard disk space is required! 81 | 82 | ### Ubuntu 24.04 83 | 84 | - `sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0` is needed for bitbake 85 | 86 | ## Setup 87 | 88 | This repository uses submodules and a simple wrapper script to set the default 89 | `TEMPLATECONF` that allows users to select the device they want to build. The 90 | first step is to clone down the submodules: 91 | 92 | ```bash 93 | git submodule update --init --recursive 94 | ``` 95 | 96 | ## Building 97 | 98 | Next, initialize the build environment, and optionally specify the build directory: 99 | 100 | ```bash 101 | . init-build-env [BUILDDIR] 102 | ``` 103 | 104 | Finally, the images can be built - details in linked readme for each DEMO. Default device is `qemuarm64`: 105 | 106 | ```bash 107 | export DEVICE=[DEVICE] 108 | export IMAGE=[IMAGE] 109 | bitbake $IMAGE 110 | ``` 111 | 112 | To build for a different device, set the `DEVICE` (see [here](#Demonstration-environments)) and `IMAGE` environment variable, 113 | like this: 114 | 115 | ```bash 116 | export DEVICE=aws-c2-arm64 117 | export IMAGE=aws-demo-image 118 | bitbake $IMAGE 119 | ``` 120 | 121 | For a list of all possible devices, see `meta-aws-demos/conf/devices`. 122 | 123 | The `init-build-env` script adds a helper function called `get_devices` which 124 | will list all devices that can be configured. This can be used to build all devices with: 125 | 126 | ```bash 127 | for d in $(get_devices); do for i in $(get_images); do DEVICE=$d IMAGE=$i && echo $DEVICE && echo $IMAGE && bitbake $i; done; done 128 | ``` 129 | 130 | ## Adding new images, devices 131 | 132 | New platforms can be added by adding a new directory under 133 | `meta-aws-demos/conf/devices`. This directory should contain 2 files: 134 | 135 | `layers.conf`: This is the file that will be required in `bblayers.conf` when 136 | the device is selected 137 | 138 | `config.conf`: This is the file that will be required in `local.conf` when the 139 | device is selected 140 | 141 | New images can be added by adding a new directory under 142 | `meta-aws-demos/recipes-core/images/`. This directory can contain 2 files: 143 | 144 | `layers.conf`: This is the file that will be optionally included in `bblayers.conf` when 145 | the image is selected 146 | 147 | `config.conf`: This is the file that will be optionally included in `local.conf` when the 148 | image is selected 149 | 150 | ## Updating submodules to latest version of specified branch is easy. 151 | 152 | The following will update upstream submodule changes recursively: 153 | ```bash 154 | git submodule update --remote --init --recursive 155 | ``` 156 | -------------------------------------------------------------------------------- /init-build-env: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -n "$BASH_SOURCE" ]; then 4 | THIS_SCRIPT=$BASH_SOURCE 5 | elif [ -n "$ZSH_NAME" ]; then 6 | THIS_SCRIPT=$0 7 | else 8 | THIS_SCRIPT="$(pwd)/oe-init-build-env" 9 | if [ ! -e "$THIS_SCRIPT" ]; then 10 | echo "Error: $THIS_SCRIPT doesn't exist!" >&2 11 | echo "Please run this script in oe-init-build-env's directory." >&2 12 | exit 1 13 | fi 14 | fi 15 | 16 | ROOT_DIR=$(realpath $(dirname $THIS_SCRIPT)) 17 | 18 | export TEMPLATECONF="$ROOT_DIR/meta-aws-demos/conf/templates/default" 19 | 20 | if [ -n "$1" ]; then 21 | BUILDDIR=$(realpath "$1") 22 | else 23 | BUILDDIR=$ROOT_DIR/build 24 | fi 25 | 26 | get_devices() { 27 | ( 28 | cd $ROOT_DIR/meta-aws-demos/conf/devices 29 | for f in *; do 30 | if [ -e $f/config.conf ]; then 31 | echo $f 32 | fi 33 | done 34 | ) 35 | } 36 | 37 | get_images() { 38 | ( 39 | cd $ROOT_DIR/meta-aws-demos/recipes-core/images 40 | for f in *; do 41 | if [ -e $f ]; then 42 | echo $f 43 | fi 44 | done 45 | ) 46 | } 47 | 48 | cd $(dirname $THIS_SCRIPT)/poky 49 | . oe-init-build-env "$BUILDDIR" 50 | 51 | export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS} DEVICE IMAGE" 52 | 53 | # set defaults 54 | export DEVICE="qemuarm64" 55 | export IMAGE="aws-demo-image" 56 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/COPYING.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/README.rst: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the meta-rauc-aws-ec2 layer. 2 | 3 | Please see the corresponding sections below for details. 4 | 5 | Dependencies 6 | ============ 7 | 8 | * URI: git://git.openembedded.org/openembedded-core 9 | * URI: https://github.com/rauc/meta-rauc.git 10 | * URI: https://github.com/aws4embeddedlinux/meta-aws 11 | * URI: https://github.com/lgirdk/meta-virtualization 12 | 13 | 14 | Patches 15 | ======= 16 | 17 | Please submit any patches against the meta-rauc-aws-ec2 layer via GitHub 18 | pull request on https://github.com/rauc/meta-rauc-community. 19 | 20 | Maintainer: Thomas Roos 21 | 22 | Disclaimer 23 | ========== 24 | 25 | Note that this is just an example layer that shows a few possible configuration 26 | options how RAUC can be used. 27 | Actual requirements may differ from project to projects and will probably need 28 | a much different RAUC/bootloader/system configuration. 29 | 30 | Also note that this layer is for demo purpose only and does not care about 31 | migratability between different layer revision. 32 | 33 | I. Adding the meta-rauc-aws-ec2 layer to your build 34 | ======================================================= 35 | 36 | Run 'bitbake-layers add-layer meta-rauc-aws-ec2' 37 | 38 | II. Build The Demo System 39 | ========================= 40 | 41 | :: 42 | 43 | $ source oe-init-build-env 44 | 45 | Set the ``MACHINE`` to the model you intend to build for. E.g.:: 46 | 47 | 48 | MACHINE = "aws-ec2-arm64" 49 | # or MACHINE = "aws-ec2-x86-64" 50 | 51 | Make sure either your distro (recommended) or your local.conf have ``rauc`` 52 | ``DISTRO_FEATURE`` enabled:: 53 | 54 | DISTRO_FEATURES:append = " rauc" 55 | 56 | Add this to your local.conf 57 | INHERIT += "aws-ec2-image" 58 | 59 | Build the image:: 60 | 61 | $ bitbake core-image-minimal 62 | 63 | III. Flash & Run The Demo System 64 | ================================ 65 | 66 | Follow instructions here: https://github.com/aws4embeddedlinux/meta-aws/blob/master/scripts/ec2-ami/README.md 67 | 68 | IV. Build and Install The Demo Bundle 69 | ===================================== 70 | 71 | To build the bundle, run:: 72 | 73 | $ bitbake ec2-demo-bundle 74 | 75 | Copy the generated bundle to the target system via scp. 76 | 77 | On the target, you can then install the bundle:: 78 | 79 | # rauc install /path/to/ec2-demo-bundle.raucb 80 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have recipes-* directories, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | BBFILE_COLLECTIONS += "meta-rauc-aws-ec2-x86-64" 9 | BBFILE_PATTERN_meta-rauc-aws-ec2-x86-64= "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_meta-rauc-aws-ec2-x86-64 = "6" 11 | 12 | LAYERDEPENDS_meta-rauc-aws-ec2-x86-64 = "core" 13 | LAYERSERIES_COMPAT_meta-rauc-aws-ec2-x86-64 = "scarthgap" 14 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-bsp/boot-image/boot-image.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021 Enrico Jorns 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "Boot images" 5 | LICENSE = "MIT" 6 | 7 | inherit nopackages deploy 8 | 9 | do_fetch[noexec] = "1" 10 | do_patch[noexec] = "1" 11 | do_compile[noexec] = "1" 12 | do_install[noexec] = "1" 13 | deltask do_populate_sysroot 14 | 15 | do_deploy[depends] += "\ 16 | dosfstools-native:do_populate_sysroot \ 17 | mtools-native:do_populate_sysroot \ 18 | grub-efi:do_deploy \ 19 | rauc-qemu-grubconf:do_deploy" 20 | 21 | do_deploy () { 22 | FATSOURCEDIR="${WORKDIR}/efi-boot/" 23 | mkdir -p ${FATSOURCEDIR} 24 | 25 | mkdir -p ${FATSOURCEDIR}/EFI/BOOT 26 | cp ${DEPLOY_DIR_IMAGE}/grub.cfg ${FATSOURCEDIR}/EFI/BOOT/ 27 | 28 | if [ "${TARGET_ARCH}" = "x86_64" ]; then 29 | kernel_efi_image="bootx64.efi" 30 | elif [ "${TARGET_ARCH}" = "i686" ]; then 31 | kernel_efi_image="bootia32.efi" 32 | elif [ "${TARGET_ARCH}" = "aarch64" ]; then 33 | kernel_efi_image="bootaa64.efi" 34 | fi 35 | 36 | cp ${DEPLOY_DIR_IMAGE}/grub-efi-$kernel_efi_image ${FATSOURCEDIR}/EFI/BOOT/$kernel_efi_image 37 | 38 | MKDOSFS_EXTRAOPTS="-S 512" 39 | FATIMG="${WORKDIR}/efi-boot.vfat" 40 | BLOCKS=32786 41 | 42 | rm -f ${FATIMG} 43 | 44 | mkdosfs -n "BOOT" ${MKDOSFS_EXTRAOPTS} -C ${FATIMG} \ 45 | ${BLOCKS} 46 | # Copy FATSOURCEDIR recursively into the image file directly 47 | mcopy -i ${FATIMG} -s ${FATSOURCEDIR}/* ::/ 48 | chmod 644 ${FATIMG} 49 | 50 | mv ${FATIMG} ${DEPLOYDIR}/ 51 | 52 | GRUBENV_IMG="${WORKDIR}/grubenv.vfat" 53 | 54 | rm -f ${GRUBENV_IMG} 55 | 56 | mkdosfs -n "BOOT" ${MKDOSFS_EXTRAOPTS} -C ${GRUBENV_IMG} \ 57 | 64 58 | mcopy -i ${GRUBENV_IMG} -s ${DEPLOY_DIR_IMAGE}/grubenv ::/ 59 | chmod 644 ${GRUBENV_IMG} 60 | 61 | mv ${GRUBENV_IMG} ${DEPLOYDIR}/ 62 | } 63 | 64 | do_deploy[cleandirs] += "${WORKDIR}/efi-boot" 65 | 66 | addtask deploy after do_install 67 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-bsp/grub/files/grub.cfg.in: -------------------------------------------------------------------------------- 1 | serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 2 | default=0 3 | timeout=3 4 | 5 | set ORDER="A B" 6 | set A_OK=1 7 | set B_OK=0 8 | set A_TRY=0 9 | set B_TRY=0 10 | load_env --file=(hd0,2)/grubenv 11 | 12 | # select bootable slot 13 | for SLOT in $ORDER; do 14 | if [ "$SLOT" == "A" ]; then 15 | INDEX=0 16 | OK=$A_OK 17 | TRY=$A_TRY 18 | A_TRY=1 19 | fi 20 | if [ "$SLOT" == "B" ]; then 21 | INDEX=1 22 | OK=$B_OK 23 | TRY=$B_TRY 24 | B_TRY=1 25 | fi 26 | if [ "$OK" -eq 1 -a "$TRY" -eq 0 ]; then 27 | default=$INDEX 28 | break 29 | fi 30 | done 31 | 32 | # reset booted flags 33 | if [ "$default" -eq 0 ]; then 34 | if [ "$A_OK" -eq 1 -a "$A_TRY" -eq 1 ]; then 35 | A_TRY=0 36 | fi 37 | if [ "$B_OK" -eq 1 -a "$B_TRY" -eq 1 ]; then 38 | B_TRY=0 39 | fi 40 | fi 41 | 42 | save_env --file=(hd0,2)/grubenv A_TRY A_OK B_TRY B_OK ORDER 43 | 44 | CMDLINE="rootwait rootfstype=ext4" 45 | 46 | menuentry "Slot A (OK=$A_OK TRY=$A_TRY)" { 47 | linux (hd0,3)/boot/@@KERNEL_IMAGE@@ root=/dev/nvme0n1p3 $CMDLINE rauc.slot=A 48 | } 49 | 50 | menuentry "Slot B (OK=$B_OK TRY=$B_TRY)" { 51 | linux (hd0,4)/boot/@@KERNEL_IMAGE@@ root=/dev/nvme0n1p4 $CMDLINE rauc.slot=B 52 | } 53 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-bsp/grub/files/grubenv: -------------------------------------------------------------------------------- 1 | # GRUB Environment Block 2 | ####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################### -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-bsp/grub/rauc-qemu-grubconf.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Grub configuration file to use with RAUC" 2 | LICENSE = "MIT" 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 4 | 5 | include conf/image-uefi.conf 6 | 7 | RPROVIDES:${PN} += "virtual-grub-bootconf" 8 | 9 | SRC_URI += " \ 10 | file://grubenv \ 11 | file://grub.cfg.in \ 12 | " 13 | 14 | S = "${WORKDIR}" 15 | 16 | inherit deploy 17 | 18 | do_install() { 19 | install -d ${D}${EFI_FILES_PATH} 20 | sed -e "s|@@KERNEL_IMAGE@@|${KERNEL_IMAGETYPE}|g" \ 21 | ${WORKDIR}/grub.cfg.in > ${D}${EFI_FILES_PATH}/grub.cfg 22 | } 23 | 24 | FILES:${PN} += "${EFI_FILES_PATH}" 25 | 26 | do_deploy() { 27 | install -m 644 ${WORKDIR}/grubenv ${DEPLOYDIR} 28 | 29 | sed -e "s|@@KERNEL_IMAGE@@|${KERNEL_IMAGETYPE}|g" \ 30 | ${WORKDIR}/grub.cfg.in > ${DEPLOYDIR}/grub.cfg 31 | } 32 | 33 | addtask deploy after do_install before do_build 34 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/bundles/ec2-demo-bundle.bb: -------------------------------------------------------------------------------- 1 | inherit bundle 2 | 3 | LICENSE = "MIT" 4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 5 | 6 | RAUC_BUNDLE_COMPATIBLE = "aws-ec2 demo platform" 7 | 8 | RAUC_BUNDLE_FORMAT = "verity" 9 | 10 | RAUC_BUNDLE_SLOTS = "rootfs" 11 | 12 | RAUC_IMAGE_FSTYPE = "tar.bz2" 13 | 14 | RAUC_SLOT_rootfs = "core-image-minimal" 15 | # uncomment for enabling adaptive update method 'block-hash-index' 16 | #RAUC_SLOT_rootfs[fstype] = "ext4" 17 | #RAUC_SLOT_rootfs[adaptive] = "block-hash-index" 18 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/images/core-image-minimal.bbappend: -------------------------------------------------------------------------------- 1 | IMAGE_INSTALL:append = " kernel-image kernel-modules" 2 | 3 | inherit aws-ec2-image 4 | WKS_FILE = "ec2_partition.wks.in" 5 | do_image_wic[depends] += "boot-image:do_deploy" 6 | 7 | # Optimizations for RAUC adaptive method 'block-hash-index' 8 | # rootfs image size must to be 4K-aligned 9 | IMAGE_ROOTFS_ALIGNMENT = "4" 10 | # ext4 block size should be set to 4K and use a fixed directory hash seed to 11 | # reduce the image delta size (keep oe-core's 4K bytes-per-inode) 12 | EXTRA_IMAGECMD:ext4 = "-i 4096 -b 4096 -E hash_seed=86ca73ff-7379-40bd-a098-fcb03a6e719d" 13 | 14 | IMAGE_PREPROCESS_COMMAND:append = " rootfs_user_fstab" 15 | 16 | #### 17 | rootfs_user_fstab () { 18 | install -d -m 0755 ${IMAGE_ROOTFS}/data 19 | } -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/rauc/files/ca.cert.pem: -------------------------------------------------------------------------------- 1 | Certificate: 2 | Data: 3 | Version: 3 (0x2) 4 | Serial Number: 1 (0x1) 5 | Signature Algorithm: sha256WithRSAEncryption 6 | Issuer: O=Test Org, CN=Test Org rauc CA Development 7 | Validity 8 | Not Before: Jan 1 00:00:00 1970 GMT 9 | Not After : Dec 31 23:59:59 9999 GMT 10 | Subject: O=Test Org, CN=Test Org rauc CA Development 11 | Subject Public Key Info: 12 | Public Key Algorithm: rsaEncryption 13 | RSA Public-Key: (2048 bit) 14 | Modulus: 15 | 00:c0:fe:7b:6c:c3:e3:47:cc:d4:15:e1:0c:b2:1c: 16 | c9:f7:61:3e:42:d7:f1:a4:30:f2:db:0e:49:95:49: 17 | 70:ee:97:6d:fe:48:5d:b9:22:63:47:e0:be:63:d7: 18 | 68:9b:38:04:7d:7f:d9:65:ef:1d:6c:26:cb:05:7f: 19 | 59:45:15:9d:76:59:c4:8d:59:a0:38:a0:25:fa:86: 20 | 1b:f4:85:ff:cf:7c:c7:57:a3:7e:56:71:7d:69:c3: 21 | 69:a7:fb:e6:8e:bc:f9:49:e2:f5:9a:97:e5:2d:75: 22 | ef:f9:76:29:5f:76:11:1b:70:6f:4d:26:4f:e0:06: 23 | 9b:8c:e3:76:91:81:4a:4e:98:5d:2e:f4:bd:23:4d: 24 | e7:5d:9b:ea:68:4d:03:9e:35:90:c5:f2:8d:ae:ed: 25 | 44:4f:f3:50:dc:2b:ef:ae:44:35:79:78:3d:65:4b: 26 | d9:16:98:aa:be:08:47:25:af:68:1c:0b:8e:c1:aa: 27 | 02:a7:61:4f:4d:15:1b:07:3c:4e:60:b3:9a:d5:c1: 28 | 39:34:4e:8e:e7:93:46:f1:75:95:aa:16:9a:1d:e6: 29 | 49:15:a5:ae:06:8a:45:16:a9:af:59:60:9b:c6:6d: 30 | 3d:19:57:5d:de:31:d5:dc:96:0e:a4:25:fe:7a:07: 31 | 71:c5:40:c0:a3:d0:d5:84:47:14:7a:5a:f1:07:75: 32 | 79:35 33 | Exponent: 65537 (0x10001) 34 | X509v3 extensions: 35 | X509v3 Subject Key Identifier: 36 | 44:0C:AF:4A:74:B4:C7:65:02:B2:95:F1:91:7C:A3:CC:E6:3E:99:E8 37 | X509v3 Authority Key Identifier: 38 | keyid:44:0C:AF:4A:74:B4:C7:65:02:B2:95:F1:91:7C:A3:CC:E6:3E:99:E8 39 | DirName:/O=Test Org/CN=Test Org rauc CA Development 40 | serial:01 41 | 42 | X509v3 Basic Constraints: 43 | CA:TRUE 44 | Signature Algorithm: sha256WithRSAEncryption 45 | 30:07:51:4d:d6:2c:0c:2f:3e:6c:5c:34:1f:07:21:8d:50:77: 46 | 9a:a6:81:75:62:f0:fe:ff:3b:5b:d0:7c:d1:45:e7:e2:67:d4: 47 | 23:cb:af:9a:8b:f4:2b:d2:33:3d:45:bb:a7:7d:b4:9b:41:db: 48 | fb:62:ac:83:fc:41:ae:e5:dc:2d:df:7d:72:7e:df:34:01:60: 49 | 94:7f:15:78:84:87:f0:23:e4:8e:b8:dc:71:cb:84:4b:25:bb: 50 | 62:8f:fd:7f:d3:3c:1d:85:45:fb:03:7c:a2:bc:c4:a8:fa:2b: 51 | ec:79:67:8d:f4:5f:37:a8:5a:54:bc:b3:78:11:0b:8b:29:90: 52 | 8b:48:4a:d7:87:93:96:97:72:10:1d:70:29:f8:e4:c3:81:6d: 53 | 7d:c3:6e:d4:c8:1b:0b:0d:f9:c0:b9:7b:11:54:e2:af:8b:a0: 54 | 45:de:c2:67:81:8c:0c:9d:ba:a1:31:8b:f2:cc:da:c7:cc:6d: 55 | 21:92:2a:57:29:9c:48:92:75:d9:1a:6e:d3:ee:53:66:83:2e: 56 | 08:74:09:5d:78:13:99:34:7d:16:8c:ba:29:75:80:20:8b:ca: 57 | 91:19:29:64:ef:64:37:de:5b:22:18:99:5b:63:69:9a:a2:44: 58 | 21:70:30:41:f2:58:27:ab:4f:5c:d0:e1:94:5d:d1:5b:8d:fd: 59 | bf:8f:a9:99 60 | -----BEGIN CERTIFICATE----- 61 | MIIDhjCCAm6gAwIBAgIBATANBgkqhkiG9w0BAQsFADA6MREwDwYDVQQKDAhUZXN0 62 | IE9yZzElMCMGA1UEAwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudDAgFw03 63 | MDAxMDEwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowOjERMA8GA1UECgwIVGVzdCBP 64 | cmcxJTAjBgNVBAMMHFRlc3QgT3JnIHJhdWMgQ0EgRGV2ZWxvcG1lbnQwggEiMA0G 65 | CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA/ntsw+NHzNQV4QyyHMn3YT5C1/Gk 66 | MPLbDkmVSXDul23+SF25ImNH4L5j12ibOAR9f9ll7x1sJssFf1lFFZ12WcSNWaA4 67 | oCX6hhv0hf/PfMdXo35WcX1pw2mn++aOvPlJ4vWal+Utde/5dilfdhEbcG9NJk/g 68 | BpuM43aRgUpOmF0u9L0jTeddm+poTQOeNZDF8o2u7URP81DcK++uRDV5eD1lS9kW 69 | mKq+CEclr2gcC47BqgKnYU9NFRsHPE5gs5rVwTk0To7nk0bxdZWqFpod5kkVpa4G 70 | ikUWqa9ZYJvGbT0ZV13eMdXclg6kJf56B3HFQMCj0NWERxR6WvEHdXk1AgMBAAGj 71 | gZQwgZEwHQYDVR0OBBYEFEQMr0p0tMdlArKV8ZF8o8zmPpnoMGIGA1UdIwRbMFmA 72 | FEQMr0p0tMdlArKV8ZF8o8zmPpnooT6kPDA6MREwDwYDVQQKDAhUZXN0IE9yZzEl 73 | MCMGA1UEAwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudIIBATAMBgNVHRME 74 | BTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAwB1FN1iwMLz5sXDQfByGNUHeapoF1 75 | YvD+/ztb0HzRRefiZ9Qjy6+ai/Qr0jM9RbunfbSbQdv7YqyD/EGu5dwt331yft80 76 | AWCUfxV4hIfwI+SOuNxxy4RLJbtij/1/0zwdhUX7A3yivMSo+ivseWeN9F83qFpU 77 | vLN4EQuLKZCLSErXh5OWl3IQHXAp+OTDgW19w27UyBsLDfnAuXsRVOKvi6BF3sJn 78 | gYwMnbqhMYvyzNrHzG0hkipXKZxIknXZGm7T7lNmgy4IdAldeBOZNH0WjLopdYAg 79 | i8qRGSlk72Q33lsiGJlbY2maokQhcDBB8lgnq09c0OGUXdFbjf2/j6mZ 80 | -----END CERTIFICATE----- 81 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/rauc/files/rauc-grow-data-partition.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Grow data partition to max size and expand filesystem 3 | DefaultDependencies=no 4 | Before=data.mount 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStart=/bin/sh -c '/usr/bin/growpart /dev/nvme0n1 5 && /usr/sbin/shutdown -r now' 9 | RemainAfterExit=yes 10 | SuccessExitStatus=1 0 11 | 12 | [Install] 13 | WantedBy=data.mount 14 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/rauc/files/system.conf: -------------------------------------------------------------------------------- 1 | [system] 2 | compatible=@@MACHINE@@ 3 | bootloader=grub 4 | grubenv=/grubenv/grubenv 5 | data-directory=/data/ 6 | 7 | [keyring] 8 | path=/etc/rauc/ca.cert.pem 9 | 10 | [log.readable] 11 | filename = rauc-history.log 12 | 13 | [log.json] 14 | filename = rauc-history.json 15 | format=json 16 | 17 | [slot.rootfs.0] 18 | device=/dev/nvme0n1p3 19 | type=ext4 20 | bootname=A 21 | 22 | [slot.rootfs.1] 23 | device=/dev/nvme0n1p4 24 | type=ext4 25 | bootname=B 26 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/rauc/rauc-conf.bbappend: -------------------------------------------------------------------------------- 1 | require ${@bb.utils.contains('DISTRO_FEATURES', 'rauc', '${BPN}_rauc.inc', '', d)} 2 | 3 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 4 | SRC_URI:append := " file://ca.cert.pem " 5 | 6 | do_install:prepend() { 7 | sed -i "s/@@MACHINE@@/${MACHINE}/g" ${WORKDIR}/system.conf 8 | } 9 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/rauc/rauc-conf_rauc.inc: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | # additional dependencies required to run RAUC on the target 4 | RDEPENDS:${PN} += "grub-editenv e2fsprogs-mke2fs" 5 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-core/rauc/rauc_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | SRC_URI:append := " \ 3 | file://rauc-grow-data-partition.service \ 4 | " 5 | 6 | inherit systemd 7 | 8 | SYSTEMD_PACKAGES += "${PN}-grow-data-part" 9 | SYSTEMD_SERVICE:${PN}-grow-data-part = "rauc-grow-data-partition.service" 10 | 11 | PACKAGES += "rauc-grow-data-part" 12 | 13 | RDEPENDS:${PN}-grow-data-part += "cloud-utils gptfdisk" 14 | 15 | do_install:append() { 16 | install -d ${D}${systemd_unitdir}/system/ 17 | install -m 0644 ${WORKDIR}/rauc-grow-data-partition.service ${D}${systemd_unitdir}/system/ 18 | } 19 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/recipes-extended/cloud-utils/cloud-utils_0.33.bb: -------------------------------------------------------------------------------- 1 | LICENSE = "GPL-3.0-only" 2 | LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504" 3 | 4 | SRC_URI = "git://github.com/canonical/cloud-utils;protocol=https;branch=main" 5 | 6 | SRCREV = "646ab04dcc275565608af3acc2f27ad8ca79dcfe" 7 | 8 | RDEPENDS:${PN} += " \ 9 | python3-core \ 10 | bash \ 11 | " 12 | S = "${WORKDIR}/git" 13 | 14 | do_compile () { 15 | oe_runmake 16 | } 17 | 18 | do_install () { 19 | oe_runmake install 'DESTDIR=${D}' 20 | } 21 | -------------------------------------------------------------------------------- /layers/bsp/meta-rauc-aws-ec2/wic/ec2_partition.wks.in: -------------------------------------------------------------------------------- 1 | # EFI boot partition is p1 2 | # grubenv partition is p2 3 | # root_a partition is p3 4 | # root_b partition is p4 5 | # data partition is p5 6 | 7 | 8 | part --fixed-size 50M --source rawcopy --sourceparams="file=efi-boot.vfat" --fstype=vfat --label boot --active --align 4096 9 | part --fixed-size 10M --source rawcopy --sourceparams="file=grubenv.vfat" --fstype=vfat --label grubenv --align 1024 10 | part / --source rootfs --exclude-path=data/ --fstype=ext4 --label root_a --fixed-size 1000M --align 4096 11 | part / --source rootfs --exclude-path=data/ --fstype=ext4 --label root_b --fixed-size 1000M --align 4096 12 | part /data --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/data --size 500M --fstype=ext4 --label data --align 4096 --fsoptions "x-systemd.growfs" 13 | 14 | bootloader --ptable gpt 15 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/aws-ec2-arm64/README.md: -------------------------------------------------------------------------------- 1 | # aws-ec2-arm64 2 | 3 | Shows [EC2 AMI generation](https://github.com/aws4embeddedlinux/meta-aws/blob/master/scripts/ec2-ami/README.md) feature. 4 | 5 | ## build an aws-ec2-arm64 image and create an EC2 AMI from it 6 | 7 | ### Set the DEVICE 8 | ```bash 9 | export DEVICE=aws-ec2-arm64 10 | ``` 11 | 12 | ### Set the IMAGE (e.g. aws-demo-image) 13 | ```bash 14 | export IMAGE=aws-demo-image 15 | ``` 16 | 17 | ### Build the IMAGE 18 | ```bash 19 | bitbake $IMAGE 20 | ``` 21 | 22 | ### Upload this image to your ec2 account (follow instructions to setup this up before!) 23 | ```bash 24 | cd .. 25 | meta-aws-demos$ layers/sw/meta-aws/scripts/ec2-ami/create-ec2-ami.sh amitest-bucket 16 aws-demo-image aws-ec2-arm64 26 | ``` 27 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/aws-ec2-arm64/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO ?= "poky" 2 | 3 | MACHINE ?= "aws-ec2-arm64" 4 | INHERIT += "aws-ec2-image" 5 | 6 | SDKMACHINE = "x86_64" 7 | 8 | QB_MEM = "-m 2048" -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/aws-ec2-arm64/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/sw/meta-virtualization \ 3 | " 4 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/aws-ec2-x86-64/README.md: -------------------------------------------------------------------------------- 1 | # aws-ec2-x86-64 2 | 3 | Shows [EC2 AMI generation](https://github.com/aws4embeddedlinux/meta-aws/blob/master/scripts/ec2-ami/README.md) feature. 4 | 5 | ## build an aws-ec2-x86-64 image and create an EC2 AMI from it 6 | 7 | ### Set the DEVICE 8 | ```bash 9 | export DEVICE=aws-ec2-x86-64 10 | ``` 11 | 12 | ### Set the IMAGE (e.g. aws-demo-image) 13 | ```bash 14 | export IMAGE=aws-demo-image 15 | ``` 16 | 17 | ### Build the IMAGE 18 | ```bash 19 | bitbake $IMAGE 20 | ``` 21 | 22 | ### Upload this image to your ec2 account (follow instructions to setup this up before!) 23 | ```bash 24 | cd .. 25 | meta-aws-demos$ layers/sw/meta-aws/scripts/ec2-ami/create-ec2-ami.sh amitest-bucket 16 aws-demo-image aws-ec2-x86-64 26 | ``` 27 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/aws-ec2-x86-64/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO ?= "poky" 2 | 3 | MACHINE ?= "aws-ec2-x86-64" 4 | INHERIT += "aws-ec2-image" 5 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/aws-ec2-x86-64/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/sw/meta-virtualization \ 3 | " 4 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/imx8m/README.md: -------------------------------------------------------------------------------- 1 | # Build for the NXP i.MX8MQEVK and i.MX8MPEVK 2 | 3 | The whole image can be build with this 4 | ```bash 5 | export DEVICE=imx8m 6 | bitbake imx-image-full 7 | ``` 8 | 9 | > [!NOTE] 10 | > this demo will require to accept the EULA in the config manually. 11 | > add ACCEPT_FSL_EULA = "1" in your local.conf 12 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/imx8m/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO ?= "poky" 2 | MACHINE ??= 'imx8mq-evk' 3 | DISTRO ?= 'fsl-imx-wayland' 4 | 5 | PACKAGECONFIG:append:pn-qemu-system-native = " sdl" 6 | 7 | # Switch to Debian packaging and include package-management in the image 8 | PACKAGE_CLASSES = "package_deb" 9 | EXTRA_IMAGE_FEATURES += "package-management" 10 | 11 | IMAGE_INSTALL:append = " greengrass-bin" 12 | IMAGE_INSTALL:append = " python3-grpcio-tools" 13 | IMAGE_INSTALL:append = " python3-numpy" 14 | IMAGE_INSTALL:append = " python3-grpcio" 15 | IMAGE_INSTALL:append = " python3-protobuf" 16 | IMAGE_INSTALL:append = " opencv" 17 | IMAGE_INSTALL:append = " aws-iot-device-sdk-python-v2" 18 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/imx8m/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/bsp/meta-freescale \ 3 | ${OEROOT}/../layers/bsp/meta-freescale-distro \ 4 | " -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemuarm/README.md: -------------------------------------------------------------------------------- 1 | # qemuarm - qemu for arm32 2 | 3 | ## build an qemuarm image 4 | 5 | ### Build the image 6 | 7 | ### Run this image in QEMU 8 | ```bash 9 | runqemu slirp nographic 10 | ``` 11 | 12 | ### Fix DNS (a bug, if not using systemd) 13 | ```bash 14 | echo nameserver 8.8.4.4 >> /etc/resolv.conf 15 | ``` 16 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemuarm/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "qemuarm" 2 | 3 | # not many arm64 dev notebooks are used yet 4 | SDKMACHINE = "x86_64" 5 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemuarm/layers.conf: -------------------------------------------------------------------------------- 1 | # no additional layer necessary to build qemu -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemuarm64/README.md: -------------------------------------------------------------------------------- 1 | # qemuarm64 - qemu for arm64 2 | 3 | This is the default DEVICE. 4 | 5 | ## build an qemuarm64 image 6 | 7 | ### Build the image 8 | 9 | ### Run this image in QEMU 10 | ```bash 11 | runqemu slirp nographic 12 | ``` 13 | 14 | ### Fix DNS (a bug, if not using systemd) 15 | ```bash 16 | echo nameserver 8.8.4.4 >> /etc/resolv.conf 17 | ``` 18 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemuarm64/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "qemuarm64" 2 | 3 | # not many arm64 dev notebooks are used yet 4 | SDKMACHINE = "x86_64" 5 | 6 | # since this is running locally 7 | # EXTRA_IMAGE_FEATURES += "debug-tweaks tools-debug" 8 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemuarm64/layers.conf: -------------------------------------------------------------------------------- 1 | # no additional layer necessary to build qemu -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemux86-64/README.md: -------------------------------------------------------------------------------- 1 | # qemux86-64 - qemu for x86-64 2 | 3 | ## build an qemux86-64 image 4 | 5 | ### Build the image 6 | 7 | ### Run this image in QEMU. (root password disabled) 8 | ```bash 9 | runqemu slirp nographic 10 | ``` 11 | 12 | ### Fix DNS (a bug, if not using systemd) 13 | ```bash 14 | echo nameserver 8.8.4.4 >> /etc/resolv.conf 15 | ``` 16 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemux86-64/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "qemux86-64" 2 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/qemux86-64/layers.conf: -------------------------------------------------------------------------------- 1 | # no additional layer necessary to build qemu -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi-64/README.md: -------------------------------------------------------------------------------- 1 | # raspberrypi-64 - Raspberry Pi 64bit 2 | 3 | Compatible with Raspberry Pi 3,4,5 4 | 5 | See here: https://github.com/agherzan/meta-raspberrypi 6 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi-64/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "raspberrypi-armv8" 2 | 3 | IMAGE_FSTYPES ?= "wic wic.bz2" 4 | 5 | # WIFI 6 | DISTRO_FEATURES:append = " wifi" 7 | 8 | # ENABLE DEBUG OVER USB 9 | ENABLE_UART = "1" 10 | 11 | # https://meta-raspberrypi.readthedocs.io/en/latest/ipcompliance.html 12 | LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" 13 | 14 | # necessary as long as this PR is not merged: https://github.com/agherzan/meta-raspberrypi/pull/1460 15 | RPI_KERNEL_DEVICETREE_OVERLAYS:append = " overlays/bcm2712d0.dtbo" 16 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi-64/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/bsp/meta-raspberrypi \ 3 | " -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi0-wifi/README.md: -------------------------------------------------------------------------------- 1 | # raspberrypi0-wifi - RaspberryPi Zero WiFi Development Board 2 | 3 | Compatible with RaspberryPi Zero WiFi Development Board 4 | 5 | See here: https://github.com/agherzan/meta-raspberrypi 6 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi0-wifi/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "raspberrypi0-wifi" 2 | 3 | IMAGE_FSTYPES ?= "wic wic.bz2" 4 | 5 | # WIFI 6 | DISTRO_FEATURES:append = " wifi" 7 | 8 | # ENABLE DEBUG OVER USB 9 | ENABLE_UART = "1" 10 | 11 | # https://meta-raspberrypi.readthedocs.io/en/latest/ipcompliance.html 12 | LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi0-wifi/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/bsp/meta-raspberrypi \ 3 | " -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi2/README.md: -------------------------------------------------------------------------------- 1 | # raspberrypi-2 - Raspberry Pi 2 2 | 3 | Compatible with Raspberry Pi 2 4 | 5 | See here: https://github.com/agherzan/meta-raspberrypi 6 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi2/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "raspberrypi2" 2 | 3 | IMAGE_FSTYPES ?= "wic wic.bz2" 4 | 5 | # WIFI 6 | DISTRO_FEATURES:append = " wifi" 7 | 8 | # ENABLE DEBUG OVER USB 9 | ENABLE_UART = "1" 10 | 11 | # https://meta-raspberrypi.readthedocs.io/en/latest/ipcompliance.html 12 | LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/raspberrypi2/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/bsp/meta-raspberrypi \ 3 | " -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/rockchip-rv1106/README.md: -------------------------------------------------------------------------------- 1 | # rockchip-rv1106 2 | 3 | https://www.luckfox.com/Luckfox-Pico/EN-Luckfox-Pico-Pro 4 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/rockchip-rv1106/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "rockchip-rv1106" 2 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/rockchip-rv1106/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/bsp/rockchip-rv1106-dev/meta-rockchip-rv1106 \ 3 | ${OEROOT}/../layers/sw/meta-ptx \ 4 | " -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/stm32mp13-disco/README.md: -------------------------------------------------------------------------------- 1 | # stm32mp13-disco -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/stm32mp13-disco/config.conf: -------------------------------------------------------------------------------- 1 | MACHINE = "stm32mp13-disco" 2 | 3 | BB_DANGLINGAPPENDS_WARNONLY ?= "true" 4 | 5 | IMAGE_ROOTFS_MAXSIZE = "2097152" -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/stm32mp13-disco/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/../layers/bsp/meta-st-stm32mp \ 3 | " -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/ti-am572x-idk/README.md: -------------------------------------------------------------------------------- 1 | # ti-am572x-idk 2 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/ti-am572x-idk/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky" 2 | 3 | MACHINE = "am57xx-evm" 4 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/ti-am572x-idk/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS = "\ 2 | ${OEROOT}/../layers/bsp/meta-arm/meta-arm \ 3 | ${OEROOT}/../layers/bsp/meta-arm/meta-arm-toolchain \ 4 | ${OEROOT}/../layers/bsp/meta-ti/meta-ti-bsp \ 5 | ${OEROOT}/../layers/bsp/meta-ti/meta-ti-extras \ 6 | " 7 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/xilinx-zcu104-zynqmp/README.md: -------------------------------------------------------------------------------- 1 | # xilinx-zcu104-zynqmp 2 | 3 | The whole image can be build with this (not working when your host machine is arm64!) 4 | ```bash 5 | export DEVICE=xilinx-zcu104-zynqmp 6 | runqemu slirp nographic 7 | 8 | MACHINE=zynqmp-generic bitbake fsbl-firmware pmu-firmware 9 | ``` 10 | 11 | ## You need to accept the license and add this to your config: 12 | `LICENSE_FLAGS_ACCEPTED += "xilinx"` 13 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/xilinx-zcu104-zynqmp/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO ?= "petalinux" 2 | 3 | MACHINE ?= "zcu104-zynqmp" 4 | 5 | DISTRO_FEATURES += "systemd" 6 | DISTRO_FEATURES += "virtualization" 7 | DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" 8 | VIRTUAL-RUNTIME_init_manager = "systemd" 9 | VIRTUAL-RUNTIME_initscripts = "" 10 | 11 | BASIC_NET = "i2c-tools \ 12 | python3-smbus \ 13 | bridge-utils \ 14 | hostapd \ 15 | dhcpcd \ 16 | iptables \ 17 | wpa-supplicant \ 18 | strace \ 19 | " 20 | 21 | IMAGE_INSTALL:append = " ${BASIC_NET}" 22 | 23 | #do_image[mcdepends] = "multiconfig::pmu:pmu-firmware:do_deploy" 24 | 25 | PREFERRED_PROVIDER_virtual/pmufw = "pmufw" 26 | PREFERRED_PROVIDER_virtual/boot-bin = "xilinx-bootbin" 27 | PREFERRED_PROVIDER_virtual/dtb = "device-tree" 28 | PREFERRED_PROVIDER_qemu-native = "qemu-xilinx-native" 29 | 30 | # 31 | # Qemu configuration 32 | # 33 | # By default native qemu will build with a builtin VNC server where graphical output can be 34 | # seen. The line below enables the SDL UI frontend too. 35 | PACKAGECONFIG:append:pn-qemu-system-native = " sdl" 36 | # By default libsdl2-native will be built, if you want to use your host's libSDL instead of 37 | # the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below. 38 | #ASSUME_PROVIDED += "libsdl2-native" 39 | 40 | # You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds 41 | # a handy set of menus for controlling the emulator. 42 | #PACKAGECONFIG:append:pn-qemu-system-native = " gtk+" 43 | 44 | #Add below lines to use runqemu for ZU+ machines 45 | PMU_FIRMWARE_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" 46 | PMU_FIRMWARE_IMAGE_NAME ??= "pmu-firmware-${MACHINE}" 47 | 48 | #Enable the below line to use pmu-rom.elf from a specific path 49 | #PMU_ROM = "/proj/yocto/pmu-rom/pmu-rom.elf" 50 | 51 | EXTRA_IMAGE_FEATURES ?= "debug-tweaks" -------------------------------------------------------------------------------- /meta-aws-demos/conf/devices/xilinx-zcu104-zynqmp/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS = "\ 2 | ${OEROOT}/../layers/bsp/meta-xilinx/meta-xilinx-core \ 3 | ${OEROOT}/../layers/bsp/meta-xilinx/meta-xilinx-bsp \ 4 | ${OEROOT}/../layers/bsp/meta-xilinx/meta-xilinx-standalone \ 5 | ${OEROOT}/../layers/bsp/meta-xilinx/meta-xilinx-contrib \ 6 | ${OEROOT}/../layers/bsp/meta-xilinx-tools \ 7 | " 8 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have recipes-* directories, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | # this is necessary to find aws-demo-image 9 | BBFILES += "${LAYERDIR}/recipes-*/*/*/*.bb \ 10 | ${LAYERDIR}/recipes-*/*/*/*.bbappend" 11 | 12 | BBFILE_COLLECTIONS += "aws-demos" 13 | BBFILE_PATTERN_aws-demos := "^${LAYERDIR}/" 14 | BBFILE_PRIORITY_aws-demos = "99" 15 | 16 | # This should only be incremented on significant changes that will 17 | # cause compatibility issues with other layers 18 | LAYERVERSION_aws-demos = "1" 19 | LAYERSERIES_COMPAT_aws-demos = "scarthgap" 20 | LAYERDEPENDS_aws-demos = "core meta-aws" 21 | 22 | # Ignore aws-iot-greengrass-lite-container-demo-image.bb that requires meta-virtualization if it's not present. 23 | BBMASK += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'virtualization-layer', '', 'meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/aws-iot-greengrass-lite-container-demo-image*', d)}" 24 | 25 | # Ignore other images than the selected IMAGE, this is necessary if an image use a layer global class that is not present in other images it will give error otherwise. 26 | BBMASK += "/meta-aws-demos/recipes-core/images/(?!${IMAGE}/)" 27 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/templates/default/bblayers.conf.sample: -------------------------------------------------------------------------------- 1 | OEROOT = "##OEROOT##" 2 | 3 | BBPATH = "${TOPDIR}" 4 | BBFILES ?= "" 5 | 6 | # Add an local layers here (and for devtool) 7 | BBLAYERS = "" 8 | 9 | require ##OEROOT##/../meta-aws-demos/conf/devices/${DEVICE}/layers.conf 10 | 11 | # optional 12 | include ##OEROOT##/../meta-aws-demos/recipes-core/images/${IMAGE}/layers.conf 13 | 14 | # filter duplicate layers 15 | BBLAYERS := "${@' '.join(sorted(set('${BBLAYERS}'.split())))}" 16 | -------------------------------------------------------------------------------- /meta-aws-demos/conf/templates/default/local.conf.sample: -------------------------------------------------------------------------------- 1 | CONF_VERSION ?= "2" 2 | DISTRO ?= "poky" 3 | 4 | # mandatory 5 | require ${OEROOT}/../meta-aws-demos/conf/devices/${DEVICE}/config.conf 6 | 7 | # optional 8 | include ${OEROOT}/../meta-aws-demos/recipes-core/images/${IMAGE}/config.conf 9 | 10 | # Additional image features 11 | USER_CLASSES ?= "buildstats" 12 | 13 | # By default disable interactive patch resolution (tasks will just fail instead): 14 | PATCHRESOLVE = "noop" 15 | 16 | # Disk Space Monitoring during the build 17 | BB_DISKMON_DIRS = "\ 18 | STOPTASKS,${TMPDIR},1G,100K \ 19 | STOPTASKS,${DL_DIR},1G,100K \ 20 | STOPTASKS,${SSTATE_DIR},1G,100K \ 21 | HALT,${TMPDIR},100M,1K \ 22 | HALT,${DL_DIR},100M,1K \ 23 | HALT,${SSTATE_DIR},100M,1K" 24 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-demo-image 2 | Is a general demo installing all "useful" meta-aws packages into one image. 3 | 4 | `debug-tweaks` are enabled by default and therefor is no password set for user root. 5 | 6 | When building for ec2-* remember that password login is disabled completly and only cert based ssh login with user `user` is configured by default. 7 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-demo-image/aws-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A image to test meta-aws software" 2 | inherit core-image 3 | 4 | IMAGE_INSTALL =+ "\ 5 | amazon-cloudwatch-publisher \ 6 | amazon-kvs-producer-pic \ 7 | amazon-kvs-producer-sdk-c \ 8 | amazon-kvs-producer-sdk-cpp \ 9 | amazon-kvs-webrtc-sdk \ 10 | amazon-s3-gst-plugin \ 11 | amazon-ssm-agent \ 12 | aws-c-auth \ 13 | aws-c-cal \ 14 | aws-c-common \ 15 | aws-c-compression \ 16 | aws-c-event-stream \ 17 | aws-c-http \ 18 | aws-c-io \ 19 | aws-c-iot \ 20 | aws-c-mqtt \ 21 | aws-c-s3 \ 22 | aws-c-sdkutils \ 23 | aws-checksums \ 24 | aws-cli \ 25 | aws-crt-cpp \ 26 | aws-crt-python \ 27 | aws-iot-device-sdk-cpp-v2 \ 28 | aws-iot-device-sdk-cpp-v2-samples-mqtt5-pubsub \ 29 | aws-iot-device-sdk-python-v2 \ 30 | aws-iot-fleetwise-edge \ 31 | aws-iot-securetunneling-localproxy \ 32 | aws-sdk-cpp \ 33 | corretto-11-bin \ 34 | greengrass-bin \ 35 | python3-boto3 \ 36 | python3-botocore \ 37 | python3-s3transfer \ 38 | python3-timeloop \ 39 | s2n \ 40 | " 41 | 42 | EXTRA_IMAGE_FEATURES += "debug-tweaks tools-debug" 43 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 11 | " 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-device-client-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-device-client-demo-image 2 | A image to demo aws-iot-device-client. 3 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-device-client-demo-image/aws-iot-device-client-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A image to test meta-aws software" 2 | 3 | IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL} aws-iot-device-client" 4 | 5 | IMAGE_LINGUAS = " " 6 | 7 | LICENSE = "MIT" 8 | 9 | inherit core-image 10 | 11 | IMAGE_ROOTFS_SIZE ?= "8192" 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-device-client-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 11 | " 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image-agl/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-fleetwise-test-image-agl 2 | AGL version of FleetWise Edge Agent image. 3 | 4 | This example showcases how to run, include, configure, and use an AWS IoT Fleetwise Edge Agent. 5 | 6 | Together with: https://docs.automotivelinux.org/en/octopus/#01_Getting_Started/02_Building_AGL_Image/08_Building_for_Raspberry_Pi_4/ 7 | 8 | Apart from adding it to an image along with can-utils 9 | ``` 10 | IMAGE_INSTALL:append = " aws-iot-fleetwise-edge \ 11 | can-utils " 12 | ``` 13 | It's important to configure some of the parameters in order for the FWE to connect to a specific AWS IoT account and to use the right vehicle ID as well as consume data from the appropriate CAN bus. 14 | 15 | For more info on what all this means, take a look at the official documentation 16 | https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/vehicles.html 17 | 18 | Example config: 19 | ``` 20 | CERTIFICATE:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 21 | PRIVATE_KEY:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 22 | VEHICLE_NAME:pn-aws-iot-fleetwise-edge="v1" 23 | ENDPOINT_URL:pn-aws-iot-fleetwise-edge="xxx.iot.region.amazonaws.com" 24 | CAN_BUS:pn-aws-iot-fleetwise-edge="vcan0" 25 | ``` 26 | This will use the `configure-fwe` from [here](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/tools/configure-fwe.sh) to create an appropriate config.json. 27 | 28 | More information about AWS IoT FleetWise Edge Agent can be found [here](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/README.md). 29 | 30 | ## build an qemux86-64 image with FleetWise Edge Agent installed 31 | 32 | * Build the image 33 | 34 | ```bash 35 | bitbake aws-iot-fleetwise-test-image-agl 36 | ``` 37 | * Run this image in QEMU. (root password disabled) 38 | ```bash 39 | runqemu slirp nographic 40 | ``` 41 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image-agl/aws-iot-fleetwise-test-image-agl.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A image to test aws-iot-fleetwise" 2 | inherit core-image 3 | 4 | IMAGE_INSTALL += "tmux" 5 | 6 | TOOLCHAIN_TARGET_TASK += "libwebsockets-dev mbedtls-dev" 7 | 8 | TEST_SUITES = " ping aws-iot-fleetwise-edge " 9 | 10 | IMAGE_INSTALL:append = " aws-iot-fleetwise-edge \ 11 | can-utils " 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image-agl/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-agl" 2 | 3 | EXTRA_IMAGE_FEATURES ?= "debug-tweaks" 4 | 5 | SDKMACHINE = "x86_64" 6 | 7 | TEST_SUITES = " ping aws-iot-fleetwise-edge " 8 | 9 | QEMU_USE_KVM = "" 10 | QEMU_USE_SLIRP = "1" 11 | 12 | IMAGE_INSTALL:append = " aws-iot-fleetwise-edge \ 13 | can-utils " 14 | 15 | CERTIFICATE:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 16 | PRIVATE_KEY:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 17 | VEHICLE_NAME:pn-aws-iot-fleetwise-edge="v1" 18 | ENDPOINT_URL:pn-aws-iot-fleetwise-edge="xxx.iot.region.amazonaws.com" 19 | CAN_BUS:pn-aws-iot-fleetwise-edge="vcan0" 20 | 21 | # systemd 22 | DISTRO_FEATURES:append = " largefile ptest multiarch systemd" 23 | VIRTUAL-RUNTIME_init_manager = "systemd" 24 | VIRTUAL-RUNTIME_initscripts = "" 25 | VIRTUAL-RUNTIME_syslog = "" 26 | 27 | QB_MEM = "-m 2048" 28 | 29 | BB_DANGLINGAPPENDS_WARNONLY ?= "true" 30 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image-agl/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 11 | ${OEROOT}/../layers/sw/meta-openembedded/meta-perl \ 12 | ${OEROOT}/../layers/sw/meta-qt5 \ 13 | ${OEROOT}/../layers/sw/meta-clang \ 14 | ${OEROOT}/../layers/sw/meta-flutter \ 15 | ${OEROOT}/../layers/agl/meta-agl/meta-agl-core \ 16 | ${OEROOT}/../layers/agl/meta-agl/meta-agl-bsp \ 17 | ${OEROOT}/../layers/agl/meta-agl/meta-app-framework \ 18 | ${OEROOT}/../layers/agl/meta-agl/meta-agl-kuksa-val \ 19 | ${OEROOT}/../layers/agl/meta-agl-demo \ 20 | " -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-fleetwise-test-image 2 | 3 | This example showcases how to run, include, configure, and use an AWS IoT Fleetwise Edge Agent. 4 | 5 | Apart from adding it to an image along with can-utils 6 | ``` 7 | IMAGE_INSTALL:append = " aws-iot-fleetwise-edge \ 8 | can-utils " 9 | ``` 10 | It's important to configure some of the parameters in order for the FWE to connect to a specific AWS IoT account and to use the right vehicle ID as well as consume data from the appropriate CAN bus. 11 | 12 | For more info on what all this means, take a look at the official documentation 13 | https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/vehicles.html 14 | 15 | Example config: 16 | ``` 17 | CERTIFICATE:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 18 | PRIVATE_KEY:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 19 | VEHICLE_NAME:pn-aws-iot-fleetwise-edge="v1" 20 | ENDPOINT_URL:pn-aws-iot-fleetwise-edge="xxx.iot.region.amazonaws.com" 21 | CAN_BUS:pn-aws-iot-fleetwise-edge="vcan0" 22 | ``` 23 | This will use the `configure-fwe` from [here](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/tools/configure-fwe.sh) to create an appropriate config.json. 24 | 25 | More information about AWS IoT FleetWise Edge Agent can be found [here](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/README.md). 26 | 27 | ## build an qemux86-64 image with FleetWise Edge Agent installed 28 | 29 | ### Build the image 30 | 31 | ### Run this image in QEMU. (root password disabled) 32 | ```bash 33 | runqemu slirp nographic 34 | ``` 35 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image/aws-iot-fleetwise-test-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A image to test aws-iot-fleetwise" 2 | inherit core-image 3 | 4 | IMAGE_INSTALL += "tmux" 5 | 6 | TOOLCHAIN_TARGET_TASK += "libwebsockets-dev mbedtls-dev" 7 | 8 | TEST_SUITES = " ping aws-iot-fleetwise-edge " 9 | 10 | IMAGE_INSTALL:append = " aws-iot-fleetwise-edge \ 11 | can-utils " 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | EXTRA_IMAGE_FEATURES ?= "debug-tweaks" 3 | 4 | SDKMACHINE = "x86_64" 5 | 6 | TEST_SUITES = " ping aws-iot-fleetwise-edge " 7 | 8 | QEMU_USE_KVM = "" 9 | QEMU_USE_SLIRP = "1" 10 | 11 | IMAGE_INSTALL:append = " aws-iot-fleetwise-edge \ 12 | can-utils " 13 | 14 | CERTIFICATE:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 15 | PRIVATE_KEY:pn-aws-iot-fleetwise-edge="-----BEGIN-----\nXXXXX\n-----END-----\n" 16 | VEHICLE_NAME:pn-aws-iot-fleetwise-edge="v1" 17 | ENDPOINT_URL:pn-aws-iot-fleetwise-edge="xxx.iot.region.amazonaws.com" 18 | CAN_BUS:pn-aws-iot-fleetwise-edge="vcan0" 19 | 20 | # systemd 21 | DISTRO_FEATURES:append = " largefile ptest multiarch systemd" 22 | VIRTUAL-RUNTIME_init_manager = "systemd" 23 | VIRTUAL-RUNTIME_initscripts = "" 24 | VIRTUAL-RUNTIME_syslog = "" 25 | 26 | QB_MEM = "-m 2048" 27 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-fleetwise-test-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 11 | " 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-demo-image 2 | AWS IoT Greengrass is software that extends cloud capabilities to local 3 | devices. This enables devices to collect and analyze data closer to the 4 | source of information, react autonomously to local events, and communicate 5 | securely with each other on local networks. Local devices can also 6 | communicate securely with AWS IoT Core and export IoT data to the AWS Cloud. 7 | AWS IoT Greengrass developers can use AWS Lambda functions and prebuilt 8 | connectors to create serverless applications that are deployed to devices 9 | for local execution. 10 | 11 | AWS Greengrass Lite is the AWS IoT Greengrass runtime for constrained devices. 12 | 13 | The Greengrass Lite nucleus provides a smaller alternative to the 14 | Classic nucleus for Greengrass v2 deployments. 15 | 16 | Greengrass Lite aims to maintain compatibility with the Classic nucleus, 17 | and implements a subset of its functionality. 18 | 19 | For other installation possibilities look here: 20 | https://github.com/aws-greengrass/aws-greengrass-lite 21 | 22 | ## BUILDING 23 | 24 | ```bash 25 | . init-build-env 26 | bitbake $IMAGE 27 | runqemu slirp nographic 28 | ``` 29 | 30 | Configure this image 31 | 32 | ```bash 33 | export IMAGE=aws-iot-greengrass-demo-image 34 | ``` 35 | 36 | Configure a device e.g. raspberrypi-64 37 | 38 | ```bash 39 | export DEVICE=raspberrypi-64 40 | ``` 41 | 42 | Build 43 | 44 | ```bash 45 | bitbake $IMAGE 46 | ``` 47 | 48 | ## INSTALLATION 49 | 50 | 1. Download rpi imager for your OS (mac, win, linux) 51 | https://www.raspberrypi.com/documentation/computers/getting-started.html#raspberry-pi-imager 52 | 53 | 2. Select “use custom img” and flash demo image contained in this zip file 54 | on your SD-Card. The RPI imager auto rejects the SD card after it completes flashing the image, 55 | you need to uncheck this option or need to plug in again to transfer the unzipped connection kit. 56 | 57 | 3. Mount the boot fat partition and copy Connection Kit Zip onto it. 58 | 59 | - This needs to be done after you flashed your SD-Card. (Step 2) 60 | - This is done depending on your OS in Explorer, nemo, bash, Finder. 61 | - It is the only fat partition on the sd card 62 | 63 | 4. a) You can configure the ethernet adapter ip address by editing the cmdline.txt 64 | file on the fat partition to append eg.: ip=192.168.0.69::192.168.0.1:255.255.255.0:rpi:eth0:off 65 | 66 | 4. b) You can create a wpa_supplicant.conf file in the fat partition to configure your WIFI. 67 | It uses this https://linux.die.net/man/5/wpa_supplicant.conf format. 68 | ```conf 69 | network={ 70 | ssid="" 71 | psk="" 72 | } 73 | ``` 74 | 75 | 4. c) You can create a wlan.network file in the fat partition to do the ip configuration of your wlan, 76 | default is this, DHCP. It uses this https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html 77 | format. 78 | 79 | ```conf 80 | [Match] 81 | Name=wl* 82 | 83 | [Network] 84 | DHCP=ipv4 85 | 86 | [DHCP] 87 | RouteMetric=20 88 | ClientIdentifier=mac 89 | ``` 90 | 91 | static ip example: 92 | 93 | ```conf 94 | [Match] 95 | Name=wl* 96 | 97 | [Network] 98 | DHCP=no 99 | Address=192.168.0.123/24 100 | Gateway=192.168.0.1 101 | DNS=8.8.8.8 8.8.4.4 102 | ``` 103 | 104 | 5. Unmount, remove sd-card, put in Raspberry Pi and boot. 105 | 106 | 6. Password for "root" user is empty. Please note that this can be a security risk and should be changed 107 | when using device in a public environment! SSH is enabled by default to connect over the network! 108 | You can use the thing name to connect to the device via ssh, this is set as hostname, 109 | and annouced by mdns. Note that underscores in a thing name will be removed! 110 | 111 | ```bash 112 | Login: root 113 | Password: 114 | ``` 115 | 116 | 7. When logged in you can check the status of the installation by running 117 | systemctl status greengrass -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/aws-iot-greengrass-demo-bundle.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A update bundle for aws-iot-greengrass-demo-image" 2 | 3 | inherit bundle 4 | 5 | # RAUC_BUNDLE_VERSION = "v20200703" 6 | # RAUC_BUNDLE_DESCRIPTION = "RAUC Demo Bundle" 7 | 8 | RAUC_BUNDLE_SLOTS = "rootfs" 9 | RAUC_SLOT_rootfs = "aws-iot-greengrass-demo-image" 10 | 11 | RAUC_BUNDLE_COMPATIBLE ?= "${MACHINE}" 12 | RAUC_BUNDLE_FORMAT ?= "verity" 13 | 14 | # those are the certs that are contained in meta-rauc-community/meta-rauc-raspberrypi 15 | # they are intended for demo purpose only 16 | RAUC_KEY_FILE ?= "${THISDIR}/files/development-1.key.pem" 17 | RAUC_CERT_FILE ?= "${THISDIR}/files/development-1.cert.pem" 18 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/aws-iot-greengrass-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for aws-iot-greengrass with A/B updates" 2 | HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos" 3 | 4 | LICENSE = "MIT" 5 | 6 | # this needs to be done before installing the (dynamic) packagegroups 7 | inherit core-image 8 | 9 | IMAGE_INSTALL += "\ 10 | ${CORE_IMAGE_EXTRA_INSTALL} \ 11 | packagegroup-base \ 12 | packagegroup-core-boot \ 13 | " 14 | 15 | ### AWS ### 16 | IMAGE_INSTALL:append = " greengrass-bin udev" 17 | IMAGE_INSTALL:append = " aws-iot-device-sdk-python-v2" 18 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 19 | 20 | ### rauc ### 21 | CORE_IMAGE_EXTRA_INSTALL:append = " rauc-grow-data-part" 22 | 23 | # only adding if device is rpi, as others might have a different partition layout 24 | IMAGE_INSTALL:append:rpi = " greengrass-config-init yq" 25 | # this will allow kernel updates with rauc 26 | IMAGE_INSTALL:append = " kernel-image kernel-modules" 27 | 28 | ### tmux ### 29 | IMAGE_INSTALL:append = " tmux" 30 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8" 31 | IMAGE_INSTALL:append = " glibc-utils localedef " 32 | IMAGE_INSTALL:append = " ssh openssh-sshd openssh-sftp openssh-scp" 33 | 34 | ### aws-iot-device-client ### 35 | # IMAGE_INSTALL:append = " aws-iot-device-client" 36 | 37 | ### amazon-cloudwatch-publisher ### 38 | # IMAGE_INSTALL:append = " amazon-cloudwatch-publisher" 39 | 40 | ### misc ### 41 | IMAGE_INSTALL:append = " sudo" 42 | 43 | # this will disable root password - be warned! 44 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 45 | 46 | ### license compliance ### 47 | COPY_LIC_MANIFEST = "1" 48 | 49 | COPY_LIC_DIRS = "1" 50 | 51 | ### debug tools ### 52 | # IMAGE_INSTALL:append = " ldd gdb" 53 | # IMAGE_INSTALL:append = " valgrind" 54 | # IMAGE_INSTALL:append = " strace" 55 | 56 | 57 | # this will install all src, dbg packages to allow proper debugging with gdb 58 | # EXTRA_IMAGE_FEATURES:append = " src-pkgs dbg-pkgs" 59 | IMAGE_FEATURES += "read-only-rootfs" 60 | 61 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 62 | # for rauc bundle generation wic file is not used! 63 | IMAGE_PREPROCESS_COMMAND:append = " rootfs_user_fstab" 64 | 65 | rootfs_user_fstab () { 66 | 67 | # overwrite the default fstab, adding customization for this image 68 | cat << EOF > ${IMAGE_ROOTFS}/${sysconfdir}/fstab 69 | /dev/root / auto defaults 1 1 70 | proc /proc proc defaults 0 0 71 | devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 72 | tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 73 | tmpfs /var/volatile tmpfs defaults 0 0 74 | LABEL=boot /boot vfat defaults 0 0 75 | LABEL=data /data ext4 x-systemd.growfs 0 0 76 | /data/etc/wpa_supplicant /etc/wpa_supplicant none bind 0 0 77 | /data/etc/systemd/network /etc/systemd/network none bind 0 0 78 | /data/greengrass/v2/ /greengrass/v2/ none bind 0 0 79 | /data/home/ /home none bind 0 0 80 | EOF 81 | 82 | install -d -m 0755 ${IMAGE_ROOTFS}/data 83 | 84 | # copy those directories that should be present at the data partition to /data and just 85 | # leave them empty as a mount point for the bind mount 86 | 87 | install -d ${IMAGE_ROOTFS}/data/etc/wpa_supplicant 88 | # empty dir 89 | # mv -f ${IMAGE_ROOTFS}/etc/wpa_supplicant/* ${IMAGE_ROOTFS}/data/etc/wpa_supplicant/ 90 | 91 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/network 92 | mv -f ${IMAGE_ROOTFS}/etc/systemd/network/* ${IMAGE_ROOTFS}/data/etc/systemd/network 93 | 94 | install -d ${IMAGE_ROOTFS}/data/greengrass/v2 95 | mv -f ${IMAGE_ROOTFS}/greengrass/v2/* ${IMAGE_ROOTFS}/data/greengrass/v2 96 | 97 | # decided to do here instead of a bbappend of wpa:supplicant 98 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 99 | ln -sf /${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service 100 | 101 | mv -f ${IMAGE_ROOTFS}/etc/hostname ${IMAGE_ROOTFS}/data/etc/hostname 102 | ln -sf /data/etc/hostname ${IMAGE_ROOTFS}/etc/hostname 103 | 104 | mv -f ${IMAGE_ROOTFS}/etc/hosts ${IMAGE_ROOTFS}/data/etc/hosts 105 | ln -sf /data/etc/hosts ${IMAGE_ROOTFS}/etc/hosts 106 | 107 | # enable systemd-time-wait-sync as this is important for greengrass to have a correct clock 108 | ln -sf /${libdir}/systemd/system/systemd-time-wait-sync.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 109 | 110 | install -d ${IMAGE_ROOTFS}/data/home 111 | # mv -f ${IMAGE_ROOTFS}/home/* ${IMAGE_ROOTFS}/data/home/ 112 | } -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | 5 | # we are read only, no addition space necessary, except for ROOTFS_POSTINSTALL_COMMAND 6 | IMAGE_OVERHEAD_FACTOR = "1.1" 7 | 8 | BOOT_SPACE = "69152" 9 | 10 | DISTRO_FEATURES:append = " rauc" 11 | 12 | # we do not use bluetooth at the moment 13 | DISTRO_FEATURES:remove = " bluetooth" 14 | 15 | ENABLE_UART = "1" 16 | 17 | RPI_USE_U_BOOT = "1" 18 | 19 | # PREFERRED_PROVIDER_virtual/bootloader = "u-boot" 20 | WKS_FILE = "${THISDIR}/wic/sdimage-aws-iot-greengrass-demo_partition.wks.in" 21 | 22 | # Settings for meta-rauc-raspberry-pi 23 | IMAGE_FSTYPES="ext4 wic.bz2 wic" 24 | IMAGE_INSTALL:append = " rauc" 25 | 26 | # just necessary if aws-iot-device-client is installed 27 | PACKAGECONFIG:pn-aws-iot-device-client = "st" 28 | 29 | COPY_LIC_MANIFEST = "1" 30 | 31 | COPY_LIC_DIRS = "1" 32 | 33 | BB_GENERATE_MIRROR_TARBALLS = "1" 34 | 35 | BB_GIT_SHALLOW = "1" 36 | 37 | BB_GENERATE_SHALLOW_TARBALLS = "1" 38 | 39 | INHERIT += "create-spdx" 40 | 41 | 42 | # add build info to the image 43 | INHERIT += "image-buildinfo" 44 | 45 | 46 | # tests 47 | 48 | # use slirp networking instead of TAP interface (require root rights) 49 | #QEMU_USE_SLIRP = "1" 50 | #TEST_SERVER_IP = "127.0.0.1" 51 | 52 | # this will specify what test should run when running testimage cmd - oeqa layer tests + ptests: 53 | # Ping and SSH are not required, but do help in debugging. ptest will discover all ptest packages. 54 | # TEST_SUITES = " ping ssh ptest" 55 | 56 | # this will allow - running testimage cmd: bitbake core-image-minimal -c testimage 57 | # IMAGE_CLASSES += "testimage" 58 | 59 | # PUT = package under test / this is set in auto.conf 60 | # PUT = "greengrass-lite-ptest" 61 | # IMAGE_INSTALL:append = " ptest-runner ssh ${PUT}" 62 | 63 | # if not set, you will have to take care of mount points at two places, with this set image 64 | # partition layout is done in wic file and fstab settings in aws-iot-greengrass-lite-demo-ab-image.bb 65 | WIC_CREATE_EXTRA_ARGS = "--no-fstab-update" 66 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/files/development-1.cert.pem: -------------------------------------------------------------------------------- 1 | Certificate: 2 | Data: 3 | Version: 3 (0x2) 4 | Serial Number: 2 (0x2) 5 | Signature Algorithm: sha256WithRSAEncryption 6 | Issuer: O=Test Org, CN=Test Org rauc CA Development 7 | Validity 8 | Not Before: Jan 1 00:00:00 1970 GMT 9 | Not After : Dec 31 23:59:59 9999 GMT 10 | Subject: O=Test Org, CN=Test Org Development-1 11 | Subject Public Key Info: 12 | Public Key Algorithm: rsaEncryption 13 | RSA Public-Key: (2048 bit) 14 | Modulus: 15 | 00:ac:2b:0f:05:02:d0:bb:b0:47:05:36:71:3c:20: 16 | 0e:a7:76:8d:75:c1:23:5e:6c:7a:2d:94:ff:3c:17: 17 | d8:0b:44:48:2a:82:03:92:c5:fd:33:76:0c:42:cf: 18 | 4d:8a:c9:47:7f:af:52:7c:15:6c:3b:e7:60:d1:04: 19 | 97:24:7b:07:1f:56:7d:6c:3f:31:e8:f9:36:7b:33: 20 | 5b:cf:54:ea:37:98:a6:b1:9a:1d:da:96:a1:07:14: 21 | 9c:15:80:4d:db:0c:03:86:ce:c7:3d:72:57:a2:da: 22 | a0:c0:8c:b2:9a:a0:6a:e5:b8:5f:52:d2:f6:27:ca: 23 | 48:f4:e3:86:eb:be:24:93:6a:af:60:68:7f:09:3b: 24 | 81:96:ce:85:0c:63:93:d8:fa:91:dc:50:2e:77:bb: 25 | bc:38:42:e9:86:d8:ac:33:dd:e6:d4:37:69:e3:01: 26 | 8d:21:8f:a9:4a:7f:15:a5:aa:a9:be:fc:36:93:a4: 27 | 10:0c:18:33:30:06:7f:1c:13:b3:a9:c6:57:d7:6b: 28 | 96:45:15:e7:f5:8f:3d:48:e0:08:46:4f:7f:ef:14: 29 | 77:95:25:25:9b:14:21:84:25:eb:37:0b:01:48:e6: 30 | f5:c1:8b:61:c6:cb:8c:6b:a7:d8:d2:f9:31:e3:80: 31 | 3f:78:ea:6a:41:6c:5d:4d:83:a6:54:0d:5b:c2:0e: 32 | f6:ef 33 | Exponent: 65537 (0x10001) 34 | X509v3 extensions: 35 | X509v3 Subject Key Identifier: 36 | 89:4C:FE:8A:60:4D:C9:6D:F7:A8:C0:04:49:7F:AA:05:92:29:17:FB 37 | X509v3 Authority Key Identifier: 38 | keyid:44:0C:AF:4A:74:B4:C7:65:02:B2:95:F1:91:7C:A3:CC:E6:3E:99:E8 39 | DirName:/O=Test Org/CN=Test Org rauc CA Development 40 | serial:01 41 | 42 | X509v3 Basic Constraints: 43 | CA:FALSE 44 | Signature Algorithm: sha256WithRSAEncryption 45 | 2c:d2:30:68:f5:84:52:1e:cf:ed:0d:fc:e7:02:69:0b:3b:f6: 46 | c3:77:00:12:1d:2d:d0:8f:49:9e:5c:f1:00:7b:1d:4f:d5:a9: 47 | 46:a5:df:54:90:50:b4:8f:8e:ba:4b:2d:82:74:eb:5b:a8:f5: 48 | 45:7b:77:73:b1:9b:32:93:15:c0:5c:02:2a:ed:b0:1e:bb:d8: 49 | 4e:41:17:20:af:04:46:21:20:7b:86:9f:32:ab:54:71:26:e8: 50 | 0b:75:12:9c:63:53:4f:54:db:a7:f9:b2:fa:e9:ee:4a:9d:80: 51 | ba:ae:3f:eb:ef:10:11:2d:4f:5a:34:fb:8b:45:10:63:0b:f8: 52 | af:f3:8b:24:21:2a:e0:0b:44:38:44:b5:9d:6e:8a:ff:1f:bf: 53 | 6e:44:21:22:ec:8a:8d:73:63:e5:df:1a:ec:2a:64:1f:97:f9: 54 | 5c:3a:25:7f:03:80:4c:db:99:5e:f9:7d:2b:f1:d0:97:4d:95: 55 | 6f:29:47:7b:3f:29:e3:96:25:b0:1c:f1:0b:8b:8b:ba:de:3b: 56 | 3f:40:2e:bd:31:68:ea:a9:8f:dc:c9:09:22:df:76:69:08:5d: 57 | 5d:a4:09:62:80:20:83:9e:bd:d4:a6:35:ee:97:50:66:39:62: 58 | 66:1b:2e:75:f2:6d:e7:06:ae:67:5f:4b:63:5c:52:e7:5d:dd: 59 | c9:0c:86:2b 60 | -----BEGIN CERTIFICATE----- 61 | MIIDfTCCAmWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADA6MREwDwYDVQQKDAhUZXN0 62 | IE9yZzElMCMGA1UEAwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudDAgFw03 63 | MDAxMDEwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowNDERMA8GA1UECgwIVGVzdCBP 64 | cmcxHzAdBgNVBAMMFlRlc3QgT3JnIERldmVsb3BtZW50LTEwggEiMA0GCSqGSIb3 65 | DQEBAQUAA4IBDwAwggEKAoIBAQCsKw8FAtC7sEcFNnE8IA6ndo11wSNebHotlP88 66 | F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DRBJckewcfVn1sPzHo+TZ7M1vP 67 | VOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDAjLKaoGrluF9S0vYnykj044br 68 | viSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG2Kwz3ebUN2njAY0hj6lKfxWl 69 | qqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I4AhGT3/vFHeVJSWbFCGEJes3 70 | CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZUDVvCDvbvAgMBAAGjgZEwgY4w 71 | HQYDVR0OBBYEFIlM/opgTclt96jABEl/qgWSKRf7MGIGA1UdIwRbMFmAFEQMr0p0 72 | tMdlArKV8ZF8o8zmPpnooT6kPDA6MREwDwYDVQQKDAhUZXN0IE9yZzElMCMGA1UE 73 | AwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudIIBATAJBgNVHRMEAjAAMA0G 74 | CSqGSIb3DQEBCwUAA4IBAQAs0jBo9YRSHs/tDfznAmkLO/bDdwASHS3Qj0meXPEA 75 | ex1P1alGpd9UkFC0j466Sy2CdOtbqPVFe3dzsZsykxXAXAIq7bAeu9hOQRcgrwRG 76 | ISB7hp8yq1RxJugLdRKcY1NPVNun+bL66e5KnYC6rj/r7xARLU9aNPuLRRBjC/iv 77 | 84skISrgC0Q4RLWdbor/H79uRCEi7IqNc2Pl3xrsKmQfl/lcOiV/A4BM25le+X0r 78 | 8dCXTZVvKUd7PynjliWwHPELi4u63js/QC69MWjqqY/cyQki33ZpCF1dpAligCCD 79 | nr3UpjXul1BmOWJmGy518m3nBq5nX0tjXFLnXd3JDIYr 80 | -----END CERTIFICATE----- 81 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/files/development-1.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCsKw8FAtC7sEcF 3 | NnE8IA6ndo11wSNebHotlP88F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DR 4 | BJckewcfVn1sPzHo+TZ7M1vPVOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDA 5 | jLKaoGrluF9S0vYnykj044brviSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG 6 | 2Kwz3ebUN2njAY0hj6lKfxWlqqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I 7 | 4AhGT3/vFHeVJSWbFCGEJes3CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZU 8 | DVvCDvbvAgMBAAECggEASphBYq9sltVyf/ytpRpSnxYLhmiPFXs0mIlE6Nl/3qnQ 9 | BrLcL3yfDuvntg6xjx9UXistNtvlUDMYzJcLkV/InzhPEVZ0HnfTth9zeOpWrI30 10 | M2EN7EZ1MGcqlVpI4U5cPM1cn+/proLBQYv0WnCEwFFY477JrkXDxG7MZ1mz6TaL 11 | IGcCCIUu1BxECngQ344eaKrSR5F2MtlxAl19Pt5QSPfmuMdmElrK6RtBjnKrDu1K 12 | fe6DCfObZ3nbG2fhFV4uTxhlTC9lUmfTQMKR79rLmHNKnbMx74kFNvy3XlT2l35I 13 | ZVfRMLPWph7yMom9v/Im3Q70uhJ1lxyqbbl/DFZVmQKBgQDVo19SqR/QeDIxPIPn 14 | XvVWzo5ml3KO/dVxA8sok6twr+G7yUeIUnuauYFA/tX/FS32azFRa/7GjUfoTx3q 15 | GHK43TBCMyEt0we6WwZb+FkWa/b/RBoyD/audrpmgDDi1+fXPs8bBvoO8/oju20D 16 | I6wOjSovcIMaeLo/+u3U6ShNQwKBgQDOTpoGMsQzXchZfDmxL61h3j4Gtjrl4BpU 17 | WhAkJ9U2BRpL8NSZLErn5ik8MwgK2ut+YdU7aogI0D6Gc+4zZoJDEbhhmPD9cprv 18 | LMyfAKoisR01OyU57mMSGQq0dfjmK6PfYJdX5sQJGkMFptNAJLTDoYtmXItSICoY 19 | 1j5KTvwe5QKBgGytxmErjfakHoxzh3pdERuOylwgMPPS5xCt6FyE+pLBtmisFQqh 20 | QyXLtpgUy1IPOSmBED6mXJ4u4uSn0sTymPG3+8PBdOB12RmREqQYq2E/nQ/wWg8b 21 | ldbcqShZkATl5pfV6M+L9gtDS/1/bA5LyExCvbISX29I+R5xDSnhTlI3AoGBAJRK 22 | VVXtOa/+UhtYOpPMxGCbgZQLemxvWB2XmxCR/SRWKJ+7XOU4vCLSAoO93qMG1szB 23 | /6Y0ndFP9hFo1SfnH+ybmR+18ksLDKisV+xWavSCwI7Zk5l/a4C/tT0fqyeu6JyQ 24 | bliFjBVK5i/yyNfLSo9v16ZdENuYOQofPSjmezytAoGBALhwvtzgqvqGSXID2w5N 25 | ullK8ny3WRa1o5DLXuMV19CvknmrN/zmmjQLblKkdp9VBb7uo8czon+qL1ZZyywC 26 | W2BmHfGMPUyQHux4btsdJhlWcS7z7aYXM9QWiKlI+EKLHLILYk+LPIEf85sUcOZV 27 | eCBpViT7fv2iv/0L+mzjWtLA 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-clang \ 7 | ${OEROOT}/../layers/sw/meta-rauc \ 8 | ${OEROOT}/../layers/bsp/meta-rauc-community/meta-rauc-raspberrypi \ 9 | ${OEROOT}/../layers/bsp/meta-lts-mixins \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 11 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 12 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 13 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 14 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 15 | ${OEROOT}/../layers/sw/meta-virtualization \ 16 | " 17 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-image/wic/sdimage-aws-iot-greengrass-demo_partition.wks.in: -------------------------------------------------------------------------------- 1 | part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --fixed-size 500M --active --align 4096 2 | part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_A --align 4096 3 | part / --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_B --align 4096 4 | part /data --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/data --size 500M --ondisk mmcblk0 --fstype=ext4 --label data --align 4096 --fsoptions "x-systemd.growfs" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-simple-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-demo-simple-image 2 | 3 | This image is similar to [aws-iot-greengrass-demo-image](../aws-iot-greengrass-demo-image/README.md) 4 | 5 | The main difference it is just one rw rootfs partition.. 6 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-simple-image/aws-iot-greengrass-demo-simple-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for aws-iot-greengrass" 2 | HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos" 3 | 4 | LICENSE = "MIT" 5 | 6 | # this needs to be done before installing the (dynamic) packagegroups 7 | inherit core-image 8 | 9 | IMAGE_ROOTFS_SIZE ?= "8192" 10 | IMAGE_INSTALL += "\ 11 | ${CORE_IMAGE_EXTRA_INSTALL} \ 12 | packagegroup-base \ 13 | packagegroup-core-boot \ 14 | " 15 | ### AWS ### 16 | IMAGE_INSTALL:append = " greengrass-bin udev" 17 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 18 | 19 | # only adding if device is rpi, as others might have a different partition layout 20 | IMAGE_INSTALL:append:rpi = " greengrass-config-init yq" 21 | 22 | ### tmux ### 23 | IMAGE_INSTALL:append = " tmux" 24 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8" 25 | IMAGE_INSTALL:append = " glibc-utils localedef " 26 | IMAGE_INSTALL:append = " openssh-ssh openssh-sshd openssh-sftp openssh-scp" 27 | 28 | ### aws-iot-device-client ### 29 | # IMAGE_INSTALL:append = " aws-iot-device-client" 30 | 31 | ### amazon-cloudwatch-publisher ### 32 | # IMAGE_INSTALL:append = " amazon-cloudwatch-publisher" 33 | 34 | ### misc ### 35 | IMAGE_INSTALL:append = " sudo " 36 | 37 | # this will disable root password - be warned! 38 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 39 | 40 | ### license compliance ### 41 | COPY_LIC_MANIFEST = "1" 42 | 43 | COPY_LIC_DIRS = "1" 44 | 45 | ### debug tools ### 46 | # IMAGE_INSTALL:append = " ldd gdb" 47 | # IMAGE_INSTALL:append = " valgrind" 48 | # IMAGE_INSTALL:append = " strace" 49 | 50 | 51 | # this will install all src, dbg packages to allow proper debugging with gdb 52 | # EXTRA_IMAGE_FEATURES:append = " src-pkgs dbg-pkgs" 53 | 54 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 55 | # for rauc bundle generation wic file is not used! 56 | ROOTFS_POSTPROCESS_COMMAND += "extra_files" 57 | 58 | extra_files () { 59 | # decided to do here instead of a bbappend of wpa:supplicant 60 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 61 | ln -sf ${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service 62 | 63 | # enable systemd-time-wait-sync as this is important for greengrass to have a correct clock 64 | ln -sf /${libdir}/systemd/system/systemd-time-wait-sync.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 65 | } -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-simple-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | BOOT_SPACE = "69152" 5 | 6 | IMAGE_OVERHEAD_FACTOR = "2.0" 7 | 8 | BOOT_SPACE = "69152" 9 | 10 | 11 | COPY_LIC_MANIFEST = "1" 12 | 13 | COPY_LIC_DIRS = "1" 14 | 15 | BB_GENERATE_MIRROR_TARBALLS = "1" 16 | 17 | BB_GIT_SHALLOW = "1" 18 | 19 | BB_GENERATE_SHALLOW_TARBALLS = "1" 20 | 21 | INHERIT += "create-spdx" 22 | 23 | # tests 24 | 25 | # use slirp networking instead of TAP interface (require root rights) 26 | #QEMU_USE_SLIRP = "1" 27 | #TEST_SERVER_IP = "127.0.0.1" 28 | 29 | # this will specify what test should run when running testimage cmd - oeqa layer tests + ptests: 30 | # Ping and SSH are not required, but do help in debugging. ptest will discover all ptest packages. 31 | # TEST_SUITES = " ping ssh ptest" 32 | 33 | # this will allow - running testimage cmd: bitbake core-image-minimal -c testimage 34 | # IMAGE_CLASSES += "testimage" 35 | 36 | # PUT = package under test / this is set in auto.conf 37 | # PUT = "greengrass-lite-ptest" 38 | # IMAGE_INSTALL:append = " ptest-runner ssh ${PUT}" 39 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-demo-simple-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 11 | ${OEROOT}/../layers/sw/meta-virtualization \ 12 | " 13 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-lite-container-demo-image 2 | 3 | This image is similar to [aws-iot-greengrass-lite-demo-image](../aws-iot-greengrass-lite-demo-image/README.md) 4 | 5 | It will create a container image with greengrass lite installed. 6 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/aws-iot-greengrass-lite-container-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for gg-lite as a container" 2 | DESCRIPTION = "A small systemd system container which will run greengrass-lite." 3 | 4 | IMAGE_INSTALL += "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}" 5 | 6 | LICENSE = "MIT" 7 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 8 | 9 | IMAGE_FEATURES += "empty-root-password allow-empty-password allow-root-login serial-autologin-root" 10 | 11 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 12 | # Use local.conf to specify additional systemd services to disable. To overwrite 13 | # the default list use SERVICES_TO_DISABLE:pn-systemd-container in local.conf 14 | SERVICES_TO_DISABLE = "systemd-userdbd.service" 15 | SERVICES_TO_DISABLE:append = " ${SYSTEMD_CONTAINER_DISABLE_SERVICES}" 16 | 17 | # Use local.conf to enable systemd services 18 | SERVICES_TO_ENABLE += "${SYSTEMD_CONTAINER_ENABLE_SERVICES}" 19 | 20 | require container-systemd-base.inc 21 | 22 | SYSTEMD_CONTAINER_DISABLE_SERVICES += " \ 23 | systemd-resolved.service \ 24 | var-volatile.mount \ 25 | " 26 | 27 | IMAGE_INSTALL:append = " systemd-serialgetty systemd-extra-utils systemd-conf" 28 | # resolvconf 29 | 30 | OCI_IMAGE_ENTRYPOINT = "/sbin/init systemd.unified_cgroup_hierarchy=1" 31 | 32 | DISTRO_FEATURES:remove = "sysvinit" 33 | 34 | ### AWS ### 35 | IMAGE_INSTALL:append = " greengrass-lite" 36 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | DISTRO_FEATURES:append = " virtualization" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/container-base.bb: -------------------------------------------------------------------------------- 1 | # 2 | # Based on examples from Scott Murray (Building Container Images with 3 | # OpenEmbedded and the Yocto Project) ELCe 2018 4 | # 5 | SUMMARY = "Basic container image" 6 | LICENSE = "MIT" 7 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 8 | 9 | IMAGE_FSTYPES = "container oci" 10 | 11 | inherit image 12 | inherit image-oci 13 | 14 | IMAGE_FEATURES = "" 15 | IMAGE_LINGUAS = "" 16 | NO_RECOMMENDATIONS = "1" 17 | 18 | IMAGE_INSTALL = " \ 19 | base-files \ 20 | base-passwd \ 21 | netbase \ 22 | ${CONTAINER_SHELL} \ 23 | " 24 | 25 | # Keep the entrypoint empty so that this image can be easily be 26 | # inherted and re-used for interactive or non interactive images 27 | OCI_IMAGE_ENTRYPOINT ?= "" 28 | 29 | # If the following is configured in local.conf (or the distro): 30 | # PACKAGE_EXTRA_ARCHS:append = " container-dummy-provides" 31 | # 32 | # it has been explicitly # indicated that we don't want or need a shell, so we'll 33 | # add the dummy provides. 34 | # 35 | # This is required, since there are postinstall scripts in base-files and base-passwd 36 | # that reference /bin/sh and we'll get a rootfs error if there's no shell or no dummy 37 | # provider. 38 | CONTAINER_SHELL ?= "${@bb.utils.contains('PACKAGE_EXTRA_ARCHS', 'container-dummy-provides', 'container-dummy-provides', 'busybox', d)}" 39 | 40 | # Allow build with or without a specific kernel 41 | IMAGE_CONTAINER_NO_DUMMY = "1" 42 | 43 | # Workaround /var/volatile for now 44 | # This is required because the lack of post-install scripts means volatile 45 | # directories (/var/volatile/*, etc.) are not created, so we do that ourselves 46 | # in a minimal way below. We could bootstrap and run some of the more standard 47 | # scripts that do it at boot, but we avoid that until needed. 48 | ROOTFS_POSTPROCESS_COMMAND += "rootfs_fixup_var_volatile ; " 49 | 50 | # This :remove is required, because it comes along and deletes our /var/volatile/ 51 | # fixups! 52 | ROOTFS_POSTPROCESS_COMMAND:remove = "empty_var_volatile" 53 | 54 | rootfs_fixup_var_volatile () { 55 | install -m 1777 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/tmp 56 | install -m 755 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/log 57 | } -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/container-systemd-base.inc: -------------------------------------------------------------------------------- 1 | SUMMARY ?= "Sample systemd system container" 2 | DESCRIPTION ?= "A small systemd system container which will run \ 3 | the application defined in IMAGE_INSTALL." 4 | 5 | LICENSE ?= "MIT" 6 | LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 7 | 8 | # Some commands of interest: 9 | # % docker run -d --rm --name systemd_test --privileged \ 10 | # --cap-add SYS_ADMIN --security-opt seccomp=unconfined --cgroup-parent=docker.slice \ 11 | # --cgroupns private --tmpfs /tmp --tmpfs /run --tmpfs /run/lock zeddii/systemd-container-base 12 | # 13 | # % docker run -d --rm --name systemd_test --privileged \ 14 | # --cgroup-parent=docker.slice --cgroupns private zeddii/c3-systemd-container 15 | # 16 | # % docker inspect systemd_test 17 | # % docker inspect systemd_test | grep \"IPAddress\": 18 | # % docker exec systemd_test bash -c "echo 'testuser:password' | chpasswd" 19 | # % ssh testuser@172.17.0.2 20 | 21 | require container-base.bb 22 | 23 | OCI_IMAGE_ENTRYPOINT = "/sbin/init" 24 | 25 | IMAGE_INSTALL:append = " systemd" 26 | IMAGE_INSTALL:append = " packagegroup-core-base-utils" 27 | IMAGE_INSTALL:append = " packagegroup-core-ssh-openssh" 28 | IMAGE_INSTALL:append = " busybox" 29 | 30 | IMAGE_FEATURES ?= "" 31 | 32 | NO_RECOMMENDATIONS = "1" 33 | 34 | SERVICES_TO_DISABLE ?= " \ 35 | systemd-udevd.service \ 36 | systemd-udevd-control.socket \ 37 | systemd-udevd-kernel.socket \ 38 | proc-sys-fs-binfmt_misc.automount \ 39 | sys-fs-fuse-connections.mount \ 40 | sys-kernel-debug.mount \ 41 | systemd-hwdb-update.service \ 42 | serial-getty@ttyS0.service \ 43 | dev-ttyS0.device \ 44 | console-getty.service \ 45 | serial-getty@.service \ 46 | " 47 | 48 | SERVICES_TO_ENABLE ?= "" 49 | 50 | disable_systemd_services () { 51 | SERVICES_TO_DISABLE="${SERVICES_TO_DISABLE}" 52 | if [ -n "$SERVICES_TO_DISABLE" ]; then 53 | echo "Disabling systemd services:" 54 | for service in $SERVICES_TO_DISABLE; do 55 | echo " $service" 56 | systemctl --root="${IMAGE_ROOTFS}" mask $service > /dev/null >1 57 | done 58 | fi 59 | } 60 | 61 | enable_systemd_services () { 62 | SERVICES_TO_ENABLE="${SERVICES_TO_ENABLE}" 63 | if [ -n "$SERVICES_TO_ENABLE" ]; then 64 | echo "Enabling additional systemd services:" 65 | for service in $SERVICES_TO_ENABLE; do 66 | echo " $service" 67 | systemctl --root="${IMAGE_ROOTFS}" enable $service > /dev/null >1 68 | done 69 | fi 70 | } 71 | 72 | ROOTFS_POSTPROCESS_COMMAND += "disable_systemd_services; enable_systemd_services;" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-container-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 11 | " 12 | 13 | # only include meta-virtualization if not already included 14 | BBLAYERS += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'virtualization-layer', "", "${OEROOT}/../layers/sw/meta-virtualization", d)}" 15 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-lite-demo-ec2-image 2 | 3 | This image is similar to [aws-iot-greengrass-lite-demo-image](../aws-iot-greengrass-lite-demo-image/README.md) 4 | 5 | The main difference it is made for using rauc on ec2 x86-64. 6 | 7 | Tested with: [aws-ec2-x86-64](../../../conf/devices/aws-ec2-x86-64/) and [aws-ec2-arm64](../../../conf/devices/aws-ec2-arm64/) 8 | 9 | ## Build image and bundle 10 | 11 | ```bash 12 | . init-build-env 13 | export DEVICE=aws-ec2-x86-64 14 | or 15 | export DEVICE=aws-ec2-arm64 16 | export IMAGE=aws-iot-greengrass-lite-demo-ec2-image 17 | bitbake $IMAGE 18 | bitbake aws-iot-greengrass-lite-demo-ec2-bundle 19 | ``` 20 | 21 | ## Image upload 22 | 23 | More info here: [EC2 AMI creation feature](https://github.com/aws4embeddedlinux/meta-aws/blob/master/scripts/ec2-ami/README.md) 24 | 25 | ```bash 26 | build$ ../layers/sw/meta-aws/scripts/ec2-ami/create-ec2-ami.sh amitest-bucket 16 aws-iot-greengrass-lite-demo-ec2-image aws-ec2-x86-64 27 | or 28 | build$ ../layers/sw/meta-aws/scripts/ec2-ami/create-ec2-ami.sh amitest-bucket 16 aws-iot-greengrass-lite-demo-ec2-image aws-ec2-arm64 29 | ``` 30 | 31 | ## Greengrass lite configuration 32 | 33 | Needs to be done manually at the moment, meaning creating config files and certs, keys using e.g. vi. 34 | 35 | ## Using Greengrass to deploy the rauc update bundle 36 | 37 | Follow steps [here](../aws-iot-greengrass-lite-demo-image/README.md#demo-ab-update-greengrass-component). 38 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/aws-iot-greengrass-lite-demo-ec2-bundle.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A update bundle for aws-iot-greengrass-lite-demo-ec2-image" 2 | 3 | inherit bundle 4 | 5 | RAUC_BUNDLE_VERSION = "v20250522" 6 | RAUC_BUNDLE_DESCRIPTION = "aws-iot-greengrass-lite-demo-ec2-image update bundle" 7 | 8 | # RAUC_BUNDLE_SLOTS = "efi rootfs" 9 | RAUC_BUNDLE_SLOTS = "rootfs" 10 | RAUC_SLOT_rootfs = "aws-iot-greengrass-lite-demo-ec2-image" 11 | 12 | RAUC_BUNDLE_COMPATIBLE ?= "${MACHINE}" 13 | RAUC_BUNDLE_FORMAT ?= "verity" 14 | 15 | # those are the certs that are contained in meta-rauc-community/meta-rauc-raspberrypi 16 | # they are intended for demo purpose only 17 | RAUC_KEY_FILE ?= "${THISDIR}/files/development-1.key.pem" 18 | RAUC_CERT_FILE ?= "${THISDIR}/files/development-1.cert.pem" 19 | 20 | RAUC_IMAGE_FSTYPE = "tar.bz2" 21 | 22 | # uncomment for enabling adaptive update method 'block-hash-index' 23 | RAUC_SLOT_rootfs[fstype] = "ext4" 24 | RAUC_SLOT_rootfs[adaptive] = "block-hash-index" 25 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/aws-iot-greengrass-lite-demo-ec2-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for aws-iot-greengrass-lite with A/B updates running on EC2" 2 | HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos" 3 | 4 | LICENSE = "MIT" 5 | 6 | # this needs to be done before installing the (dynamic) packagegroups 7 | inherit core-image 8 | 9 | IMAGE_INSTALL += "\ 10 | ${CORE_IMAGE_EXTRA_INSTALL} \ 11 | packagegroup-base \ 12 | packagegroup-core-boot \ 13 | " 14 | 15 | ### AWS ### 16 | IMAGE_INSTALL:append = " greengrass-lite" 17 | IMAGE_INSTALL:append = " aws-iot-device-sdk-python-v2" 18 | IMAGE_INSTALL:append = " jq" 19 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 20 | IMAGE_INSTALL:append = " gdbserver" 21 | 22 | # necessary to boot the system 23 | IMAGE_INSTALL:append = " kernel-image" 24 | 25 | ### tmux ### 26 | IMAGE_INSTALL:append = " tmux" 27 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8" 28 | IMAGE_INSTALL:append = " glibc-utils localedef " 29 | IMAGE_INSTALL:append = " ssh openssh-sshd openssh-sftp openssh-scp" 30 | 31 | ### misc ### 32 | IMAGE_INSTALL:append = " sudo" 33 | 34 | # this will disable root password - be warned! 35 | # only for debugging - with this enabled you can login as root without password with the "EC2 serial console" 36 | # Be aware that this is a security risk and cause a security warning mail! 37 | # EXTRA_IMAGE_FEATURES += "serial-autologin-root empty-root-password allow-empty-password" 38 | 39 | ### license compliance ### 40 | COPY_LIC_MANIFEST = "1" 41 | 42 | COPY_LIC_DIRS = "1" 43 | 44 | ### debug tools ### 45 | # IMAGE_INSTALL:append = " ldd gdb" 46 | # IMAGE_INSTALL:append = " valgrind" 47 | # IMAGE_INSTALL:append = " strace" 48 | # IMAGE_INSTALL:append = " lsof" 49 | 50 | # this will install all src, dbg packages to allow proper debugging with gdb 51 | # EXTRA_IMAGE_FEATURES:append = " src-pkgs" 52 | # EXTRA_IMAGE_FEATURES:append = " dbg-pkgs" 53 | 54 | # TODO: this is causeing cloud-init to fail - disabling: IMAGE_FEATURES += "read-only-rootfs" 55 | 56 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 57 | # for rauc bundle generation wic file is not used! 58 | IMAGE_PREPROCESS_COMMAND:append = " rootfs_user_fstab" 59 | 60 | #### 61 | rootfs_user_fstab () { 62 | 63 | # Allow user to use sudo 64 | echo "user ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers 65 | 66 | 67 | # enable serial console auto login for root 68 | sed -i '/^\s*ExecStart\b/ s/getty /&--autologin root /' \ 69 | "${IMAGE_ROOTFS}${systemd_system_unitdir}/serial-getty@.service" 70 | 71 | # reload services after data partition is mounted 72 | cat > ${IMAGE_ROOTFS}/lib/systemd/system/reload-systemd-data.service << 'EOF' 73 | [Unit] 74 | Description=Reload systemd services from data partition 75 | After=data.mount 76 | 77 | [Service] 78 | Type=oneshot 79 | ExecStart=/bin/systemctl daemon-reload 80 | ExecStart=/bin/systemctl start --all 81 | RemainAfterExit=yes 82 | EOF 83 | 84 | ln -sf /lib/systemd/system/reload-systemd-data.service ${IMAGE_ROOTFS}/lib/systemd/system/reload-systemd-data.service 85 | 86 | # not necessary for this image 87 | rm ${IMAGE_ROOTFS}//usr/lib/systemd/system/systemd-vconsole-setup.service 88 | 89 | # move all exising systemd services to the lib system directory and the remaining dir will be the bind mount point 90 | cp -a ${IMAGE_ROOTFS}/etc/systemd/system/* ${IMAGE_ROOTFS}/lib/systemd/system/ 91 | rm -rf ${IMAGE_ROOTFS}/etc/systemd/system/* 92 | 93 | # cloud-intit service needs to be started after data partition is mounted 94 | mkdir -p ${IMAGE_ROOTFS}/lib/systemd/system/cloud-init.service.d/ 95 | cat << EOF > ${IMAGE_ROOTFS}/lib/systemd/system/cloud-init.service.d/overrides.conf 96 | [Unit] 97 | After=local-fs.target 98 | After=rauc-grow-data-partition.service 99 | RequiresMountsFor=/home 100 | RequiresMountsFor=/root 101 | RequiresMountsFor=/etc/ssh/ 102 | 103 | [Service] 104 | Restart=on-failure 105 | RestartSec=30 106 | StartLimitInterval=90 107 | StartLimitBurst=3 108 | ExecStopPost=/usr/bin/cloud-init clean 109 | 110 | [Install] 111 | WantedBy=multi-user.target 112 | EOF 113 | 114 | 115 | # overwrite the default fstab, adding customization for this image 116 | cat << EOF > ${IMAGE_ROOTFS}/${sysconfdir}/fstab 117 | /dev/root / auto rw 1 1 118 | proc /proc proc defaults 0 0 119 | devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 120 | tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 121 | tmpfs /var/volatile tmpfs defaults 0 0 122 | LABEL=boot /boot vfat defaults 0 0 123 | LABEL=data /data ext4 x-systemd.growfs 0 0 124 | LABEL=grubenv /grubenv auto defaults,sync 0 0 125 | /data/etc/ssh/ /etc/ssh/ none bind 0 0 126 | /data/etc/systemd/system /etc/systemd/system none bind 0 0 127 | /data/etc/systemd/network /etc/systemd/network none bind 0 0 128 | /data/etc/greengrass /etc/greengrass none bind 0 0 129 | /data/var/lib/greengrass /var/lib/greengrass none bind 0 0 130 | /data/home /home none bind 0 0 131 | /data/root /root none bind 0 0 132 | EOF 133 | 134 | 135 | # copy those directories that should be present at the data partition to /data and just 136 | # leave them empty as a mount point for the bind mount 137 | 138 | install -d ${IMAGE_ROOTFS}/grubenv 139 | 140 | install -d -m 0755 ${IMAGE_ROOTFS}/data 141 | 142 | install -d ${IMAGE_ROOTFS}/data/etc/greengrass 143 | mv -f ${IMAGE_ROOTFS}/etc/greengrass/* ${IMAGE_ROOTFS}/data/etc/greengrass/ 144 | 145 | install -d -m 0700 ${IMAGE_ROOTFS}/data/root 146 | 147 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/system 148 | 149 | install -d ${IMAGE_ROOTFS}/data/var/lib/greengrass 150 | 151 | install -d ${IMAGE_ROOTFS}/data/home 152 | mv -f ${IMAGE_ROOTFS}/home/* ${IMAGE_ROOTFS}/data/home/ 153 | 154 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/network/ 155 | 156 | install -d ${IMAGE_ROOTFS}/data/etc/ssh/ 157 | mv -f ${IMAGE_ROOTFS}/etc/ssh/* ${IMAGE_ROOTFS}/data/etc/ssh/ 158 | 159 | 160 | } 161 | 162 | #### 163 | do_image_wic[depends] += "boot-image:do_deploy" 164 | 165 | RDEPENDS:${PN} += "grub-editenv e2fsprogs-mke2fs" 166 | 167 | # Optimizations for RAUC adaptive method 'block-hash-index' 168 | # rootfs image size must to be 4K-aligned 169 | IMAGE_ROOTFS_ALIGNMENT = "4" 170 | 171 | # ext4 block size should be set to 4K and use a fixed directory hash seed to 172 | # reduce the image delta size (keep oe-core's 4K bytes-per-inode) 173 | EXTRA_IMAGECMD:ext4 = "-i 4096 -b 4096 -E hash_seed=86ca73ff-7379-40bd-a098-fcb03a6e719d" 174 | 175 | # for correct PVRE reporting 176 | IMAGE_INSTALL:append = " curl amazon-ssm-agent util-linux ca-certificates" 177 | IMAGE_FEATURES:append = " package-management" 178 | 179 | # resize data partition to 100% of underlying device 180 | IMAGE_INSTALL:append = " rauc-grow-data-part" 181 | IMAGE_INSTALL:append = " rauc-mark-good" 182 | 183 | # size optimization 184 | NO_RECOMMENDATIONS = "1" 185 | 186 | IMAGE_INSTALL:append = " systemd-extra-utils" 187 | 188 | # this will install the rauc configuration file 189 | IMAGE_INSTALL:append = " virtual-rauc-conf" 190 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | BOOT_SPACE = "69152" 5 | 6 | # we are read only, no additional space required 7 | IMAGE_OVERHEAD_FACTOR = "1.1" 8 | 9 | DISTRO_FEATURES:append = " rauc" 10 | 11 | # we do not use bluetooth at the moment 12 | DISTRO_FEATURES:remove = " bluetooth" 13 | 14 | DISTRO_FEATURES:append = " grub-efi" 15 | 16 | WKS_FILE = "ec2_partition.wks.in" 17 | 18 | IMAGE_FSTYPES += "wic.vhd tar.bz2 ext4" 19 | 20 | IMAGE_INSTALL:append = " rauc" 21 | 22 | COPY_LIC_MANIFEST = "1" 23 | 24 | COPY_LIC_DIRS = "1" 25 | 26 | BB_GENERATE_MIRROR_TARBALLS = "1" 27 | 28 | BB_GIT_SHALLOW = "1" 29 | 30 | BB_GENERATE_SHALLOW_TARBALLS = "1" 31 | 32 | INHERIT += "create-spdx" 33 | 34 | # add build info to the image 35 | INHERIT += "image-buildinfo" 36 | 37 | # if not set, you will have to take care of mount points at two places, with this set image 38 | # partition layout is done in wic file and fstab settings in aws-iot-greengrass-lite-demo-ab-image.bb 39 | WIC_CREATE_EXTRA_ARGS = "--no-fstab-update" 40 | 41 | EFI_PROVIDER = "grub-efi" 42 | 43 | MACHINE_FEATURES += "efi" 44 | 45 | PREFERRED_RPROVIDER_virtual-grub-bootconf = "rauc-qemu-grubconf" 46 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/files/development-1.cert.pem: -------------------------------------------------------------------------------- 1 | Certificate: 2 | Data: 3 | Version: 3 (0x2) 4 | Serial Number: 2 (0x2) 5 | Signature Algorithm: sha256WithRSAEncryption 6 | Issuer: O=Test Org, CN=Test Org rauc CA Development 7 | Validity 8 | Not Before: Jan 1 00:00:00 1970 GMT 9 | Not After : Dec 31 23:59:59 9999 GMT 10 | Subject: O=Test Org, CN=Test Org Development-1 11 | Subject Public Key Info: 12 | Public Key Algorithm: rsaEncryption 13 | RSA Public-Key: (2048 bit) 14 | Modulus: 15 | 00:ac:2b:0f:05:02:d0:bb:b0:47:05:36:71:3c:20: 16 | 0e:a7:76:8d:75:c1:23:5e:6c:7a:2d:94:ff:3c:17: 17 | d8:0b:44:48:2a:82:03:92:c5:fd:33:76:0c:42:cf: 18 | 4d:8a:c9:47:7f:af:52:7c:15:6c:3b:e7:60:d1:04: 19 | 97:24:7b:07:1f:56:7d:6c:3f:31:e8:f9:36:7b:33: 20 | 5b:cf:54:ea:37:98:a6:b1:9a:1d:da:96:a1:07:14: 21 | 9c:15:80:4d:db:0c:03:86:ce:c7:3d:72:57:a2:da: 22 | a0:c0:8c:b2:9a:a0:6a:e5:b8:5f:52:d2:f6:27:ca: 23 | 48:f4:e3:86:eb:be:24:93:6a:af:60:68:7f:09:3b: 24 | 81:96:ce:85:0c:63:93:d8:fa:91:dc:50:2e:77:bb: 25 | bc:38:42:e9:86:d8:ac:33:dd:e6:d4:37:69:e3:01: 26 | 8d:21:8f:a9:4a:7f:15:a5:aa:a9:be:fc:36:93:a4: 27 | 10:0c:18:33:30:06:7f:1c:13:b3:a9:c6:57:d7:6b: 28 | 96:45:15:e7:f5:8f:3d:48:e0:08:46:4f:7f:ef:14: 29 | 77:95:25:25:9b:14:21:84:25:eb:37:0b:01:48:e6: 30 | f5:c1:8b:61:c6:cb:8c:6b:a7:d8:d2:f9:31:e3:80: 31 | 3f:78:ea:6a:41:6c:5d:4d:83:a6:54:0d:5b:c2:0e: 32 | f6:ef 33 | Exponent: 65537 (0x10001) 34 | X509v3 extensions: 35 | X509v3 Subject Key Identifier: 36 | 89:4C:FE:8A:60:4D:C9:6D:F7:A8:C0:04:49:7F:AA:05:92:29:17:FB 37 | X509v3 Authority Key Identifier: 38 | keyid:44:0C:AF:4A:74:B4:C7:65:02:B2:95:F1:91:7C:A3:CC:E6:3E:99:E8 39 | DirName:/O=Test Org/CN=Test Org rauc CA Development 40 | serial:01 41 | 42 | X509v3 Basic Constraints: 43 | CA:FALSE 44 | Signature Algorithm: sha256WithRSAEncryption 45 | 2c:d2:30:68:f5:84:52:1e:cf:ed:0d:fc:e7:02:69:0b:3b:f6: 46 | c3:77:00:12:1d:2d:d0:8f:49:9e:5c:f1:00:7b:1d:4f:d5:a9: 47 | 46:a5:df:54:90:50:b4:8f:8e:ba:4b:2d:82:74:eb:5b:a8:f5: 48 | 45:7b:77:73:b1:9b:32:93:15:c0:5c:02:2a:ed:b0:1e:bb:d8: 49 | 4e:41:17:20:af:04:46:21:20:7b:86:9f:32:ab:54:71:26:e8: 50 | 0b:75:12:9c:63:53:4f:54:db:a7:f9:b2:fa:e9:ee:4a:9d:80: 51 | ba:ae:3f:eb:ef:10:11:2d:4f:5a:34:fb:8b:45:10:63:0b:f8: 52 | af:f3:8b:24:21:2a:e0:0b:44:38:44:b5:9d:6e:8a:ff:1f:bf: 53 | 6e:44:21:22:ec:8a:8d:73:63:e5:df:1a:ec:2a:64:1f:97:f9: 54 | 5c:3a:25:7f:03:80:4c:db:99:5e:f9:7d:2b:f1:d0:97:4d:95: 55 | 6f:29:47:7b:3f:29:e3:96:25:b0:1c:f1:0b:8b:8b:ba:de:3b: 56 | 3f:40:2e:bd:31:68:ea:a9:8f:dc:c9:09:22:df:76:69:08:5d: 57 | 5d:a4:09:62:80:20:83:9e:bd:d4:a6:35:ee:97:50:66:39:62: 58 | 66:1b:2e:75:f2:6d:e7:06:ae:67:5f:4b:63:5c:52:e7:5d:dd: 59 | c9:0c:86:2b 60 | -----BEGIN CERTIFICATE----- 61 | MIIDfTCCAmWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADA6MREwDwYDVQQKDAhUZXN0 62 | IE9yZzElMCMGA1UEAwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudDAgFw03 63 | MDAxMDEwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowNDERMA8GA1UECgwIVGVzdCBP 64 | cmcxHzAdBgNVBAMMFlRlc3QgT3JnIERldmVsb3BtZW50LTEwggEiMA0GCSqGSIb3 65 | DQEBAQUAA4IBDwAwggEKAoIBAQCsKw8FAtC7sEcFNnE8IA6ndo11wSNebHotlP88 66 | F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DRBJckewcfVn1sPzHo+TZ7M1vP 67 | VOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDAjLKaoGrluF9S0vYnykj044br 68 | viSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG2Kwz3ebUN2njAY0hj6lKfxWl 69 | qqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I4AhGT3/vFHeVJSWbFCGEJes3 70 | CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZUDVvCDvbvAgMBAAGjgZEwgY4w 71 | HQYDVR0OBBYEFIlM/opgTclt96jABEl/qgWSKRf7MGIGA1UdIwRbMFmAFEQMr0p0 72 | tMdlArKV8ZF8o8zmPpnooT6kPDA6MREwDwYDVQQKDAhUZXN0IE9yZzElMCMGA1UE 73 | AwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudIIBATAJBgNVHRMEAjAAMA0G 74 | CSqGSIb3DQEBCwUAA4IBAQAs0jBo9YRSHs/tDfznAmkLO/bDdwASHS3Qj0meXPEA 75 | ex1P1alGpd9UkFC0j466Sy2CdOtbqPVFe3dzsZsykxXAXAIq7bAeu9hOQRcgrwRG 76 | ISB7hp8yq1RxJugLdRKcY1NPVNun+bL66e5KnYC6rj/r7xARLU9aNPuLRRBjC/iv 77 | 84skISrgC0Q4RLWdbor/H79uRCEi7IqNc2Pl3xrsKmQfl/lcOiV/A4BM25le+X0r 78 | 8dCXTZVvKUd7PynjliWwHPELi4u63js/QC69MWjqqY/cyQki33ZpCF1dpAligCCD 79 | nr3UpjXul1BmOWJmGy518m3nBq5nX0tjXFLnXd3JDIYr 80 | -----END CERTIFICATE----- 81 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/files/development-1.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCsKw8FAtC7sEcF 3 | NnE8IA6ndo11wSNebHotlP88F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DR 4 | BJckewcfVn1sPzHo+TZ7M1vPVOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDA 5 | jLKaoGrluF9S0vYnykj044brviSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG 6 | 2Kwz3ebUN2njAY0hj6lKfxWlqqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I 7 | 4AhGT3/vFHeVJSWbFCGEJes3CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZU 8 | DVvCDvbvAgMBAAECggEASphBYq9sltVyf/ytpRpSnxYLhmiPFXs0mIlE6Nl/3qnQ 9 | BrLcL3yfDuvntg6xjx9UXistNtvlUDMYzJcLkV/InzhPEVZ0HnfTth9zeOpWrI30 10 | M2EN7EZ1MGcqlVpI4U5cPM1cn+/proLBQYv0WnCEwFFY477JrkXDxG7MZ1mz6TaL 11 | IGcCCIUu1BxECngQ344eaKrSR5F2MtlxAl19Pt5QSPfmuMdmElrK6RtBjnKrDu1K 12 | fe6DCfObZ3nbG2fhFV4uTxhlTC9lUmfTQMKR79rLmHNKnbMx74kFNvy3XlT2l35I 13 | ZVfRMLPWph7yMom9v/Im3Q70uhJ1lxyqbbl/DFZVmQKBgQDVo19SqR/QeDIxPIPn 14 | XvVWzo5ml3KO/dVxA8sok6twr+G7yUeIUnuauYFA/tX/FS32azFRa/7GjUfoTx3q 15 | GHK43TBCMyEt0we6WwZb+FkWa/b/RBoyD/audrpmgDDi1+fXPs8bBvoO8/oju20D 16 | I6wOjSovcIMaeLo/+u3U6ShNQwKBgQDOTpoGMsQzXchZfDmxL61h3j4Gtjrl4BpU 17 | WhAkJ9U2BRpL8NSZLErn5ik8MwgK2ut+YdU7aogI0D6Gc+4zZoJDEbhhmPD9cprv 18 | LMyfAKoisR01OyU57mMSGQq0dfjmK6PfYJdX5sQJGkMFptNAJLTDoYtmXItSICoY 19 | 1j5KTvwe5QKBgGytxmErjfakHoxzh3pdERuOylwgMPPS5xCt6FyE+pLBtmisFQqh 20 | QyXLtpgUy1IPOSmBED6mXJ4u4uSn0sTymPG3+8PBdOB12RmREqQYq2E/nQ/wWg8b 21 | ldbcqShZkATl5pfV6M+L9gtDS/1/bA5LyExCvbISX29I+R5xDSnhTlI3AoGBAJRK 22 | VVXtOa/+UhtYOpPMxGCbgZQLemxvWB2XmxCR/SRWKJ+7XOU4vCLSAoO93qMG1szB 23 | /6Y0ndFP9hFo1SfnH+ybmR+18ksLDKisV+xWavSCwI7Zk5l/a4C/tT0fqyeu6JyQ 24 | bliFjBVK5i/yyNfLSo9v16ZdENuYOQofPSjmezytAoGBALhwvtzgqvqGSXID2w5N 25 | ullK8ny3WRa1o5DLXuMV19CvknmrN/zmmjQLblKkdp9VBb7uo8czon+qL1ZZyywC 26 | W2BmHfGMPUyQHux4btsdJhlWcS7z7aYXM9QWiKlI+EKLHLILYk+LPIEf85sUcOZV 27 | eCBpViT7fv2iv/0L+mzjWtLA 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-ec2-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-clang \ 7 | ${OEROOT}/../layers/bsp/meta-lts-mixins \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 11 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 12 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 13 | ${OEROOT}/../layers/sw/meta-rauc \ 14 | ${OEROOT}/../layers/bsp/meta-rauc-aws-ec2 \ 15 | " 16 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-lite-demo-image 2 | AWS IoT Greengrass is software that extends cloud capabilities to local 3 | devices. This enables devices to collect and analyze data closer to the 4 | source of information, react autonomously to local events, and communicate 5 | securely with each other on local networks. Local devices can also 6 | communicate securely with AWS IoT Core and export IoT data to the AWS Cloud. 7 | AWS IoT Greengrass developers can use AWS Lambda functions and prebuilt 8 | connectors to create serverless applications that are deployed to devices 9 | for local execution. 10 | 11 | AWS Greengrass Lite is the AWS IoT Greengrass runtime for constrained devices. 12 | 13 | The Greengrass Lite nucleus provides a smaller alternative to the 14 | Classic nucleus for Greengrass v2 deployments. 15 | 16 | Greengrass Lite aims to maintain compatibility with the Classic nucleus, 17 | and implements a subset of its functionality. 18 | 19 | For other installation possibilities look here: 20 | https://github.com/aws-greengrass/aws-greengrass-lite 21 | 22 | ## BUILDING 23 | 24 | Init build environment 25 | 26 | ```bash 27 | . init-build-env 28 | ``` 29 | 30 | Configure this image 31 | 32 | ```bash 33 | export IMAGE=aws-iot-greengrass-lite-demo-image 34 | ``` 35 | 36 | Configure a device e.g. raspberrypi-64 37 | 38 | ```bash 39 | export DEVICE=raspberrypi-64 40 | ``` 41 | 42 | Build 43 | 44 | ```bash 45 | bitbake $IMAGE 46 | ``` 47 | 48 | 49 | ## INSTALLATION 50 | 51 | 1. Download rpi imager for your OS (mac, win, linux) 52 | https://www.raspberrypi.com/documentation/computers/getting-started.html#raspberry-pi-imager 53 | 54 | 2. Select "use custom img" and flash demo image contained in this zip file 55 | on your SD-Card. The RPI imager auto rejects the SD card after it completes flashing the image, 56 | you need to uncheck this option or need to plug in again to transfer the connection kit zip file. 57 | 58 | 3. Mount the boot fat partition and copy Connection Kit Zip onto it. 59 | 60 | - This needs to be done after you flashed your SD-Card. (Step 2) 61 | - This is done depending on your OS in Explorer, nemo, bash, Finder. 62 | - It is the only fat partition on the sd card 63 | 64 | 4. a) You can configure the ethernet adapter ip address by editing the cmdline.txt 65 | file on the fat partition to append eg.: ip=192.168.0.69::192.168.0.1:255.255.255.0:rpi:eth0:off 66 | 67 | 4. b) You can create a wpa_supplicant.conf file in the fat partition to configure your WIFI. 68 | It uses this https://linux.die.net/man/5/wpa_supplicant.conf format. 69 | ```conf 70 | network={ 71 | ssid="" 72 | psk="" 73 | } 74 | ``` 75 | 76 | 4. c) You can create a wlan.network file in the fat partition to do the ip configuration of your wlan, 77 | default is this, DHCP. It uses this https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html 78 | format. 79 | 80 | ```conf 81 | [Match] 82 | Name=wl* 83 | 84 | [Network] 85 | DHCP=ipv4 86 | 87 | [DHCP] 88 | RouteMetric=20 89 | ClientIdentifier=mac 90 | ``` 91 | 92 | static ip example: 93 | 94 | ```conf 95 | [Match] 96 | Name=wl* 97 | 98 | [Network] 99 | DHCP=no 100 | Address=192.168.0.123/24 101 | Gateway=192.168.0.1 102 | DNS=8.8.8.8 8.8.4.4 103 | ``` 104 | 105 | 5. Unmount, remove sd-card, put in Raspberry Pi and boot. 106 | 107 | 6. Password for "root" user is empty. Please note that this can be a security risk and should be changed 108 | when using device in a public environment! SSH is enabled by default to connect over the network! 109 | You can use the thing name to connect to the device via ssh, this is set as hostname, 110 | and annouced by mdns. Note that underscores in a thing name will be removed! 111 | 112 | ```bash 113 | Login: root 114 | Password: 115 | ``` 116 | 117 | 7. When logged in you can check the status of the installation by running 118 | systemctl status --with-dependencies greengrass-lite.target 119 | 120 | ## A/B update example made with [meta-rauc](https://github.com/rauc/meta-rauc-community) 121 | 122 | Set IMAGE to aws-iot-greengrass-lite-demo-image. 123 | ``` 124 | export IMAGE=aws-iot-greengrass-lite-demo-image 125 | ``` 126 | 127 | This image works only with raspberry pi. cause of bootloader settings. 128 | Setting DEVICE to raspberrypi-64 129 | ``` 130 | export DEVICE=raspberrypi-64 131 | ``` 132 | 133 | First compile, enable local use of openssl 134 | ``` 135 | bitbake openssl-native -caddto_recipe_sysroot 136 | ``` 137 | 138 | Build the image 139 | ``` 140 | bitbake $IMAGE 141 | ``` 142 | 143 | Build the update bundle - the update that can be applied to the image. 144 | ``` 145 | bitbake aws-iot-greengrass-lite-demo-bundle 146 | ``` 147 | 148 | Flash the image onto your device e.g. 149 | Be careful device depends on your setup - may sda is your harddisk and not a sd card!!! 150 | You can also extract this and write it with rpi-imager! 151 | ``` 152 | bzcat aws-iot-greengrass-lite-demo-image-raspberrypi-armv8.rootfs.wic.bz2 | sudo dcfldd of=/dev/sda 153 | ``` 154 | 155 | Then power-on the board and log in. To see that RAUC is configured correctly and can interact with the bootloader, run: 156 | ``` 157 | rauc status 158 | ``` 159 | 160 | To install an upgrade bundle manually just exec on the device 161 | ``` 162 | rauc install 163 | ``` 164 | 165 | To switch manually the slot 166 | ``` 167 | rauc status mark-active other 168 | ``` 169 | 170 | The rootfs is read only, for development purpose you can mount it read writeable 171 | ``` 172 | mount -o remount,rw / 173 | ``` 174 | 175 | # DEMO A/B update Greengrass component 176 | 177 | ## Overview 178 | 179 | This Greengrass component, `com.example.AbUpdate`, is designed to manage A/B system updates using RAUC (Robust Auto-Update Controller) on Linux-based systems. 180 | 181 | ## Description 182 | 183 | The component automates the process of installing system updates and verifying the installation. It uses RAUC to handle the A/B update mechanism, ensuring a reliable and fail-safe update process. 184 | 185 | ## Features 186 | 187 | - Automated installation of RAUC bundle updates 188 | - Verification of successful update installation 189 | - Comparison of installed bundle hash with current running slot 190 | 191 | ## Usage 192 | 193 | The component operates in two main phases: 194 | 195 | 1. **Bootstrap**: Installs the RAUC bundle update. 196 | 2. **Startup**: Verifies the installation by comparing the hash of the installed bundle with the currently running slot. 197 | 198 | ## Configuration 199 | 200 | The update file (`update.raucb`) is stored in an S3 bucket. Ensure the S3 URI in the component recipe is updated to point to your specific update file location. 201 | Do modify the bucket name, version etc. 202 | 203 | ```yaml 204 | --- 205 | RecipeFormatVersion: '2020-01-25' 206 | ComponentName: 'com.example.AbUpdate' 207 | ComponentVersion: '1.0.41' 208 | ComponentDescription: 'Manages A/B system updates using RAUC' 209 | ComponentPublisher: 'Example Corp' 210 | ComponentType: 'aws.greengrass.generic' 211 | Manifests: 212 | - Platform: 213 | os: 'linux' 214 | runtime: "*" 215 | Lifecycle: 216 | bootstrap: 217 | Script: | 218 | echo Bootstrap 219 | sudo rauc install {artifacts:path}/update.raucb 220 | RequiresPrivilege: true 221 | startup: 222 | Script: | 223 | echo Startup 224 | rauc status 225 | current_booted_slot_bundle_hash=$(rauc status --detailed --output-format=json-pretty | jq -r '.slots[] | select(.[].state == "booted") | .[].slot_status.bundle.hash') 226 | bundle_hash=$(rauc info --output-format=json-pretty {artifacts:path}/update.raucb | jq -r '.hash') 227 | if [ "$current_booted_slot_bundle_hash" == "$bundle_hash" ]; then 228 | echo "Bundle image hash matches the current running slot" 229 | else 230 | echo "Bundle image hash differs from the current running slot" 231 | exit 1 232 | fi 233 | Artifacts: 234 | - URI: 's3://2024-11-27-us-east-1ab-update/update.raucb' 235 | Unarchive: 'NONE' 236 | ``` 237 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/aws-iot-greengrass-lite-demo-bundle.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A update bundle for aws-iot-greengrass-lite-demo-image" 2 | 3 | inherit bundle 4 | 5 | # RAUC_BUNDLE_VERSION = "v20200703" 6 | # RAUC_BUNDLE_DESCRIPTION = "RAUC Demo Bundle" 7 | 8 | RAUC_BUNDLE_SLOTS = "rootfs" 9 | RAUC_SLOT_rootfs = "aws-iot-greengrass-lite-demo-image" 10 | 11 | RAUC_BUNDLE_COMPATIBLE ?= "${MACHINE}" 12 | RAUC_BUNDLE_FORMAT ?= "verity" 13 | 14 | # those are the certs that are contained in meta-rauc-community/meta-rauc-raspberrypi 15 | # they are intended for demo purpose only 16 | RAUC_KEY_FILE ?= "${THISDIR}/files/development-1.key.pem" 17 | RAUC_CERT_FILE ?= "${THISDIR}/files/development-1.cert.pem" 18 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/aws-iot-greengrass-lite-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for aws-iot-greengrass-lite with A/B updates" 2 | HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos" 3 | 4 | LICENSE = "MIT" 5 | 6 | # this needs to be done before installing the (dynamic) packagegroups 7 | inherit core-image 8 | 9 | IMAGE_INSTALL += "\ 10 | ${CORE_IMAGE_EXTRA_INSTALL} \ 11 | packagegroup-base \ 12 | packagegroup-core-boot \ 13 | " 14 | 15 | ### AWS ### 16 | IMAGE_INSTALL:append = " greengrass-lite" 17 | IMAGE_INSTALL:append = " aws-iot-device-sdk-python-v2" 18 | IMAGE_INSTALL:append = " jq" 19 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 20 | 21 | ### rauc ### 22 | CORE_IMAGE_EXTRA_INSTALL:append = " rauc-grow-data-part" 23 | 24 | # only adding if device is rpi, as others might have a different partition layout 25 | IMAGE_INSTALL:append:rpi = " greengrass-config-init" 26 | 27 | # this will allow kernel updates with rauc 28 | IMAGE_INSTALL:append = " kernel-image kernel-modules" 29 | 30 | ### tmux ### 31 | IMAGE_INSTALL:append = " tmux" 32 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8" 33 | IMAGE_INSTALL:append = " glibc-utils localedef " 34 | IMAGE_INSTALL:append = " ssh openssh-sshd openssh-sftp openssh-scp" 35 | 36 | ### aws-iot-device-client ### 37 | # IMAGE_INSTALL:append = " aws-iot-device-client" 38 | 39 | ### amazon-cloudwatch-publisher ### 40 | # IMAGE_INSTALL:append = " amazon-cloudwatch-publisher" 41 | 42 | ### misc ### 43 | IMAGE_INSTALL:append = " sudo" 44 | 45 | # this will disable root password - be warned! 46 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 47 | 48 | ### license compliance ### 49 | COPY_LIC_MANIFEST = "1" 50 | 51 | COPY_LIC_DIRS = "1" 52 | 53 | ### debug tools ### 54 | # IMAGE_INSTALL:append = " ldd gdb" 55 | # IMAGE_INSTALL:append = " valgrind" 56 | # IMAGE_INSTALL:append = " strace" 57 | # IMAGE_INSTALL:append = " lsof" 58 | 59 | # this will install all src, dbg packages to allow proper debugging with gdb 60 | # EXTRA_IMAGE_FEATURES:append = " src-pkgs" 61 | # EXTRA_IMAGE_FEATURES:append = " dbg-pkgs" 62 | 63 | IMAGE_FEATURES += "read-only-rootfs" 64 | 65 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 66 | # for rauc bundle generation wic file is not used! 67 | ROOTFS_POSTPROCESS_COMMAND += "rootfs_user_fstab" 68 | 69 | rootfs_user_fstab () { 70 | 71 | # overwrite the default fstab, adding customization for this image 72 | cat << EOF > ${IMAGE_ROOTFS}/${sysconfdir}/fstab 73 | /dev/root / auto defaults 1 1 74 | proc /proc proc defaults 0 0 75 | devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 76 | tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 77 | tmpfs /var/volatile tmpfs defaults 0 0 78 | LABEL=boot /boot vfat defaults 0 0 79 | LABEL=data /data ext4 x-systemd.growfs 0 0 80 | /data/etc/wpa_supplicant /etc/wpa_supplicant none bind 0 0 81 | /data/etc/greengrass /etc/greengrass none bind 0 0 82 | /data/etc/systemd/network /etc/systemd/network none bind 0 0 83 | /data/etc/systemd/system /etc/systemd/system none bind 0 0 84 | /data/var/lib/greengrass /var/lib/greengrass none bind 0 0 85 | /data/home /home none bind 0 0 86 | EOF 87 | 88 | install -d -m 0755 ${IMAGE_ROOTFS}/data 89 | 90 | # copy those directories that should be present at the data partition to /data and just 91 | # leave them empty as a mount point for the bind mount 92 | 93 | install -d ${IMAGE_ROOTFS}/data/etc/greengrass 94 | mv -f ${IMAGE_ROOTFS}/etc/greengrass/* ${IMAGE_ROOTFS}/data/etc/greengrass/ 95 | 96 | install -d ${IMAGE_ROOTFS}/data/etc/wpa_supplicant 97 | 98 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/network 99 | mv -f ${IMAGE_ROOTFS}/etc/systemd/network/* ${IMAGE_ROOTFS}/data/etc/systemd/network 100 | 101 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/system 102 | mv -f ${IMAGE_ROOTFS}/etc/systemd/system/* ${IMAGE_ROOTFS}/data/etc/systemd/system 103 | 104 | install -d ${IMAGE_ROOTFS}/data/var/lib/greengrass 105 | 106 | # decided to do here instead of a bbappend of wpa:supplicant 107 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 108 | ln -sf /${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service 109 | 110 | # enable systemd-time-wait-sync as this is important for greengrass to have a correct clock 111 | ln -sf /${libdir}/systemd/system/systemd-time-wait-sync.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 112 | 113 | install -d ${IMAGE_ROOTFS}/data/home 114 | } 115 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | BOOT_SPACE = "69152" 5 | 6 | # we are read only, no addition space necessary 7 | IMAGE_OVERHEAD_FACTOR = "1" 8 | 9 | BOOT_SPACE = "69152" 10 | 11 | DISTRO_FEATURES:append = " rauc" 12 | 13 | # we do not use bluetooth at the moment 14 | DISTRO_FEATURES:remove = " bluetooth" 15 | 16 | ENABLE_UART = "1" 17 | 18 | RPI_USE_U_BOOT = "1" 19 | 20 | # PREFERRED_PROVIDER_virtual/bootloader = "u-boot" 21 | WKS_FILE = "${THISDIR}/wic/sdimage-aws-iot-greengrass-lite-demo_partition.wks.in" 22 | 23 | # Settings for meta-rauc-raspberry-pi 24 | IMAGE_FSTYPES="ext4 wic.bz2 wic" 25 | IMAGE_INSTALL:append = " rauc" 26 | 27 | # just necessary if aws-iot-device-client is installed 28 | PACKAGECONFIG:pn-aws-iot-device-client = "st" 29 | 30 | COPY_LIC_MANIFEST = "1" 31 | 32 | COPY_LIC_DIRS = "1" 33 | 34 | BB_GENERATE_MIRROR_TARBALLS = "1" 35 | 36 | BB_GIT_SHALLOW = "1" 37 | 38 | BB_GENERATE_SHALLOW_TARBALLS = "1" 39 | 40 | INHERIT += "create-spdx" 41 | 42 | # add build info to the image 43 | INHERIT += "image-buildinfo" 44 | 45 | # if not set, you will have to take care of mount points at two places, with this set image 46 | # partition layout is done in wic file and fstab settings in aws-iot-greengrass-lite-demo-ab-image.bb 47 | WIC_CREATE_EXTRA_ARGS = "--no-fstab-update" 48 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/files/development-1.cert.pem: -------------------------------------------------------------------------------- 1 | Certificate: 2 | Data: 3 | Version: 3 (0x2) 4 | Serial Number: 2 (0x2) 5 | Signature Algorithm: sha256WithRSAEncryption 6 | Issuer: O=Test Org, CN=Test Org rauc CA Development 7 | Validity 8 | Not Before: Jan 1 00:00:00 1970 GMT 9 | Not After : Dec 31 23:59:59 9999 GMT 10 | Subject: O=Test Org, CN=Test Org Development-1 11 | Subject Public Key Info: 12 | Public Key Algorithm: rsaEncryption 13 | RSA Public-Key: (2048 bit) 14 | Modulus: 15 | 00:ac:2b:0f:05:02:d0:bb:b0:47:05:36:71:3c:20: 16 | 0e:a7:76:8d:75:c1:23:5e:6c:7a:2d:94:ff:3c:17: 17 | d8:0b:44:48:2a:82:03:92:c5:fd:33:76:0c:42:cf: 18 | 4d:8a:c9:47:7f:af:52:7c:15:6c:3b:e7:60:d1:04: 19 | 97:24:7b:07:1f:56:7d:6c:3f:31:e8:f9:36:7b:33: 20 | 5b:cf:54:ea:37:98:a6:b1:9a:1d:da:96:a1:07:14: 21 | 9c:15:80:4d:db:0c:03:86:ce:c7:3d:72:57:a2:da: 22 | a0:c0:8c:b2:9a:a0:6a:e5:b8:5f:52:d2:f6:27:ca: 23 | 48:f4:e3:86:eb:be:24:93:6a:af:60:68:7f:09:3b: 24 | 81:96:ce:85:0c:63:93:d8:fa:91:dc:50:2e:77:bb: 25 | bc:38:42:e9:86:d8:ac:33:dd:e6:d4:37:69:e3:01: 26 | 8d:21:8f:a9:4a:7f:15:a5:aa:a9:be:fc:36:93:a4: 27 | 10:0c:18:33:30:06:7f:1c:13:b3:a9:c6:57:d7:6b: 28 | 96:45:15:e7:f5:8f:3d:48:e0:08:46:4f:7f:ef:14: 29 | 77:95:25:25:9b:14:21:84:25:eb:37:0b:01:48:e6: 30 | f5:c1:8b:61:c6:cb:8c:6b:a7:d8:d2:f9:31:e3:80: 31 | 3f:78:ea:6a:41:6c:5d:4d:83:a6:54:0d:5b:c2:0e: 32 | f6:ef 33 | Exponent: 65537 (0x10001) 34 | X509v3 extensions: 35 | X509v3 Subject Key Identifier: 36 | 89:4C:FE:8A:60:4D:C9:6D:F7:A8:C0:04:49:7F:AA:05:92:29:17:FB 37 | X509v3 Authority Key Identifier: 38 | keyid:44:0C:AF:4A:74:B4:C7:65:02:B2:95:F1:91:7C:A3:CC:E6:3E:99:E8 39 | DirName:/O=Test Org/CN=Test Org rauc CA Development 40 | serial:01 41 | 42 | X509v3 Basic Constraints: 43 | CA:FALSE 44 | Signature Algorithm: sha256WithRSAEncryption 45 | 2c:d2:30:68:f5:84:52:1e:cf:ed:0d:fc:e7:02:69:0b:3b:f6: 46 | c3:77:00:12:1d:2d:d0:8f:49:9e:5c:f1:00:7b:1d:4f:d5:a9: 47 | 46:a5:df:54:90:50:b4:8f:8e:ba:4b:2d:82:74:eb:5b:a8:f5: 48 | 45:7b:77:73:b1:9b:32:93:15:c0:5c:02:2a:ed:b0:1e:bb:d8: 49 | 4e:41:17:20:af:04:46:21:20:7b:86:9f:32:ab:54:71:26:e8: 50 | 0b:75:12:9c:63:53:4f:54:db:a7:f9:b2:fa:e9:ee:4a:9d:80: 51 | ba:ae:3f:eb:ef:10:11:2d:4f:5a:34:fb:8b:45:10:63:0b:f8: 52 | af:f3:8b:24:21:2a:e0:0b:44:38:44:b5:9d:6e:8a:ff:1f:bf: 53 | 6e:44:21:22:ec:8a:8d:73:63:e5:df:1a:ec:2a:64:1f:97:f9: 54 | 5c:3a:25:7f:03:80:4c:db:99:5e:f9:7d:2b:f1:d0:97:4d:95: 55 | 6f:29:47:7b:3f:29:e3:96:25:b0:1c:f1:0b:8b:8b:ba:de:3b: 56 | 3f:40:2e:bd:31:68:ea:a9:8f:dc:c9:09:22:df:76:69:08:5d: 57 | 5d:a4:09:62:80:20:83:9e:bd:d4:a6:35:ee:97:50:66:39:62: 58 | 66:1b:2e:75:f2:6d:e7:06:ae:67:5f:4b:63:5c:52:e7:5d:dd: 59 | c9:0c:86:2b 60 | -----BEGIN CERTIFICATE----- 61 | MIIDfTCCAmWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADA6MREwDwYDVQQKDAhUZXN0 62 | IE9yZzElMCMGA1UEAwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudDAgFw03 63 | MDAxMDEwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowNDERMA8GA1UECgwIVGVzdCBP 64 | cmcxHzAdBgNVBAMMFlRlc3QgT3JnIERldmVsb3BtZW50LTEwggEiMA0GCSqGSIb3 65 | DQEBAQUAA4IBDwAwggEKAoIBAQCsKw8FAtC7sEcFNnE8IA6ndo11wSNebHotlP88 66 | F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DRBJckewcfVn1sPzHo+TZ7M1vP 67 | VOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDAjLKaoGrluF9S0vYnykj044br 68 | viSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG2Kwz3ebUN2njAY0hj6lKfxWl 69 | qqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I4AhGT3/vFHeVJSWbFCGEJes3 70 | CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZUDVvCDvbvAgMBAAGjgZEwgY4w 71 | HQYDVR0OBBYEFIlM/opgTclt96jABEl/qgWSKRf7MGIGA1UdIwRbMFmAFEQMr0p0 72 | tMdlArKV8ZF8o8zmPpnooT6kPDA6MREwDwYDVQQKDAhUZXN0IE9yZzElMCMGA1UE 73 | AwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudIIBATAJBgNVHRMEAjAAMA0G 74 | CSqGSIb3DQEBCwUAA4IBAQAs0jBo9YRSHs/tDfznAmkLO/bDdwASHS3Qj0meXPEA 75 | ex1P1alGpd9UkFC0j466Sy2CdOtbqPVFe3dzsZsykxXAXAIq7bAeu9hOQRcgrwRG 76 | ISB7hp8yq1RxJugLdRKcY1NPVNun+bL66e5KnYC6rj/r7xARLU9aNPuLRRBjC/iv 77 | 84skISrgC0Q4RLWdbor/H79uRCEi7IqNc2Pl3xrsKmQfl/lcOiV/A4BM25le+X0r 78 | 8dCXTZVvKUd7PynjliWwHPELi4u63js/QC69MWjqqY/cyQki33ZpCF1dpAligCCD 79 | nr3UpjXul1BmOWJmGy518m3nBq5nX0tjXFLnXd3JDIYr 80 | -----END CERTIFICATE----- 81 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/files/development-1.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCsKw8FAtC7sEcF 3 | NnE8IA6ndo11wSNebHotlP88F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DR 4 | BJckewcfVn1sPzHo+TZ7M1vPVOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDA 5 | jLKaoGrluF9S0vYnykj044brviSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG 6 | 2Kwz3ebUN2njAY0hj6lKfxWlqqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I 7 | 4AhGT3/vFHeVJSWbFCGEJes3CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZU 8 | DVvCDvbvAgMBAAECggEASphBYq9sltVyf/ytpRpSnxYLhmiPFXs0mIlE6Nl/3qnQ 9 | BrLcL3yfDuvntg6xjx9UXistNtvlUDMYzJcLkV/InzhPEVZ0HnfTth9zeOpWrI30 10 | M2EN7EZ1MGcqlVpI4U5cPM1cn+/proLBQYv0WnCEwFFY477JrkXDxG7MZ1mz6TaL 11 | IGcCCIUu1BxECngQ344eaKrSR5F2MtlxAl19Pt5QSPfmuMdmElrK6RtBjnKrDu1K 12 | fe6DCfObZ3nbG2fhFV4uTxhlTC9lUmfTQMKR79rLmHNKnbMx74kFNvy3XlT2l35I 13 | ZVfRMLPWph7yMom9v/Im3Q70uhJ1lxyqbbl/DFZVmQKBgQDVo19SqR/QeDIxPIPn 14 | XvVWzo5ml3KO/dVxA8sok6twr+G7yUeIUnuauYFA/tX/FS32azFRa/7GjUfoTx3q 15 | GHK43TBCMyEt0we6WwZb+FkWa/b/RBoyD/audrpmgDDi1+fXPs8bBvoO8/oju20D 16 | I6wOjSovcIMaeLo/+u3U6ShNQwKBgQDOTpoGMsQzXchZfDmxL61h3j4Gtjrl4BpU 17 | WhAkJ9U2BRpL8NSZLErn5ik8MwgK2ut+YdU7aogI0D6Gc+4zZoJDEbhhmPD9cprv 18 | LMyfAKoisR01OyU57mMSGQq0dfjmK6PfYJdX5sQJGkMFptNAJLTDoYtmXItSICoY 19 | 1j5KTvwe5QKBgGytxmErjfakHoxzh3pdERuOylwgMPPS5xCt6FyE+pLBtmisFQqh 20 | QyXLtpgUy1IPOSmBED6mXJ4u4uSn0sTymPG3+8PBdOB12RmREqQYq2E/nQ/wWg8b 21 | ldbcqShZkATl5pfV6M+L9gtDS/1/bA5LyExCvbISX29I+R5xDSnhTlI3AoGBAJRK 22 | VVXtOa/+UhtYOpPMxGCbgZQLemxvWB2XmxCR/SRWKJ+7XOU4vCLSAoO93qMG1szB 23 | /6Y0ndFP9hFo1SfnH+ybmR+18ksLDKisV+xWavSCwI7Zk5l/a4C/tT0fqyeu6JyQ 24 | bliFjBVK5i/yyNfLSo9v16ZdENuYOQofPSjmezytAoGBALhwvtzgqvqGSXID2w5N 25 | ullK8ny3WRa1o5DLXuMV19CvknmrN/zmmjQLblKkdp9VBb7uo8czon+qL1ZZyywC 26 | W2BmHfGMPUyQHux4btsdJhlWcS7z7aYXM9QWiKlI+EKLHLILYk+LPIEf85sUcOZV 27 | eCBpViT7fv2iv/0L+mzjWtLA 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-clang \ 7 | ${OEROOT}/../layers/sw/meta-rauc \ 8 | ${OEROOT}/../layers/bsp/meta-rauc-community/meta-rauc-raspberrypi \ 9 | ${OEROOT}/../layers/bsp/meta-lts-mixins \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 11 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 12 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 13 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 14 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 15 | " 16 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-image/wic/sdimage-aws-iot-greengrass-lite-demo_partition.wks.in: -------------------------------------------------------------------------------- 1 | part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --fixed-size 500M --active --align 4096 2 | part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_A --align 4096 3 | part / --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_B --align 4096 4 | part /data --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/data --size 500M --ondisk mmcblk0 --fstype=ext4 --label data --align 4096 --fsoptions "x-systemd.growfs" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-simple-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-lite-demo-simple-image 2 | 3 | This image is similar to [aws-iot-greengrass-lite-demo-image](../aws-iot-greengrass-lite-demo-image/README.md) 4 | 5 | The main difference it is just one rw rootfs partition. 6 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-simple-image/aws-iot-greengrass-lite-demo-simple-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for aws-iot-greengrass-lite" 2 | HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos" 3 | 4 | LICENSE = "MIT" 5 | 6 | # this needs to be done before installing the (dynamic) packagegroups 7 | inherit core-image 8 | 9 | IMAGE_INSTALL += "\ 10 | ${CORE_IMAGE_EXTRA_INSTALL} \ 11 | packagegroup-base \ 12 | packagegroup-core-boot \ 13 | " 14 | 15 | ### AWS ### 16 | IMAGE_INSTALL:append = " greengrass-lite" 17 | 18 | # only adding if device is rpi, as others might have a different partition layout 19 | IMAGE_INSTALL:append:rpi = " greengrass-config-init" 20 | 21 | ### tmux ### 22 | IMAGE_INSTALL:append = " tmux" 23 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8" 24 | IMAGE_INSTALL:append = " glibc-utils localedef " 25 | IMAGE_INSTALL:append = " ssh openssh-sshd openssh-sftp" 26 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 27 | 28 | ### aws-iot-device-client ### 29 | # IMAGE_INSTALL:append = " aws-iot-device-client" 30 | 31 | ### amazon-cloudwatch-publisher ### 32 | # IMAGE_INSTALL:append = " amazon-cloudwatch-publisher" 33 | 34 | ### misc ### 35 | IMAGE_INSTALL:append = " sudo" 36 | 37 | # this will disable root password - be warned! 38 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 39 | 40 | ### license compliance ### 41 | COPY_LIC_MANIFEST = "1" 42 | 43 | COPY_LIC_DIRS = "1" 44 | 45 | ### debug tools ### 46 | # IMAGE_INSTALL:append = " ldd gdb" 47 | # IMAGE_INSTALL:append = " valgrind" 48 | # IMAGE_INSTALL:append = " strace" 49 | 50 | # this will install all src, dbg packages to allow proper debugging with gdb 51 | # EXTRA_IMAGE_FEATURES:append = " src-pkgs dbg-pkgs" 52 | 53 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 54 | # for rauc bundle generation wic file is not used! 55 | ROOTFS_POSTINSTALL_COMMAND += "extra_files_common" 56 | ROOTFS_POSTINSTALL_COMMAND:rpi += "extra_files_rpi" 57 | 58 | extra_files_common () { 59 | # enable systemd-time-wait-sync as this is important for greengrass to have a correct clock 60 | ln -sf /${libdir}/systemd/system/systemd-time-wait-sync.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 61 | } 62 | 63 | extra_files_rpi () { 64 | # decided to do here instead of a bbappend of wpa:supplicant 65 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 66 | ln -sf /${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service 67 | } 68 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-simple-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | BOOT_SPACE = "69152" 5 | 6 | IMAGE_OVERHEAD_FACTOR = "2.0" 7 | 8 | # just necessary if aws-iot-device-client is installed 9 | PACKAGECONFIG:pn-aws-iot-device-client = "st" 10 | 11 | COPY_LIC_MANIFEST = "1" 12 | 13 | COPY_LIC_DIRS = "1" 14 | 15 | BB_GENERATE_MIRROR_TARBALLS = "1" 16 | 17 | BB_GIT_SHALLOW = "1" 18 | 19 | BB_GENERATE_SHALLOW_TARBALLS = "1" 20 | 21 | INHERIT += "create-spdx" 22 | 23 | # tests 24 | 25 | # use slirp networking instead of TAP interface (require root rights) 26 | #QEMU_USE_SLIRP = "1" 27 | #TEST_SERVER_IP = "127.0.0.1" 28 | 29 | # this will specify what test should run when running testimage cmd - oeqa layer tests + ptests: 30 | # Ping and SSH are not required, but do help in debugging. ptest will discover all ptest packages. 31 | # TEST_SUITES = " ping ssh ptest" 32 | 33 | # this will allow - running testimage cmd: bitbake core-image-minimal -c testimage 34 | # IMAGE_CLASSES += "testimage" 35 | 36 | # PUT = package under test / this is set in auto.conf 37 | # PUT = "greengrass-lite-ptest" 38 | # IMAGE_INSTALL:append = " ptest-runner ssh ${PUT}" 39 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-simple-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-clang \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 11 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 12 | " 13 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-tiny-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-lite-demo-tiny-image 2 | 3 | This image is similar to [aws-iot-greengrass-lite-demo-image](../aws-iot-greengrass-lite-demo-image/README.md) 4 | 5 | The main difference it is just one rootfs partition and linked to libmusl to create a tiny image. 6 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-tiny-image/aws-iot-greengrass-lite-demo-tiny-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A tiny demo image for AWS IoT Greengrass lite" 2 | 3 | IMAGE_INSTALL += "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}" 4 | 5 | LICENSE = "MIT" 6 | 7 | inherit core-image 8 | 9 | ### AWS ### 10 | # disabled as there is a link issue 11 | IMAGE_INSTALL:append = " greengrass-lite" 12 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 13 | 14 | # only adding if device is rpi 15 | IMAGE_INSTALL:append:rpi = " greengrass-config-init" 16 | 17 | ### MISC ### 18 | IMAGE_INSTALL:append = " sudo" 19 | 20 | # this will disable root password - be warned! 21 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 22 | 23 | ### license compliance ### 24 | COPY_LIC_MANIFEST = "1" 25 | 26 | COPY_LIC_DIRS = "1" 27 | 28 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 29 | # for rauc bundle generation wic file is not used! 30 | ROOTFS_POSTINSTALL_COMMAND += "extra_files" 31 | 32 | extra_files () { 33 | # enable systemd-time-wait-sync as this is important for greengrass to have a correct clock 34 | ln -sf /${libdir}/systemd/system/systemd-time-wait-sync.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 35 | } 36 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-tiny-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | 5 | IMAGE_OVERHEAD_FACTOR = "2" 6 | 7 | BOOT_SPACE = "69152" 8 | 9 | # just necessary if aws-iot-device-client is installed 10 | PACKAGECONFIG:pn-aws-iot-device-client = "st" 11 | 12 | DISTRO_FEATURES:remove = " ptest" 13 | 14 | # OSPO license compliance 15 | COPY_LIC_MANIFEST = "1" 16 | COPY_LIC_DIRS = "1" 17 | BB_GENERATE_MIRROR_TARBALLS = "1" 18 | BB_GIT_SHALLOW = "1" 19 | BB_GENERATE_SHALLOW_TARBALLS = "1" 20 | INHERIT += "create-spdx" 21 | 22 | DISTRO_FEATURES:append = " systemd" 23 | 24 | TCLIBC = "musl" 25 | 26 | FULL_OPTIMIZATION="-Os -pipe ${DEBUG_FLAGS}" 27 | 28 | PACKAGE_CLASSES ?= "package_ipk" 29 | 30 | VIRTUAL-RUNTIME_init_manager = "systemd" 31 | VIRTUAL-RUNTIME_initscripts = "systemd-compat-units" 32 | 33 | 34 | # We can use packagegroup-core-boot, but in the future we may need a new packagegroup-core-tiny 35 | #POKY_DEFAULT_EXTRA_RDEPENDS += "packagegroup-core-boot" 36 | # Drop kernel-module-af-packet from RRECOMMENDS 37 | POKY_DEFAULT_EXTRA_RRECOMMENDS = "" 38 | 39 | # FIXME: what should we do with this? 40 | TCLIBCAPPEND = "" 41 | 42 | # Disable wide char support for ncurses as we don't include it in 43 | # in the LIBC features below. 44 | # Leave native enable to avoid build failures 45 | ENABLE_WIDEC = "false" 46 | ENABLE_WIDEC:class-native = "true" 47 | 48 | # Drop native language support. This removes the 49 | # eglibc->bash->gettext->libc-posix-clang-wchar dependency. 50 | USE_NLS="no" 51 | # As we don't have native language support, don't install locales into images 52 | IMAGE_LINGUAS = "" 53 | 54 | # Comment out any of the lines below to disable them in the build 55 | # DISTRO_FEATURES options: 56 | # alsa bluetooth ext2 pcmcia usbgadget usbhost wifi nfs zeroconf pci 57 | DISTRO_FEATURES_TINY = "pci" 58 | DISTRO_FEATURES_NET = "ipv4 ipv6" 59 | DISTRO_FEATURES_USB = "usbhost" 60 | #DISTRO_FEATURES_USBGADGET = "usbgadget" 61 | DISTRO_FEATURES_WIFI = "wifi" 62 | 63 | DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \ 64 | ${DISTRO_FEATURES_NET} \ 65 | ${DISTRO_FEATURES_USB} \ 66 | ${DISTRO_FEATURES_USBGADGET} \ 67 | ${DISTRO_FEATURES_WIFI} \ 68 | " 69 | 70 | DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" 71 | DISTRO_FEATURES:class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" 72 | 73 | # FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in 74 | # packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and 75 | # netbase. 76 | 77 | # Drop v86d from qemu dependency list (we support serial) 78 | # Drop grub from meta-intel BSPs 79 | # FIXME: A different mechanism is needed here. We could define -tiny 80 | # variants of all compatible machines, but that leads to a lot 81 | # more machine configs to maintain long term. 82 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "" 83 | 84 | # The mtrace script included by eglibc is a perl script. This means the system 85 | # will build perl in case this package is installed. Since we don't care about 86 | # this script for the purposes of tiny, remove the dependency from here. 87 | RDEPENDS:${PN}-mtrace:pn-eglibc = "" 88 | 89 | SKIP_RECIPE[build-appliance-image] = "not buildable with poky-tiny" 90 | SKIP_RECIPE[core-image-rt] = "not buildable with poky-tiny" 91 | SKIP_RECIPE[core-image-rt-sdk] = "not buildable with poky-tiny" 92 | SKIP_RECIPE[core-image-sato] = "not buildable with poky-tiny" 93 | SKIP_RECIPE[core-image-sato-dev] = "not buildable with poky-tiny" 94 | SKIP_RECIPE[core-image-sato-sdk] = "not buildable with poky-tiny" 95 | SKIP_RECIPE[core-image-x11] = "not buildable with poky-tiny" 96 | SKIP_RECIPE[core-image-weston] = "not buildable with poky-tiny" 97 | 98 | # Disable python usage in opkg-utils since it won't build with tiny config 99 | PACKAGECONFIG:remove:pn-opkg-utils = "python" 100 | 101 | 102 | NO_RECOMMENDATIONS = "1" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-demo-tiny-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 11 | " 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-walltablet-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-lite-walltablet-demo-image 2 | 3 | This image is similar to [aws-iot-greengrass-lite-demo-image](../aws-iot-greengrass-lite-demo-image/README.md) 4 | 5 | The main difference that it has chromium running on wayland installed. 6 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-walltablet-demo-image/aws-iot-greengrass-lite-walltablet-demo-bundle.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A update bundle for aws-iot-greengrass-lite-demo-image" 2 | 3 | inherit bundle 4 | 5 | # RAUC_BUNDLE_VERSION = "v20200703" 6 | # RAUC_BUNDLE_DESCRIPTION = "RAUC Demo Bundle" 7 | 8 | RAUC_BUNDLE_SLOTS = "rootfs" 9 | RAUC_SLOT_rootfs = "aws-iot-greengrass-lite-walltablet-demo-image" 10 | 11 | RAUC_BUNDLE_COMPATIBLE ?= "${MACHINE}" 12 | RAUC_BUNDLE_FORMAT ?= "verity" 13 | 14 | # those are the certs that are contained in meta-rauc-community/meta-rauc-raspberrypi 15 | # they are intended for demo purpose only 16 | RAUC_KEY_FILE ?= "${THISDIR}/files/development-1.key.pem" 17 | RAUC_CERT_FILE ?= "${THISDIR}/files/development-1.cert.pem" 18 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-walltablet-demo-image/aws-iot-greengrass-lite-walltablet-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for aws-iot-greengrass-lite with A/B updates" 2 | HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos" 3 | 4 | LICENSE = "MIT" 5 | 6 | # this needs to be done before installing the (dynamic) packagegroups 7 | inherit core-image 8 | 9 | IMAGE_INSTALL += "\ 10 | ${CORE_IMAGE_EXTRA_INSTALL} \ 11 | packagegroup-base \ 12 | packagegroup-core-boot \ 13 | " 14 | 15 | ### AWS ### 16 | IMAGE_INSTALL:append = " greengrass-lite" 17 | IMAGE_INSTALL:append = " aws-iot-device-sdk-python-v2" 18 | IMAGE_INSTALL:append = " jq" 19 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 20 | 21 | ### rauc ### 22 | CORE_IMAGE_EXTRA_INSTALL:append = " rauc-grow-data-part" 23 | 24 | # only adding if device is rpi, as others might have a different partition layout 25 | IMAGE_INSTALL:append:rpi = " greengrass-config-init" 26 | 27 | # this will allow kernel updates with rauc 28 | IMAGE_INSTALL:append = " kernel-image kernel-modules" 29 | 30 | ### tmux ### 31 | IMAGE_INSTALL:append = " tmux" 32 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8" 33 | IMAGE_INSTALL:append = " glibc-utils localedef " 34 | IMAGE_INSTALL:append = " ssh openssh-sshd openssh-sftp openssh-scp" 35 | 36 | ### aws-iot-device-client ### 37 | # IMAGE_INSTALL:append = " aws-iot-device-client" 38 | 39 | ### amazon-cloudwatch-publisher ### 40 | # IMAGE_INSTALL:append = " amazon-cloudwatch-publisher" 41 | 42 | ### misc ### 43 | IMAGE_INSTALL:append = " sudo" 44 | 45 | # this will disable root password - be warned! 46 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 47 | 48 | ### license compliance ### 49 | COPY_LIC_MANIFEST = "1" 50 | 51 | COPY_LIC_DIRS = "1" 52 | 53 | ### debug tools ### 54 | # IMAGE_INSTALL:append = " ldd gdb" 55 | # IMAGE_INSTALL:append = " valgrind" 56 | # IMAGE_INSTALL:append = " strace" 57 | # IMAGE_INSTALL:append = " lsof" 58 | 59 | # this will install all src, dbg packages to allow proper debugging with gdb 60 | # EXTRA_IMAGE_FEATURES:append = " src-pkgs" 61 | # EXTRA_IMAGE_FEATURES:append = " dbg-pkgs" 62 | 63 | IMAGE_FEATURES += "read-only-rootfs" 64 | 65 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 66 | # for rauc bundle generation wic file is not used! 67 | ROOTFS_POSTPROCESS_COMMAND += "rootfs_user_fstab" 68 | 69 | rootfs_user_fstab () { 70 | 71 | # overwrite the default fstab, adding customization for this image 72 | cat << EOF > ${IMAGE_ROOTFS}/${sysconfdir}/fstab 73 | /dev/root / auto defaults 1 1 74 | proc /proc proc defaults 0 0 75 | devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 76 | tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 77 | tmpfs /var/volatile tmpfs defaults 0 0 78 | LABEL=boot /boot vfat defaults 0 0 79 | LABEL=data /data ext4 x-systemd.growfs 0 0 80 | /data/etc/wpa_supplicant /etc/wpa_supplicant none bind 0 0 81 | /data/etc/greengrass /etc/greengrass none bind 0 0 82 | /data/etc/systemd/network /etc/systemd/network none bind 0 0 83 | /data/etc/systemd/system /etc/systemd/system none bind 0 0 84 | /data/var/lib/greengrass /var/lib/greengrass none bind 0 0 85 | /data/home /home none bind 0 0 86 | EOF 87 | 88 | install -d -m 0755 ${IMAGE_ROOTFS}/data 89 | 90 | # copy those directories that should be present at the data partition to /data and just 91 | # leave them empty as a mount point for the bind mount 92 | 93 | install -d ${IMAGE_ROOTFS}/data/etc/greengrass 94 | mv -f ${IMAGE_ROOTFS}/etc/greengrass/* ${IMAGE_ROOTFS}/data/etc/greengrass/ 95 | 96 | install -d ${IMAGE_ROOTFS}/data/etc/wpa_supplicant 97 | 98 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/network 99 | mv -f ${IMAGE_ROOTFS}/etc/systemd/network/* ${IMAGE_ROOTFS}/data/etc/systemd/network 100 | 101 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/system 102 | mv -f ${IMAGE_ROOTFS}/etc/systemd/system/* ${IMAGE_ROOTFS}/data/etc/systemd/system 103 | 104 | install -d ${IMAGE_ROOTFS}/data/var/lib/greengrass 105 | 106 | # decided to do here instead of a bbappend of wpa:supplicant 107 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 108 | ln -sf /${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service 109 | 110 | # enable systemd-time-wait-sync as this is important for greengrass to have a correct clock 111 | ln -sf /${libdir}/systemd/system/systemd-time-wait-sync.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 112 | 113 | install -d ${IMAGE_ROOTFS}/data/home 114 | mv -f ${IMAGE_ROOTFS}/home/* ${IMAGE_ROOTFS}/data/home/ 115 | } 116 | 117 | ### specific to walltablet 118 | 119 | IMAGE_FEATURES:append = " package-management hwcodecs weston " 120 | 121 | IMAGE_INSTALL:append = " chromium-ozone-wayland wayland weston" 122 | 123 | CORE_IMAGE_BASE_INSTALL += "gtk+3-demo" 124 | CORE_IMAGE_BASE_INSTALL += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'weston-xwayland matchbox-terminal', '', d)}" 125 | 126 | QB_MEM = "-m 512" 127 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-walltablet-demo-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | BOOT_SPACE = "69152" 5 | 6 | # we are read only, no addition space necessary 7 | IMAGE_OVERHEAD_FACTOR = "1.1" 8 | 9 | DISTRO_FEATURES:append = " rauc" 10 | 11 | ENABLE_UART = "1" 12 | 13 | # PREFERRED_PROVIDER_virtual/bootloader = "u-boot" 14 | WKS_FILE = "${THISDIR}/wic/sdimage-aws-iot-greengrass-lite-demo_partition.wks.in" 15 | 16 | # Settings for meta-rauc-raspberry-pi 17 | IMAGE_FSTYPES="ext4 wic.bz2 wic" 18 | IMAGE_INSTALL:append = " rauc" 19 | 20 | # just necessary if aws-iot-device-client is installed 21 | PACKAGECONFIG:pn-aws-iot-device-client = "st" 22 | 23 | COPY_LIC_MANIFEST = "1" 24 | 25 | COPY_LIC_DIRS = "1" 26 | 27 | BB_GENERATE_MIRROR_TARBALLS = "1" 28 | 29 | BB_GIT_SHALLOW = "1" 30 | 31 | BB_GENERATE_SHALLOW_TARBALLS = "1" 32 | 33 | INHERIT += "create-spdx" 34 | 35 | # add build info to the image 36 | INHERIT += "image-buildinfo" 37 | 38 | # if not set, you will have to take care of mount points at two places, with this set image 39 | # partition layout is done in wic file and fstab settings in aws-iot-greengrass-lite-demo-ab-image.bb 40 | WIC_CREATE_EXTRA_ARGS = "--no-fstab-update" 41 | 42 | ### specific to walltablet / window manager 43 | 44 | 45 | ### specific to home assistant 46 | LICENSE_FLAGS_ACCEPTED += "commercial" 47 | 48 | DISTRO_FEATURES:remove = "ptest" 49 | 50 | # VC4 Graphics 51 | DISTRO_FEATURES:append = " wayland" 52 | 53 | DISTRO_FEATURES:remove = "x11" 54 | 55 | MACHINE_FEATURES:append = " vc4graphics" 56 | 57 | DISTRO_FEATURES:append = " pulseaudio" 58 | 59 | PACKAGECONFIG:pn-chromium-ozone-wayland += "proprietary-codecs" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-walltablet-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-clang \ 7 | ${OEROOT}/../layers/sw/meta-rauc \ 8 | ${OEROOT}/../layers/bsp/meta-rauc-community/meta-rauc-raspberrypi \ 9 | ${OEROOT}/../layers/bsp/meta-lts-mixins \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 11 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 12 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 13 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 14 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 15 | ${OEROOT}/../layers/sw/meta-browser/meta-chromium \ 16 | ${OEROOT}/../layers/sw/meta-clang \ 17 | " 18 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-walltablet-demo-image/wic/sdimage-aws-iot-greengrass-lite-demo_partition.wks.in: -------------------------------------------------------------------------------- 1 | part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --fixed-size 500M --active --align 4096 2 | part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_A --align 4096 3 | part / --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_B --align 4096 4 | part /data --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/data --size 500M --ondisk mmcblk0 --fstype=ext4 --label data --align 4096 --fsoptions "x-systemd.growfs" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-iot-greengrass-lite-webrtc-demo-image 2 | 3 | This image contain [amazon-kvs-webrtc-sdk](https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c) and when started it automatically connect to Amazon Kinesis Video Streams WebRTC using the [kvsWebrtcClientMasterGstSample](https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c?tab=readme-ov-file#sample-kvswebrtcclientmastergstsample) that use the default camera and microphone to init a WebRTC connection as a Master. 4 | It is based on [aws-iot-greengrass-lite-demo-image](../aws-iot-greengrass-lite-demo-image/README.md) and does have the same features, such as A/B update, read only partition etc. 5 | 6 | The channel name is the same as the thing name. It will use AWS IoT certs to connect to your account. [For this permissions need to be added to your account.](https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c?tab=readme-ov-file#setup-iot) E.g. Attach this policy to your: GreengrassV2CoreDeviceRole (when using the connection kit) 7 | 8 | ```json 9 | { 10 | "Version":"2012-10-17", 11 | "Statement":[ 12 | { 13 | "Effect":"Allow", 14 | "Action":[ 15 | "kinesisvideo:DescribeSignalingChannel", 16 | "kinesisvideo:CreateSignalingChannel", 17 | "kinesisvideo:GetSignalingChannelEndpoint", 18 | "kinesisvideo:GetIceServerConfig", 19 | "kinesisvideo:ConnectAsMaster" 20 | ], 21 | "Resource":"arn:aws:kinesisvideo:*:*:channel/${credentials-iot:ThingName}/*" 22 | } 23 | ] 24 | } 25 | ``` 26 | Note: if you want to use keys on your device you need to edit [here](aws-iot-greengrass-lite-webrtc-demo-image.bb#L123) and [here](config.conf#L66). 27 | 28 | ### Create a signalling channel in web console or cli (can also done on testpage) 29 | 30 | ```bash 31 | aws kinesisvideo create-signaling-channel \ 32 | --channel-name "" \ 33 | --channel-type SINGLE_MASTER 34 | ``` 35 | 36 | ## Bulid image - tested on raspberry pi zero with camera module V3. 37 | 38 | ```bash 39 | . init-build-env 40 | export DEVICE=raspberrypi-64 41 | export IMAGE=aws-iot-greengrass-lite-webrtc-demo-image 42 | bitbake $IMAGE 43 | ``` 44 | 45 | ## Flash onto your sd card - be careful about device naming to not overwrite the wrong disk! 46 | 47 | ```bash 48 | sudo bzcat build/tmp/deploy/images/raspberrypi-armv8/aws-iot-greengrass-lite-webrtc-demo-image-raspberrypi-armv8.rootfs.wic.bz2 | sudo dd of=/dev/sdX 49 | ``` 50 | 51 | ## Debugging 52 | Once booted you can connect to your device via ssh. Be careful default password is empty for root user! 53 | Wifi can be configured as described [here](../aws-iot-greengrass-lite-demo-image/README.md#installation). That zip file can be downloaded from web console (AWS IoT -> AWS IoT Greengrass) when following the "Set up one Greengrass core device" wizard. 54 | 55 | ```bash 56 | ssh root@ 57 | cat /etc/systemd/system/webrtc.service 58 | ``` 59 | 60 | ## Testing 61 | Use the official [Testpage](https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html) and enter your keys and start as viewer. This should start a WebRTC connection with your device. 62 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/aws-iot-greengrass-lite-webrtc-demo-bundle.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A update bundle for aws-iot-greengrass-litewebrtc-demo-image" 2 | 3 | inherit bundle 4 | 5 | # RAUC_BUNDLE_VERSION = "v20200703" 6 | # RAUC_BUNDLE_DESCRIPTION = "RAUC Demo Bundle" 7 | 8 | RAUC_BUNDLE_SLOTS = "rootfs" 9 | RAUC_SLOT_rootfs = "aws-iot-greengrass-lite-webrtc-demo-image" 10 | 11 | RAUC_BUNDLE_COMPATIBLE ?= "${MACHINE}" 12 | RAUC_BUNDLE_FORMAT ?= "verity" 13 | 14 | # those are the certs that are contained in meta-rauc-community/meta-rauc-raspberrypi 15 | # they are intended for demo purpose only 16 | RAUC_KEY_FILE ?= "${THISDIR}/files/development-1.key.pem" 17 | RAUC_CERT_FILE ?= "${THISDIR}/files/development-1.cert.pem" 18 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/aws-iot-greengrass-lite-webrtc-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A demo image for aws-iot-greengrass-lite with webrtc + A/B updates" 2 | HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos" 3 | 4 | LICENSE = "MIT" 5 | 6 | # this needs to be done before installing the (dynamic) packagegroups 7 | inherit core-image 8 | 9 | IMAGE_INSTALL += "\ 10 | ${CORE_IMAGE_EXTRA_INSTALL} \ 11 | packagegroup-base \ 12 | packagegroup-core-boot \ 13 | " 14 | 15 | ### AWS ### 16 | IMAGE_INSTALL:append = " greengrass-lite" 17 | IMAGE_INSTALL:append = " aws-iot-device-sdk-python-v2" 18 | IMAGE_INSTALL:append = " jq" 19 | IMAGE_INSTALL:append = " python3-misc python3-venv python3-tomllib python3-ensurepip libcgroup python3-pip" 20 | 21 | ### rauc ### 22 | CORE_IMAGE_EXTRA_INSTALL:append = " rauc-grow-data-part" 23 | 24 | # only adding if device is rpi, as others might have a different partition layout 25 | IMAGE_INSTALL:append:rpi = " greengrass-config-init" 26 | 27 | # this will allow kernel updates with rauc 28 | IMAGE_INSTALL:append = " kernel-image kernel-modules" 29 | 30 | ### tmux ### 31 | IMAGE_INSTALL:append = " tmux" 32 | GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8" 33 | IMAGE_INSTALL:append = " glibc-utils localedef " 34 | IMAGE_INSTALL:append = " openssh-ssh openssh-sshd openssh-sftp openssh-scp" 35 | 36 | ### aws-iot-device-client ### 37 | # IMAGE_INSTALL:append = " aws-iot-device-client" 38 | 39 | ### amazon-cloudwatch-publisher ### 40 | # IMAGE_INSTALL:append = " amazon-cloudwatch-publisher" 41 | 42 | ### misc ### 43 | IMAGE_INSTALL:append = " sudo" 44 | 45 | # this will disable root password - be warned! 46 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 47 | 48 | ### license compliance ### 49 | COPY_LIC_MANIFEST = "1" 50 | 51 | COPY_LIC_DIRS = "1" 52 | 53 | ### debug tools ### 54 | # IMAGE_INSTALL:append = " ldd gdb" 55 | # IMAGE_INSTALL:append = " valgrind" 56 | # IMAGE_INSTALL:append = " strace" 57 | # IMAGE_INSTALL:append = " lsof" 58 | IMAGE_INSTALL:append = " htop" 59 | 60 | # this will install all src, dbg packages to allow proper debugging with gdb 61 | # EXTRA_IMAGE_FEATURES:append = " src-pkgs" 62 | # EXTRA_IMAGE_FEATURES:append = " dbg-pkgs" 63 | 64 | IMAGE_FEATURES += "read-only-rootfs" 65 | 66 | # this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file, 67 | # for rauc bundle generation wic file is not used! 68 | ROOTFS_POSTPROCESS_COMMAND += "rootfs_user_fstab" 69 | 70 | rootfs_user_fstab () { 71 | 72 | # overwrite the default fstab, adding customization for this image 73 | cat << EOF > ${IMAGE_ROOTFS}/${sysconfdir}/fstab 74 | /dev/root / auto defaults 1 1 75 | proc /proc proc defaults 0 0 76 | devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 77 | tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 78 | tmpfs /var/volatile tmpfs defaults 0 0 79 | LABEL=boot /boot vfat defaults 0 0 80 | LABEL=data /data ext4 x-systemd.growfs 0 0 81 | /data/etc/wpa_supplicant /etc/wpa_supplicant none bind 0 0 82 | /data/etc/greengrass /etc/greengrass none bind 0 0 83 | /data/etc/systemd/network /etc/systemd/network none bind 0 0 84 | /data/etc/systemd/system /etc/systemd/system none bind 0 0 85 | /data/var/lib/greengrass /var/lib/greengrass none bind 0 0 86 | /data/home /home none bind 0 0 87 | EOF 88 | 89 | install -d -m 0755 ${IMAGE_ROOTFS}/data 90 | 91 | # copy those directories that should be present at the data partition to /data and just 92 | # leave them empty as a mount point for the bind mount 93 | 94 | install -d ${IMAGE_ROOTFS}/data/etc/greengrass 95 | mv -f ${IMAGE_ROOTFS}/etc/greengrass/* ${IMAGE_ROOTFS}/data/etc/greengrass/ 96 | 97 | install -d ${IMAGE_ROOTFS}/data/etc/wpa_supplicant 98 | 99 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/network 100 | mv -f ${IMAGE_ROOTFS}/etc/systemd/network/* ${IMAGE_ROOTFS}/data/etc/systemd/network 101 | 102 | install -d ${IMAGE_ROOTFS}/data/etc/systemd/system 103 | mv -f ${IMAGE_ROOTFS}/etc/systemd/system/* ${IMAGE_ROOTFS}/data/etc/systemd/system 104 | 105 | install -d ${IMAGE_ROOTFS}/data/var/lib/greengrass 106 | 107 | # decided to do here instead of a bbappend of wpa:supplicant 108 | install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 109 | ln -sf /${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service 110 | 111 | # enable systemd-time-wait-sync as this is important for greengrass to have a correct clock 112 | ln -sf /${libdir}/systemd/system/systemd-time-wait-sync.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 113 | 114 | install -d ${IMAGE_ROOTFS}/data/home 115 | 116 | # create a webrtc systemd service and enable it the hacky way 117 | cat << 'EOF' > ${IMAGE_ROOTFS}/${libdir}/systemd/system/webrtc.service 118 | [Unit] 119 | Description=Webrtc service 120 | After=network.target 121 | After=systemd-time-wait-sync.service 122 | 123 | [Service] 124 | # use key instead of a cert 125 | # Environment=AWS_ACCESS_KEY_ID=XXX 126 | # Environment=AWS_SECRET_ACCESS_KEY=XXX 127 | 128 | # using AWS IoT certs 129 | Environment=AWS_IOT_CORE_ROLE_ALIAS=GreengrassV2TokenExchangeCoreDeviceRoleAlias 130 | Environment=AWS_IOT_CORE_PRIVATE_KEY=/etc/greengrass/private.pem.key 131 | Environment=AWS_IOT_CORE_CERT=/etc/greengrass/device.pem.crt 132 | Environment=AWS_KVS_CACERT_PATH=/etc/greengrass/AmazonRootCA1.pem 133 | # 134 | 135 | ExecStart=/bin/sh -c "export AWS_IOT_CORE_THING_NAME=$$(awk -F': ' '/thingName/ {print $2}' /etc/greengrass/config.yaml | tr -d '\"' | sed 's/thingName: //') && \ 136 | AWS_IOT_CORE_CREDENTIAL_ENDPOINT=$$(awk -F': ' '/iotCredEndpoint/ {print $2}' /etc/greengrass/config.yaml | tr -d '\"' | sed 's/iotCredEndpoint: //') \ 137 | /usr/bin/kvsWebrtcClientMasterGstSample $AWS_IOT_CORE_THING_NAME audio-video" 138 | 139 | [Install] 140 | WantedBy=multi-user.target 141 | EOF 142 | 143 | ln -sf /${libdir}/systemd/system/webrtc.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/ 144 | 145 | } 146 | 147 | # webrtc 148 | IMAGE_INSTALL:append = " amazon-kvs-webrtc-sdk" 149 | IMAGE_INSTALL:append = " gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly v4l-utils libcamera libcamera-apps libcamera-gst" 150 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky-altcfg" 2 | 3 | QB_MEM = "-m 2048" 4 | BOOT_SPACE = "69152" 5 | 6 | # we are read only, no addition space necessary 7 | IMAGE_OVERHEAD_FACTOR = "1" 8 | 9 | BOOT_SPACE = "69152" 10 | 11 | DISTRO_FEATURES:append = " rauc" 12 | 13 | # we do not use bluetooth at the moment 14 | DISTRO_FEATURES:remove = " bluetooth" 15 | 16 | ENABLE_UART = "1" 17 | 18 | RPI_USE_U_BOOT = "1" 19 | 20 | # PREFERRED_PROVIDER_virtual/bootloader = "u-boot" 21 | WKS_FILE = "${THISDIR}/wic/sdimage-aws-iot-greengrass-lite-demo_partition.wks.in" 22 | 23 | # Settings for meta-rauc-raspberry-pi 24 | IMAGE_FSTYPES="ext4 wic.bz2 wic" 25 | IMAGE_INSTALL:append = " rauc" 26 | 27 | # just necessary if aws-iot-device-client is installed 28 | PACKAGECONFIG:pn-aws-iot-device-client = "st" 29 | 30 | COPY_LIC_MANIFEST = "1" 31 | 32 | COPY_LIC_DIRS = "1" 33 | 34 | BB_GENERATE_MIRROR_TARBALLS = "1" 35 | 36 | BB_GIT_SHALLOW = "1" 37 | 38 | BB_GENERATE_SHALLOW_TARBALLS = "1" 39 | 40 | INHERIT += "create-spdx" 41 | 42 | # add build info to the image 43 | INHERIT += "image-buildinfo" 44 | 45 | # if not set, you will have to take care of mount points at two places, with this set image 46 | # partition layout is done in wic file and fstab settings in aws-iot-greengrass-lite-demo-ab-image.bb 47 | WIC_CREATE_EXTRA_ARGS = "--no-fstab-update" 48 | 49 | ### added for webrtc demo image - to use the camera 50 | 51 | # this will enable camera v3 support (bcm2835-unicam) 52 | RASPBERRYPI_CAMERA_V3 = "1" 53 | VIDEO_CAMERA = "1" 54 | 55 | # enable to build gst plugins in libcamera 56 | PACKAGECONFIG:append:pn-libcamera = " gst" 57 | 58 | # enable opus codec 59 | PACKAGECONFIG:append:pn-gstreamer1.0-plugins-base = " opus" 60 | 61 | # enable h264 codec 62 | LICENSE_FLAGS_ACCEPTED += "commercial" 63 | PACKAGECONFIG:append:pn-gstreamer1.0-plugins-ugly = " x264" 64 | 65 | # enable credentials for amazon-kvs-webrtc-sdk samples 66 | EXTRA_OECMAKE:append:pn-amazon-kvs-webrtc-sdk = " -DIOT_CORE_ENABLE_CREDENTIALS=ON" 67 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/files/development-1.cert.pem: -------------------------------------------------------------------------------- 1 | Certificate: 2 | Data: 3 | Version: 3 (0x2) 4 | Serial Number: 2 (0x2) 5 | Signature Algorithm: sha256WithRSAEncryption 6 | Issuer: O=Test Org, CN=Test Org rauc CA Development 7 | Validity 8 | Not Before: Jan 1 00:00:00 1970 GMT 9 | Not After : Dec 31 23:59:59 9999 GMT 10 | Subject: O=Test Org, CN=Test Org Development-1 11 | Subject Public Key Info: 12 | Public Key Algorithm: rsaEncryption 13 | RSA Public-Key: (2048 bit) 14 | Modulus: 15 | 00:ac:2b:0f:05:02:d0:bb:b0:47:05:36:71:3c:20: 16 | 0e:a7:76:8d:75:c1:23:5e:6c:7a:2d:94:ff:3c:17: 17 | d8:0b:44:48:2a:82:03:92:c5:fd:33:76:0c:42:cf: 18 | 4d:8a:c9:47:7f:af:52:7c:15:6c:3b:e7:60:d1:04: 19 | 97:24:7b:07:1f:56:7d:6c:3f:31:e8:f9:36:7b:33: 20 | 5b:cf:54:ea:37:98:a6:b1:9a:1d:da:96:a1:07:14: 21 | 9c:15:80:4d:db:0c:03:86:ce:c7:3d:72:57:a2:da: 22 | a0:c0:8c:b2:9a:a0:6a:e5:b8:5f:52:d2:f6:27:ca: 23 | 48:f4:e3:86:eb:be:24:93:6a:af:60:68:7f:09:3b: 24 | 81:96:ce:85:0c:63:93:d8:fa:91:dc:50:2e:77:bb: 25 | bc:38:42:e9:86:d8:ac:33:dd:e6:d4:37:69:e3:01: 26 | 8d:21:8f:a9:4a:7f:15:a5:aa:a9:be:fc:36:93:a4: 27 | 10:0c:18:33:30:06:7f:1c:13:b3:a9:c6:57:d7:6b: 28 | 96:45:15:e7:f5:8f:3d:48:e0:08:46:4f:7f:ef:14: 29 | 77:95:25:25:9b:14:21:84:25:eb:37:0b:01:48:e6: 30 | f5:c1:8b:61:c6:cb:8c:6b:a7:d8:d2:f9:31:e3:80: 31 | 3f:78:ea:6a:41:6c:5d:4d:83:a6:54:0d:5b:c2:0e: 32 | f6:ef 33 | Exponent: 65537 (0x10001) 34 | X509v3 extensions: 35 | X509v3 Subject Key Identifier: 36 | 89:4C:FE:8A:60:4D:C9:6D:F7:A8:C0:04:49:7F:AA:05:92:29:17:FB 37 | X509v3 Authority Key Identifier: 38 | keyid:44:0C:AF:4A:74:B4:C7:65:02:B2:95:F1:91:7C:A3:CC:E6:3E:99:E8 39 | DirName:/O=Test Org/CN=Test Org rauc CA Development 40 | serial:01 41 | 42 | X509v3 Basic Constraints: 43 | CA:FALSE 44 | Signature Algorithm: sha256WithRSAEncryption 45 | 2c:d2:30:68:f5:84:52:1e:cf:ed:0d:fc:e7:02:69:0b:3b:f6: 46 | c3:77:00:12:1d:2d:d0:8f:49:9e:5c:f1:00:7b:1d:4f:d5:a9: 47 | 46:a5:df:54:90:50:b4:8f:8e:ba:4b:2d:82:74:eb:5b:a8:f5: 48 | 45:7b:77:73:b1:9b:32:93:15:c0:5c:02:2a:ed:b0:1e:bb:d8: 49 | 4e:41:17:20:af:04:46:21:20:7b:86:9f:32:ab:54:71:26:e8: 50 | 0b:75:12:9c:63:53:4f:54:db:a7:f9:b2:fa:e9:ee:4a:9d:80: 51 | ba:ae:3f:eb:ef:10:11:2d:4f:5a:34:fb:8b:45:10:63:0b:f8: 52 | af:f3:8b:24:21:2a:e0:0b:44:38:44:b5:9d:6e:8a:ff:1f:bf: 53 | 6e:44:21:22:ec:8a:8d:73:63:e5:df:1a:ec:2a:64:1f:97:f9: 54 | 5c:3a:25:7f:03:80:4c:db:99:5e:f9:7d:2b:f1:d0:97:4d:95: 55 | 6f:29:47:7b:3f:29:e3:96:25:b0:1c:f1:0b:8b:8b:ba:de:3b: 56 | 3f:40:2e:bd:31:68:ea:a9:8f:dc:c9:09:22:df:76:69:08:5d: 57 | 5d:a4:09:62:80:20:83:9e:bd:d4:a6:35:ee:97:50:66:39:62: 58 | 66:1b:2e:75:f2:6d:e7:06:ae:67:5f:4b:63:5c:52:e7:5d:dd: 59 | c9:0c:86:2b 60 | -----BEGIN CERTIFICATE----- 61 | MIIDfTCCAmWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADA6MREwDwYDVQQKDAhUZXN0 62 | IE9yZzElMCMGA1UEAwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudDAgFw03 63 | MDAxMDEwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowNDERMA8GA1UECgwIVGVzdCBP 64 | cmcxHzAdBgNVBAMMFlRlc3QgT3JnIERldmVsb3BtZW50LTEwggEiMA0GCSqGSIb3 65 | DQEBAQUAA4IBDwAwggEKAoIBAQCsKw8FAtC7sEcFNnE8IA6ndo11wSNebHotlP88 66 | F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DRBJckewcfVn1sPzHo+TZ7M1vP 67 | VOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDAjLKaoGrluF9S0vYnykj044br 68 | viSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG2Kwz3ebUN2njAY0hj6lKfxWl 69 | qqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I4AhGT3/vFHeVJSWbFCGEJes3 70 | CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZUDVvCDvbvAgMBAAGjgZEwgY4w 71 | HQYDVR0OBBYEFIlM/opgTclt96jABEl/qgWSKRf7MGIGA1UdIwRbMFmAFEQMr0p0 72 | tMdlArKV8ZF8o8zmPpnooT6kPDA6MREwDwYDVQQKDAhUZXN0IE9yZzElMCMGA1UE 73 | AwwcVGVzdCBPcmcgcmF1YyBDQSBEZXZlbG9wbWVudIIBATAJBgNVHRMEAjAAMA0G 74 | CSqGSIb3DQEBCwUAA4IBAQAs0jBo9YRSHs/tDfznAmkLO/bDdwASHS3Qj0meXPEA 75 | ex1P1alGpd9UkFC0j466Sy2CdOtbqPVFe3dzsZsykxXAXAIq7bAeu9hOQRcgrwRG 76 | ISB7hp8yq1RxJugLdRKcY1NPVNun+bL66e5KnYC6rj/r7xARLU9aNPuLRRBjC/iv 77 | 84skISrgC0Q4RLWdbor/H79uRCEi7IqNc2Pl3xrsKmQfl/lcOiV/A4BM25le+X0r 78 | 8dCXTZVvKUd7PynjliWwHPELi4u63js/QC69MWjqqY/cyQki33ZpCF1dpAligCCD 79 | nr3UpjXul1BmOWJmGy518m3nBq5nX0tjXFLnXd3JDIYr 80 | -----END CERTIFICATE----- 81 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/files/development-1.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCsKw8FAtC7sEcF 3 | NnE8IA6ndo11wSNebHotlP88F9gLREgqggOSxf0zdgxCz02KyUd/r1J8FWw752DR 4 | BJckewcfVn1sPzHo+TZ7M1vPVOo3mKaxmh3alqEHFJwVgE3bDAOGzsc9clei2qDA 5 | jLKaoGrluF9S0vYnykj044brviSTaq9gaH8JO4GWzoUMY5PY+pHcUC53u7w4QumG 6 | 2Kwz3ebUN2njAY0hj6lKfxWlqqm+/DaTpBAMGDMwBn8cE7OpxlfXa5ZFFef1jz1I 7 | 4AhGT3/vFHeVJSWbFCGEJes3CwFI5vXBi2HGy4xrp9jS+THjgD946mpBbF1Ng6ZU 8 | DVvCDvbvAgMBAAECggEASphBYq9sltVyf/ytpRpSnxYLhmiPFXs0mIlE6Nl/3qnQ 9 | BrLcL3yfDuvntg6xjx9UXistNtvlUDMYzJcLkV/InzhPEVZ0HnfTth9zeOpWrI30 10 | M2EN7EZ1MGcqlVpI4U5cPM1cn+/proLBQYv0WnCEwFFY477JrkXDxG7MZ1mz6TaL 11 | IGcCCIUu1BxECngQ344eaKrSR5F2MtlxAl19Pt5QSPfmuMdmElrK6RtBjnKrDu1K 12 | fe6DCfObZ3nbG2fhFV4uTxhlTC9lUmfTQMKR79rLmHNKnbMx74kFNvy3XlT2l35I 13 | ZVfRMLPWph7yMom9v/Im3Q70uhJ1lxyqbbl/DFZVmQKBgQDVo19SqR/QeDIxPIPn 14 | XvVWzo5ml3KO/dVxA8sok6twr+G7yUeIUnuauYFA/tX/FS32azFRa/7GjUfoTx3q 15 | GHK43TBCMyEt0we6WwZb+FkWa/b/RBoyD/audrpmgDDi1+fXPs8bBvoO8/oju20D 16 | I6wOjSovcIMaeLo/+u3U6ShNQwKBgQDOTpoGMsQzXchZfDmxL61h3j4Gtjrl4BpU 17 | WhAkJ9U2BRpL8NSZLErn5ik8MwgK2ut+YdU7aogI0D6Gc+4zZoJDEbhhmPD9cprv 18 | LMyfAKoisR01OyU57mMSGQq0dfjmK6PfYJdX5sQJGkMFptNAJLTDoYtmXItSICoY 19 | 1j5KTvwe5QKBgGytxmErjfakHoxzh3pdERuOylwgMPPS5xCt6FyE+pLBtmisFQqh 20 | QyXLtpgUy1IPOSmBED6mXJ4u4uSn0sTymPG3+8PBdOB12RmREqQYq2E/nQ/wWg8b 21 | ldbcqShZkATl5pfV6M+L9gtDS/1/bA5LyExCvbISX29I+R5xDSnhTlI3AoGBAJRK 22 | VVXtOa/+UhtYOpPMxGCbgZQLemxvWB2XmxCR/SRWKJ+7XOU4vCLSAoO93qMG1szB 23 | /6Y0ndFP9hFo1SfnH+ybmR+18ksLDKisV+xWavSCwI7Zk5l/a4C/tT0fqyeu6JyQ 24 | bliFjBVK5i/yyNfLSo9v16ZdENuYOQofPSjmezytAoGBALhwvtzgqvqGSXID2w5N 25 | ullK8ny3WRa1o5DLXuMV19CvknmrN/zmmjQLblKkdp9VBb7uo8czon+qL1ZZyywC 26 | W2BmHfGMPUyQHux4btsdJhlWcS7z7aYXM9QWiKlI+EKLHLILYk+LPIEf85sUcOZV 27 | eCBpViT7fv2iv/0L+mzjWtLA 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-clang \ 7 | ${OEROOT}/../layers/sw/meta-rauc \ 8 | ${OEROOT}/../layers/bsp/meta-rauc-community/meta-rauc-raspberrypi \ 9 | ${OEROOT}/../layers/bsp/meta-lts-mixins \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 11 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 12 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 13 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 14 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 15 | " 16 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-iot-greengrass-lite-webrtc-demo-image/wic/sdimage-aws-iot-greengrass-lite-demo_partition.wks.in: -------------------------------------------------------------------------------- 1 | part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --fixed-size 500M --active --align 4096 2 | part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_A --align 4096 3 | part / --ondisk mmcblk0 --fstype=ext4 --fixed-size 2000M --label rootfs_B --align 4096 4 | part /data --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/data --size 500M --ondisk mmcblk0 --fstype=ext4 --label data --align 4096 --fsoptions "x-systemd.growfs" -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-webrtc-demo-image/README.md: -------------------------------------------------------------------------------- 1 | # aws-webrtc-demo-image 2 | A image to test [amazon-kvs-producer-sdk-c](https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c). 3 | 4 | Tested on device: [qemu-arm64](../../../conf/devices/qemu-arm64/README.md) 5 | 6 | Setup [environment (AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY)](https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c?tab=readme-ov-file#run) 7 | 8 | Run this to send audio-video to Kinesis Video Streams e.g. 9 | ```bash 10 | kvsWebrtcClientMasterGstSample test audio-video testsrc 11 | ``` 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-webrtc-demo-image/aws-webrtc-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A image to test amazon-kvs-webrtc-sdk" 2 | inherit core-image 3 | 4 | IMAGE_INSTALL =+ "amazon-kvs-webrtc-sdk" 5 | 6 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password allow-root-login empty-root-password" 7 | 8 | IMAGE_INSTALL =+ "gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly tmux" 9 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-webrtc-demo-image/config.conf: -------------------------------------------------------------------------------- 1 | DISTRO = "poky" 2 | 3 | # this is required for gstreamer1.0-plugins-ugly 4 | LICENSE_FLAGS_ACCEPTED = "commercial" 5 | 6 | # x264 needs to be enabled 7 | PACKAGECONFIG:append:pn-gstreamer1.0-plugins-ugly = "x264" 8 | 9 | # opus needs to be enabled 10 | PACKAGECONFIG:append:pn-gstreamer1.0-plugins-base = "opus" 11 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-core/images/aws-webrtc-demo-image/layers.conf: -------------------------------------------------------------------------------- 1 | BBLAYERS += "\ 2 | ${OEROOT}/meta \ 3 | ${OEROOT}/meta-poky \ 4 | ${OEROOT}/../meta-aws-demos \ 5 | ${OEROOT}/../layers/sw/meta-aws \ 6 | ${OEROOT}/../layers/sw/meta-openembedded/meta-oe \ 7 | ${OEROOT}/../layers/sw/meta-openembedded/meta-python \ 8 | ${OEROOT}/../layers/sw/meta-openembedded/meta-multimedia \ 9 | ${OEROOT}/../layers/sw/meta-openembedded/meta-networking \ 10 | ${OEROOT}/../layers/sw/meta-openembedded/meta-filesystems \ 11 | " 12 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-iot/aws-iot-greengrass/greengrass-bin/greengrass-classic.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | system: 3 | rootPath: "@GG_WORKING_DIR@" 4 | services: 5 | aws.greengrass.Nucleus: 6 | componentType: "NUCLEUS" 7 | configuration: 8 | runWithDefault: 9 | posixUser: "@GG_USER@:@GG_GROUP@" 10 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-iot/aws-iot-greengrass/greengrass-bin/greengrass.service.template: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Greengrass Core 3 | After=network.target 4 | After=systemd-time-wait-sync.service 5 | 6 | 7 | [Service] 8 | Type=simple 9 | PIDFile=/var/run/greengrass.pid 10 | RemainAfterExit=no 11 | Restart=on-failure 12 | RestartSec=10 13 | ExecStart=/bin/sh /greengrass/v2/alts/current/distro/bin/loader 14 | KillMode=mixed 15 | 16 | [Install] 17 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /meta-aws-demos/recipes-iot/aws-iot-greengrass/greengrass-bin_%.bbappend: -------------------------------------------------------------------------------- 1 | # This are the necessary changes to make greengrass-bin using greengrass-config-init 2 | 3 | FILESEXTRAPATHS:prepend:rpi := "${THISDIR}/greengrass-bin:" 4 | 5 | SRC_URI:append:rpi = " \ 6 | file://greengrass-classic.yaml \ 7 | file://greengrass.service.template \ 8 | " 9 | 10 | gg_workingdir = "/greengrass/v2" 11 | gg_user = "ggc_user" 12 | gg_group = "ggc_group" 13 | 14 | # fix service file - add systemd-time-wait-sync.service 15 | do_install:append:rpi () { 16 | install -m 0640 ${S}/greengrass.service.template ${GG_ROOT}/packages/artifacts-unarchived/aws.greengrass.Nucleus/${PV}/aws.greengrass.nucleus/bin/greengrass.service.template 17 | # Install systemd service file 18 | install -d ${D}${systemd_unitdir}/system/ 19 | install -m 0644 ${S}/greengrass.service.template ${D}${systemd_unitdir}/system/greengrass.service 20 | sed -i -e "s,REPLACE_WITH_GG_LOADER_FILE,/${GG_BASENAME}/alts/current/distro/bin/loader,g" ${D}${systemd_unitdir}/system/greengrass.service 21 | sed -i -e "s,REPLACE_WITH_GG_LOADER_PID_FILE,/var/run/greengrass.pid,g" ${D}${systemd_unitdir}/system/greengrass.service 22 | 23 | } 24 | 25 | do_install:append:rpi () { 26 | install -m 0640 ${S}/greengrass-classic.yaml ${GG_ROOT}/greengrass-classic.yaml.fragment 27 | sed -i -e 's,@GG_WORKING_DIR@,${gg_workingdir},g' \ 28 | -e 's,@GG_USER@,${gg_user},g' \ 29 | -e 's,@GG_GROUP@,${gg_group},g' \ 30 | ${GG_ROOT}/greengrass-classic.yaml.fragment 31 | } 32 | 33 | FILES:${PN}:append:rpi = " \ 34 | ${sysconfdir}/sudoers.d/${BPN} \ 35 | " 36 | 37 | do_install:append:rpi() { 38 | install -d -m 0750 ${D}/${sysconfdir}/sudoers.d 39 | echo "${gg_user} ALL=(root) NOPASSWD:/usr/bin/rauc *" >> ${D}/${sysconfdir}/sudoers.d/${BPN} 40 | chmod 0440 ${D}/${sysconfdir}/sudoers.d/${BPN} 41 | } 42 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-iot/aws-iot-greengrass/greengrass-config-init.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "AWS IoT Greengrass config init" 2 | DESCRIPTION = "AWS IoT Greengrass config init by zip from fat partition, e.g. for Raspberry Pi" 3 | LICENSE = "MIT" 4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 5 | 6 | SRC_URI = "\ 7 | file://greengrass-config-init.service \ 8 | file://greengrass-config-init.sh \ 9 | file://wlan.network \ 10 | " 11 | 12 | FILES:${PN} += "\ 13 | ${systemd_unitdir}/system/greengrass-config-init.service \ 14 | ${sysconfdir}/systemd/network/wlan.network \ 15 | " 16 | 17 | RDEPENDS:${PN} += "\ 18 | avahi-daemon \ 19 | avahi-utils \ 20 | sed \ 21 | zip \ 22 | " 23 | 24 | inherit systemd features_check 25 | 26 | REQUIRED_DISTRO_FEATURES = "wifi" 27 | 28 | SYSTEMD_SERVICE:${PN} += "greengrass-config-init.service" 29 | 30 | do_install() { 31 | install -d ${D}${bindir}/ 32 | install -m 0755 ${WORKDIR}/greengrass-config-init.sh ${D}${bindir}/ 33 | 34 | install -d ${D}${systemd_unitdir}/system 35 | install -m 0644 ${WORKDIR}/greengrass-config-init.service ${D}${systemd_unitdir}/system/ 36 | sed -i -e 's,@BINDIR@,${bindir},g' \ 37 | ${D}${systemd_unitdir}/system/greengrass-config-init.service 38 | 39 | install -d -m 0755 ${D}${sysconfdir}/systemd/network 40 | install -m 0644 ${WORKDIR}/wlan.network ${D}${sysconfdir}/systemd/network/ 41 | 42 | install -d ${D}${sysconfdir}/wpa_supplicant 43 | } 44 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-iot/aws-iot-greengrass/greengrass-config-init/greengrass-config-init.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=greengrass config init service 3 | After=tmp.mount 4 | Before=greengrass-lite.target greengrass.service wpa_supplicant@wlan0.service avahi-daemon.service systemd-networkd.service 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStart=@BINDIR@/greengrass-config-init.sh 9 | RemainAfterExit=yes 10 | 11 | [Install] 12 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /meta-aws-demos/recipes-iot/aws-iot-greengrass/greengrass-config-init/greengrass-config-init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -euxo pipefail 4 | 5 | if [ -e /dev/mmcblk0p1 ]; then 6 | mkdir -p /tmp/mmcblk0p1 7 | mount /dev/mmcblk0p1 /tmp/mmcblk0p1 8 | config_zip=$(find /tmp/mmcblk0p1 -type f ! -name '.*' -regex ".*connectionKit.*\.zip" -print) 9 | if [ -n "$config_zip" ]; then 10 | echo "connectionKit zip found" 11 | 12 | if [ -d /etc/greengrass ]; then 13 | echo "ggconfigd found - gg-lite" 14 | config_file="/etc/greengrass/config.yaml" 15 | unzip -jo $config_zip -d /etc/greengrass/ 16 | sed -i -e s:{{config_dir}}:\/etc\/greengrass:g -e s:{{nucleus_component}}:aws.greengrass.NucleusLite:g $config_file 17 | elif [ -d "/greengrass/v2/" ]; then 18 | echo "/greengrass/v2/ found - gg-classic" 19 | config_file="/greengrass/v2/config/config.yaml" 20 | unzip -jo $config_zip -d /greengrass/v2/ 21 | mv /greengrass/v2/config.yaml /greengrass/v2/config.yaml.fragment 22 | sed -i -e s:{{config_dir}}:\/greengrass\/v2:g -e s:{{nucleus_component}}:aws.greengrass.Nucleus:g /greengrass/v2/config.yaml.fragment 23 | # if there is a effective config that will be used instead of the new one, so delete it first 24 | rm -rf /greengrass/v2/config/* 25 | yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' /greengrass/v2/config.yaml.fragment /greengrass/v2/greengrass-classic.yaml.fragment > $config_file 26 | else 27 | echo "no directory /greengrass/v2/ or /etc/greengrass found - doing nothing" 28 | exit -1 29 | fi 30 | chmod 644 $config_file 31 | rm $config_zip 32 | sync 33 | 34 | fi 35 | if [ -f /tmp/mmcblk0p1/wpa_supplicant.conf ]; then 36 | echo "wpa_supplicant.conf found" 37 | mv /tmp/mmcblk0p1/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlan0.conf 38 | chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf 39 | sync 40 | fi 41 | if [ -f /tmp/mmcblk0p1/wlan.network ]; then 42 | echo "wlan.network found" 43 | mv /tmp/mmcblk0p1/wlan.network /etc/systemd/network/ 44 | chmod 644 /etc/systemd/network/wlan.network 45 | sync 46 | fi 47 | umount /tmp/mmcblk0p1 48 | sync 49 | 50 | # setting hostname to thingname 51 | if [ -f /etc/greengrass/config.yaml ]; then 52 | config_file="/etc/greengrass/config.yaml" 53 | elif [ -f /greengrass/v2/config/config.yaml ]; then 54 | config_file="/greengrass/v2/config/config.yaml" 55 | else 56 | echo "no config is found, doing nothing" 57 | exit 0 58 | fi 59 | THING_NAME=$(grep 'thingName:' $config_file | awk '{print $2}' | tr -d '"' | sed 's/_//g') 60 | echo "setting hostname to: $THING_NAME" 61 | hostname $THING_NAME 62 | fi 63 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-iot/aws-iot-greengrass/greengrass-config-init/wlan.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=wl* 3 | 4 | [Network] 5 | DHCP=ipv4 6 | 7 | [DHCP] 8 | RouteMetric=20 9 | ClientIdentifier=mac 10 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-multimedia/libcamera/libcamera/0001-media_device-Add-bool-return-type-to-unlock.patch: -------------------------------------------------------------------------------- 1 | From 6914c4fd3d53c0c6ea304123bf57429bb64ec16f Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Wed, 31 Jan 2024 21:01:27 -0800 4 | Subject: [PATCH 1/2] media_device: Add bool return type to unlock() 5 | 6 | unlock uses lockf which is marked with __attribute__ 7 | ((warn_unused_result)) and compilers warn about it and some treat 8 | -Wunused-result as error with -Werror turned on, It would be good to 9 | check if lockf failed or succeeded, however, that piece is not changed 10 | with this, this fixes build with clang++ 18 11 | 12 | ../git/src/libcamera/media_device.cpp:167:2: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] 13 | 167 | lockf(fd_.get(), F_ULOCK, 0); 14 | | ^~~~~ ~~~~~~~~~~~~~~~~~~~~~ 15 | 1 error generated. 16 | 17 | Upstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2024-February/040380.html] 18 | Signed-off-by: Khem Raj 19 | --- 20 | include/libcamera/internal/media_device.h | 2 +- 21 | src/libcamera/media_device.cpp | 6 +++--- 22 | 2 files changed, 4 insertions(+), 4 deletions(-) 23 | 24 | diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h 25 | index eb8cfde4..b09dfd16 100644 26 | --- a/include/libcamera/internal/media_device.h 27 | +++ b/include/libcamera/internal/media_device.h 28 | @@ -33,7 +33,7 @@ public: 29 | bool busy() const { return acquired_; } 30 | 31 | bool lock(); 32 | - void unlock(); 33 | + bool unlock(); 34 | 35 | int populate(); 36 | bool isValid() const { return valid_; } 37 | diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp 38 | index 2949816b..eaa2fdb0 100644 39 | --- a/src/libcamera/media_device.cpp 40 | +++ b/src/libcamera/media_device.cpp 41 | @@ -159,12 +159,12 @@ bool MediaDevice::lock() 42 | * 43 | * \sa lock() 44 | */ 45 | -void MediaDevice::unlock() 46 | +bool MediaDevice::unlock() 47 | { 48 | if (!fd_.isValid()) 49 | - return; 50 | + return false; 51 | 52 | - lockf(fd_.get(), F_ULOCK, 0); 53 | + return lockf(fd_.get(), F_ULOCK, 0) == 0; 54 | } 55 | 56 | /** 57 | -- 58 | 2.43.0 59 | 60 | -------------------------------------------------------------------------------- /meta-aws-demos/recipes-multimedia/libcamera/libcamera_0.4.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Linux libcamera framework" 2 | SECTION = "libs" 3 | 4 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" 5 | 6 | LIC_FILES_CHKSUM = "\ 7 | file://LICENSES/GPL-2.0-or-later.txt;md5=fed54355545ffd980b814dab4a3b312c \ 8 | file://LICENSES/LGPL-2.1-or-later.txt;md5=2a4f4fd2128ea2f65047ee63fbca9f68 \ 9 | " 10 | 11 | SRC_URI = " \ 12 | git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \ 13 | file://0001-media_device-Add-bool-return-type-to-unlock.patch \ 14 | " 15 | 16 | SRCREV = "35ed4b91291d9f3d08e4b51acfb51163e65df8f8" 17 | 18 | PE = "1" 19 | 20 | S = "${WORKDIR}/git" 21 | 22 | DEPENDS = "python3-pyyaml-native python3-jinja2-native python3-ply-native python3-jinja2-native udev gnutls chrpath-native libevent libyaml" 23 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}" 24 | 25 | PACKAGES =+ "${PN}-gst ${PN}-pycamera" 26 | 27 | PACKAGECONFIG ??= "" 28 | PACKAGECONFIG[gst] = "-Dgstreamer=enabled,-Dgstreamer=disabled,gstreamer1.0 gstreamer1.0-plugins-base" 29 | PACKAGECONFIG[pycamera] = "-Dpycamera=enabled,-Dpycamera=disabled,python3 python3-pybind11" 30 | 31 | LIBCAMERA_PIPELINES ??= "auto" 32 | 33 | EXTRA_OEMESON = " \ 34 | -Dpipelines=${LIBCAMERA_PIPELINES} \ 35 | -Dv4l2=true \ 36 | -Dcam=enabled \ 37 | -Dlc-compliance=disabled \ 38 | -Dtest=false \ 39 | -Ddocumentation=disabled \ 40 | " 41 | 42 | RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}" 43 | 44 | inherit meson pkgconfig python3native 45 | 46 | do_configure:prepend() { 47 | sed -i -e 's|py_compile=True,||' ${S}/utils/codegen/ipc/mojo/public/tools/mojom/mojom/generate/template_expander.py 48 | } 49 | 50 | do_install:append() { 51 | chrpath -d ${D}${libdir}/libcamera.so 52 | chrpath -d ${D}${libexecdir}/libcamera/v4l2-compat.so 53 | } 54 | 55 | do_package:append() { 56 | bb.build.exec_func("do_package_recalculate_ipa_signatures", d) 57 | } 58 | 59 | do_package_recalculate_ipa_signatures() { 60 | local modules 61 | for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do 62 | module="${module%.sign}" 63 | if [ -f "${module}" ] ; then 64 | modules="${modules} ${module}" 65 | fi 66 | done 67 | 68 | ${S}/src/ipa/ipa-sign-install.sh ${B}/src/ipa-priv-key.pem "${modules}" 69 | } 70 | 71 | FILES:${PN} += " ${libexecdir}/libcamera/v4l2-compat.so" 72 | FILES:${PN}-gst = "${libdir}/gstreamer-1.0" 73 | FILES:${PN}-pycamera = "${PYTHON_SITEPACKAGES_DIR}/libcamera" 74 | 75 | # libcamera-v4l2 explicitly sets _FILE_OFFSET_BITS=32 to get access to 76 | # both 32 and 64 bit file APIs. 77 | GLIBC_64BIT_TIME_FLAGS = "" --------------------------------------------------------------------------------