Linux-kernel: make isoimage fails due to missing certs. Proceed how? - linux-kernel

I tried make isoimage but got:
kernel/Makefile:135: *** No X.509 certificates found ***
CHK kernel/config_data.h
Kernel: arch/x86/boot/bzImage is ready (#1)
rm -rf arch/x86/boot/isoimage
mkdir arch/x86/boot/isoimage
for i in lib lib64 share end ; do \
if [ -f /usr/$i/syslinux/isolinux.bin ] ; then \
cp /usr/$i/syslinux/isolinux.bin arch/x86/boot/isoimage ; \
[...]
done
arch/x86/boot/Makefile:160: rule for target „isoimage“ failed
make[1]: *** [isoimage] error 1
arch/x86/Makefile:236: rule for target „isoimage“ failed
make: *** [isoimage] error 2
while using AUR build system.
So where does one get those certs from and where to put them?

on Arch-Linux & derivates, the certs will be put in place by:
pacman -S linux
That linux package should have "mkisolinux" as a dependency, because the
make isoimage
requires it. Still, one needs to manually copy
cp /usr/lib/syslinux/bios/isolinux.bin /usr/include/syslinux/isolinux.bin
for the target to actually succeed.
"make isoimage" does work after these measures usually.
The issue is reproducible and could be easily fixed in Arch.

Related

Is there a Buildroot setting for making kernel source available to compile against?

I've been given a .zip file containing source for a proprietary kernel module. Once unzip'd, there is an install script that needs to be run. The install script untar's the actual source and builds the kernel module. It requires kernel headers to compile against.
Here is my Buildroot .mk file:
FOOCO_VERSION = 1.0
FOOCO_SOURCE = cust_kernel_drvr.zip
FOOCO_SITE = /mnt/third-party/fooco
FOOCO_SITE_METHOD = local
define FOOCO_CONFIGURE_CMDS
unzip $(#D)/$(FOOCO_SOURCE) -d $(#D)
endef
define FOOCO_BUILD_CMDS
chmod +x $(#D)/TOOLS/Linux_x64/DRIVER/install
cd $(#D)/TOOLS/Linux_x64/DRIVER; $(SHELL) ./install
rm -rf $(#D)
endef
$(eval $(generic-package))
This results in the following log output and error:
(Note: I enabled debugging that shows the start and end of each step.)
DEBUG: start | rsync | fooco
>>> fooco 1.0 Syncing from source dir /mnt/third-party/fooco
rsync -au --chmod=u=rwX,go=rX --exclude .svn --exclude .git --exclude .hg --exclude .bzr --exclude CVS /mnt/third-party/fooco/ /root/buildroot-2022.02.1/output/build/fooco-1.0
DEBUG: end | rsync | fooco
DEBUG: start | configure | fooco
>>> fooco 1.0 Configuring
unzip /root/buildroot-2022.02.1/output/build/fooco-1.0/cust_kernel_drvr.zip -d /root/buildroot-2022.02.1/output/build/fooco-1.0
Archive: /root/buildroot-2022.02.1/output/build/foofo-1.0/cust_kernel_drvr.zip
[snip]
creating: /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/
creating: /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/
inflating: /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/install
inflating: /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/cust_kernel_drvr-1.2.0.15-0.noarch.rpm
inflating: /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/cust_kernel_drvr.tar.gz
inflating: /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/license_gpl.txt
[snip]
DEBUG: end | configure | fooco
DEBUG: start | build | fooco
>>> fooco 1.0 Building
chmod +x /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/install
cd /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER; /bin/bash ./install
Extracting archive..OK!
Compiling the driver...Error: make[1]: Entering directory '/root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/fooco_cust/src/linux/driver'
common.mk:82: *** Kernel header files not in any of the expected locations.
common.mk:83: *** Install the appropriate kernel development package, e.g.
common.mk:84: *** kernel-devel, for building kernel modules and try again. Stop.
make[1]: Leaving directory '/root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/fooco_cust/src/linux/driver'
Error: unable to find driver file (fooco_cust.ko) in /root/buildroot-2022.02.1/output/build/fooco-1.0/TOOLS/Linux_x64/DRIVER/fooco_cust/src/linux/driver
rm -rf /root/buildroot-2022.02.1/output/build/fooco-1.0
DEBUG: end | build | fooco
touch: cannot touch '/root/buildroot-2022.02.1/output/build/fooco-1.0/.stamp_built': No such file or directory
make: *** [/root/buildroot-2022.02.1/output/build/fooco-1.0/.stamp_built] Error 1
package/pkg-generic.mk:289: recipe for target
'/root/buildroot-2022.02.1/output/build/fooco-1.0/.stamp_built' failed
I found that the make files that came with the kernel module are looking in several places for the kernel headers:
/lib/modules/${BUILD_KERNEL}/source \
/lib/modules/${BUILD_KERNEL}/build \
/usr/src/linux-${BUILD_KERNEL} \
/usr/src/linux-$(${BUILD_KERNEL} | sed 's/-.*//') \
/usr/src/kernel-headers-${BUILD_KERNEL} \
/usr/src/kernel-source-${BUILD_KERNEL} \
/usr/src/linux-$(${BUILD_KERNEL} | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
/usr/src/linux \
/usr/src/kernels/${BUILD_KERNEL} \
/usr/src/kernels
Why is the kernel source not visible to this build? I thought that, since Buildroot is building the kernel as part of the overall process, the header files would be available for subsequent kernel module compiles. Am I missing a setting? I feel that I'm not understanding the Buildroot process in a basic way, even after referring to the manual many times.
I'm using Buildroot 2022.02.1 and kernel 5.15.33.
Your download/extract logic is very convoluted. You should really use something like this:
FOO_SITE = /mnt/third-party/fooco
FOO_SOURCE = cust_kernel_drvr.zip
FOO_SITE_METHOD = file
define FOO_EXTRACT_CMDS
unzip $(FOO_DLDIR)/$(FOOCO_SOURCE) -d $(#D)
endef
Regarding the build issue: it is impossible to help without studying the specific build system of this kernel module. Very likely you will need to pass some environment variables to tell the build system where your kernel source code is located, and possibly other things. But without looking at the specific details, it's impossible to help you.
You can have a look at how standard out of tree kernel modules are handled by looking at the package/pkg-kernel-module.mk code. However, that will not be directly useful to a package like yours that uses a custom installation script.
The magic was the LINUX_DIR variable which, according to Buildroot user manual:
contains the path to where the Linux kernel has been extracted and built.
I was able to patch the install script to send this variable to the make file that was looking for the kernel.

make error while building GNU Octave from sources

mkdir .build && \
cd .build && \
./../configure --prefix=$HOME/my_octave && \ [1]
make -j2 && \ [2]
make check && \
make install
While running make -j2 I get the error as
error: print: error opening file 'extended.tex'
error: called from print>latex_standalone at line 1029 column 5
__opengl_print__ at line 214 column 5
print at line 759 column 16 plotimages at line 109 column 7
GEN doc/interpreter/gplot.pdfMakefile:27911: recipe for target `'doc/interpreter/extended.pdf' failedmake[2]: *** [doc/interpreter/extended.pdf] Error `1make[2]: *** Waiting for unfinished jobs....make[2]: Leaving directory `'/home/bhanu/octave/.build'Makefile:26305: recipe for target 'all-recursive' failedmake[1]: *** `[all-recursive] Error 1make[1]: Leaving directory '/home/bhanu/octave/.build'Makefile:9916:
recipe for target 'all' failedmake: *** [all] Error 2
Can someone help me solve the error? I am running it on Ubuntu 18.04 system.
Some times the build process tries to rebuild all the documentation.
I am building from the source octave-5.2.0.tar.lz file and
the usual workaround is just
touch AUTHORS BUGS INSTALL.OCTAVE
between configure and the first make in the
build tree.
At the end of build phase I have only two PDFs
./doc/interpreter/octave.pdf
./doc/liboctave/liboctave.pdf
Create file named 'extended.tex' like this:
touch doc/interpreter/extended.tex
You have to do this inside the octave/.build/ directory.
Do this for any errors similar to this in the future. It worked for me this way.

curl make error: "missing separator (did you mean TAB instead of 8 spaces?)"

I'm trying to build curl 7.38.0 on debian wheezy and keep getting this error after running ./configure.
$ make
Making all in lib
make[1]: Entering directory '/home/abc/curl-7.38.0/lib'
Makefile:2833: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
make[1]: Leaving directory '/home/abc/curl-7.38.0/lib'
Makefile:846: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I tried looking at/around lines 2833 or 846 to see if there were excess spaces, but I didn't find any problems. Everything looks fine, so I don't understand why there would be any problems. Any help much appreciated!
I've encountered this error a few times before. The error message can be misleading a bit. What I found was that the timestamps of the files in the source directory were messed up for me, so I used touch to update them.
touch ./*
If that doesn't work, try updating all of the files except the Makefile.
for i in ./*; do [[ $i != ./Makefile ]] && touch $i; done
Then run make, and the config.status should recheck and proceed with compilation.

How do I build camlp5-6.11 on Windows 8 under cygwin with OCaml 4.01.0?

I installed OCaml 4.01.0 from http://protz.github.io/ocaml-installer/. I am now trying to build camlp5-6.11. When I run ./configure && make world.opt in cygwin, I get
...
sed -e "s|#VERSION#|6.11|" -e "s|#CAMLP5DIR#|D:\OCaml\lib/camlp5|" META.tpl > META
make[2]: Leaving directory '/cygdrive/d/Downloads/camlp5-6.11/etc'
make[2]: Entering directory '/cygdrive/d/Downloads/camlp5-6.11/top'
ocamlrun.exe ../boot/camlp5r.exe -nolib -I ../boot -mode S -o camlp5_top.ppo camlp5_top.ml
ocamlc.opt -warn-error A -I ../main -I ../boot -I ../ocaml_stuff/4.01.0/utils -I ../ocaml_stuff/4.01.0/parsing -I D:OCamllib/compiler-libs -c -impl camlp5_top.ppo
File "camlp5_top.ml", line 51, characters 14-32:
Error: Unbound module Toploop
../config/Makefile:20: recipe for target 'camlp5_top.cmo' failed
make[2]: *** [camlp5_top.cmo] Error 2
make[2]: Leaving directory '/cygdrive/d/Downloads/camlp5-6.11/top'
Makefile:26: recipe for target 'out' failed
make[1]: *** [out] Error 2
make[1]: Leaving directory '/cygdrive/d/Downloads/camlp5-6.11'
Makefile:141: recipe for target 'world.opt' failed
make: *** [world.opt] Error 2
How do I fix this?
I suspect the Makefile of Camlp5 hasn't been tested on Windows. It probably doesn't deal properly with backslashes: indeed, in your output, I can see D:OCamllib/compiler-libs which leads me to think that the error lies on the Camlp5 side: the path should obviously be D:\OCaml\lib....
Little-known fact about windows: / works as a path separator just as well, so if that's an option, you could probably try to hardcode d:/ocaml/ somewhere in the Makefile as the root dir for your OCaml installation, but you'd also have to fix the Makefile to generate d:/ocaml/lib as the library directory.

OS X: Make failing due to space in path

I'm trying to install the FFI gem. The native extensions are not building. THe problem is in the make. If I so it manually, here's what I see:
RossRankins-MacBook-Pro:libffi Ross$ make
make "AR_FLAGS=" "CC_FOR_BUILD=" "CFLAGS=-g -O2" "CXXFLAGS=" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "JC1FLAGS=" "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make" "MAKEINFO=/bin/sh "/Volumes/Macintosh HD/Users/Ross/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.11/ext/ffi_c/libffi/missing" --run makeinfo " "PICFLAG=" "PICFLAG_FOR_TARGET=" "RUNTESTFLAGS=" "SHELL=/bin/sh" "exec_prefix=/usr/local" "infodir=/usr/local/share/info" "libdir=/usr/local/lib" "prefix=/usr/local" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld" "NM=/usr/bin/nm" "RANLIB=ranlib" "DESTDIR=" all-recursive
make[1]: *** No rule to make target `HD/Users/Ross/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.11/ext/ffi_c/libffi/missing --run makeinfo '. Stop.
make: *** [all] Error 2
As you can see it's truncating the Macintosh HD part of the path. I tried running the full command above but editing the path, and its not helping... Ideas?
Isn't the /Volumes/Macintosh HD/Users/... bit is also known as /Users/... ?
If so,
$ ls -id "/Volumes/Macintosh HD/Users"
$ ls -id /Users
should both give the same result, and you can just use the version with no space rather than fiddling about trying to quote it.

Resources