Compare commits

..

1 Commits

Author SHA1 Message Date
Mauro Morales
6e7bcc882b works 2024-02-09 17:44:57 +01:00
8 changed files with 58 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
# https://quay.io/repository/kairos/packages?tab=tags&tag=latest # https://quay.io/repository/kairos/packages?tab=tags&tag=latest
ARG LEAP_VERSION=15.5 ARG LEAP_VERSION=15.5
ARG LUET_VERSION=0.35.0 ARG LUET_VERSION=0.35.0
ARG ENKI_VERSION=v0.0.17 ARG ENKI_VERSION=v0.0.16
FROM quay.io/luet/base:$LUET_VERSION AS luet FROM quay.io/luet/base:$LUET_VERSION AS luet
FROM quay.io/kairos/enki:${ENKI_VERSION} as enki FROM quay.io/kairos/enki:${ENKI_VERSION} as enki
@@ -9,10 +9,9 @@ FROM quay.io/kairos/enki:${ENKI_VERSION} as enki
FROM opensuse/leap:$LEAP_VERSION as default FROM opensuse/leap:$LEAP_VERSION as default
RUN zypper ref && zypper dup -y RUN zypper ref && zypper dup -y
## ISO+ Arm image + Netboot + cloud images Build depedencies ## ISO+ Arm image + Netboot + cloud images Build depedencies
RUN zypper ref && zypper in -y bc qemu-tools jq cdrtools docker git curl gptfdisk kpartx sudo xfsprogs parted \ RUN zypper ref && zypper in -y bc qemu-tools jq cdrtools docker git curl gptfdisk kpartx sudo xfsprogs parted util-linux-systemd e2fsprogs curl util-linux udev rsync grub2 dosfstools grub2-x86_64-efi squashfs mtools xorriso lvm2 zstd
util-linux-systemd e2fsprogs curl util-linux udev rsync grub2 dosfstools grub2-x86_64-efi squashfs mtools xorriso lvm2 zstd
RUN zypper in -y python311-pip python311-cryptography sbsigntools tpm2-* # ukify deps
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 # make python3.11 the default python3 for ukify
COPY --from=luet /usr/bin/luet /usr/bin/luet COPY --from=luet /usr/bin/luet /usr/bin/luet
ENV LUET_NOLOCK=true ENV LUET_NOLOCK=true
ENV TMPDIR=/tmp ENV TMPDIR=/tmp
@@ -24,21 +23,20 @@ COPY luet-amd64.yaml /tmp/luet-amd64.yaml
RUN mkdir -p /etc/luet/ RUN mkdir -p /etc/luet/
RUN cp /tmp/luet-${TARGETARCH}.yaml /etc/luet/luet.yaml RUN cp /tmp/luet-${TARGETARCH}.yaml /etc/luet/luet.yaml
## Uki artifacts, will be set under the /usr/kairos directory
## We can install both arches, as the artifacts are named differently
RUN luet install --config /tmp/luet-amd64.yaml -y system/systemd-boot
RUN luet install --config /tmp/luet-arm64.yaml -y system/systemd-boot
# ukify + measure
RUN luet install -y system/systemd-ukify
# ukify deps that are not in the suse repos as packages. ukify package provides this so we have the exact versions needed
RUN pip3 install -r /usr/kairos/ukify-requirements.txt
## Live CD artifacts ## Live CD artifacts
RUN luet install -y livecd/grub2 --system-target /grub2 RUN luet install -y livecd/grub2 --system-target /grub2
RUN luet install -y livecd/grub2-efi-image --system-target /efi RUN luet install -y livecd/grub2-efi-image --system-target /efi
## RPI64 ## RPI64
RUN luet install -y firmware/u-boot-rpi64 firmware/raspberrypi-firmware firmware/raspberrypi-firmware-config firmware/raspberrypi-firmware-dt --system-target /rpi/ RUN luet install -y firmware/raspberrypi-firmware firmware/raspberrypi-firmware-config firmware/raspberrypi-firmware-dt --system-target /rpi/
COPY luet-arm64-old.yaml /tmp/luet-arm64.yaml
COPY luet-amd64-old.yaml /tmp/luet-amd64.yaml
RUN cp /tmp/luet-${TARGETARCH}.yaml /etc/luet/luet.yaml
RUN luet install -y firmware/u-boot-rpi64 --system-target /rpi/
COPY luet-arm64.yaml /tmp/luet-arm64.yaml
COPY luet-amd64.yaml /tmp/luet-amd64.yaml
## PineBook64 Pro ## PineBook64 Pro
RUN luet install -y arm-vendor-blob/u-boot-rockchip --system-target /pinebookpro/u-boot RUN luet install -y arm-vendor-blob/u-boot-rockchip --system-target /pinebookpro/u-boot

View File

@@ -2,6 +2,8 @@
partprobe partprobe
kpartx -va $DRIVE
image=$1 image=$1
if [ -z "$image" ]; then if [ -z "$image" ]; then

View File

