Skip to content

Commit

Permalink
arm: Add cloud-config layout.env defaults
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
  • Loading branch information
mudler committed Jan 18, 2022
1 parent 29e149f commit 85c52db
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
34 changes: 34 additions & 0 deletions examples/odroid-c2/files/system/oem/01_layout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# The only difference with main cOS is that we don't require the OEM partition here
name: "Rootfs Layout Settings"
stages:
rootfs.before:
- name: "Pull data from provider"
datasource:
providers: ["cdrom"]
path: "/oem"
rootfs:
- if: '[ ! -f "/run/cos/recovery_mode" ]'
name: "Layout configuration"
environment_file: /run/cos/cos-layout.env
environment:
VOLUMES: "LABEL=COS_PERSISTENT:/usr/local"
OVERLAY: "tmpfs:25%"
- if: '[ -f "/run/cos/recovery_mode" ]'
# omit the persistent partition on recovery mode
name: "Layout configuration"
environment_file: /run/cos/cos-layout.env
environment:
VOLUMES: ""
OVERLAY: "tmpfs:25%"
initramfs:
- if: '[ ! -f "/run/cos/recovery_mode" ]'
name: "Persist /etc/machine-id"
commands:
- |
# persist machine-id
if [ -s /usr/local/etc/machine-id ]; then
cat /usr/local/etc/machine-id > /etc/machine-id
else
mkdir -p /usr/local/etc
cp /etc/machine-id /usr/local/etc
fi
34 changes: 34 additions & 0 deletions examples/rpi/files/system/oem/01_layout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# The only difference with main cOS is that we don't require the OEM partition here
name: "Rootfs Layout Settings"
stages:
rootfs.before:
- name: "Pull data from provider"
datasource:
providers: ["cdrom"]
path: "/oem"
rootfs:
- if: '[ ! -f "/run/cos/recovery_mode" ]'
name: "Layout configuration"
environment_file: /run/cos/cos-layout.env
environment:
VOLUMES: "LABEL=COS_PERSISTENT:/usr/local"
OVERLAY: "tmpfs:25%"
- if: '[ -f "/run/cos/recovery_mode" ]'
# omit the persistent partition on recovery mode
name: "Layout configuration"
environment_file: /run/cos/cos-layout.env
environment:
VOLUMES: ""
OVERLAY: "tmpfs:25%"
initramfs:
- if: '[ ! -f "/run/cos/recovery_mode" ]'
name: "Persist /etc/machine-id"
commands:
- |
# persist machine-id
if [ -s /usr/local/etc/machine-id ]; then
cat /usr/local/etc/machine-id > /etc/machine-id
else
mkdir -p /usr/local/etc
cp /etc/machine-id /usr/local/etc
fi

0 comments on commit 85c52db

Please sign in to comment.