Compare commits

...

4 Commits

Author SHA1 Message Date
a1246aa1b1 Add kernel-tools 2024-09-03 07:30:58 -04:00
7fcf4d4eb1 Add custom disk image
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-08-26 04:19:46 -04:00
3c48251da1 Cloud-Base-Generic: shim + grub2 for riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-08-23 07:06:41 -04:00
1ba1bf7c41 Initial riscv64 Kiwi hacks
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-05-03 01:17:43 -04:00
9 changed files with 183 additions and 19 deletions

View File

@ -9,6 +9,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"/>
@ -16,6 +18,7 @@
<package name="grub2-ppc64le" arch="ppc64le"/>
<package name="s390utils-base" arch="s390x"/>
<package name="shim-signed-aa64" arch="aarch64"/>
<package name="shim-unsigned-riscv64" arch="riscv64"/>
<package name="shim-signed-x64" arch="x86_64"/>
<package name="kernel-core"/>
<package name="systemd-oomd-defaults"/>

View File

@ -1,6 +1,7 @@
<image>
<users profiles="Cloud-Azure,Cloud-AmazonEC2,Cloud-GCE,Cloud-OpenStack,LiveInstall">
<users profiles="Cloud-Azure,Cloud-AmazonEC2,Cloud-GCE,Cloud-OpenStack,LiveInstall,Server">
<!-- 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

@ -277,4 +277,99 @@ 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/f40-staging/latest/riscv64/
#baseurl=https://dl.fedoraproject.org/pub/alt/risc-v/repo/fedora/f40/latest/riscv64/
#baseurl=https://mirror.math.princeton.edu/pub/alt/risc-v/repo/fedora/f40/latest/riscv64/
enabled=1
gpgcheck=0
[fedora-riscv-debuginfo]
name=Fedora RISC-V - Debug
baseurl=http://fedora.riscv.rocks/repos-dist/f40-staging/latest/riscv64/debug/
#baseurl=https://dl.fedoraproject.org/pub/alt/risc-v/repo/fedora/f40/latest/riscv64/debug/
#baseurl=https://mirror.math.princeton.edu/pub/alt/risc-v/repo/fedora/f40/latest/riscv64/debug/
enabled=0
gpgcheck=0
[fedora-riscv-source]
name=Fedora RISC-V - Source
baseurl=http://fedora.riscv.rocks/repos-dist/f40-staging/latest/src/
#baseurl=https://dl.fedoraproject.org/pub/alt/risc-v/repo/fedora/f40/latest/src/
#baseurl=https://mirror.math.princeton.edu/pub/alt/risc-v/repo/fedora/f40/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/f40-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:40"
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

@ -35,6 +35,7 @@
<include from="this://./teams/cloud/container.xml"/>
<include from="this://./teams/cloud/vagrant.xml"/>
<include from="this://./teams/workstation.xml"/>
<include from="this://./teams/server.xml"/>
<include from="this://./teams/kde.xml"/>
<include from="this://./teams/xfce.xml"/>
<include from="this://./teams/cinnamon.xml"/>

View File

@ -1,7 +1,6 @@
<image>
<repository type="rpm-md" alias="rawhide" sourcetype="metalink">
<source path="https://mirrors.fedoraproject.org/metalink?repo=rawhide&amp;arch=$basearch">
<signing key="file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-rawhide-primary"/>
<repository type="rpm-md" alias="rawhide" sourcetype="baseurl">
<source path="http://fedora.riscv.rocks/repos-dist/f40-staging/latest/riscv64">
</source>
</repository>
</image>

View File

@ -89,10 +89,10 @@
</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"
kernelcmdline="no_timer_check console=ttyS0,115200n8 earlycon=sbi"
devicepersistency="by-uuid"
bootpartition="true" bootpartsize="1000" bootfilesystem="ext4" efipartsize="100" firmware="uefi"
rootfs_label="fedora"
@ -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

