Skip to content

Commit

Permalink
🌱 Re-order packages layout (#417)
Browse files Browse the repository at this point in the history
* 🌱 Simplify framework images creation

No need to account anymore for different flavors of the toolkit

Signed-off-by: Ettore Di Giacinto <[email protected]>

* 🤖 No need to publish framework images anymore

Signed-off-by: Ettore Di Giacinto <[email protected]>

* ⬆️ Bump Kairos repositories

Signed-off-by: Ettore Di Giacinto <[email protected]>

Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Nov 14, 2022
1 parent 639fc75 commit 6572ad8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 86 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/image-framework.yaml

This file was deleted.

43 changes: 27 additions & 16 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,17 @@ framework:

ENV USER=root

IF [ "$FLAVOR" == "ubuntu-20-lts" ] || [ "$FLAVOR" == "ubuntu-22-lts" ]
ARG TOOLKIT_IMG="ubuntu"
ELSE IF [ "$FLAVOR" == "rockylinux" ]
ARG TOOLKIT_IMG="fedora"
ELSE IF [ "$FLAVOR" != "ubuntu" ] && [ "$FLAVOR" != "opensuse" ] && [ "$FLAVOR" != "fedora" ]
ARG TOOLKIT_IMG="opensuse"
ELSE
ARG TOOLKIT_IMG="$FLAVOR"
END

# Framework files
RUN luet install -y --system-target /framework \
system/elemental-toolkit-$TOOLKIT_IMG dracut/kcrypt system/kcrypt system/suc-upgrade
system/base-cloud-config dracut/immutable-rootfs dracut/kcrypt static/grub-config system/kcrypt system/suc-upgrade system/shim system/grub2-efi system/elemental-cli

IF [ "$FLAVOR" = "alpine" ] || [ "$FLAVOR" = "alpine-arm-rpi" ]
RUN luet install -y --system-target /framework \
init-svc/openrc
ELSE
RUN luet install -y --system-target /framework \
init-svc/systemd
END

# Keep openSUSE kernel on ARM
IF [ "$FLAVOR" = "opensuse-arm-rpi" ] || [ "$FLAVOR" = "alpine-arm-rpi" ]
Expand All @@ -184,11 +182,6 @@ framework:
distro-kernels/ubuntu distro-initrd/ubuntu
END

# Required for Secure boot
RUN luet install -y --system-target /framework system/shim system/grub2-efi
# Elemental CLI
RUN luet install -y --system-target /framework system/elemental-cli

COPY +luet/luet /framework/usr/bin/luet

RUN luet cleanup --system-target /framework
Expand Down Expand Up @@ -254,6 +247,24 @@ docker:

# Copy kairos binaries
COPY +build-kairos-agent/kairos-agent /usr/bin/kairos-agent

# Enable services
IF [ -f /sbin/openrc ]
RUN mkdir -p /etc/runlevels/default && \
ln -sf /etc/init.d/cos-setup-boot /etc/runlevels/default/cos-setup-boot && \
ln -sf /etc/init.d/cos-setup-network /etc/runlevels/default/cos-setup-network && \
ln -sf /etc/init.d/cos-setup-reconcile /etc/runlevels/default/cos-setup-reconcile && \
ln -sf /etc/init.d/kairos-agent /etc/runlevels/default/kairos-agent
# Otherwise we assume systemd
ELSE
RUN ls -liah /etc/systemd/system
RUN systemctl enable cos-setup-rootfs.service && \
systemctl enable cos-setup-initramfs.service && \
systemctl enable cos-setup-reconcile.timer && \
systemctl enable cos-setup-fs.service && \
systemctl enable cos-setup-boot.service && \
systemctl enable cos-setup-network.service
END

# Regenerate initrd if necessary
IF [ "$FLAVOR" = "opensuse" ] || [ "$FLAVOR" = "opensuse-arm-rpi" ] || [ "$FLAVOR" = "tumbleweed-arm-rpi" ]
Expand Down
8 changes: 1 addition & 7 deletions images/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ RUN apk --no-cache add \
open-vm-tools-vmbackup \
openntpd

RUN mkdir -p /etc/runlevels/default && \
ln -sf /etc/init.d/cos-setup-boot /etc/runlevels/default/cos-setup-boot && \
ln -sf /etc/init.d/cos-setup-network /etc/runlevels/default/cos-setup-network && \
ln -sf /etc/init.d/cos-setup-reconcile /etc/runlevels/default/cos-setup-reconcile && \
ln -sf /etc/init.d/crond /etc/runlevels/default/crond && \
ln -sf /etc/init.d/kairos-agent /etc/runlevels/default/kairos-agent

RUN rc-update add sshd boot && \
rc-update add connman boot && \
rc-update add acpid boot && \
Expand All @@ -111,6 +104,7 @@ RUN rc-update add sshd boot && \
rc-update add udev sysinit && \
rc-update add udev-trigger sysinit && \
rc-update add openntpd boot && \
rc-update add crond && \
rc-update add fail2ban

# Symlinks to make elemental installer work
Expand Down
8 changes: 0 additions & 8 deletions images/Dockerfile.alpine-arm-rpi
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ RUN apk --no-cache add \
open-vm-tools-vmbackup \
openntpd


RUN mkdir -p /etc/runlevels/default && \
ln -sf /etc/init.d/cos-setup-boot /etc/runlevels/default/cos-setup-boot && \
ln -sf /etc/init.d/cos-setup-network /etc/runlevels/default/cos-setup-network && \
ln -sf /etc/init.d/cos-setup-reconcile /etc/runlevels/default/cos-setup-reconcile && \
ln -sf /etc/init.d/kairos-agent /etc/runlevels/default/kairos-agent

RUN rc-update add sshd boot && \
rc-update add connman boot && \
rc-update add acpid boot && \
Expand All @@ -115,4 +108,3 @@ RUN rc-update add sshd boot && \
RUN ln -s /usr/sbin/grub-install /usr/sbin/grub2-install && \
ln -s /usr/bin/grub-editenv /usr/bin/grub2-editenv

# RUN ln -sf Image /boot/vmlinuz
4 changes: 2 additions & 2 deletions repositories/repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ repositories:
priority: 2
urls:
- "quay.io/kairos/packages"
reference: 20221114105054-repository.yaml
reference: 20221114135627-repository.yaml
- !!merge <<: *kairos
arch: arm64
urls:
- "quay.io/kairos/packages-arm64"
reference: 20221114105316-repository.yaml
reference: 20221114140603-repository.yaml

0 comments on commit 6572ad8

Please sign in to comment.