Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMU build error for SNP kernel #81

Open
mmisono opened this issue Nov 13, 2024 · 2 comments
Open

QEMU build error for SNP kernel #81

mmisono opened this issue Nov 13, 2024 · 2 comments

Comments

@mmisono
Copy link
Member

mmisono commented Nov 13, 2024

$ inv build.build-qemu-snp
$ nix build --out-link /scratch/atsushi/CVM_eval/build/qemu-amd-sev-snp --json .#qemu-amd-sev-snp
error: builder for '/nix/store/kc0hl7dr5lxjlvj7hmwbwjkk3isc19bx-source.drv' failed with exit code 1;
       last 25 log lines:
       > remote: Compressing objects: 100% (2/2), done.
       > remote: Total 2 (delta 0), reused 2 (delta 0), pack-reused 0 (from 0)
       > Unpacking objects: 100% (2/2), 931 bytes | 931.00 KiB/s, done.
       > From https://gitlab.com/qemu-project/vbootrom
       >  * branch            0c37a43527f0ee2b9584e7fb2fdc805e902635ac -> FETCH_HEAD
       > Submodule path 'roms/vbootrom': checked out '0c37a43527f0ee2b9584e7fb2fdc805e902635ac'
       > remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
       > remote: Enumerating objects: 269, done.
       > remote: Counting objects: 100% (269/269), done.
       > remote: Compressing objects: 100% (136/136), done.
       > remote: Total 167 (delta 86), reused 54 (delta 5), pack-reused 0 (from 0)
       > Receiving objects: 100% (167/167), 29.21 KiB | 29.21 MiB/s, done.
       > Resolving deltas: 100% (86/86), completed with 65 local objects.
       > From https://gitlab.com/libvirt/libvirt-ci
       >  * branch            77c800186f34b21be7660750577cc5582a914deb -> FETCH_HEAD
       > Submodule path 'tests/lcitool/libvirt-ci': checked out '77c800186f34b21be7660750577cc5582a914deb'
       > Cloning into '/nix/store/2g178cazqargsbn9f5h55cqiiw7xi8qp-source/roms/edk2/UnitTestFrameworkPkg/Library/SubhookLib/subhook'...
       > fatal: could not read Username for 'https://github.com': No such device or address
       > fatal: clone of 'https://github.com/Zeex/subhook.git' into submodule path
[...]

It seems the submodule URL has changed:
https://github.com/tianocore/edk2/blob/2839fed575f0eccae7f5a89f7252487dd058b462/.gitmodules#L28C8-L28C53

@mmisono
Copy link
Member Author

mmisono commented Dec 12, 2024

The workaround is to manually build software.

QEMU

  • for 6.8 kernel (see doc for software version)
nix develop nixpkgs#qemu
git clone https://github.com/mmisono/qemu --recursive
cd qemu
git checkout -b snp-latest-20240221 origin/snp-latest-20240221
git submodule update --init
cd ./roms/edk2
  • Edit .gitmodules and update the URL
--- a/.gitmodules
+++ b/.gitmodules
@@ -25,7 +25,7 @@
        url = https://github.com/google/googletest.git
 [submodule "UnitTestFrameworkPkg/Library/SubhookLib/subhook"]
        path = UnitTestFrameworkPkg/Library/SubhookLib/subhook
-       url = https://github.com/Zeex/subhook.git
+       url = https://github.com/tianocore/edk2-subhook.git
 [submodule "MdePkg/Library/BaseFdtLib/libfdt"]
        path = MdePkg/Library/BaseFdtLib/libfdt
        url = https://github.com/devicetree-org/pylibfdt.git
# back to the root of the qemu directory
cd ../../
mkdir build
cd build
../configure --target-list=x86_64-softmmu --disable-docs
make -j$(nproc)
# in the CVM_eval directory, create simlink to the built qemu
mkdir -p build/qemu-amd-sev-snp/bin
ln -s <path/to>/qemu-system-x86_64 build/qemu-amd-sev-snp/bin

@mmisono mmisono changed the title QEMU build error for SNP 6.9 kernel QEMU build error for SNP kernel Dec 12, 2024
@mmisono
Copy link
Member Author

mmisono commented Dec 12, 2024

I confirmed the current 6.8 and 6.9 have this issue (probably any older version as well). The newer version will not have this issue as the submodule URL is updated.

@mmisono mmisono pinned this issue Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant