Can't compile IPK with SDK ("key-build" signing key is missing)

Hi everybody, i have a serious problem about the lede-sdk-17.01.0-mvebu. Today i download the lede-sdk-17.01.0-mvebu,because i need to compile something, but in the end,it show me like this:
Signing package index...
Cannot open file '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
Cannot open file '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
Cannot open file '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
Cannot open file '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
Cannot open file '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
Cannot open file '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
Cannot open file '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
package/Makefile:78: recipe for target 'package/index' failed
make[2]: *** [package/index] Error 1
make[2]: Leaving directory '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64'
Makefile:55: recipe for target 'world' failed
make[1]: *** [world] Error 2
make[1]: Leaving directory '/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64'
/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/include/toplevel.mk:190: recipe for target 'world' failed
make: *** [world] Error 2


and i check there is no such file like "key-build", i don't know what is that means, how can i fix it? please help me.

In a normal LEDE buildroot you have your own personal signing key that is used for signing the packages and package lists of your build. that is supposed to be autogenerated at the first compiling. The two files are key-build and key-build.pub and they should be located in the buildroot root dir (from where you run all the compiling commands). Apparently generating them fails for you, but I am not sure why. I have never used the SDK, so it might have something to do with the SDK itself.

[quote="samuraiheart7, post:1, topic:2266"]
'/root/lede-sdk-17.01.0-mvebu_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64/key-build' for reading
[/quote]Comment regarding that. Are you sure that you are not compiling as "root" user? Based on the error message, it looks a bit like that. The buildroot usually gives a warning that you should not do that, and you should do all compiling with a normal (less-privileged) user account. If you are using "root", that might have impact also on key generation.

Thanks for reply. Yes, i compiling as "root" user, it's my first time to compiling, didn't know how to do it at all. I think i can solve this problem now. Thank you soooooooo much! :slight_smile:

I checked the source code and the build key is generated when building the "base-files" package that always belongs to each firmware. If you have never compiled a full firmware (or the base-files package), it is quite possible that the file is not autogenerated.

So I suggest that you first use the SDK to compile a full firmware for your device to get all necessary bits in places, and only then try to compile individual packages. (Or compile the "base-files" package first)

The advice to NOT use root account is the first item on the wiki explaining the usage of the build system.
https://lede-project.org/docs/guide-developer/use-buildsystem

But that advice was missing from the SDK page, so I added that item also there.
https://lede-project.org/docs/guide-developer/compile_packages_for_lede_with_the_sdk

I don't know how to say...Thank you very much!!!!! It's help me a lot!!! I think i should follow your advice(like compile the "base-files" first), it will give me more experience. Thank you for your professional guidance,i'm really appreciate it!!!:slight_smile:

The same error on lede-sdk-ar71xx-nand_gcc-5.4.0_musl.Linux-x86_64.
Normal User to build external ipk first.

try ./staging_dir/host/bin/usign -G -s ./key-build -p ./key-build.pub -c "Local build key" to build key manually.
Or make menuconfig, disable global building settings | Cryptographically sign package lists

4 Likes