Skip to content

Commit

Permalink
rename ab images to be the default
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-roos committed Nov 28, 2024
1 parent 83ef6ef commit 8c978e0
Show file tree
Hide file tree
Showing 39 changed files with 425 additions and 465 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build-gg-lite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ jobs:
- raspberrypi-64
image:
- aws-iot-greengrass-lite-demo-image
- aws-iot-greengrass-lite-demo-ab-image
- aws-iot-greengrass-lite-tiny-demo-image
- aws-iot-greengrass-lite-demo-simple-image
- aws-iot-greengrass-lite-demo-tiny-image
exclude:
- image: aws-iot-greengrass-lite-demo-ab-image
- image: aws-iot-greengrass-lite-demo-image
device: qemuarm
- image: aws-iot-greengrass-lite-demo-ab-image
- image: aws-iot-greengrass-lite-demo-image
device: qemuarm64
- image: aws-iot-greengrass-lite-demo-ab-image
- image: aws-iot-greengrass-lite-demo-image
device: qemux86-64
- image: aws-iot-greengrass-lite-demo-ab-image
- image: aws-iot-greengrass-lite-demo-image
device: aws-ec2-arm64
- image: aws-iot-greengrass-lite-demo-ab-image
- image: aws-iot-greengrass-lite-demo-image
device: aws-ec2-x86-64
runs-on: codebuild-${{ vars.CODEBUILD_RUNNER_NAME }}-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: checkout meta-aws-demos branch to build
uses: actions/checkout@v4
with:
submodules: recursive
submodules: true
fetch-depth: 0
- name: build
shell: bash
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build-gg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@ jobs:
- raspberrypi-64
image:
- aws-iot-greengrass-demo-image
- aws-iot-greengrass-demo-ab-image
- aws-iot-greengrass-demo-simple-image
exclude:
- image: aws-iot-greengrass-demo-ab-image
- image: aws-iot-greengrass-demo-simple-image
device: qemuarm
- image: aws-iot-greengrass-demo-ab-image
- image: aws-iot-greengrass-demo-simple-image
device: qemuarm64
- image: aws-iot-greengrass-demo-ab-image
- image: aws-iot-greengrass-demo-simple-image
device: qemux86-64
- image: aws-iot-greengrass-demo-ab-image
- image: aws-iot-greengrass-demo-simple-image
device: aws-ec2-arm64
- image: aws-iot-greengrass-demo-ab-image
- image: aws-iot-greengrass-demo-simple-image
device: aws-ec2-x86-64
runs-on: codebuild-${{ vars.CODEBUILD_RUNNER_NAME }}-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: checkout meta-aws-demos branch to build
uses: actions/checkout@v4
with:
submodules: recursive
submodules: true
fetch-depth: 0
- name: build
shell: bash
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# aws-greengrass-demo-image
A image to use demo greengrass-bin
# aws-greengrass-demo-ab-image

## Fleet Provisioning for Embedded Linux Devices with AWS IoT Greengrass
this blog post:
https://dev.to/iotbuilders/fleet-provisioning-for-embedded-linux-devices-with-aws-iot-greengrass-4h8b
Is the default demo image for Greengrass
Works only for raspberry-pi.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
DESCRIPTION = "A update bundle for aws-iot-greengrass-demo-ab-image"
DESCRIPTION = "A update bundle for aws-iot-greengrass-demo-image"

inherit bundle

# RAUC_BUNDLE_VERSION = "v20200703"
# RAUC_BUNDLE_DESCRIPTION = "RAUC Demo Bundle"

RAUC_BUNDLE_SLOTS = "rootfs"
RAUC_SLOT_rootfs = "aws-iot-greengrass-demo-ab-image"
RAUC_SLOT_rootfs = "aws-iot-greengrass-demo-image"

RAUC_BUNDLE_COMPATIBLE ?= "${MACHINE}"
RAUC_BUNDLE_FORMAT ?= "verity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
SUMMARY = "A demo image for aws-iot-greengrass"
SUMMARY = "A demo image for aws-iot-greengrass with A/B updates"
HOMEPAGE = "https://github.com/aws4embeddedlinux/meta-aws-demos"

