Make oldconfig error 127

make: *** [generate] Error 127 Maybe you will get the following error when you try to work with a go operator-sdk project you cloned from GitHub. Here we see that simply the bin directory with the needed controller-gen , kustomize and setup-envtest files, wasn’t created by operator-sdk commands. This blog post does address that […]

Содержание

  1. make: *** [generate] Error 127
  2. 1. Fast solution
  3. 2. Reproduce the problem
  4. Step 1: Clone a GO operator-sdk project from GitHub
  5. Step 2: Run make generate and get the error
  6. Step 3: Verify operator-sdk version
  7. 3. Fix the problem for now
  8. Step 1: Uninstall operator-sdk we installed with brew
  9. make oldconfig error

make: *** [generate] Error 127

Maybe you will get the following error when you try to work with a go operator-sdk project you cloned from GitHub.

Here we see that simply the bin directory with the needed controller-gen , kustomize and setup-envtest files, wasn’t created by operator-sdk commands.

This blog post does address that topic for a macOS operating system and is structured in following sections:

  1. Fast solution
  2. Reproduce the problem
  3. Fix the problem

1. Fast solution

In short words we need just to copy the bin directory from an existing operator-sdk project we have on our machine and past it into the cloned project and it will work for our cloned project.

But we will have problems, when we create new projects with that installation setup using brew install operator-sdk .
(even when this is my preferred way 😦 because I want to avoid FATA[0009] failed to create API: unable to run post-scaffold tasks of “base.go.kubebuilder.io/v3”: exit status 2)

2. Reproduce the problem

We are using the currently available operator SDK version 19.1.0 which we installed using brew as described in the operator-sdk documentation.

Step 1: Clone a GO operator-sdk project from GitHub

Step 2: Run make generate and get the error

As we will see, there are files and bin folder missing.

bin/controller-gen: No such file or directory

Step 3: Verify operator-sdk version

Ensure you have operator-sdk version: «v1.19.1» installed.

3. Fix the problem for now

We are using an Operator SDK version that worked before, in my case I used 18.0.0 successfully some time ago. As far as I remember, golang version 1.17.6 was related to operator-sdk 18.0.0 version.

Note: If you want to install an older Operator SDK version with brew, that won’t work as there is only one brew formulae, as I found out. I hope that the brew installation will be fixed in the future.

So, we will do the following sequence to fix the problem:

  1. Uninstall the operator-sdk we installed with brew
  2. Install operator-sdk 18.0.0 using the binaries and install golang in version go 1.17.6
  3. Verify does the creation of a new operator project now include the bin and the related files

Step 1: Uninstall operator-sdk we installed with brew

Follow the steps outlined in one of my blog posts, but only for uninstalling. The current version of the operator-sdk in brew is 1.19.1 .

Источник

make oldconfig error

make oldconfig
HOSTCC scripts/basic/fixdep
/bin/sh: 1: gcc: not found
scripts/Makefile.host:107: recipe for target ‘scripts/basic/fixdep’ failed
make[1]: *** [scripts/basic/fixdep] Error 127
Makefile:501: recipe for target ‘scripts_basic’ failed
make: *** [scripts_basic] Error 2
lnxvm@lnxvm-VirtualBox:

/D ocuments/k ernel/linu x-5.6.3$ sudo make oldconfig
HOSTCC scripts/basic/fixdep
/bin/sh: 1: gcc: not found
scripts/Makefile.host:107: recipe for target ‘scripts/basic/fixdep’ failed
make[1]: *** [scripts/basic/fixdep] Error 127
Makefile:501: recipe for target ‘scripts_basic’ failed
make: *** [scripts_basic] Error 2

make oldconfig
make: *** No rule to make target ‘oldconfig’. Stop.
lnxvm@lnxvm-VirtualBox:/bo ot$ sudo make oldconfig
[sudo] password for lnxvm:
make: *** No rule to make target ‘oldconfig’. Stop.