@ -14,7 +14,7 @@
<type image="oci">
<containerconfig
name="fedora"
tag="rawhide"
tag="40"
maintainer="Fedora Project Contributors &lt;devel@lists.fedoraproject.org&gt;"
>
<subcommand execute="/bin/bash"/>
@ -23,12 +23,12 @@
<label name="org.opencontainers.image.url" value="https://fedoraproject.org/"/>
<label name="org.opencontainers.image.license" value="MIT"/>
<label name="org.opencontainers.image.name" value="fedora"/>
<label name="org.opencontainers.image.version" value="rawhide"/>
<label name="org.opencontainers.image.version" value="40"/>
<!-- Legacy attributes for backward compatibility -->
<label name="vendor" value="Fedora Project"/>
<label name="license" value="MIT"/>
<label name="name" value="fedora"/>
<label name="version" value="rawhide"/>
<label name="version" value="40"/>
</labels>
</containerconfig>
</type>
@ -41,7 +41,7 @@
<type image="oci">
<containerconfig
name="fedora-minimal"
tag="rawhide"
tag="40"
maintainer="Fedora Project Contributors &lt;devel@lists.fedoraproject.org&gt;"
>
<subcommand execute="/bin/bash"/>
@ -50,12 +50,12 @@
<label name="org.opencontainers.image.url" value="https://fedoraproject.org/"/>
<label name="org.opencontainers.image.license" value="MIT"/>
<label name="org.opencontainers.image.name" value="fedora-minimal"/>
<label name="org.opencontainers.image.version" value="rawhide"/>
<label name="org.opencontainers.image.version" value="40"/>
<!-- Legacy attributes for backward compatibility -->
<label name="vendor" value="Fedora Project"/>
<label name="license" value="MIT"/>
<label name="name" value="fedora-minimal"/>
<label name="version" value="rawhide"/>
<label name="version" value="40"/>
</labels>
</containerconfig>
</type>
@ -68,7 +68,7 @@
<type image="oci">
<containerconfig
name="fedora-toolbox"
tag="rawhide"
tag="40"
maintainer="Fedora Project Contributors &lt;devel@lists.fedoraproject.org&gt;"
>
<subcommand execute="/bin/bash"/>
@ -77,13 +77,13 @@
<label name="org.opencontainers.image.url" value="https://fedoraproject.org/"/>
<label name="org.opencontainers.image.license" value="MIT"/>
<label name="org.opencontainers.image.name" value="fedora-toolbox"/>
<label name="org.opencontainers.image.version" value="rawhide"/>
<label name="org.opencontainers.image.version" value="40"/>
<label name="com.github.containers.toolbox" value="true"/>
<!-- Legacy attributes for backward compatibility -->
<label name="vendor" value="Fedora Project"/>
<label name="license" value="MIT"/>
<label name="name" value="fedora-toolbox"/>
<label name="version" value="rawhide"/>
<label name="version" value="40"/>
</labels>
</containerconfig>
</type>
@ -198,7 +198,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/server.xml Normal file
View File

@ -0,0 +1,62 @@
<image>
<profiles>
<profile name="Server" description="Server Disk Image">
<requires profile="BootCore"/>
</profile>
</profiles>
<preferences profiles="Server">
<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="Server">
<package name="fedora-release-server"/>
</packages>
<packages type="image" patternType="plusRecommended" profiles="Server">
<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,11 +5,14 @@ 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
shim="$(ls boot/efi/EFI/*/shim${arch}.efi)"
csv="${shim%/*}/BOOT${ARCH}.CSV"
# We don't have shim on riscv64
#shim="$(ls boot/efi/EFI/*/shim${arch}.efi)"
#csv="${shim%/*}/BOOT${ARCH}.CSV"
csv="boot/efi/EFI/fedora/BOOT.CSV"
# copy UKI images (typically one) to ${ESP}/EFI/Linux and
# generate BOOT.CSV with one entry per UKI.