@@ -73,12 +73,8 @@ cleanup() {
fi fi
losetup -D "${LOOP}" || true; losetup -D "${LOOP}" || true;
losetup -D "${DRIVE}" || true; dmsetup remove KairosVG-oem || true;
dmsetup remove KairosVG-recovery || true;
if [ "$model" == "rpi3" ]; then
dmsetup remove KairosVG-oem || true;
dmsetup remove KairosVG-recovery || true;
fi
} }
ensure_dir_structure() { ensure_dir_structure() {
@@ -368,19 +364,14 @@ if [ "$model" == "rpi3" ]; then
sgdisk -m 1:2:3:4 ${output_image} sgdisk -m 1:2:3:4 ${output_image}
sfdisk --part-type ${output_image} 1 c sfdisk --part-type ${output_image} 1 c
elif [ "$model" == "rpi4" ]; then elif [ "$model" == "rpi4" ]; then
sgdisk -n 1:0:+96M -c 1:EFI -t 1:ef00 ${output_image} echo "label: gpt" | sfdisk "${output_image}"
partprobe sgdisk -n 1:8192:+96M -c 1:EFI -t 1:0c00 ${output_image}
sgdisk -n 2:0:+${state_size}M -c 2:state -t 2:8300 ${output_image} sgdisk -n 2:0:+${state_size}M -c 2:state -t 2:8300 ${output_image}
partprobe
sgdisk -n 3:0:+${recovery_size}M -c 3:recovery -t 3:8300 ${output_image} sgdisk -n 3:0:+${recovery_size}M -c 3:recovery -t 3:8300 ${output_image}
partprobe
sgdisk -n 4:0:+${oem_size}M -c 4:oem -t 4:8300 ${output_image} sgdisk -n 4:0:+${oem_size}M -c 4:oem -t 4:8300 ${output_image}
partprobe
sgdisk -n 5:0:+64M -c 5:persistent -t 5:8300 ${output_image} sgdisk -n 5:0:+64M -c 5:persistent -t 5:8300 ${output_image}
partprobe sgdisk -g ${output_image}
# Move backup header to end of disk sgdisk -m 1:2:3:4:5 ${output_image}
sgdisk -e ${output_image}
sgdisk -v ${output_image}
else else
sgdisk -n 1:8192:+16M -c 1:EFI -t 1:0700 ${output_image} sgdisk -n 1:8192:+16M -c 1:EFI -t 1:0700 ${output_image}
sgdisk -n 2:0:+${state_size}M -c 2:state -t 2:8300 ${output_image} sgdisk -n 2:0:+${state_size}M -c 2:state -t 2:8300 ${output_image}
@@ -432,12 +423,12 @@ fi
# Create partitions (RECOVERY, STATE, COS_PERSISTENT) # Create partitions (RECOVERY, STATE, COS_PERSISTENT)
mkfs.vfat -F 32 ${efi} mkfs.vfat -F 32 ${efi}
fatlabel ${efi} COS_GRUB fatlabel ${efi} COS_GRUB
mkfs.ext3 -F -L ${STATE_LABEL} $state mkfs.ext4 -F -L ${STATE_LABEL} $state
mkfs.ext3 -F -L ${PERSISTENT_LABEL} $persistent mkfs.ext4 -F -L ${PERSISTENT_LABEL} $persistent
if [ "$model" == 'rpi4' ]; then if [ "$model" == 'rpi4' ]; then
mkfs.ext3 -F -L ${RECOVERY_LABEL} $recovery mkfs.ext4 -F -L ${RECOVERY_LABEL} $recovery
mkfs.ext3 -F -L ${OEM_LABEL} $oem mkfs.ext4 -F -L ${OEM_LABEL} $oem
else else
pvcreate $recovery pvcreate $recovery
vgcreate KairosVG $recovery vgcreate KairosVG $recovery

View File

@@ -2,4 +2,4 @@
set -ex set -ex
enki --config-dir /config "$@" enki --config-dir /config $@

View File

@@ -0,0 +1,15 @@
general:
debug: false
spinner_charset: 9
logging:
enable_emoji: false
repositories:
- name: "kairos"
description: "kairos repository"
type: "docker"
cached: true
enable: true
priority: 2
urls:
- "quay.io/kairos/packages"
reference: 20240202131847-repository.yaml

View File

@@ -12,4 +12,4 @@ repositories:
priority: 2 priority: 2
urls: urls:
- "quay.io/kairos/packages" - "quay.io/kairos/packages"
reference: 20240219135130-repository.yaml reference: 20240207153537-repository.yaml

View File

@@ -0,0 +1,15 @@
general:
debug: false
spinner_charset: 9
logging:
enable_emoji: false
repositories:
- name: "kairos-arm64"
description: "kairos repository arm64"
type: "docker"
cached: true
enable: true
priority: 2
urls:
- "quay.io/kairos/packages-arm64"
reference: 20240202135656-repository.yaml

View File

@@ -12,4 +12,4 @@ repositories:
priority: 2 priority: 2
urls: urls:
- "quay.io/kairos/packages-arm64" - "quay.io/kairos/packages-arm64"
reference: 20240219145903-repository.yaml reference: 20240207154912-repository.yaml