sudo apt-get -y install libssl-dev
[sudo] password for lnxvm:
Reading package lists. Done
Building dependency tree
Reading state information. Done
libssl-dev is already the newest version (1.1.1-1ubuntu2.1

18.04.5) .
The following packages were automatically installed and are no longer required:
fonts-liberation2 fonts-opensymbol gir1.2-geocodeglib-1.0 gir1.2-gst-plugins-base-1. 0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0
gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3 libboost-date-time1.65.1 libboost-filesystem1.65.1
libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2
libdazzle-1.0-0 libe-book-0.1-1 libedataserverui-1.2-2 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14
libfreerdp-client2-2 libfreerdp2-2 libgc1c2 libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6 libgpod-common libgpod4
liblangtag-common liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5 libraw16
librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5 libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss
lp-solve media-player-info python3-mako python3-markupsafe syslinux syslinux-common syslinux-legacy usb-creator-common
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 290 not upgraded.
lnxvm@lnxvm-VirtualBox:/$ sudo apt-get -y install libncurses5 libncurses5-dev
Reading package lists. Done
Building dependency tree
Reading state information. Done
libncurses5 is already the newest version (6.1-1ubuntu1.18.04).
libncurses5-dev is already the newest version (6.1-1ubuntu1.18.04).
The following packages were automatically installed and are no longer required:
fonts-liberation2 fonts-opensymbol gir1.2-geocodeglib-1.0 gir1.2-gst-plugins-base-1. 0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0
gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3 libboost-date-time1.65.1 libboost-filesystem1.65.1
libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2
libdazzle-1.0-0 libe-book-0.1-1 libedataserverui-1.2-2 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14
libfreerdp-client2-2 libfreerdp2-2 libgc1c2 libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6 libgpod-common libgpod4
liblangtag-common liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5 libraw16
librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5 libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss
lp-solve media-player-info python3-mako python3-markupsafe syslinux syslinux-common syslinux-legacy usb-creator-common
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 290 not upgraded.
lnxvm@lnxvm-VirtualBox:/$ sudo mkdir -p /usr/src/kernel
lnxvm@lnxvm-VirtualBox:/$ sudo chown -R lnxvm:lnxvm /usr/src/kernel
lnxvm@lnxvm-VirtualBox:/$ cd /usr/src/kernel
lnxvm@lnxvm-VirtualBox:/us r/src/kern el$ pwd
/usr/src/kernel
lnxvm@lnxvm-VirtualBox:/us r/src/kern el$ ls
linux-5.6.3
lnxvm@lnxvm-VirtualBox:/us r/src/kern el$ cd linux-5.6.3
lnxvm@lnxvm-VirtualBox:/us r/src/kern el/linux-5 .6.3$ cp /boot/config-5.0.0-23-gene ric .config
lnxvm@lnxvm-VirtualBox:/us r/src/kern el/linux-5 .6.3$ make menuconfig
HOSTCC scripts/basic/fixdep
/bin/sh: 1: gcc: not found
scripts/Makefile.host:107: recipe for target ‘scripts/basic/fixdep’ failed
make[1]: *** [scripts/basic/fixdep] Error 127
Makefile:501: recipe for target ‘scripts_basic’ failed
make: *** [scripts_basic] Error 2

You’ll install the gcc compiler package + your Distro’s equivalent of the build-essential package (if it’s not installed).

You must have gcc installed before you can build much of anything. especially the entire Kernel.

Building Kernels is complex.

Having a Kernel Crash can lose a great deal of data.

Debugging Kernel Crashes after custom builds can eat up a massive amount of time.

Tip: Rather than building the 5.0 Kernel on Bionic, might be good to wait 10 days till Focal releases, then you’ll have a 5.4 version of the Kernel installed by default.

