diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 0000000000000000000000000000000000000000..2ef307818bc336bb7b147ae4e5af3b64ba16b4b3 --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,45 @@ +name: Example Build Workflow +on: + push: +jobs: + build: + name: Build NestOS image + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y podman xz-utils curl qemu-user-static + + - name: Build nosa image + run: ./bootstrap.sh -r podman -a riscv64 + + - name: Use nosa to build NestOS image + run: | + cat << EOF > nosa + #!/bin/bash + podman run --rm -it --security-opt label=disable --privileged --user=root \ + -v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse --network=host \ + --tmpfs /tmp -v /var/tmp:/var/tmp -v /etc/pki/ca-trust/:/etc/pki/ca-trust/:ro \ + ${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:Z,ro} \ + ${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:Z,ro} \ + ${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \ + ${COREOS_ASSEMBLER_CONTAINER:-localhost/nestos-assembler} "$@" + EOF + chmod +x nosa + mkdir out + cd out + ../nosa init --branch v1.0-riscv https://gitee.com/MahnoKropotkinov/nestos-config.git + ../nosa fetch + ../nosa build + ../nosa buildextend-metal + ../nosa buildextend-metal4k + ../nosa buildextend-live + + - name: Uploard build artifact + uses: actions/upload-artifact@v4 + with: + name: images + path: out/builds/24.03-LTS-*/riscv64/nestos-24.03-LTS* diff --git a/Dockerfile b/Dockerfile index 620db5aaa89c0ba58ce3cc83ce6b9987de8fcf5c..5f3662482140bf658faffb81bd397e36215617da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM openeuler-22.03-lts-sp4:latest +FROM openeuler-24.03-lts-sp2 WORKDIR /root/containerbuild # Keep this Dockerfile idempotent for local development rebuild use cases. diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..7d71d5da8f025a230303a985e9a77cfc782a425c --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,54 @@ +#!/bin/bash +set -e +set -o pipefail +# 默认的 OCI 运行时 +RUNTIME="docker" +arch=$(uname -m) + +# 解析命令行选项 +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -r|--runtime) + RUNTIME="$2" + shift # 移过参数名 + shift # 移过参数值 + ;; + -a|--arch) + arch="$2" + shift + shift + ;; + *) + # 未知选项 + echo "未知选项: $1" + exit 1 + ;; + esac +done + +# 验证运行时 +if [[ "$RUNTIME" != "docker" && "$RUNTIME" != "podman" ]]; then + echo "无效的运行时: '$RUNTIME'. 请使用 'docker' 或 'podman'." + exit 1 +fi + +if ! command -v curl &>/dev/null; then + echo "请先安装 curl" + exit 1 +fi +if ! command -v xz &>/dev/null; then + echo "请先安装 xz" + exit 1 +fi +if ! command -v "$RUNTIME" &>/dev/null; then + echo "未找到 '$RUNTIME',请先安装它。" + exit 1 +fi + +echo "将使用 '$RUNTIME' 导入镜像..." +# 下载、解压并导入镜像 +curl -L "https://repo.openeuler.org/openEuler-24.03-LTS-SP2/docker_img/${arch}/openEuler-docker.${arch}.tar.xz" | xz -d | "$RUNTIME" load +echo "镜像导入完成 将启动构建" +"$RUNTIME" build -t nestos-assembler:latest . +echo "镜像构建完成 名称:nestos-assembler" diff --git a/build.sh b/build.sh index f0a2a58a253180ea74d3d0351838f4d815ea27f2..18d55eb955dd6629df24862db80ef21b1a69dc1d 100755 --- a/build.sh +++ b/build.sh @@ -28,10 +28,15 @@ configure_yum_repos() { rm -rf /etc/yum.repos.d/* # Consistent with the base image, current: openeuler 22.03-LTS-SP4 - echo -e "[${version_id}-SP4-NestOS]\nname=NestOS\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-22.03-LTS-SP4/EPOL/multi_version/NestOS/For-Container/20240628/$arch/\ngpgcheck=0\npriority=2\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo - echo -e "[${version_id}-SP4-everything]\nname=everything\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-22.03-LTS-SP4/everything/$arch/\ngpgcheck=0\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo - echo -e "[${version_id}-SP4-EPOL]\nname=EPOL\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-22.03-LTS-SP4/EPOL/main/$arch/\ngpgcheck=0\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo - echo -e "[${version_id}-SP4-extra]\nname=extra\nenabled=1\nmetadata_expire=1m\nbaseurl=https://nestos.org.cn/NestOS-22.03-LTS-SP4/For-Container/20240628/$arch/\ngpgcheck=0\npriority=1\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo +# echo -e "[${version_id}-SP4-NestOS]\nname=NestOS\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-22.03-LTS-SP4/EPOL/multi_version/NestOS/For-Container/20240628/$arch/\ngpgcheck=0\npriority=2\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo + # echo -e "[${version_id}-SP4-everything]\nname=everything\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-22.03-LTS-SP4/everything/$arch/\ngpgcheck=0\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo + # echo -e "[${version_id}-SP4-EPOL]\nname=EPOL\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-22.03-LTS-SP4/EPOL/main/$arch/\ngpgcheck=0\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo + echo -e "[${version_id}-patch]\nname=patch\nenabled=1\nmetadata_expire=1m\nbaseurl=https://build-repo.tarsier-infra.isrc.ac.cn/home:/mahno:/NestOS-patch/openEuler_24.03/\ngpgcheck=0\npriority=1\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo + + echo -e "[${version_id}-NestOS]\nname=NestOS\nenabled=1\nmetadata_expire=1m\nbaseurl=https://build-repo.tarsier-infra.isrc.ac.cn/home:/mahno:/openEuler_24.03_LTS_SP1_Epol_Multi-Version_NestOS_For-Container/openEuler_24.03_SP2_Everything/\ngpgcheck=0\npriority=2\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo + echo -e "[${version_id}-everything]\nname=everything\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-24.03-LTS/everything/$arch/\ngpgcheck=0\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo + echo -e "[${version_id}-EPOL]\nname=EPOL\nenabled=1\nmetadata_expire=1m\nbaseurl=https://repo.openeuler.org/openEuler-24.03-LTS/EPOL/main/$arch/\ngpgcheck=0\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo + echo -e "[${version_id}-extra]\nname=extra\nenabled=1\nmetadata_expire=1m\nbaseurl=https://build-repo.tarsier-infra.isrc.ac.cn/home:/mahno:/NestOS-extra/openEuler_24.03/\ngpgcheck=0\npriority=1\nskip_if_unavailable=False\n" >> /etc/yum.repos.d/nestos-sp4.repo } install_rpms() { diff --git a/mantle/kola/tests/ignition/overlay.go b/mantle/kola/tests/ignition/overlay.go new file mode 100644 index 0000000000000000000000000000000000000000..9306a572e9ac5b46b437d91779376448bb74c1b3 --- /dev/null +++ b/mantle/kola/tests/ignition/overlay.go @@ -0,0 +1,96 @@ +// Copyright 2025 openEuler +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ignition + +import ( + "github.com/coreos/coreos-assembler/mantle/kola/cluster" + "github.com/coreos/coreos-assembler/mantle/kola/register" + "github.com/coreos/coreos-assembler/mantle/platform/conf" +) + +func init() { + register.RegisterTest(®ister.Test{ + Name: "nestos.ignition.overlay", + Description: "Verify Ignition overlay functionality works correctly.", + Run: testIgnitionOverlay, + ClusterSize: 1, + Tags: []string{"ignition"}, + UserData: conf.Ignition(`{ + "ignition": { "version": "3.0.0" }, + "storage": { + "files": [ + { + "path": "/etc/ignition-overlay-test", + "contents": { + "source": "data:,Ignition%20overlay%20test%20successful" + }, + "mode": 420 + }, + { + "path": "/etc/ignition-config-1", + "contents": { + "source": "data:,Config%201" + }, + "mode": 420 + } + ] + }, + "systemd": { + "units": [ + { + "name": "ignition-overlay-test.service", + "enabled": true, + "contents": "[Unit]\nDescription=Ignition Overlay Test Service\n\n[Service]\nType=oneshot\nExecStart=/bin/touch /var/log/ignition-overlay-ran\n\n[Install]\nWantedBy=multi-user.target" + } + ] + } + }`), + }) +} + +func testIgnitionOverlay(c cluster.TestCluster) { + m := c.Machines()[0] + + // Verify files created by Ignition + c.Run("verify-files", func(c cluster.TestCluster) { + // Check main test file + output := c.MustSSH(m, "cat /etc/ignition-overlay-test") + if string(output) != "Ignition overlay test successful" { + c.Fatalf("Expected 'Ignition overlay test successful', got '%s'", string(output)) + } + + // Check config file + output = c.MustSSH(m, "cat /etc/ignition-config-1") + if string(output) != "Config 1" { + c.Fatalf("Expected 'Config 1', got '%s'", string(output)) + } + }) + + // Verify systemd service + c.Run("verify-service", func(c cluster.TestCluster) { + // Check service is enabled + c.RunCmdSync(m, "systemctl is-enabled ignition-overlay-test.service") + + // Check service ran (file should exist) + c.RunCmdSync(m, "test -f /var/log/ignition-overlay-ran") + }) + + // Test overlay with additional config + c.Run("test-overlay-merge", func(c cluster.TestCluster) { + // This would test merging multiple Ignition configs + // For now, just verify the base functionality + c.RunCmdSync(m, "ls -la /etc/ignition-*") + }) +} diff --git a/mantle/kola/tests/misc/dual-rootfs.go b/mantle/kola/tests/misc/dual-rootfs.go new file mode 100644 index 0000000000000000000000000000000000000000..e09ce5f634f61d78f6009c77530eefc95e87a377 --- /dev/null +++ b/mantle/kola/tests/misc/dual-rootfs.go @@ -0,0 +1,152 @@ +// Copyright 2025 openEuler +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package misc + +import ( + "fmt" + + "github.com/coreos/coreos-assembler/mantle/kola/cluster" + "github.com/coreos/coreos-assembler/mantle/kola/register" + "github.com/coreos/coreos-assembler/mantle/kola/tests/util" +) + +func init() { + register.RegisterTest(®ister.Test{ + Run: testDualRootfs, + ClusterSize: 1, + Name: "nestos.dual-rootfs", + Description: "Verify dual root filesystem (A/B) functionality works correctly.", + Tags: []string{"rpm-ostree", "dual-rootfs"}, + }) +} + +func testDualRootfs(c cluster.TestCluster) { + m := c.Machines()[0] + + // Get initial rpm-ostree status + c.Run("check-deployments", func(c cluster.TestCluster) { + status, err := util.GetRpmOstreeStatusJSON(c, m) + if err != nil { + c.Fatalf("Failed to get rpm-ostree status: %v", err) + } + + if len(status.Deployments) < 2 { + c.Skipf("Dual rootfs test requires at least 2 deployments, found %d", len(status.Deployments)) + } + + // Find booted deployment + var bootedDeployment *util.RpmOstreeDeployment + for i, deployment := range status.Deployments { + if deployment.Booted { + bootedDeployment = &status.Deployments[i] + break + } + } + + if bootedDeployment == nil { + c.Fatal("No booted deployment found") + } + + c.Logf("Current booted deployment: %s (checksum: %s)", bootedDeployment.Version, bootedDeployment.Checksum) + + // Create a marker file to verify we're on the right deployment + markerContent := fmt.Sprintf("deployment-%s", bootedDeployment.Checksum[:8]) + c.RunCmdSync(m, fmt.Sprintf("echo '%s' > /etc/dual-rootfs-marker", markerContent)) + }) + + // Test switching to another deployment + c.Run("switch-deployment", func(c cluster.TestCluster) { + status, err := util.GetRpmOstreeStatusJSON(c, m) + if err != nil { + c.Fatalf("Failed to get rpm-ostree status: %v", err) + } + + // Find non-booted deployment + var targetDeployment *util.RpmOstreeDeployment + for i, deployment := range status.Deployments { + if !deployment.Booted { + targetDeployment = &status.Deployments[i] + break + } + } + + if targetDeployment == nil { + c.Skip("No alternative deployment available for switching") + } + + c.Logf("Switching to deployment: %s (checksum: %s)", targetDeployment.Version, targetDeployment.Checksum) + + // Switch to the target deployment + c.RunCmdSync(m, fmt.Sprintf("sudo rpm-ostree deploy %s", targetDeployment.Checksum)) + }) + + // Reboot and verify + c.Run("reboot-verify", func(c cluster.TestCluster) { + // Reboot the machine + err := m.Reboot() + if err != nil { + c.Fatalf("Failed to reboot machine: %v", err) + } + + // Wait for machine to come back + // (kola handles this automatically) + + // Verify we're on the new deployment + status, err := util.GetRpmOstreeStatusJSON(c, m) + if err != nil { + c.Fatalf("Failed to get rpm-ostree status after reboot: %v", err) + } + + // Find the new booted deployment + var newBootedDeployment *util.RpmOstreeDeployment + for i, deployment := range status.Deployments { + if deployment.Booted { + newBootedDeployment = &status.Deployments[i] + break + } + } + + if newBootedDeployment == nil { + c.Fatal("No booted deployment found after reboot") + } + + c.Logf("New booted deployment: %s (checksum: %s)", newBootedDeployment.Version, newBootedDeployment.Checksum) + + // Verify marker file doesn't exist (since we're on a different deployment) + output, err := c.SSH(m, "cat /etc/dual-rootfs-marker") + if err == nil { + c.Logf("Warning: marker file still exists with content: %s", string(output)) + c.Log("This may indicate the deployment switch didn't work as expected") + } else { + c.Log("Marker file correctly absent on new deployment") + } + }) + + // Cleanup: switch back to original deployment + c.Run("cleanup", func(c cluster.TestCluster) { + // Get current status + status, err := util.GetRpmOstreeStatusJSON(c, m) + if err != nil { + c.Logf("Warning: Failed to get status for cleanup: %v", err) + return + } + + // Find the first (original) deployment + if len(status.Deployments) > 1 { + originalChecksum := status.Deployments[1].Checksum + c.RunCmdSync(m, fmt.Sprintf("sudo rpm-ostree deploy %s", originalChecksum)) + } + }) +} diff --git a/mantle/platform/qemu.go b/mantle/platform/qemu.go index 38e6bafcd9e608daedee655f81e30c1a14016c6d..30769fae12031b825602f0c193c4b2719f126d04 100644 --- a/mantle/platform/qemu.go +++ b/mantle/platform/qemu.go @@ -592,6 +592,8 @@ func virtio(arch, device, args string) string { suffix = "pci" case "s390x": suffix = "ccw" + case "riscv64": + suffix = "device" default: panic(fmt.Sprintf("RpmArch %s unhandled in virtio()", arch)) } @@ -1328,7 +1330,7 @@ func baseQemuArgs(arch string, memoryMiB int) ([]string, error) { // The machine argument needs to reference our memory device; see below machineArg := "memory-backend=" + memoryDevice accel := "accel=kvm" - if _, ok := os.LookupEnv("COSA_NO_KVM"); ok || hostArch != arch { + if _, ok := os.LookupEnv("COSA_NO_KVM"); ok || hostArch != arch || arch == "riscv64" { accel = "accel=tcg" kvm = false } @@ -1357,6 +1359,11 @@ func baseQemuArgs(arch string, memoryMiB int) ([]string, error) { // https://qemu.readthedocs.io/en/latest/system/ppc/pseries.html#switching-between-the-kvm-pr-and-kvm-hv-kernel-module "-machine", "pseries,kvm-type=HV," + machineArg, } + case "riscv64": + ret = []string{ + "qemu-system-riscv64", + "-machine", "virt," + machineArg, + } default: return nil, fmt.Errorf("architecture %s not supported for qemu", arch) } diff --git a/riscv-notice.md b/riscv-notice.md new file mode 100644 index 0000000000000000000000000000000000000000..ba9ce642ec3235d30255c29b2ff64ed927de1c30 --- /dev/null +++ b/riscv-notice.md @@ -0,0 +1,4 @@ +# 在RISC-V架构下的使用注意 + +### 安全启动相关 +截至2025年8月,shim软件包尚未正式支持RISC-V平台,UEFI安全启动支持尚不明确。若您当前的硬件平台要求安全启动,请将其关闭,或者联系社区完善这方面的支持。 diff --git a/src/cmd-buildextend-metal b/src/cmd-buildextend-metal index 48af73c78f5c20ddc13f9034f8021144aa9ea584..1da71d61d7ced9b738fad1406d982838f8ade00e 100755 --- a/src/cmd-buildextend-metal +++ b/src/cmd-buildextend-metal @@ -87,7 +87,7 @@ if [ $# -ne 0 ]; then fi case "$basearch" in - "x86_64"|"aarch64"|"s390x"|"ppc64le") ;; + "x86_64"|"aarch64"|"s390x"|"ppc64le"|"riscv64") ;; *) fatal "$basearch is not supported for this command" ;; esac diff --git a/src/create_disk.sh b/src/create_disk.sh index 1a562aae61d721270ed93fe9b6af77449c6a8383..c212ee1f2511bce3bbcecc36b008717c4266f522 100755 --- a/src/create_disk.sh +++ b/src/create_disk.sh @@ -157,7 +157,18 @@ if [ "${rootfs_size}" != "0" ]; then fi # shellcheck disable=SC2031 +# oh, we didn't make any partition here case "$arch" in + riscv64) + RESERVEDPN=1 + EFIPN=2 + sgdisk -Z "$disk" \ + -U "${uninitialized_gpt_uuid}" \ + -n ${RESERVEDPN}:0:+1M -c ${RESERVEDPN}:reserved -t ${RESERVEDPN}:8DA63339-0007-60C0-C436-083AC8230908 \ + -n ${EFIPN}:0:+127M -c ${EFIPN}:EFI-SYSTEM -t ${EFIPN}:C12A7328-F81F-11D2-BA4B-00A0C93EC93B \ + -n ${BOOTPN}:0:+384M -c ${BOOTPN}:boot \ + -n ${ROOTPN}:0:"${rootfs_size}" -c ${ROOTPN}:root -t ${ROOTPN}:0FC63DAF-8483-4772-8E79-3D69D8477DE4 + ;; x86_64) EFIPN=2 sgdisk -Z "$disk" \ @@ -345,6 +356,7 @@ if test -n "${deploy_via_container}"; then deploy_commit=$(cat /tmp/commit.txt) rm /tmp/commit.txt else + find /boot -name 'grubriscv64.efi' # Pull the container image... time ostree container image pull $rootfs/ostree/repo "${ostree_container}" # But we default to not leaving a ref for the image around, so the @@ -400,15 +412,38 @@ install_uefi() { # https://github.com/coreos/fedora-coreos-tracker/issues/510 # See also https://github.com/ostreedev/ostree/pull/1873#issuecomment-524439883 # Unshare mount ns to work around https://github.com/coreos/bootupd/issues/367 - unshare -m /usr/bin/bootupctl backend install --src-root="${deploy_root}" "${rootfs}" +<<<<<<< HEAD + # We have a "static" grub config file that basically configures grub to look + # in the RAID called "md-boot", if it exists, or the partition labeled "boot". + local target_efi="$rootfs/boot/efi" + local vendordir + if [ "$arch" = riscv64 ]; then + vendordir="${target_efi}/EFI/BOOT" + # don't be so serious, just put local grub efi here and it's done + mkdir -p "${vendordir}" + cp /boot/efi/EFI/openEuler/grubriscv64.efi ${vendordir}/BOOTRISCV64.EFI + else + unshare -m /usr/bin/bootupctl backend install --src-root="${deploy_root}" "${rootfs}" + local grubefi + grubefi=$(find "${target_efi}/EFI/" -maxdepth 1 -type d | grep -v BOOT) + local vendor_id="${grubefi##*/}" + vendordir="${target_efi}/EFI/${vendor_id}" + mkdir -p "${vendordir}" + fi +======= + #unshare -m /usr/bin/bootupctl backend install --src-root="${deploy_root}" "${rootfs}" # We have a "static" grub config file that basically configures grub to look # in the RAID called "md-boot", if it exists, or the partition labeled "boot". local target_efi="$rootfs/boot/efi" - local grubefi - grubefi=$(find "${target_efi}/EFI/" -maxdepth 1 -type d | grep -v BOOT) - local vendor_id="${grubefi##*/}" - local vendordir="${target_efi}/EFI/${vendor_id}" + # grub2-install --target=riscv64-efi --efi-directory=$target_efi --bootloader-id=openEuler + # local grubefi + # grubefi=$(find "${target_efi}/EFI/" -maxdepth 1 -type d | grep -v BOOT) + # local vendor_id="${grubefi##*/}" + local vendordir="${target_efi}/EFI/BOOT" + # don't be so serious, just put my grub efi here and it's fine mkdir -p "${vendordir}" + cp /boot/efi/EFI/openEuler/grubriscv64.efi ${vendordir}/BOOTRISCV64.EFI +>>>>>>> a5ef8e5b (add support for riscv architecture) cat > "${vendordir}/grub.cfg" << 'EOF' if [ -e (md/md-boot) ]; then # The search command might pick a RAID component rather than the RAID, @@ -475,6 +510,9 @@ generate_gpgkeys() { # Other arch-specific bootloader changes # shellcheck disable=SC2031 case "$arch" in +riscv64) + install_uefi + ;; x86_64) # UEFI install_uefi diff --git a/src/deps.txt b/src/deps.txt index 2185947e6b161e697be2993d39a0e00567e439f3..a07044431997decd4eb21c4de44a83fd48ebdab5 100644 --- a/src/deps.txt +++ b/src/deps.txt @@ -26,7 +26,7 @@ make git rpm-build guestfs-tools libguestfs virtiofsd /usr/bin/qemu-img qemu-kvm swtpm # And the main arch emulators for cross-arch testing # qemu-system-aarch64-core qemu-system-ppc-core qemu-system-s390x-core qemu-system-x86-core -qemu-system-aarch64 qemu-system-x86_64 +qemu-system-aarch64 qemu-system-x86_64 qemu-system-riscv # cross-arch emulators need these,but openEuler did not provide these packages in every repo currently. # edk2-ovmf edk2-aarch64 diff --git a/src/vmdeps-riscv64.txt b/src/vmdeps-riscv64.txt new file mode 100644 index 0000000000000000000000000000000000000000..df5924ddbef1d908c33cea1484f66ef7b2d817f1 --- /dev/null +++ b/src/vmdeps-riscv64.txt @@ -0,0 +1,8 @@ +# For grub install when creating images and pxe install +grub2 grub2-tools-extra +bootupd + +# For creating bootable UEFI media on aarch64 +grub2-efi-riscv64 + +edk2-ovmf-riscv64 \ No newline at end of file diff --git a/vendor/github.com/vishvananda/netns/netns_linux_riscv64.go b/vendor/github.com/vishvananda/netns/netns_linux_riscv64.go new file mode 100644 index 0000000000000000000000000000000000000000..6ed687cebfc439863c96dd02ff5c153635c6fdd8 --- /dev/null +++ b/vendor/github.com/vishvananda/netns/netns_linux_riscv64.go @@ -0,0 +1,7 @@ +// +build linux,riscv64 + +package netns + +const ( + SYS_SETNS = 268 +)