compilation linux kernel openssl/opensslv.h error - linux

I am trying to compile a Linux kernel without selecting the TCP/IP protocol in menuconfig but I face this error when I try to compile:
scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such
file or directory
To compile I use this command:
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
I'm working with linux-4.10.1's kernel

As make-kpkg is a Debian-specific tool, I assume you are using a Debian distribution; you mentioned it is Ubuntu.
It looks like you don't have the dependencies for building the kernel installed. You can install them (on Debian/Ubuntu) using:
# apt build-dep linux
If APT is missing source addresses, modify your /etc/apt/sources.list to contain a line as:
deb-src http://de.archive.ubuntu.com/ubuntu/ DIST main
It should be commented in that file (so prefixed with a #). If so, just remove the #, otherwise copy the deb ... line and change deb to deb-src. Remember to reload package sources afterwards:
# apt update

Related

Error when I try to run an executable file while loading libz.so.1 library in linux debian

I can't run the executable file because of the libz.so.1 library.
I have the libz.so.1 file in file path /usr/lib/x86-64-linux-gnu/libz.so.1, but the error appears. How can I do to solve this? This is the output of the terminal.
aruvi#iris:Desktop/Final_iRTC_witout_ACM_model$ ./main_iRTC_init
./main_iRTC_init: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
The executable file was compiled for 32 bit environment but now the platform is changed to the 64 bit version. please suggest and guide me to solve the problem.
If your application is compiled for i386 (aka x86, or ia32), then all it's dylib dependencies must be i386 as well (or more generally: all dylib dependencies must be satisfied by the same architecture).
You can install (and run) i386 binaries/packages/dependencies on your Debian system by enabling multiarch:
dpkg --add-architecture i386
apt-get update
apt-get install zlib1g:i386

Include objTools in kernel debians (linux-headers and linux-image)

We are compiling kernel and creating debians of linux kernel.
Recently, we found that it does not contain objTools source files in the debians.
Is there a way, we can include it in debians and will be available after installing debians?
We tried the following:
Approach1:
1. In config file, we enabled CONFIG_STACK_VALIDATION
2. Ran make-kpkg -j4 --rootcmd fakeroot --initrd --append-to-version=-12 kernel_image kernel_headers
Approach2:
1. In config file, we enabled CONFIG_STACK_VALIDATION
2. Added (cd $srctree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrsrcfiles" in scripts/package/builddeb file
3. Ran make-kpkg -j4 --rootcmd fakeroot --initrd --append-to-version=-12 kernel_image kernel_headers
Both above created debian files but objTools folder had only Makefile inside linux-headers debian.
When I added kernel_source in make-kpkg command, it created debian but on installing it is showing linux-source-12.tar.bz2.
I want to get objTools folders along with all files on installing kernel debians i.e. linux-headers and linux-image debians such that when I install debians using command dpkg -i linux-image*.deb linux-headers*.deb, it should also install Tools source files.
Please help.
I applied the patch mentioned in https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=833500;filename=kernel-package_add_objtool.patch;msg=10 and it worked.

Trying to compile adxl345 as a module in 4.4.54-ti-r93 kernel but get error

I have downloaded below debian image from latest images site
Debian 8.7 2017-03-19 4GB SD LXQT
I have attached a adxl345 accelerometer, and with user space tools its working fine.
Now I am trying to attach a kernel driver i.e in adxl345. I put the source files in
/home/debian/Desktop/adxl345
and issued make.
I get this error
root#beaglebone:/home/debian/Desktop/adxl345# make
make -C /lib/modules/4.4.54-ti-r93/build M=/home/debian/Desktop/adxl345 modules
make[1]: *** /lib/modules/4.4.54-ti-r93/build: No such file or directory. Stop.
Makefile:13: recipe for target 'default' failed
make: *** [default] Error 2
I checked
root#beaglebone:/lib/modules/4.4.54-ti-r93# ls
extra modules.builtin modules.devname modules.symbols.bin
kernel modules.builtin.bin modules.order
modules.alias modules.dep modules.softdep
modules.alias.bin modules.dep.bin modules.symbols
there is no build directory. I tried to update kernel headers
sudo apt-get install linux-headers-linux-headers-4.4.54-ti-r93
but it says
E: Unable to locate package linux-headers-linux-headers-4.4.54-ti-r93
How I am going to build the drivers?
I did not updated cache
sudo apt-get update
Once updated we can check at /lib/modules
there will be a build directory.
Now it should be building.

Build mozilla JSS

I followed NSS build instructions and built NSS successfully.
Then I follow JSS build instructions and building fails with error:
In file included from CryptoManager.c:6:0:
../../../../dist/public/nss/secitem.h:15:21: fatal error: plarena.h: No such file or directory
compilation terminated.
This result is on Ubuntu 16.04 LTS.
On WIndows I get:
All directories (dist, jss, nspr and nss) are on the same level.
What am I doing wrong?
Check my post here. Basically it's due to missing packages. If not working, this file is somewhere under nspr. Copy it and place it beside the .c file which needs it.
EDIT:
To sum it up:
1. Install build-essential and gcc with g++.
2. Try to install zlib1g-dev and libc6-dev, if they are absent.
3. And, install zlib1g-dev.
4. cd into the nss directory, and run the build like this:
gmake nss_build_all NSS_SSL_ENABLE_ZLIB=
if you are under a x64 environment, add USE_64=1, too.
It should work.

Header files are not found by GCC

Working with embedded C-projects. There are libraries, include files and so on - for micro controllers. No need for me to use GCC for a host machine and OS (Linux Mint 64 bit). As a rule...
But now I'm trying to compile mspdebug project from a Github - with a GCC of course. And I get an error at the very begin of make:
mspdebug$ make
cc -DUSE_READLINE -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\" -o util/btree.o -c util/btree.c
util/btree.c:19:20: fatal error: assert.h: No such file or directory
#include <assert.h>
^
compilation terminated.
I search for the includes in all possible paths (I've got the list of them via gcc -v command) - there are no assert.h file, as well, as stdio.h and so on. Except virtual box directories there is only one place (where GCC does not search includes): /usr/lib/syslinux/com32/include
AFAIK, all standard libs and includes are installed with the GCC. So I try to reinstall GCC (4.8.4) - nothing changes.
What is the normal way to give GCC all standard environment it needs?
Thanks to the right direction set by Sam Varshavchik I found the info in the stackoverflow. So I did the following:
1) installed build-essential:
sudo apt-get install build-essential
2) installed libusb (since my try to build the package revealed the absence of usb.h):
sudo apt-get install libusb-dev
And it is OK! The mspdebug (v.023) is compiled and successfully tested!
So, Linux Mint 17.2 (at least) requires installing some libs to a GCC, the most basic is build-essential.
assert.h is not part of gcc, it's a part of glibc.
Most likely, your Linux distribution puts the system headers into a separate package that you need to install.
Fedora, for examples, puts the header files in the glibc-headers package. However, you can't be using Fedora, because Fedora's gcc package has a dependency on glibc-headers, to make sure that it gets pulled in.
Whatever Linux distribution you're using, you need to research which distribution package will install the system header files you need to build stuff with.

Resources