File project.diff of Package openSUSE-Aeon-UKI
--- config.sh.orig
+++ config.sh
@@ -234,3 +234,18 @@ mkdir -p /home/tik/.config/gtk-3.0
echo "file:///ignition" >> /home/tik/.config/gtk-3.0/bookmarks
sed -i 's/DISPLAYMANAGER_AUTOLOGIN=""/DISPLAYMANAGER_AUTOLOGIN="tik"/' /etc/sysconfig/displaymanager
+
+#======================================
+# Unified Kernel Image
+#--------------------------------------
+
+# Add zypper repo to uki packages
+zypper --gpg-auto-import-keys --non-interactive ar -f https://download.opensuse.org/repositories/home:/vlefebvre:/unified/devel_aeon/ unified
+
+#======================================
+# sdboot
+#--------------------------------------
+if rpm -q sdbootutil; then
+ # FIXME: kiwi needs /boot/efi to exist before syncing the disk image
+ mkdir -p /boot/efi
+fi
\ No newline at end of file
--- disk.sh.orig
+++ disk.sh
@@ -5,3 +5,61 @@ e2label /dev/loop0p3 ignition
# Create ignition directory
mkdir /ignition/ignition
chown -R tik:users /ignition
+
+# =============================================================================
+# Put typecode to 8304 needed by the discovery tool by systemd (gpt-auto-root)
+# =============================================================================
+root_dev=$(basename "$(findmnt / -n --output SOURCE | cut -d '[' -f1)")
+dev_path="/dev/${root_dev%*p?}"
+root_part=${root_dev: -1}
+echo "Change the partition n°${root_part} type of ${dev_path} in 8304"
+sgdisk -t "$root_part:8304" "$dev_path"
+# =============================================================================
+
+# =============================================================================
+# Install the UKI in the boot partition and add boot menu entry
+# =============================================================================
+chroot_uname=$(find /lib/modules/*/vmlinuz | head -n 1 \
+ | sed -e 's|/lib/modules/\(.*\)/vmlinuz|\1|g')
+efi_dir="/boot/efi/EFI/opensuse"
+kernel_module_dir="/usr/lib/modules/$chroot_uname"
+efi_file=$(basename "$kernel_module_dir"/uki-default-*.efi)
+if [ -e "$efi_file" ]; then
+ kernel_module_dir="/lib/modules/$chroot_uname"
+ efi_file=$(basename "$kernel_module_dir"/uki-default-*.efi)
+fi
+if [ -e "$efi_file" ]; then
+ echo "No efi file installed"
+ exit 1
+fi
+if [[ ! -d "$efi_dir" ]]; then
+ mkdir -p "$efi_dir"
+fi
+arch="$(uname -m)"
+case "$arch" in
+ aarch64) arch=aa64 ;;
+ x86_64) arch=x64 ;;
+ *) echo "Unknown arch $arch"; exit 1 ;;
+esac
+if [ $(command -v sdbootutil) ] \
+ && [ "$(sdbootutil --arch $arch bootloader)" == "systemd-boot" ]; then
+ # Cannot set default:
+ # bootctl want to set EFI variable where the chroot isn't boot in EFI, the
+ # command will fail.
+ uki-tool sdboot \
+ --add \
+ -k ${chroot_uname} \
+ --uki ${efi_file} \
+ --arch ${arch} \
+ --efi EFI/opensuse
+else
+ echo "#####DISK - grub2"
+ chmod -x /etc/grub.d/10_linux
+ uki-tool grub2 \
+ --add \
+ -k ${chroot_uname} \
+ --uki ${kernel_module_dir}/${efi_file} \
+ --efi EFI/opensuse \
+ --default
+fi
+# =============================================================================
--- openSUSE-Aeon.kiwi.orig
+++ openSUSE-Aeon.kiwi
@@ -1,21 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- OBS-ExclusiveArch: x86_64 aarch64 -->
-<image schemaversion="7.6" name="Aeon-Installer" displayname="Aeon Installer">
+<!-- OBS-Profiles: @BUILD_FLAVOR@ -->
+<image schemaversion="7.6" name="openSUSE-Aeon-UKI" displayname="openSUSE Aeon UKI">
<description type="system">
- <author>Richard Brown</author>
- <contact>rbrownsuse@opensuse.org</contact>
- <specification>Aeon Installer</specification>
+ <author>Valentin Lefebvre</author>
+ <contact>vlefebvre@opensuse.org</contact>
+ <specification>openSUSE Aeon UKI</specification>
</description>
+ <profiles>
+ <profile name="kvm-and-xen" description="UKI Image for KVM and Xen" arch="x86_64"/>
+ <profile name="kvm-and-xen-sdboot" description="UKI Image for KVM and Xen using sdboot" arch="x86_64"/>
+ </profiles>
<preferences>
<version>0.1.0</version>
<packagemanager>zypper</packagemanager>
<rpm-excludedocs>true</rpm-excludedocs>
<locale>en_US</locale>
+ <keytable>fr-azerty</keytable>
+ <timezone>Europe/Paris</timezone>
+ </preferences>
+ <preferences profiles="kvm-and-xen" arch="x86_64">
<type
image="oem"
filesystem="btrfs"
+ format="qcow2"
fsmountoptions="compress=zstd:1"
firmware="uefi"
+ initrd_system="none"
+ efipartsize="1000"
bootpartition="false"
bootkernel="custom"
devicepersistency="by-uuid"
@@ -24,16 +36,17 @@
btrfs_root_is_readonly_snapshot="true"
btrfs_quota_groups="true"
rootfs_label="TIKINSTALL"
+ editbootinstall="editbootinstall_mbr.sh"
>
- <bootloader name="grub2" console="gfxterm"/>
- <oemconfig>
+ <bootloader name="grub2" console="gfxterm"/>
+ <oemconfig>
<oem-resize>false</oem-resize>
</oemconfig>
<systemdisk>
<volume name="home"/>
<volume name="root"/>
<volume name="opt"/>
- <volume name="srv"/>
+ <volume name="srv"/>
<volume name="boot/grub2/i386-pc"/>
<volume name="boot/grub2/x86_64-efi" mountpoint="boot/grub2/x86_64-efi"/>
<volume name="boot/writable"/>
@@ -43,6 +56,46 @@
<partitions>
<partition name="ignition" size="1G" mountpoint="/ignition" filesystem="ext4"/>
</partitions>
+ <size unit="G">24</size>
+ </type>
+ </preferences>
+ <preferences profiles="kvm-and-xen-sdboot" arch="x86_64">
+ <type
+ image="oem"
+ filesystem="btrfs"
+ format="qcow2"
+ fsmountoptions="compress=zstd:1"
+ firmware="uefi"
+ initrd_system="none"
+ efipartsize="1000"
+ bootpartition="false"
+ bootkernel="custom"
+ devicepersistency="by-uuid"
+ btrfs_root_is_subvolume="true"
+ btrfs_root_is_snapshot="true"
+ btrfs_root_is_readonly_snapshot="true"
+ btrfs_quota_groups="true"
+ rootfs_label="TIKINSTALL"
+ editbootinstall="editbootinstall_mbr.sh"
+ >
+ <bootloader name="custom"/>
+ <oemconfig>
+ <oem-resize>false</oem-resize>
+ </oemconfig>
+ <systemdisk>
+ <volume name="home"/>
+ <volume name="root"/>
+ <volume name="opt"/>
+ <volume name="srv"/>
+ <volume name="boot/grub2/i386-pc"/>
+ <volume name="boot/grub2/x86_64-efi" mountpoint="boot/grub2/x86_64-efi"/>
+ <volume name="usr/local"/>
+ <volume name="var" copy_on_write="false"/>
+ </systemdisk>
+ <partitions>
+ <partition name="ignition" size="1G" mountpoint="/ignition" filesystem="ext4"/>
+ </partitions>
+ <size unit="G">24</size>
</type>
</preferences>
<repository type="rpm-md">
@@ -50,11 +103,28 @@
</repository>
<packages type="image">
<package name="live-add-yast-repos"/>
+ <!-- <package name="patterns-aeon-base"/> -->
<package name="patterns-tik-base"/>
<package name="tik-module-welcome"/>
<package name="tik-module-mig"/>
<package name="tik-module-encrypt"/>
<package name="tik-osimage-Aeon"/>
+ <package name="kernel-default"/>
+ <package name="uefi_mbr"/>
+ <package name="efibootmgr"/>
+ <!--UKI packages -->
+ <package name="uki-default"/>
+ </packages>
+ <packages type="image" profiles="kvm-and-xen">
+ <package name="grub2"/>
+ <package name="grub2-branding-openSUSE" bootinclude="true"/>
+ <package name="grub2-x86_64-efi"/>
+ <package name="grub2-snapper-plugin"/> <!-- snapper - grub2 - integration, "small" -->
+ </packages>
+ <packages type="image" profiles="kvm-and-xen-sdboot">
+ <package name="systemd-boot"/>
+ <package name="sdbootutil-snapper"/>
+ <package name="sdbootutil"/>
</packages>
<packages type="bootstrap">
<!-- Avoid that zypper picks the busybox-foo variant for those, that would fail later -->