lnxvm@lnxvm-VirtualBox:/$ sudo apt-get install manpages-dev
Reading package lists. Done
Building dependency tree
Reading state information. Done
manpages-dev is already the newest version (4.15-1).
manpages-dev set to manually installed.
The following packages were automatically installed and are no longer required:
fonts-liberation2 fonts-opensymbol gir1.2-geocodeglib-1.0 gir1.2-gst-plugins-base-1. 0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0
gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3 libboost-date-time1.65.1 libboost-filesystem1.65.1
libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2
libdazzle-1.0-0 libe-book-0.1-1 libedataserverui-1.2-2 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14
libfreerdp-client2-2 libfreerdp2-2 libgc1c2 libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6 libgpod-common libgpod4
liblangtag-common liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5 libraw16
librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5 libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss
lp-solve media-player-info python3-mako python3-markupsafe syslinux syslinux-common syslinux-legacy usb-creator-common
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 282 not upgraded.
lnxvm@lnxvm-VirtualBox:/$ gcc —version
gcc (Ubuntu 7.5.0-3ubuntu1

18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

am geting
lnxvm@lnxvm-VirtualBox:/us r/src/kern el/linux-5 .6.3$ make menuconfig
HOSTCC scripts/basic/fixdep
UPD scripts/kconfig/mconf-cfg
HOSTCC scripts/kconfig/mconf.o
HOSTCC scripts/kconfig/lxdialog/c hecklist.o
HOSTCC scripts/kconfig/lxdialog/i nputbox.o
HOSTCC scripts/kconfig/lxdialog/m enubox.o
HOSTCC scripts/kconfig/lxdialog/t extbox.o
HOSTCC scripts/kconfig/lxdialog/u til.o
HOSTCC scripts/kconfig/lxdialog/y esno.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex. c
/bin/sh: 1: flex: not found
scripts/Makefile.host:9: recipe for target ‘scripts/kconfig/lexer.lex .c’ failed
make[1]: *** [scripts/kconfig/lexer.lex .c] Error 127
Makefile:568: recipe for target ‘menuconfig’ failed
make: *** [menuconfig] Error 2

flex installation used to take time.

I like the comment from David Favor
>> Building Kernels is complex.
>> Having a Kernel Crash can lose a great deal of data.
Hence better have a backup before proceeding the same.

I am unable to reproduce your error
for your information:

This is where all Ubuntu Kernel builds live, before they’re rolled into Distros.

You can even download a prebuild 5.6.4 + even a 5.7 Beta Kernel from this archive.

sudo apt-get -y install flex
Reading package lists. Done
Building dependency tree
Reading state information. Done
The following packages were automatically installed and are no longer required:
fonts-liberation2 fonts-opensymbol gir1.2-geocodeglib-1.0
gir1.2-gst-plugins-base-1. 0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0
gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3
libboost-date-time1.65.1 libboost-filesystem1.65.1 libboost-iostreams1.65.1
libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5
libclucene-core1v5 libcmis-0.5-5v5 libcolamd2 libdazzle-1.0-0
libe-book-0.1-1 libedataserverui-1.2-2 libeot0 libepubgen-0.1-1
libetonyek-0.1-1 libevent-2.1-6 libexiv2-14 libfreerdp-client2-2
libfreerdp2-2 libgc1c2 libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6
libgpod-common libgpod4 liblangtag-common liblangtag1 liblirc-client0
liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5
libraw16 librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5
libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss lp-solve
media-player-info python3-mako python3-markupsafe syslinux syslinux-common
syslinux-legacy usb-creator-common
Use ‘sudo apt autoremove’ to remove them.
The following additional packages will be installed:
libfl-dev libfl2 libsigsegv2 m4
Suggested packages:
bison flex-doc m4-doc
The following NEW packages will be installed:
flex libfl-dev libfl2 libsigsegv2 m4
0 upgraded, 5 newly installed, 0 to remove and 284 not upgraded.
Need to get 545 kB of archives.
After this operation, 1,511 kB of additional disk space will be used.
Get:1 http://za.archive.ubuntu.com/ubuntu bionic/main amd64 libsigsegv2 amd64 2.12-1 [14.7 kB]
Get:2 http://za.archive.ubuntu.com/ubuntu bionic/main amd64 m4 amd64 1.4.18-1 [197 kB]
Get:3 http://za.archive.ubuntu.com/ubuntu bionic/main amd64 flex amd64 2.6.4-6 [316 kB]
Get:4 http://za.archive.ubuntu.com/ubuntu bionic/main amd64 libfl2 amd64 2.6.4-6 [11.4 kB]
Get:5 http://za.archive.ubuntu.com/ubuntu bionic/main amd64 libfl-dev amd64 2.6.4-6 [6,320 B]
Fetched 545 kB in 1s (418 kB/s)
Selecting previously unselected package libsigsegv2:amd64.
(Reading database . 122333 files and directories currently installed.)
Preparing to unpack . /libsigsegv2_2.12-1_amd 64.deb .
Unpacking libsigsegv2:amd64 (2.12-1) .
Selecting previously unselected package m4.
Preparing to unpack . /archives/m4_1.4.18-1_a md64.deb .
Unpacking m4 (1.4.18-1) .
Selecting previously unselected package flex.
Preparing to unpack . /flex_2.6.4-6_amd64.deb .
Unpacking flex (2.6.4-6) .
Selecting previously unselected package libfl2:amd64.
Preparing to unpack . /libfl2_2.6.4-6_amd64.d eb .
Unpacking libfl2:amd64 (2.6.4-6) .
Selecting previously unselected package libfl-dev:amd64.
Preparing to unpack . /libfl-dev_2.6.4-6_amd6 4.deb .
Unpacking libfl-dev:amd64 (2.6.4-6) .
Setting up libsigsegv2:amd64 (2.12-1) .
Processing triggers for install-info (6.5.0.dfsg.1-2) .
Setting up m4 (1.4.18-1) .
Processing triggers for libc-bin (2.27-3ubuntu1) .
Setting up libfl2:amd64 (2.6.4-6) .
Processing triggers for man-db (2.8.3-2ubuntu0.1) .
Setting up flex (2.6.4-6) .
Setting up libfl-dev:amd64 (2.6.4-6) .
Processing triggers for libc-bin (2.27-3ubuntu1) .
lnxvm@lnxvm-VirtualBox:/us r/src/kern el$ make oldconfig
make: *** No rule to make target ‘oldconfig’. Stop.
lnxvm@lnxvm-VirtualBox:/us r/src/kern el$ make menuconfig
make: *** No rule to make target ‘menuconfig’. Stop.

ASKER CERTIFIED SOLUTION

lnxvm@lnxvm-VirtualBox:/us r/src/kern el/linux-5 .6.3$ ls -ltr
total 808
drwxrwxr-x 4 lnxvm lnxvm 4096 Apr 8 09:11 virt
drwxrwxr-x 3 lnxvm lnxvm 4096 Apr 8 09:11 usr
drwxrwxr-x 36 lnxvm lnxvm 4096 Apr 8 09:11 tools
drwxrwxr-x 26 lnxvm lnxvm 4096 Apr 8 09:11 sound
drwxrwxr-x 12 lnxvm lnxvm 4096 Apr 8 09:11 security
drwxrwxr-x 15 lnxvm lnxvm 4096 Apr 8 09:11 scripts
drwxrwxr-x 30 lnxvm lnxvm 4096 Apr 8 09:11 samples
-rw-rw-r— 1 lnxvm lnxvm 727 Apr 8 09:11 README
drwxrwxr-x 72 lnxvm lnxvm 4096 Apr 8 09:11 net
drwxrwxr-x 3 lnxvm lnxvm 4096 Apr 8 09:11 mm
-rw-rw-r— 1 lnxvm lnxvm 60410 Apr 8 09:11 Makefile
-rw-rw-r— 1 lnxvm lnxvm 545614 Apr 8 09:11 MAINTAINERS
drwxrwxr-x 6 lnxvm lnxvm 4096 Apr 8 09:11 LICENSES
drwxrwxr-x 20 lnxvm lnxvm 12288 Apr 8 09:11 lib
drwxrwxr-x 18 lnxvm lnxvm 4096 Apr 8 09:11 kernel
-rw-rw-r— 1 lnxvm lnxvm 595 Apr 8 09:11 Kconfig
-rw-rw-r— 1 lnxvm lnxvm 1327 Apr 8 09:11 Kbuild
drwxrwxr-x 2 lnxvm lnxvm 4096 Apr 8 09:11 ipc
drwxrwxr-x 2 lnxvm lnxvm 4096 Apr 8 09:11 init
drwxrwxr-x 28 lnxvm lnxvm 4096 Apr 8 09:11 include
drwxrwxr-x 78 lnxvm lnxvm 4096 Apr 8 09:11 fs
drwxrwxr-x 138 lnxvm lnxvm 4096 Apr 8 09:11 drivers
drwxrwxr-x 81 lnxvm lnxvm 4096 Apr 8 09:11 Documentation
drwxrwxr-x 4 lnxvm lnxvm 4096 Apr 8 09:11 crypto
-rw-rw-r— 1 lnxvm lnxvm 99724 Apr 8 09:11 CREDITS
-rw-rw-r— 1 lnxvm lnxvm 496 Apr 8 09:11 COPYING
drwxrwxr-x 2 lnxvm lnxvm 4096 Apr 8 09:11 certs
drwxrwxr-x 3 lnxvm lnxvm 4096 Apr 8 09:11 block
drwxrwxr-x 27 lnxvm lnxvm 4096 Apr 8 09:11 arch
lnxvm@lnxvm-VirtualBox:/us r/src/kern el/linux-5 .6.3$ make help
Cleaning targets:
clean — Remove most generated files but keep the config and
enough build support to build external modules
mrproper — Remove all generated files + config + various backup files
distclean — mrproper + remove editor backup and patch files

Configuration targets:
config — Update current config utilising a line-oriented program
nconfig — Update current config utilising a ncurses menu based program
menuconfig — Update current config utilising a menu based program
xconfig — Update current config utilising a Qt based front-end
gconfig — Update current config utilising a GTK+ based front-end
oldconfig — Update current config utilising a provided .config as base
localmodconfig — Update current config disabling modules not loaded
localyesconfig — Update current config converting local mods to core
defconfig — New config with default from ARCH supplied defconfig
savedefconfig — Save current config as ./defconfig (minimal config)
allnoconfig — New config where all options are answered with no
allyesconfig — New config where all options are accepted with yes
allmodconfig — New config selecting modules when possible
alldefconfig — New config with all symbols set to default
randconfig — New config with random answer to all options
yes2modconfig — Change answers from yes to mod if possible
mod2yesconfig — Change answers from mod to yes if possible
listnewconfig — List new options
helpnewconfig — List new options and help text
olddefconfig — Same as oldconfig but sets new symbols to their
default value without prompting
kvmconfig — Enable additional options for kvm guest kernel support
xenconfig — Enable additional options for xen dom0 and guest kernel
support
tinyconfig — Configure the tiniest possible kernel
testconfig — Run Kconfig unit tests (requires python3 and pytest)

Other generic targets:
all — Build all targets marked with [*]
* vmlinux — Build the bare kernel
* modules — Build all modules
modules_install — Install all modules to INSTALL_MOD_PATH (default: /)
dir/ — Build all files in dir and below
dir/file.[ois] — Build specified target only
dir/file.ll — Build the LLVM assembly file
(requires compiler support for LLVM assembly generation)
dir/file.lst — Build specified mixed source/assembly target only
(requires a recent binutils and recent build (System.map))
dir/file.ko — Build module including final link
modules_prepare — Set up for building external modules
tags/TAGS — Generate tags file for editors
cscope — Generate cscope index
gtags — Generate GNU GLOBAL index
kernelrelease — Output the release version string (use with make -s)
kernelversion — Output the version stored in Makefile (use with make -s)
image_name — Output the image name (use with make -s)
headers_install — Install sanitised kernel headers to INSTALL_HDR_PATH
(default: ./usr)

Static analysers:
checkstack — Generate a list of stack hogs
namespacecheck — Name space analysis on compiled kernel
versioncheck — Sanity check on version.h usage
includecheck — Check for duplicate included header files
export_report — List the usages of all exported symbols
headerdep — Detect inclusion cycles in headers
coccicheck — Check with Coccinelle

Tools:
nsdeps — Generate missing symbol namespace dependencies

Kernel selftest:
kselftest — Build and run kernel selftest (run as root)
Build, install, and boot kernel before
running kselftest on it
kselftest-clean — Remove all generated kselftest files
kselftest-merge — Merge all the config dependencies of kselftest to existing
.config.

Userspace tools targets:
use «make tools/help»
or «cd tools; make help»

Kernel packaging:
rpm-pkg — Build both source and binary RPM kernel packages
binrpm-pkg — Build only the binary kernel RPM package
deb-pkg — Build both source and binary deb kernel packages
bindeb-pkg — Build only the binary kernel deb package
snap-pkg — Build only the binary kernel snap package
(will connect to external hosts)
dir-pkg — Build the kernel as a plain directory structure
tar-pkg — Build the kernel as an uncompressed tarball
targz-pkg — Build the kernel as a gzip compressed tarball
tarbz2-pkg — Build the kernel as a bzip2 compressed tarball
tarxz-pkg — Build the kernel as a xz compressed tarball
perf-tar-src-pkg — Build perf-5.6.3.tar source tarball
perf-targz-src-pkg — Build perf-5.6.3.tar.gz source tarball
perf-tarbz2-src-pkg — Build perf-5.6.3.tar.bz2 source tarball
perf-tarxz-src-pkg — Build perf-5.6.3.tar.xz source tarball

Documentation targets:
Linux kernel internal documentation in different formats from ReST:
htmldocs — HTML
latexdocs — LaTeX
pdfdocs — PDF
epubdocs — EPUB
xmldocs — XML
linkcheckdocs — check for broken external links
(will connect to external hosts)
refcheckdocs — check for references to non-existing files under
Documentation
cleandocs — clean all generated files

make SPHINXDIRS=»s1 s2″ [target] Generate only docs of folder s1, s2
valid values for SPHINXDIRS are: hwmon vm openrisc sh leds virt mips arm64 powerpc driver-api accounting RCU target dev-tools timers power networking input cdrom infiniband sound media core-api w1 pcmcia netlabel riscv kbuild userspace-api watchdog s390 filesystems fb livepatch hid kernel-hacking arm translations scheduler m68k firmware-guide isdn x86 doc-guide block locking spi usb maintainer process sparc PCI bpf security xtensa misc-devices fault-injection mic parisc ia64 i2c gpu fpga admin-guide trace ide crypto iio

make SPHINX_CONF= [target] use *additional* sphinx-build
configuration. This is e.g. useful to build with nit-picking config.

Default location for the generated documents is Documentation/output

Architecture specific targets (x86):
* bzImage — Compressed kernel image (arch/x86/boot/bzImage)
install — Install kernel using
(your)

/bin/installkernel or
(distribution) /sbin/installkernel or
install to $(INSTALL_PATH) and run lilo
fdimage — Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
fdimage144 — Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
fdimage288 — Create 2.8MB boot floppy image (arch/x86/boot/fdimage)
isoimage — Create a boot CD-ROM image (arch/x86/boot/image.iso)
bzdisk/fdimage*/isoimage also accept:
FDARGS=». » arguments for the booted kernel
FDINITRD=file initrd for the booted kernel

i386_defconfig — Build for i386
x86_64_defconfig — Build for x86_64

make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
make V=2 [targets] 2 => give reason for rebuild of target
make O=dir [targets] Locate all output files in «dir», including .config
make C=1 [targets] Check re-compiled c source with $CHECK
(sparse by default)
make C=2 [targets] Force check of all c source with $CHECK
make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections
make W=n [targets] Enable extra build checks, n=1,2,3 where
1: warnings which may be relevant and do not occur too often
2: warnings which occur quite often but may still be relevant
3: more obscure warnings, can most likely be ignored
Multiple levels can be combined with W=12 or W=123

Execute «make» or «make all» to build all targets marked with [*]
For further info see the ./README file
lnxvm@lnxvm-VirtualBox:/us r/src/kern el/linux-5 .6.3$

Источник

This semester I got this new subject where we get to work with Discovery STM32 F4, and we are still in the phase of setting it up. But I have this problem in the beginning.

When I try to compile this «blink» code I get this error:

Error 127

So, as I got it so far, we are using this shortcut command «make» to compile code, and we were given instruction to set it up as it’s shown in images below:

Setup]

