Skip to content

Commit

Permalink
Fix rootfs layout (#76)
Browse files Browse the repository at this point in the history
* Use yaml elemental layout

Signed-off-by: Andrea Mazzotti <[email protected]>

* Fix uninitialized /usr/libexec

Signed-off-by: Andrea Mazzotti <[email protected]>

---------

Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti authored Jun 28, 2024
1 parent 959d5c0 commit 8c559a7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 25 deletions.
3 changes: 3 additions & 0 deletions Dockerfile.kubeadm.os
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ RUN zypper clean --all && \
>/var/log/lastlog && \
rm -rf /boot/vmlinux*

# Required by k3s/rke2
RUN mkdir -p /usr/libexec && touch /usr/libexec/.keep

# Generate initrd with required elemental services
# Features currently excluded: [cloud-config-defaults]
RUN elemental init --debug --force boot-assessment,cloud-config-essentials,dracut-config,elemental-rootfs,elemental-setup,elemental-sysroot,grub-config,grub-default-bootargs
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.os
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ RUN zypper clean --all && \
# Enable /tmp to be on tmpfs
RUN cp /usr/share/systemd/tmp.mount /etc/systemd/system

# Required by k3s/rke2
RUN mkdir -p /usr/libexec && touch /usr/libexec/.keep

# Generate initrd with required elemental services
# Features currently excluded: [cloud-config-defaults]
RUN elemental init --debug --force boot-assessment,cloud-config-essentials,dracut-config,elemental-rootfs,elemental-setup,elemental-sysroot,grub-config,grub-default-bootargs
Expand Down
60 changes: 35 additions & 25 deletions framework/files/system/oem/01_elemental-rootfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,40 @@ stages:
rootfs:
- if: '[ ! -f "/run/elemental/recovery_mode" ]'
name: "Layout configuration"
environment_file: /run/elemental/mount-layout.env
environment:
OVERLAY: "tmpfs:25%"
RW_PATHS: "/var /etc /srv"
PERSISTENT_STATE_PATHS: >-
/etc/systemd
/etc/kubernetes
/etc/rancher
/etc/ssh
/etc/iscsi
/etc/cni
/etc/conntrackd
/etc/containerd
/home
/opt
/root
/usr/libexec
/usr/local
/var/log
/var/lib
PERSISTENT_STATE_BIND: "true"
files:
- path: /run/elemental/config.d/layout.yaml
content: |
mount:
write-fstab: true
ephemeral:
type: tmpfs
size: 25%
paths: ['/etc', '/var', '/srv']
persistent:
mode: bind
paths:
- /etc/systemd
- /etc/kubernetes
- /etc/rancher
- /etc/ssh
- /etc/iscsi
- /etc/cni
- /etc/conntrackd
- /etc/containerd
- /home
- /opt
- /root
- /usr/libexec
- /usr/local
- /var/log
- /var/lib
- if: '[ -f "/run/elemental/recovery_mode" ]'
# omit the persistent partition on recovery mode
name: "Layout configuration for recovery"
environment_file: /run/elemental/mount-layout.env
environment:
OVERLAY: "tmpfs:25%"
files:
- path: /run/elemental/config.d/layout.yaml
content: |
mount:
write-fstab: true
ephemeral:
type: tmpfs
size: 25%

0 comments on commit 8c559a7

Please sign in to comment.