Initial draft for riscv64 (F41)

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2024-11-28 16:31:59 +02:00
parent d01a6e9612
commit de1a80f184
Signed by: davidlt
GPG Key ID: 7A5F42FAF91FACC3
11 changed files with 234 additions and 5 deletions

View File

@ -14,7 +14,8 @@
<timezone>UTC</timezone>
<release-version>41</release-version>
</preferences>
<include from="this://./repositories/core.xml"/>
<!-- <include from="this://./repositories/core.xml"/> -->
<include from="this://./repositories/core-riscv64.xml"/>
<include from="this://./components/boot.xml"/>
<include from="this://./components/desktops/common.xml"/>
<include from="this://./components/desktops/gnome.xml"/>
@ -47,6 +48,7 @@
<include from="this://./teams/sway.xml"/>
<include from="this://./teams/budgie.xml"/>
<include from="this://./teams/miraclewm.xml"/>
<include from="this://./teams/riscv.xml"/>
<packages type="bootstrap">
<package name="basesystem"/>
<package name="filesystem"/>

View File

@ -6,7 +6,7 @@
<requires profile="BootCore"/>
</profile>
</profiles>
<preferences profiles="BootDiskCore" arch="x86_64,aarch64">
<preferences profiles="BootDiskCore" arch="x86_64,aarch64,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"
@ -67,6 +67,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"/>
@ -75,6 +77,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"/>
@ -82,6 +85,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"/>
@ -91,6 +95,7 @@
<packages type="iso" patternType="plusRecommended" profiles="BootCore">
<package name="grub2-efi-aa64-cdboot" arch="aarch64"/>
<package name="grub2-efi-x64-cdboot" arch="x86_64"/>
<package name="grub2-efi-riscv64-cdboot" arch="riscv64"/>
</packages>
<packages type="image" patternType="plusRecommended" profiles="BootDiskCore">
<package name="arm-image-installer" arch="aarch64"/>
@ -102,5 +107,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>

View File

@ -22,6 +22,16 @@
<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" 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"

View File

@ -3,4 +3,10 @@
<!-- The password here does not matter, it will be erased in config.sh -->
<user name="root" groups="root" password="linux" home="/root" pwdformat="plain" />
</users>
<users profiles="RISCVServer">
<!-- The password here does not matter, it will be erased in config.sh -->
<user name="root" groups="root" password="linux" home="/root" pwdformat="plain" />
<user name="riscv" groups="wheel,mock" password="fedora_rocks!" home="/home/riscv" pwdformat="plain" />
</users>
</image>

View File

@ -302,4 +302,94 @@ EOF
/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
fi
# Find the architecture we are on
installarch=$(uname -m)
# Do custom Fedora/RISCV changes
if [[ $installarch == "riscv64" ]]; then
# Disable default branched fedora repos
# We only want to have Fedora/RISCV Koji repos
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/{fedora.repo,fedora-updates.repo,fedora-updates-testing.repo,fedora-cisco-openh264.repo}
# Create Fedora/RISCV repos
cat << EOF > /etc/yum.repos.d/fedora-riscv.repo
[fedora-riscv]
name=Fedora RISC-V
baseurl=http://fedora.riscv.rocks/repos-dist/f41-staging/latest/riscv64/
enabled=1
gpgcheck=0
[fedora-riscv-debuginfo]
name=Fedora RISC-V - Debug
baseurl=http://fedora.riscv.rocks/repos-dist/f41-staging/latest/riscv64/debug/
enabled=0
gpgcheck=0
[fedora-riscv-source]
name=Fedora RISC-V - Source
baseurl=http://fedora.riscv.rocks/repos-dist/f41-staging/latest/src/
enabled=0
gpgcheck=0
EOF
# Create Fedora/RISC-V Koji repo (pulling directly from Koji)
cat << EOF > /etc/yum.repos.d/fedora-riscv-koji.repo
[fedora-riscv-koji]
name=Fedora RISC-V Koji
baseurl=http://fedora.riscv.rocks/repos/f41-staging/latest/riscv64/
enabled=0
gpgcheck=0
EOF
# Disable tmpfs for /tmp
# Most boards don't have a lot of RAM.
systemctl mask tmp.mount
# We most likely don't have HW random number generator
systemctl enable haveged.service
# Update login message
cat << EOF | tee /etc/issue /etc/issue.net
Welcome to the Fedora/RISC-V disk image
https://fedoraproject.org/wiki/Architectures/RISC-V
Build date: $(date --utc)
\S
Kernel \r on an \m (\l)
User 'root' with password is 'linux'.
User 'riscv' with password 'fedora_rocks!' in 'wheel'
and 'mock' groups.
For updates and latest information read:
https://fedoraproject.org/wiki/Architectures/RISC-V
Fedora/RISC-V
-------------
Koji: http://fedora.riscv.rocks/koji/
SCM: http://fedora.riscv.rocks:3000/
Distribution rep.: http://fedora.riscv.rocks/repos-dist/
Koji internal rep.: http://fedora.riscv.rocks/repos/
EOF
# Setup toolbox container to use
cat << EOF | tee -a /etc/containers/toolbox.conf
image = "fedora.riscv.rocks:3000/davidlt/fedora-toolbox:41"
EOF
# Add insecure (HTTP) Fedora/RISCV registry (Gitea)
cat << EOF | tee -a /etc/containers/registries.conf
[[registry]]
location="fedora.riscv.rocks:3000"
insecure=true
EOF
# Add Fedora/RISCV registry for search
sed -i -r 's/(unqualified-search-registries = \[")/\1fedora.riscv.rocks:3000", "/' /etc/containers/registries.conf
fi
exit 0