Can anyone see what’s the problem here?

Paolo's user avatar

Paolo

18k6 gold badges33 silver badges62 bronze badges

asked Apr 1, 2016 at 20:59

Emir's user avatar

4

Error 127 means one of two things:

  1. file not found: the path you’re using is incorrect. double check that the program is actually in your $PATH, or in this case, the relative path is correct — remember that the current working directory for a random terminal might not be the same for the IDE you’re using. it might be better to just use an absolute path instead.
  2. ldso is not found: you’re using a pre-compiled binary and it wants an interpreter that isn’t on your system. maybe you’re using an x86_64 (64-bit) distro, but the prebuilt is for x86 (32-bit). you can determine whether this is the answer by opening a terminal and attempting to execute it directly. or by running file -L on /bin/sh (to get your default/native format) and on the compiler itself (to see what format it is).

if the problem is (2), then you can solve it in a few diff ways:

  1. get a better binary. talk to the vendor that gave you the toolchain and ask them for one that doesn’t suck.
  2. see if your distro can install the multilib set of files. most x86_64 64-bit distros allow you to install x86 32-bit libraries in parallel.
  3. build your own cross-compiler using something like crosstool-ng.
  4. you could switch between an x86_64 & x86 install, but that seems a bit drastic ;).

answered Apr 2, 2016 at 1:02

Mike Frysinger's user avatar

Mike FrysingerMike Frysinger

2,6901 gold badge21 silver badges24 bronze badges

2

error

make oldconfig
  HOSTCC  scripts/basic/fixdep
/bin/sh: 1: gcc: not found
scripts/Makefile.host:107: recipe for target ‘scripts/basic/fixdep’ failed
make[1]: *** [scripts/basic/fixdep] Error 127
Makefile:501: recipe for target ‘scripts_basic’ failed
make: *** [scripts_basic] Error 2
lnxvm@lnxvm-VirtualBox:~/Documents/kernel/linux-5.6.3$ sudo make oldconfig
  HOSTCC  scripts/basic/fixdep
/bin/sh: 1: gcc: not found
scripts/Makefile.host:107: recipe for target ‘scripts/basic/fixdep’ failed
make[1]: *** [scripts/basic/fixdep] Error 127
Makefile:501: recipe for target ‘scripts_basic’ failed
make: *** [scripts_basic] Error 2

make oldconfig
make: *** No rule to make target ‘oldconfig’.  Stop.
lnxvm@lnxvm-VirtualBox:/boot$ sudo make oldconfig
[sudo] password for lnxvm:
make: *** No rule to make target ‘oldconfig’.  Stop.

i also id this

sudo apt-get -y install libssl-dev
[sudo] password for lnxvm:
Reading package lists… Done
Building dependency tree
Reading state information… Done
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.5).
The following packages were automatically installed and are no longer required:
  fonts-liberation2 fonts-opensymbol gir1.2-geocodeglib-1.0 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0
  gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3 libboost-date-time1.65.1 libboost-filesystem1.65.1
  libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2
  libdazzle-1.0-0 libe-book-0.1-1 libedataserverui-1.2-2 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14
  libfreerdp-client2-2 libfreerdp2-2 libgc1c2 libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6 libgpod-common libgpod4
  liblangtag-common liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5 libraw16
  librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5 libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss
  lp-solve media-player-info python3-mako python3-markupsafe syslinux syslinux-common syslinux-legacy usb-creator-common
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 290 not upgraded.
lnxvm@lnxvm-VirtualBox:/$ sudo apt-get -y install libncurses5 libncurses5-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
libncurses5 is already the newest version (6.1-1ubuntu1.18.04).
libncurses5-dev is already the newest version (6.1-1ubuntu1.18.04).
The following packages were automatically installed and are no longer required:
  fonts-liberation2 fonts-opensymbol gir1.2-geocodeglib-1.0 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0
  gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3 libboost-date-time1.65.1 libboost-filesystem1.65.1
  libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2
  libdazzle-1.0-0 libe-book-0.1-1 libedataserverui-1.2-2 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14
  libfreerdp-client2-2 libfreerdp2-2 libgc1c2 libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6 libgpod-common libgpod4
  liblangtag-common liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5 libraw16
  librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5 libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss
  lp-solve media-player-info python3-mako python3-markupsafe syslinux syslinux-common syslinux-legacy usb-creator-common
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 290 not upgraded.
lnxvm@lnxvm-VirtualBox:/$ sudo mkdir -p /usr/src/kernel
lnxvm@lnxvm-VirtualBox:/$ sudo chown -R lnxvm:lnxvm /usr/src/kernel
lnxvm@lnxvm-VirtualBox:/$ cd /usr/src/kernel
lnxvm@lnxvm-VirtualBox:/usr/src/kernel$ pwd
/usr/src/kernel
lnxvm@lnxvm-VirtualBox:/usr/src/kernel$ ls
linux-5.6.3
lnxvm@lnxvm-VirtualBox:/usr/src/kernel$ cd linux-5.6.3
lnxvm@lnxvm-VirtualBox:/usr/src/kernel/linux-5.6.3$ cp /boot/config-5.0.0-23-generic .config
lnxvm@lnxvm-VirtualBox:/usr/src/kernel/linux-5.6.3$ make menuconfig
  HOSTCC  scripts/basic/fixdep
/bin/sh: 1: gcc: not found
scripts/Makefile.host:107: recipe for target ‘scripts/basic/fixdep’ failed
make[1]: *** [scripts/basic/fixdep] Error 127
Makefile:501: recipe for target ‘scripts_basic’ failed
make: *** [scripts_basic] Error 2

LinuxLinux NetworkingLinux OS DevUnix OSLinux Distributions

I am trying to install shc on Ubuntu 18.04

wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
tar xvfz shc-3.8.9.tgz
cd shc-3.8.9
make

But receive the following error:

cc -Wall  shc.c -o shc
make: cc: Command not found
makefile:31: recipe for target 'shc' failed
make: *** [shc] Error 127

The makefile:

# Makefile
#

INSTALL_PATH = /usr/local

# For SCO
CFLAGS = -b elf -O -D_SVID

# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0

# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa

# For HPUX
CFLAGS = -Wall -O -Ae

# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0

# For GNU C compiler
CFLAGS = -Wall # -O6 -pedantic

#SHELL = /bin/sh

SHCFLAGS = -v -T # Add -T option to allow binary to be traceable

all: shc ask_for_test

shc: shc.c
    $(CC) $(CFLAGS) $@.c -o $@

ask_for_test:
    @echo '***  �Do you want to probe shc with a test script?'
    @echo '***  Please try...   make test'

test: make_the_test ask_for_strings

make_the_test: match.x
    @echo '***  Running a compiled test script!'
    @echo '***  It must show files with substring "sh" in your PATH...'
    ./match.x sh

match.x: shc match
    @echo '***  Compiling script "match"'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -f match

ask_for_strings:
    @echo '***  �Do you want to see strings in the generated binary?'
    @echo '***  Please try...   make strings'

strings: make_the_strings ask_for_expiration

make_the_strings: match.x
    @echo '***  Running: "strings -n 5 'match.x'"'
    @echo '***  It must show no sensible information...'
    strings -n 5 match.x

ask_for_expiration:
    @echo '***  �Do you want to probe expiration date?'
    @echo '***  Please try...   make expiration'

expiration: til_yesterday ask_for_install

til_yesterday: shc match
    @echo '***  Compiling "match" to expired date'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -vv -e `date "+%d/%m/%Y"` -f match
    @echo '***  Running a compiled test script!'
    @echo '***  It must fail showing "./match.x: has expired!"'
    ./match.x

ask_for_install:
    @echo '***  �Do you want to install shc?'
    @echo '***  Please try...   make install'

install: shc
    @echo '***  Installing shc and shc.1 on '$(INSTALL_PATH)
    @echo -n '***   �Do you want to continue? '; read ANS; case "$$ANS" in y|Y|yes|Yes|YES) ;; *) exit 1;; esac;
    install -c -s shc $(INSTALL_PATH)/bin/
    install -c -m 644 shc.1 $(INSTALL_PATH)/man/man1/

clean:
    rm -f *.o *~ *.x.c

cleanall: clean
    rm -f shc *.x

I have no idea how to fix this error. Can anyone help?

mature's user avatar

mature

3,7199 gold badges29 silver badges64 bronze badges

asked Nov 22, 2018 at 17:24

2

cc is an alias for the GNU C compiler (gcc). You can install it as follows:

 sudo apt install gcc

If, for some reason, the gcc compiler is already installed, but the symbolic link /usr/bin/cc is missing, you can also do:

 make CC=gcc

answered Nov 22, 2018 at 18:07

Peter Selinger's user avatar

1

sudo apt install build-essential

This will install a C compiler (providing the cc command) as well as other tools that you may need for building software from source.

answered Nov 22, 2018 at 19:39

Mark's user avatar

MarkMark

5724 silver badges13 bronze badges

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • make Error 127
  • Печать

Страницы: [1]   Вниз

