-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm: create COS_PERSISTENT instead of COS_OEM (#1023)
* arm: create COS_PERSISTENT instead of COS_OEM Add a cloud-init also to automatically expand the COS_PERSISTENT partition on first boot Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com> * ci [dropme] trigger image creation Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com> * Add rd.cos.oemlabel=COS_OEM to arm images bootargs Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com> * arm: Add cloud-config layout.env defaults Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
- Loading branch information
Showing
8 changed files
with
93 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
- arm_adaptations | ||
tags: | ||
- '*' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
set kernel=/boot/vmlinuz | ||
if [ -n "$recoverylabel" ]; then | ||
set kernelcmd="console=tty1 console=ttyS0 root=live:LABEL=$recoverylabel rd.live.dir=/ rd.live.squashimg=$img panic=5" | ||
set kernelcmd="console=tty1 console=ttyS0 root=live:LABEL=$recoverylabel rd.live.dir=/ rd.live.squashimg=$img panic=5 rd.cos.oemtimeout=10" | ||
else | ||
set kernelcmd="console=tty1 console=ttyS0 root=LABEL=$label cos-img/filename=$img panic=5 security=selinux selinux=1" | ||
set kernelcmd="console=tty1 console=ttyS0 root=LABEL=$label cos-img/filename=$img panic=5 security=selinux selinux=1 rd.cos.oemtimeout=10 rd.cos.oemlabel=COS_OEM" | ||
fi | ||
|
||
set initramfs=/boot/initrd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: "Expand COS_PERSISTENT" | ||
stages: | ||
rootfs: | ||
- name: "Expand persistent partition" | ||
layout: | ||
device: | ||
label: "COS_PERSISTENT" | ||
expand_partition: | ||
size: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
name: "Immutable Layout" | ||
# 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: | ||
# As the image creation script doesn't set up any COS_PERSISTENT partition | ||
# or we either partition one on boot, or the user has to provide it. | ||
# With this setting we don't require COS_PERSISTENT to be mounted, | ||
# that means that the system will boot only in ephemeral mode with no persistency except | ||
# OEM files. | ||
# To override this behavior, simply overwrite this file OR specify | ||
# a cloud init which is executed after this one in the /oem partition (e.g. 02_custom_layout.yaml ). | ||
- if: '[ ! -f "/run/cos/recovery_mode" ]' | ||
name: "Don't require COS_PERSISTENT" | ||
name: "Layout configuration" | ||
environment_file: /run/cos/cos-layout.env | ||
environment: | ||
VOLUMES: "LABEL=COS_OEM:/oem" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: "Expand COS_PERSISTENT" | ||
stages: | ||
rootfs: | ||
- name: "Expand persistent partition" | ||
layout: | ||
device: | ||
label: "COS_PERSISTENT" | ||
expand_partition: | ||
size: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
name: "Immutable Layout" | ||
# 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: | ||
# As the image creation script doesn't set up any COS_PERSISTENT partition | ||
# or we either partition one on boot, or the user has to provide it. | ||
# With this setting we don't require COS_PERSISTENT to be mounted, | ||
# that means that the system will boot only in ephemeral mode with no persistency except | ||
# OEM files. | ||
# To override this behavior, simply overwrite this file OR specify | ||
# a cloud init which is executed after this one in the /oem partition (e.g. 02_custom_layout.yaml ). | ||
- if: '[ ! -f "/run/cos/recovery_mode" ]' | ||
name: "Don't require COS_PERSISTENT" | ||
name: "Layout configuration" | ||
environment_file: /run/cos/cos-layout.env | ||
environment: | ||
VOLUMES: "LABEL=COS_OEM:/oem" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters