aboutsummaryrefslogtreecommitdiff
diff options
from:
to:
context:
space:
mode:
authorGravatar David Abdurachmanov <davidlt@rivosinc.com> 2024-11-28 16:31:59 +0200
committerGravatar Andrea Bolognani <abologna@redhat.com> 2025-02-07 15:06:22 +0100
commitb5d377d912dd9cfd48b89e3084d6dd49ed9bbcad (patch)
treee02651fd0c494d6afdf7d9f21363fe5e27285794
parent4b4a83b33f8eff8f7f13f35b61b4f5464ea4444a (diff)
downloadkiwi-descriptions-b5d377d912dd9cfd48b89e3084d6dd49ed9bbcad.tar.gz
kiwi-descriptions-b5d377d912dd9cfd48b89e3084d6dd49ed9bbcad.zip
Initial riscv64 support
Most of the changes are self-explanatory and just follow what's already happening for existing architectures. Two things are worth pointing out: * we need to use shim-unsigned instead of shim-signed because riscv64 is not fully integrated into Fedora yet and so we can't do Secure Boot signing for the time being; * we use ext4 as bootfilesystem since in most cases the underlying firmware is going to be U-Boot, which needs to be able to load the board's DTB from /boot and doesn't support XFS. Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
-rw-r--r--components/boot.xml8
-rw-r--r--components/liveinstall.xml9
-rw-r--r--grub-riscv64.cfg.iso-template41
-rw-r--r--teams/cloud/cloud.xml4
-rw-r--r--teams/cloud/container.xml2
-rw-r--r--teams/server.xml36
-rwxr-xr-xuki-editbootconfig.sh5
7 files changed, 99 insertions, 6 deletions
diff --git a/components/boot.xml b/components/boot.xml
index ee27d4f..d801c01 100644
--- a/components/boot.xml
+++ b/components/boot.xml
@@ -7,7 +7,7 @@
<requires profile="BootCore"/>
</profile>
</profiles>
- <preferences profiles="BootDiskCore" arch="x86_64">
+ <preferences profiles="BootDiskCore" arch="x86_64,riscv64">
<type image="oem"
filesystem="btrfs" btrfs_root_is_subvolume="true" btrfs_set_default_volume="false" fsmountoptions="x-systemd.growfs,compress=zstd:1"
kernelcmdline="rhgb quiet" devicepersistency="by-uuid"
@@ -86,6 +86,8 @@
<packages type="image" patternType="plusRecommended" profiles="BootCore">
<package name="grub2-efi-aa64" arch="aarch64"/>
<package name="grub2-efi-aa64-modules" arch="aarch64"/>
+ <package name="grub2-efi-riscv64" arch="riscv64"/>
+ <package name="grub2-efi-riscv64-modules" arch="riscv64"/>
<package name="grub2-efi-x64" arch="x86_64"/>
<package name="grub2-efi-x64-modules" arch="x86_64"/>
<package name="grub2-pc" arch="x86_64"/>
@@ -94,6 +96,7 @@
<package name="s390utils-base" arch="s390x"/>
<package name="shim-signed-aa64" arch="aarch64"/>
<package name="shim-signed-x64" arch="x86_64"/>
+ <package name="shim-unsigned-riscv64" arch="riscv64"/>
<package name="kernel-core"/>
<package name="systemd-oomd-defaults"/>
<package name="systemd-resolved"/>
@@ -101,6 +104,7 @@
<packages type="image" patternType="plusRecommended" profiles="BootCoreUKI">
<package name="shim-signed-aa64" arch="aarch64"/>
<package name="shim-signed-x64" arch="x86_64"/>
+ <package name="shim-unsigned-riscv64" arch="riscv64"/>
<package name="systemd-oomd-defaults"/>
<package name="systemd-resolved"/>
<package name="kernel-uki-virt"/>
@@ -109,6 +113,7 @@
</packages>
<packages type="iso" patternType="plusRecommended" profiles="BootCore">
<package name="grub2-efi-aa64-cdboot" arch="aarch64"/>
+ <package name="grub2-efi-riscv64-cdboot" arch="riscv64"/>
<package name="grub2-efi-x64-cdboot" arch="x86_64"/>
</packages>
<packages type="image" patternType="plusRecommended" profiles="BootDiskCore">
@@ -121,5 +126,6 @@
<package name="btrfs-progs"/>
<package name="udisks2-btrfs"/>
<package name="uboot-images-armv8" arch="aarch64"/>
+ <package name="uboot-images-riscv64" arch="riscv64"/>
</packages>
</image>
diff --git a/components/liveinstall.xml b/components/liveinstall.xml
index 814dd76..ea6029a 100644
--- a/components/liveinstall.xml
+++ b/components/liveinstall.xml
@@ -23,6 +23,15 @@
<bootloader name="grub2" grub_template="grub-arm.cfg.iso-template" console="console" timeout="10"/>
</type>
</preferences>
+ <preferences profiles="LiveInstall" arch="riscv64">
+ <type image="iso"
+ publisher="Fedora Project" volid="Fedora_Linux" application_id="Fedora_Linux"
+ primary="true" flags="dmsquash" filesystem="squashfs" squashfscompression="xz" mediacheck="true"
+ firmware="uefi" efiparttable="gpt" efifatimagesize="30" kernelcmdline="quiet rhgb"
+ >
+ <bootloader name="grub2" grub_template="grub-riscv64.cfg.iso-template" console="console" timeout="10"/>
+ </type>
+ </preferences>
<preferences profiles="LiveInstall" arch="ppc64le">
<type image="iso"
publisher="Fedora Project" volid="Fedora_Linux" application_id="Fedora_Linux"
diff --git a/grub-riscv64.cfg.iso-template b/grub-riscv64.cfg.iso-template
new file mode 100644
index 0000000..037ae79
--- /dev/null
+++ b/grub-riscv64.cfg.iso-template
@@ -0,0 +1,41 @@
+# Inspired by the config used for lorax-built live media
+
+set default="1"
+
+function load_video {
+ insmod efi_gop
+ insmod efi_uga
+ insmod video_bochs
+ insmod video_cirrus
+ insmod all_video
+}
+set basicgfx="nomodeset"
+
+load_video
+set gfxpayload=keep
+insmod gzio
+insmod part_gpt
+insmod ext2
+
+terminal_input console
+terminal_output ${terminal_output}
+
+set timeout=${boot_timeout}
+set timeout_style=${boot_timeout_style}
+
+search ${search_params}
+
+menuentry "Start ${title}" --class fedora --class gnu-linux --class gnu --class os {
+ linux ($$root)${bootpath}/${kernel_file} ${boot_options}
+ initrd ($$root)${bootpath}/${initrd_file}
+}
+menuentry "Test this media & start ${title}" --class fedora --class gnu-linux --class gnu --class os {
+ linux ($$root)${bootpath}/${kernel_file} ${boot_options} rd.live.check
+ initrd ($$root)${bootpath}/${initrd_file}
+}
+submenu "Troubleshooting -->" {
+ menuentry "Start ${title} in basic graphics mode" --class fedora --class gnu-linux --class gnu --class os {
+ linux ($$root)${bootpath}/${kernel_file} ${boot_options} $${basicgfx}
+ initrd ($$root)${bootpath}/${initrd_file}
+ }
+}
diff --git a/teams/cloud/cloud.xml b/teams/cloud/cloud.xml
index b38b508..b6874c4 100644
--- a/teams/cloud/cloud.xml
+++ b/teams/cloud/cloud.xml
@@ -89,7 +89,7 @@
</oemconfig>
</type>
</preferences>
- <preferences profiles="Cloud-Base-Generic" arch="x86_64,aarch64">
+ <preferences profiles="Cloud-Base-Generic" arch="x86_64,aarch64,riscv64">
<type image="oem" format="qcow2"
filesystem="btrfs" btrfs_root_is_subvolume="true" btrfs_set_default_volume="false" fsmountoptions="compress=zstd:1"
kernelcmdline="no_timer_check console=tty1 console=ttyS0,115200n8 systemd.firstboot=off"
@@ -149,7 +149,7 @@
</oemconfig>
</type>
</preferences>
- <preferences profiles="Cloud-Base-UEFI-UKI" arch="x86_64,aarch64">
+ <preferences profiles="Cloud-Base-UEFI-UKI" arch="x86_64,aarch64,riscv64">
<type image="oem" format="qcow2"
firmware="uefi" efipartsize="1000"
bootpartition="false"
diff --git a/teams/cloud/container.xml b/teams/cloud/container.xml
index 420918a..733fc87 100644
--- a/teams/cloud/container.xml
+++ b/teams/cloud/container.xml
@@ -246,7 +246,7 @@
<package name="man-db"/>
<package name="man-pages"/>
<package name="mesa-dri-drivers"/>
- <package name="mesa-va-drivers" arch="aarch64,ppc64le,x86_64"/> <!-- doesn't exist in s390x -->
+ <package name="mesa-va-drivers" arch="aarch64,ppc64le,x86_64,riscv64"/> <!-- doesn't exist in s390x -->
<package name="mesa-vulkan-drivers"/>
<package name="mtr"/>
<package name="nss-mdns"/>
diff --git a/teams/server.xml b/teams/server.xml
index fbcf610..02f3915 100644
--- a/teams/server.xml
+++ b/teams/server.xml
@@ -71,6 +71,24 @@
</oemconfig>
</type>
</preferences>
+ <preferences profiles="ServerVMDisk" arch="riscv64">
+ <type image="oem" format="qcow2"
+ filesystem="xfs"
+ kernelcmdline="earlycon console=ttyS0,115200n8"
+ devicepersistency="by-uuid"
+ bootpartition="true" bootpartsize="1000" bootfilesystem="ext4" efipartsize="100" firmware="uefi"
+ rootfs_label="fedora"
+ >
+ <bootloader name="grub2" console="serial" timeout="0"/>
+ <size unit="G">10</size>
+ <systemdisk>
+ <volume name="@root"/>
+ </systemdisk>
+ <oemconfig>
+ <oem-resize>false</oem-resize>
+ </oemconfig>
+ </type>
+ </preferences>
<preferences profiles="ServerDisk" arch="x86_64">
<type image="oem"
filesystem="xfs"
@@ -139,6 +157,24 @@
</oemconfig>
</type>
</preferences>
+ <preferences profiles="ServerDisk" arch="riscv64">
+ <type image="oem"
+ filesystem="xfs"
+ kernelcmdline="earlycon console=ttyS0,115200n8"
+ devicepersistency="by-uuid"
+ bootpartition="true" bootpartsize="1000" bootfilesystem="ext4" efipartsize="100" firmware="uefi"
+ rootfs_label="fedora"
+ >
+ <bootloader name="grub2" console="serial" timeout="3" timeout_style="menu"/>
+ <size unit="G">10</size>
+ <systemdisk>
+ <volume name="@root"/>
+ </systemdisk>
+ <oemconfig>
+ <oem-resize>false</oem-resize>
+ </oemconfig>
+ </type>
+ </preferences>
<packages type="bootstrap" patternType="plusRecommended" profiles="ServerCore">
<package name="fedora-release-server"/>
</packages>
diff --git a/uki-editbootconfig.sh b/uki-editbootconfig.sh
index 32cb463..a2e2bcc 100755
--- a/uki-editbootconfig.sh
+++ b/uki-editbootconfig.sh
@@ -3,8 +3,9 @@ echo "###" "$0" "$@"
# set arch-specific variables
case "$(uname -m)" in
- aarch64) arch="aa64"; ARCH="AA64";;
- x86_64) arch="x64"; ARCH="X64";;
+ aarch64) arch="aa64"; ARCH="AA64";;
+ riscv64) arch="riscv64"; ARCH="RISCV64";;
+ x86_64) arch="x64"; ARCH="X64";;
esac
# figure where shim.efi and BOOT.CSV are located