Creating a defconfig for u-boot - linux-kernel

I'm trying to create a defconfig for u-boot using make u-boot-savedefconfig but I get the error.
make: *** No rule to make target 'u-boot-savedefconfig'. Stop.make: *** No rule to make target 'u-boot-savedefconfig'. Stop.
Should I modify the makefile or is it not possible to create a defconfig for u-boot?
I expect a defconfig file to be created using the existing .config file as I'd like to upload the defconfig to github.
Are there any docs that I can follow? I'm using timesys to create custom embedded Linux, the docs in Timesys do not contain any info about creating defconfig.

The name of the make target is not u-boot-savedefconfig but just savedefconfig just like the Linux kernel.

Related

Meta-swupdate yocto gub instead of u-boot bootloader

I want to use the swupdate meta layer in my yocto build framework. see: https://github.com/sbabic/meta-swupdate
Before I build it with bitbake swupdateI do some configuration with bitbake -c menuconfig swupdate here I can find some configuration for change the bootloader from u-boot to grub. screenshot
Anytime when I call bitbake swupdatethe recipies u-boot is building...
If I start only the bitbake u-boot I get an error:
Configuration file ".config" not found!
But there is no option bitbake -c menuconfig u-boot
I'm confused. Is there another .config file for u-boot?
If my understanding of the swupdate recipe is correct, the DEPENDS variable is automatically appended depending on the content of the defconfig file that is specified in SRC_URI or in config fragments[1]. Therefore, in order to remove u-boot from the DEPENDS variable, one needs to remove it from the defconfig that is unpacked in the recipe workdir. Running the menuconfig task won't probably be enough. One can probably remove U-Boot from the defconfig by running the menuconfig task, get the resulting defconfig output from the workdir and add it in a bbappend of the swupdate recipe.
[1] https://github.com/sbabic/meta-swupdate/blob/master/recipes-support/swupdate/swupdate.inc#L90-L150

Linux kernel out-of-tree module, installation of uapi headers issue

I have an external out-of-tree linux kernel module, say foo. Therein, I have a directory include/uapi/ that should, I assume, contain Kbuild file defining inclusion rules and/or headers to export. The directory include/uapi/ on its turn contains one more directory linux having the target user-API headers in, say three files foo.h bar.h baz.h
Ok, I have defined this Kbuild file inside include/uapi and it contains:
header-y += linux/
Then, inside include/uapi/linux directory I've defined one more KBuild and it has the content:
header-y += foo.h bar.h baz.h
Now I am expecting that upon running the command
make -C /lib/modules/5.4.48-dannftk/build M=/home/dannftk/foo INSTALL_HDR_PATH=/home/dannftk/my_exported_headers/ headers_install
I will get the headers installed in the /home/dannftk/my_exported_headers/ directory, instead, I am getting the error saying:
make: *** No rule to make target 'headers_install'. Stop.
/home/dannftk/foo - the path the out-of-tree module discussed is located by
/lib/modules/5.4.48-dannftk/build - the build directory of the kernel, it points to /usr/src/linux-5.4.48 containing the source code of the kernel, actually, I am on Gentoo Linux
May someone give me a hint what I am doing wrongly? Am I incorrectly setting rules for Kbuild? Or maybe I am locating them in unexpected for the kernel build system directories?
Thank you in advance
I personally consider this issue as a bad Kbuild error message. It's too confusing.
The answer is in linux documentation:
--- 2.3 Targets
When building an external module, only a subset of the "make"
targets are available.
make -C $KDIR M=$PWD [target]
The default will build the module(s) located in the current
directory, so a target does not need to be specified. All
output files will also be generated in this directory. No
attempts are made to update the kernel source, and it is a
precondition that a successful "make" has been executed for the
kernel.
modules
The default target for external modules. It has the
same functionality as if no target was specified. See
description above.
modules_install
Install the external module(s). The default location is
/lib/modules/<kernel_release>/extra/, but a prefix may
be added with INSTALL_MOD_PATH (discussed in section 5).
clean
Remove all generated files in the module directory only.
help
List the available targets for external modules.
There were some hacks available in older kernel versions, as adding header-y += ... into Kbuild file, but, as you see, it's not the official approach.
Looks like developers of out-of-tree modules should take care of headers installation manually, without reusing of linux kernel make rules.

