bitbake -c savedefconfig overwrites current configuration - linux-kernel

Yocto environment for an ARM embedded board.
Following these instructions I'm having hard time to change the kenerl configuration.
Basically I did:
bitbake -c menuconfig virtual/kernel
enabled a new driver (i.e. PPP)
save
check new the items in .config
bitbake -c savedefconfig virtual/kernel
now both defconfig and .config don't have the PPP module anymore
even more: entering again the menuconfig it is disabled
Why it does not work as expected?

Related

Raspian kernel cross compilation failing

I want to cross-compile a Raspbian kernel that I downloaded from www.github.com/raspberrypi/linux on my host machine (Linux Mint Cinnamon 64bit).
I was executing the following steps:
Create folders leading to path home/sven/Develop/Raspbian
Cloning repo from link above leading to home/sven/Develop/Raspbian/linux containing the source code
Cleaning kernel by running make mrproper
Creating .config from my running raspberry pi 3B+ by running sudo scp pi#.../proc/config.gz . and then unzipping it with gunzip -c config.gz > .config
Running ARCH=arm CROSS_COMPILE=${CCPREFIX} make oldconfig
grep -v DEBUG_INFO < .config > newconfig
mv newconfig .config
ARCH=arm CROSS_COMPILE=${CCPREFIX} make oldconfig
ARCH=arm CROSS_COMPILE=${CCPREFIX} make
However, the last step is always failing (Error 2 or Error 1). I have also tried the following commands that have also been unsuccessful:
make ARCH=arm CROSS_COMPILE=${CCPREFIX}
make ARCH=arm CROSS_COMPILE=
If I type in only make oldconfig or only make, it works but then I have no idea if it's really compiled for ARM or with the gcc compiler...
My .profile file looks like this at the end:
PATH=/opt/toolchain/.../gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:$PATH
export CCPREFIX=arm-linux-gnueabihf-
I have already tried the PATH without the "/bin/" at the end, also not working.
Does anyone have an idea???

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

How to build kernel and kernel modules for specific kernel version magic?

I need to build kernel to have vermagic
3.10.28-gbc1b510-33899-g9fa745e SMP preempt mod_unload modversions ARMv7
but after building and verification some module via modinfo it displays
3.10.28 preempt mod_unload modversions ARMv6
Looks like I can't load module because different vermagic. How to build kernel and modules for vermagic to be axactly the same ?. I'm using buildroot.
I created this shell script in order to prepare for build
#!/bin/sh
export PATH=$PATH:/buildroot-2018.02.3/output/host/arm-buildroot-linux-gnueabi/bin:/buildroot-2018.02.3/output/host/bin:/buildroot-2018.02.3/output/host/sbin:/buildroot-2018.02.3/output/host/bin
export LD_LIBRARY_PATH=/buildroot-2018.02.3/output/host/lib
export LIBRARY_PATH=/buildroot-2018.02.3/output/host/lib
export PKG_CONFIG_PATH=/buildroot-2018.02.3/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/lib/pkgconfig
exec /bin/bash
then I enter folder
/buildroot-2018.02.3/output/build/linux-3.10.28/
and
make distclean
make clean
then copy .config and
make ARCH=arm menuconfig
and
make -j9 ARCH=arm
I'm using original kernel konfig with additionaly selected a few options to build as modules without modifications of any other.
There is linux-3.10.28/arch/arm/Makefile file. In this file there are those defines
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
I found suggestion somewhere which lead me to replace
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
with
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
I olso uncommented these two:
tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
tune-$(CONFIG_CPU_V6K) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
I added
-gbc1b510-33899-g9fa745e SMP
as local_version in kernel .config
and now version string print by modinfo is the same.

Cross Compile Linux Kernel Module

I am looking into cross compiling a kernel module for an ARM linux. I have my toolchain installed.
But there's something I am not quite getting from various how-tos.
The module I want to build is gadgetfs.
The kernel version on my host is 3.5.0-34-generic while
on the target it's 3.6.9-0.1
Now what kernel sources or headers do I actually need to download and install, and where?
I downloaded linux-3.6.9.tar.bz2 from kernel.org and extracted it.
In drivers/usb/gadget/ there's a Makefile and according to this site I need to append these lines to it, then run make:
KDIR := /lib/modules/`uname -r`/build
PWD := `pwd`
obj-m := dummy_hcd.o gadgetfs.o
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
But what do i have to replace uname -r with? Cause this would give me my host's kernel version. But my target version is different. Where is the /lib/modules/3.6.9 folder?
CROSS_COMPILE and ARCH is both set.
You need to cross compile (or download pre-compiled) matching version of Linux for your target on your host machine with right configuration since Linux doesn't have a stable binary API. Host's kernel version is not relevant.
After having target build available on your host you can build a module via
make -C kernel_build_dir M=`pwd` ARCH=arm CROSS_COMPILE=<...> modules
under that module's directory.

Error in linux cross compilation u-boot

When i am cross compile u-boot code in ubuntu and gives command as follow
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- distclean
error is:
System not configured -see readme Error[1]
What is solution for this?
thank you.
hardik gajjar
To compile U-Boot, the easiest way is to export the CROSS_COMPILE variable :
$ export CROSS_COMPILE=/directory/.../arm-none-linux-gnueabi-
And then you have to choose the board configuration, for example :
$ make lpc4350-board_config
Then you can compile :
$ make
The distclean target is used to undo/clear any changes made to the local working directory by selecting any board/device-specific config.
The error System not configured -see readme Error[1] indicates that the current u-boot working-directory is NOT yet configured for any device/board and hence the distclean target to make is redundant at this point.

Resources