Тема: make Error 127  (Прочитано 6864 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
w2e

Ubuntu 12.04
трей
—————————————————————————

000@1000:~/dd/dir320$ make kernel_menuconfig
make[1]: Entering directory `/home/000/dd/dir320/target/linux'
make[2]: Entering directory `/home/000/dd/dir320/target/linux/brcm47xx'
if [ -s "/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27/patches/series" ]; then (cd "/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27"; if quilt --quiltrc=- next >/dev/null 2>&1; then quilt --quiltrc=- push -a; else quilt --quiltrc=- top >/dev/null 2>&1; fi ); fi
make[2]: *** [/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27/.quilt_checked] Error 127
make[2]: Leaving directory `/home/000/dd/dir320/target/linux/brcm47xx'
make[1]: *** [menuconfig] Error 2
make[1]: Leaving directory `/home/000/dd/dir320/target/linux'
make: *** [kernel_menuconfig] Ошибка 2
что  делать?  кто нить знает?


Пользователь решил продолжить мысль 30 Июня 2012, 16:59:41:


проблема решена  не хватала пакета quilt.

« Последнее редактирование: 30 Июня 2012, 16:59:41 от w2e »


Оффлайн
victor00000


  • Печать

Страницы: [1]   Вверх

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • make Error 127

SMF 2.0.19 |
SMF © 2011, Simple Machines | Карта форума

Страница сгенерирована за 0.054 секунд. Запросов: 25.

Обновлено Обновлено: 12.05.2022
Опубликовано Опубликовано: 04.03.2019

Ядро операционной системы является основным ее элементом — оно выполняет функции распределения ресурсов и предоставления интерфейса для взаимодействия с оборудованием. Из соображений безопасности или обеспечения корректной работы современного оборудования может возникнуть необходимость обновления ядра.

Смотрим версию ядра
Устанавливаем новое ядро
    С помощью менеджера пакетов
    Вручную
Загружаем систему с нужной версии ядра
Что делать, если система перестала загружаться
Удаление ядра из системы
Решение проблем

1. Проверка текущей версии ядра

Перед обновлением необходимо убедиться, что текущая версия ядра уже не обновлена. Это выполняется командой:

uname -r

Пример ответа:

3.10.0-862.2.3.el7.x86_64

* в данном примере установлено ядро версии 3.10.0.

2. Установка ядра

Перед обновлением ядра, необходимо обновить саму систему:

yum update

После стоит перезагрузить систему:

shutdown -r now

Далее у нас на выбор два способа обновления ядра — с использованием репозитория или вручную, скачав исходник с kernel.org.

С помощью yum

Самый быстрый и безопасный способ обновить ядро CentOS — воспользоваться автоматической установкой из репозитория. Минусом тут является то, что можно установить только ту версию, которая имеется в наличие в данном репозитории.

Последняя версии ядра для CentOS находится в репозитории ELRepo (не путать с EPEL). Сначала устанавливаем его.

Переходим на веб-страницу elrepo.org и копируем ссылку на последнюю версию репозитория для нашей версии операционной системы, например:

Ссылка на последнюю версию репозитория ELRepo

Импортируем ключ репозитория:

rpm —import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

Воспользовавшись ссылкой, устанавливаем сам репозиторий:

yum install https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

* список установленных репозиториев можно посмотреть командой yum repolist.

Теперь можно установить ядро:

yum —enablerepo=elrepo-kernel install kernel-ml

Ручное обновление

Чаще всего, администратор пользуется встроенными в сборку Linux инструментами (как описано выше) — это безопаснее и проще. Однако, если нужной версии ядра нет в репозитории или мы хотим установить тестовую версию, необходима ручная установка.

Ручная установка неадаптированного для определенной сборки Linux ядра — потенциальный риск для системы. Обновление стоит проводить сначала в тестовой среде, а также выполнить резервное копирование всех важных данных.

Для начала переходим на сайт kernel.org и копируем ссылку на нужную версию ядра Linux:

Ссылка на скачивание ядра Linux

* в данном примере мы скопировали ссылку на нестабильную версию ядра 5.0.

Воспользовавшись ссылкой, скачиваем ядро на компьютер с Linux:

wget https://git.kernel.org/torvalds/t/linux-5.0-rc8.tar.gz

* если система вернет ошибку, нужно установить wget — yum install wget.

Распаковываем скачанный архив:

tar -xvf linux-5.0-rc8.tar.gz -C /usr/src

* в данном примере мы распаковываем архив linux-5.0-rc8.tar.gz в каталог /usr/src.

Переходим в каталог, куда распаковали исходник ядра:

cd /usr/src/linux-5.0-rc8/

Устанавливаем инструменты для компиляции пакетов:

yum groupinstall «Development Tools»

yum install ncurses-devel openssl-devel bc

Создаем свою конфигурацию для ядра:

make menuconfig

Или используем текущую конфигурацию для ядра:

make oldconfig

На все вопросы, которые задает система можно отвечать нажатием Enter, чтобы принимать значения по умолчанию.

Компилируем ядро:

make

* процедура может занять много времени.

После устанавливаем ядро и модули:

make modules_install install

3. Применение нового ядра

Хорошей идеей после установки нового ядра будет его проверка. Перезагружаем систему и в окне со списком вариантов загрузки, выбираем с использованием нового ядра.

После загрузки системы тестируем ее, и если все работает, корректно, настраиваем систему на автоматический выбор нужной нам версии.

Чтобы система грузилась с использованием нового ядра, необходимо внести изменения в GRUB:

vi /etc/default/grub


GRUB_DEFAULT=0

* данной настройкой мы говорим загрузчику использовать первое ядро для загрузки (первым идет последнее по версии ядро).

Применяем настройки для grub:

grub2-mkconfig -o /boot/grub2/grub.cfg

Можно перезагружать компьютер:

shutdown -r now

После загрузки проверяем текущую версию ядра:

uname -r

Если система не загружается после обновления ядра

При установке новой версии ядра, старые версии тоже сохраняются и их можно выбрать при загрузке CentOS.

Если управление осуществляется удаленно по SSH, мы должны подключить монитор к компьютеру и включить его. В процессе загрузки выскочит окно со списком систем:

Ссылка на скачивание ядра Linux

Выбираем вариант загрузки с предыдущей версией ядра.

Удаление ядра

Рассмотрим несколько сценариев удаления ядра.

1. Удалить конкретную версию.

Выводим список ядер, установленных в системе:

rpm -qa | grep kernel-

Удаляем ядро командой, на подобие:

yum remove kernel-ml-5.17.6-1.el7.elrepo.x86_64

* где kernel-ml-5.17.6-1.el7.elrepo.x86_64 — ядро в системе, которое будет удалено.

Важно загрузить систему под другой версией ядра, чтобы при удалении не возникло проблем.

2. Чистка системы от устаревших версий ядер.

Мы можем удалить ядра, которые устарели в нашей системе. Для жтого нам нужна утилита yum-utils:

yum install yum-utils

После вводим:

package-cleanup —oldkernels —count=2

* в данном примере мы удалим все ядра, оставив по версии последних два.

Возможные ошибки

1. Фатальная ошибка: <путь до файла>: Нет такого файла или каталога.

Например: 

Причина: в системе не установлен один из пакетов, содержащий необходимые библиотеки.

Решение: необходимо воспользоваться поисковиком, чтобы определить, какой именно пакет необходим для продолжения установки и воспользоваться командой yum install <имя пакета> для его установки.

2. [<путь до файла>] Ошибка 127

Например: [include/generated/timeconst.h] Ошибка 127

Причина: как и с предыдущей ошибкой, в системе не установлен один из пакетов, содержащий необходимые библиотеки.

Решение: аналогично предыдущему примеру решения проблемы, необходимо воспользоваться поисковиком, чтобы определить, какой именно пакет необходим для продолжения установки и воспользоваться командой yum install <имя пакета> для его установки.

Понравилась статья? Поделить с друзьями:
  • Make no rule to make target install stop ошибка
  • Make modules error 2
  • Main impersonatewrapper cpp error wtsqueryusertoken error 1008
  • Main filter error failed to create video converter
  • Main file data integrity crc error