View File

@ -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}
}
}

View File

@ -0,0 +1,11 @@
<image>
<repository type="rpm-md" alias="fedora" sourcetype="baseurl">
<source path="http://fedora.riscv.rocks/repos-dist/$releasever-staging/latest/$basearch" />
</repository>
<!-- For folks to enable for building images with content in Koji working repos -->
<!--
<repository type="rpm-md" alias="fedora-koji" sourcetype="baseurl">
<source path="http://fedora.riscv.rocks/repos/$releasever/latest/$basearch"/>
</repository>
-->
</image>

View File

@ -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"

View File

@ -242,7 +242,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"/>

62
teams/riscv.xml Normal file
View File

@ -0,0 +1,62 @@
<image>
<profiles>
<profile name="RISCVServer" description="RISC-V Server Disk Image">
<requires profile="BootCore"/>
</profile>
</profiles>
<preferences profiles="RISCVServer">
<type image="oem"
filesystem="btrfs" btrfs_root_is_subvolume="true" btrfs_set_default_volume="false" fsmountoptions="x-systemd.growfs,compress=zstd:1"
kernelcmdline="earlycon"
devicepersistency="by-uuid"
bootpartition="true" bootpartsize="1000" bootfilesystem="ext4" efipartsize="500" firmware="uefi"
rootfs_label="fedora"
>
<bootloader name="grub2" console="serial" timeout="5" timeout_style="menu"/>
<size unit="G">5</size>
<systemdisk name="fedora">
<volume name="@root=root"/>
<volume name="home" parent="/"/>
<volume name="var" parent="/"/>
</systemdisk>
<oemconfig>
<oem-resize>false</oem-resize>
</oemconfig>
</type>
</preferences>
<packages type="bootstrap" patternType="plusRecommended" profiles="RISCVServer">
<package name="fedora-release-server"/>
</packages>
<packages type="image" patternType="plusRecommended" profiles="RISCVServer">
<namedCollection name="container-management"/>
<namedCollection name="server-product-environment"/>
<namedCollection name="core"/>
<namedCollection name="standard"/>
<namedCollection name="hardware-support"/>
<namedCollection name="networkmanager-submodules"/>
<package name="chrony"/>
<package name="lm_sensors"/>
<package name="mtd-utils"/>
<package name="bdsync"/>
<package name="htop"/>
<package name="mock"/>
<package name="toolbox"/>
<package name="cloud-utils-growpart"/>
<package name="zstd"/>
<package name="haveged"/>
<package name="pciutils"/>
<package name="nvme-cli"/>
<package name="efibootmgr"/>
<package name="kernel"/>
<package name="kernel-core"/>
<package name="kernel-modules"/>
<package name="kernel-modules-core"/>
<package name="kernel-modules-extra"/>
<package name="kernel-tools"/>
<package name="opensbi-unstable" arch="riscv64"/>
<package name="glibc-langpack-en"/>
<ignore name="dracut-config-rescue"/>
<package name="uboot-images-riscv64" arch="riscv64"/>
<package name="uboot-tools"/>
</packages>
</image>

View File

@ -5,6 +5,7 @@ echo "###" "$0" "$@"
case "$(uname -m)" in
aarch64) arch="aa64"; ARCH="AA64";;
x86_64) arch="x64"; ARCH="X64";;
riscv64) arch="riscv64"; ARCH="RISCV64";;
esac
# figure where shim.efi and BOOT.CSV are located