make: No rule to make target in Kitkat

I am working in Android source code with Kitkat version, and I encounter a weird problem when I executing make command, the error message are listed below.
make: No rule to make target `out/target/product/msm8909_512/obj/STATIC_LIBRARIES/revlib_intermediates/export_includes',
needed by `out/target/product/msm8909_512/obj/STATIC_LIBRARIES/third_party_harfbuzz_ng_harfbuzz_ng_gyp_intermediates/import_includes'.
Stop.make: Waiting for unfinished jobs....
I can't find a proper answer so far, do I need to install any additional libraries ?
Env: ubuntu 12.04 && java version 1.6.0_45
Please do me a favor.
No rule to make target xxx, needed by yyy.
This means that make decided it needed to build a target, but then couldn't find any instructions in the makefile on how to do that, either explicit or implicit (including in the default rules database). If you want that file to be built, you will need to add a rule to your makefile describing how that target can be built. Other possible sources of this problem are typos in the makefile (if that filename is wrong) or a corrupted source tree (if that file is not supposed to be built, but rather only a prerequisite).
reference

kernel compile and menuconfig

I am a newer in linux and using ubuntu(4.4.0-64-generic) in vmware fusion. I am learning how to compile kernel. So, I downloaded the kernel(linux-4.4.52.tar.xz) from the kernel.org. But when I input make menuconfig, there are some errors.
root#ubuntu:/usr/src/linux-4.4.52# make menuconfig
HOSTCC scripts/basic/fixdep
In file included from /usr/include/x86_64-linux-gnu/bits/posix1_lim.h:160:0,
from /usr/include/limits.h:143,
from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:168,
from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:7,
from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:34,
from scripts/basic/fixdep.c:114:
/usr/include/x86_64-linux-gnu/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
scripts/Makefile.host:91: recipe for target 'scripts/basic/fixdep' failed
make[1]: * [scripts/basic/fixdep] Error 1
Makefile:444: recipe for target 'scripts_basic' failed
make: * [scripts_basic] Error 2
I have installed headers files and done everything I can do. Someone can help me solve this problem?
You symbolic link is wrong; /usr/src/linux-4.4.0-64-generic/include/linux is the wrong directory and must not be linked to /usr/include/linux.
The kernel has two sets of headers: kernel-internal headers, and user API headers. The latter are inside the uapi directory, and they are what user-space program should see.
When you are compiling your own kernel, you can install the user-space headers of that kernel with make headers_install.
When you are using your distribution's kernel, you can just (re-)install the appropriate package (in your case, linux-headers-generic), and that will do the right thing as long as you do not muck around with those files afterwards.

How to rename a built-in linux kernel module?

I am trying to extend the built-in xfs module of linux kernel. Following this SO post, I am now able to compile it locally. But to avoid conflict with the existing kernel xfs module, I would like to rename my extension to, say xxfs, without changing the name of the source files.
I've found a related post, following which I changed the relevant lines in Makefile to:
obj-$(CONFIG_XFS_FS) += xxfs.o
xxfs-objs := xfs.o
But I got an error saying
make[1]: *** No rule to make target '/home/dev/tmp/xxfs/xfs.o', needed by '/home/dev/tmp/xxfs/xxfs.o'. Stop.
Makefile:1403: recipe for target '_module_/home/dev/tmp/xxfs' failed
make: *** [_module_/home/dev/tmp/xxfs] Error 2
make: Leaving directory '/usr/src/linux-headers-4.4.0-28-generic'
Environment:
Ubuntu 16.04 with kernel 4.4.0-28-generic.
EDIT
I got the xfs kernel module source file by
installing the linux kernel source with apt-get source linux-source-4.4.0
copy the linux-4.4.0/fs/xfs to another directory (merely for easy maintenance), currently /home/dev/tmp/xxfs
To compile the module, I run the command make -C /lib/modules/$(uname -r)/build M=$(pwd) modules from the /home/dev/tmp/xxfs directory, after which a xfs.ko will be generated in the same directory.
However after I change the following line in Makefile
obj-$(CONFIG_XFS_FS) += xfs.o
to
obj-$(CONFIG_XFS_FS) += xxfs.o
xxfs-objs := xfs.o
Everything else is not touched, but I am no longer able to compile the module with the same command.

Resources