LICENSE = "MIT"

# this needs to be done before installing the (dynamic) packagegroups
inherit core-image

IMAGE_ROOTFS_SIZE ?= "8192"
IMAGE_INSTALL += "\
${CORE_IMAGE_EXTRA_INSTALL} \
packagegroup-base \
Expand All @@ -17,7 +16,8 @@ IMAGE_INSTALL:append = " greengrass-bin udev"

# only adding if device is rpi, as others might have a different partition layout
IMAGE_INSTALL:append:rpi = " greengrass-config-init yq"

# this will allow kernel updates with rauc
IMAGE_INSTALL:append = " kernel-image kernel-modules"
### tmux ###
IMAGE_INSTALL:append = " tmux"
GLIBC_GENERATE_LOCALES = "en_US.UTF-8 UTF-8"
Expand All @@ -31,7 +31,7 @@ IMAGE_INSTALL:append = " ssh openssh-sshd openssh-sftp openssh-scp"
# IMAGE_INSTALL:append = " amazon-cloudwatch-publisher"

### misc ###
IMAGE_INSTALL:append = " sudo "
IMAGE_INSTALL:append = " sudo"

# this will disable root password - be warned!
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
Expand All @@ -49,13 +49,52 @@ COPY_LIC_DIRS = "1"

# this will install all src, dbg packages to allow proper debugging with gdb
# EXTRA_IMAGE_FEATURES:append = " src-pkgs dbg-pkgs"
IMAGE_FEATURES += "read-only-rootfs"

# this should be equal to sdimage-aws-iot-greengrass-lite-demo-ab_partition.wks.in file,
# for rauc bundle generation wic file is not used!
ROOTFS_POSTPROCESS_COMMAND += "extra_files"
ROOTFS_POSTINSTALL_COMMAND += "rootfs_user_fstab"

rootfs_user_fstab () {

# overwrite the default fstab, adding customization for this image
cat << EOF > ${IMAGE_ROOTFS}/${sysconfdir}/fstab
/dev/root / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
LABEL=boot /boot vfat defaults 0 0
LABEL=data /data ext4 defaults 0 0
LABEL=home /home ext4 x-systemd.growfs 0 0
/data/etc/wpa_supplicant /etc/wpa_supplicant none bind 0 0
/data/etc/systemd/network /etc/systemd/network none bind 0 0
/data/greengrass/v2/ /greengrass/v2/ none bind 0 0
EOF

install -d -m 0755 ${IMAGE_ROOTFS}/data

# copy those directories that should be present at the data partition to /data and just
# leave them empty as a mount point for the bind mount

install -d ${IMAGE_ROOTFS}/data/etc/wpa_supplicant
# empty dir
# mv -f ${IMAGE_ROOTFS}/etc/wpa_supplicant/* ${IMAGE_ROOTFS}/data/etc/wpa_supplicant/

install -d ${IMAGE_ROOTFS}/data/etc/systemd/network
mv -f ${IMAGE_ROOTFS}/etc/systemd/network/* ${IMAGE_ROOTFS}/data/etc/systemd/network

install -d ${IMAGE_ROOTFS}/data/greengrass/v2
mv -f ${IMAGE_ROOTFS}/greengrass/v2/* ${IMAGE_ROOTFS}/data/greengrass/v2

# decided to do here instead of a bbappend of wpa:supplicant
install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/
ln -sf /${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service

mv -f ${IMAGE_ROOTFS}/etc/hostname ${IMAGE_ROOTFS}/data/etc/hostname
ln -sf /data/etc/hostname ${IMAGE_ROOTFS}/etc/hostname

mv -f ${IMAGE_ROOTFS}/etc/hosts ${IMAGE_ROOTFS}/data/etc/hosts
ln -sf /data/etc/hosts ${IMAGE_ROOTFS}/etc/hosts

extra_files () {
# decided to do here instead of a bbappend of wpa:supplicant
install -d ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/
ln -sf ${libdir}/systemd/system/wpa_supplicant@.service ${IMAGE_ROOTFS}/${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service
}
Loading

0 comments on commit 8c978e0

Please sign in to comment.