oscarlab/graphene-sgx-driver

Build Linux kernel patch error

ltinerary opened this issue · 5 comments

error

when I Install the Linux kernel patched with FSGSBASE, During buid the Build the linux-image and linux-header .deb files(make -j $(getconf _NPROCESSORS_ONLN) deb-pkg LOCALVERSION=-custom),it cames a error:

debian/rules:6:recipe for target 'build' failed
make[2]: *** [deb-pkg] Error 2
dpkg-buildpackage:Error: debian/rules build subprocess returned exit status 2
script/Makefile.package:73: recipe for target 'deb-pkg' failed
make[1]: *** [deb-pkg] Error 2
Makefile:1469: recipe for target 'deb-pkg' failed
make: *** [deb-pkg] Error 2

Does this error related to this patch?

Description:

I flow the Building with SGX support,and tried to build a Linux kernel with FSGSBASE patch.when I run this command:

make -j $(getconf _NPROCESSORS_ONLN) deb-pkg LOCALVERSION=-custom

$(getconf _NPROCESSORS_ONLN) in my computer's value is 16.

I am very new to this and wasn't able to find a solution.

infos:

  • os : Ubuntu 18.04
  • current kernel: 5.4.0-72-generic
  • arch:x86_64
  • cpu:Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz

Would anyone be able to help me?

Please let me know if you need any more information.

Thanks a lot !

I don't understand what you're trying to do with all your Debian makefiles.

What you need to do is to git-clone the Linux sources, switch the branch to linux-5.4.y, apply the patches we provide using git am, then build the kernel and install it as a default kernel on your Debian machine.

These steps are described in steps 1, 2, 3, and 4 in our tutorial that you linked (https://graphene.readthedocs.io/en/latest/building.html#a-install-the-linux-kernel-patched-with-fsgsbase).

I understand that the final "install the custom-built kernel on your machine" step (step 4) may be different on Debian than on Ubuntu, but the first three steps should be exactly the same.

I don't understand what you're trying to do with all your Debian makefiles.

What you need to do is to git-clone the Linux sources, switch the branch to linux-5.4.y, apply the patches we provide using git am, then build the kernel and install it as a default kernel on your Debian machine.

These steps are described in steps 1, 2, 3, and 4 in our tutorial that you linked (https://graphene.readthedocs.io/en/latest/building.html#a-install-the-linux-kernel-patched-with-fsgsbase).

I understand that the final "install the custom-built kernel on your machine" step (step 4) may be different on Debian than on Ubuntu, but the first three steps should be exactly the same.

I alreadly did step1、step2、step3,
but in step4,the issue appeared when I build the kernel.

I think the makefile info may give some help,
if it was useless i will delete the makefile info in a minute.

By the way, can you give me some advice about this error report in step4?

Thanks a lot!

Ok, I'm starting to understand now. Thanks for the info, now it's more clear.

But do you have more output from the build process? You only copied the last 7 lines of the output. And these lines do not show the root cause of the error. The Makefiles also only show how the first Makefile calls the second Makefile, the second Makefile calls the third Makefile, and the third Makefile (debian/rules) calls yet another Makefile ($(srctree)/Makefile). And this last Makefile and its output are not shown in your messages.

Also,I found some warning like this(may had ten?).
warning


And it's had a warning about suggestions for naming Linux folders.
微信图片_20210422095435

For the time being, I only find these warnings. Tomorrow I will carefully check the other errors or warnings in the log.


2021.4.22: I checked and I found a other warning:can't find jump dest instruction at .text+0xa0

微信图片_20210422092303

Also I found this error:
certs

Thanks a lot~

I successfully compiled the kernel !
In .config file,I was changed the CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"to be empty.
Then I got the '*.deb' files!
Although I still don't know why.
Thanks @dimakuv