30 May, 2018
1 commit
-
[ Upstream commit f8437520704cfd9cc442a99d73ed708a3cdadaf9 ]
Since d5d332d3f7e8, a couple of links in scripts/dtc/include-prefixes
are additionally required in order to build device trees with the header
package.Signed-off-by: Jan Kiszka
Reviewed-by: Riku Voipio
Signed-off-by: Masahiro Yamada
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
13 Feb, 2018
1 commit
-
commit af60e207087975d069858741c44ed4f450330ac4 upstream.
If build fails during (bin)rpm-pkg, the spec file is not cleaned by
anyone until the next successful build of the package.We do not have to immediately delete the spec file in case somebody
may want to take a look at it. Instead, make them ignored by git,
and cleaned up by make mrproper.Signed-off-by: Masahiro Yamada
Signed-off-by: Greg Kroah-Hartman
14 Dec, 2017
2 commits
-
[ Upstream commit 606625be47bc87b6fab0af10cd57aaa675cb9e42 ]
If "make rpm-pkg" or "make binrpm-pkg" is run with -j[jobs] option,
the following warning message is displayed.warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
Follow the suggestion.
Signed-off-by: Masahiro Yamada
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
[ Upstream commit 2dbc644ac62bbcb9ee78e84719953f611be0413d ]
For rpm-pkg and deb-pkg, a source tar file is created. All paths in
the archive must be prefixed with the base name of the tar so that
everything is contained in the directory when you extract it.Currently, scripts/package/Makefile uses a symlink for that, and
removes it after the tar is created.If you terminate the build during the tar creation, the symlink is
left over. Then, at the next package build, you will see a warning
like follows:ln: '.' and 'kernel-4.14.0+/.' are the same file
It is possible to fix it by adding -n (--no-dereference) option to
the "ln" command, but a cleaner way is to use --transform option
of "tar" command. This option is GNU extension, but it should not
hurt to use it in the Linux build system.The 'S' flag is needed to exclude symlinks from the path fixup.
Without it, symlinks in the kernel are broken.Signed-off-by: Masahiro Yamada
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
20 Sep, 2017
3 commits
-
The "Release:" field of the spec file is determined based on the
.version file.However, the .version file is not copied to the source tar file.
So, when we build the kernel from the source package, the UTS_VERSION
always indicates #1. This does not match with "rpm -q".The kernel UTS_VERSION and "rpm -q" do not agree for binrpm-pkg, either.
Please note the kernel has already been built before the spec file is
created. Currently, mkspec invokes mkversion. This script returns an
incremented version. So, the "Release:" field of the spec file is
greater than the version in the kernel by one.For the source package build (where .version file is missing), we can
give KBUILD_BUILD_VERSION=%{release} to the build command.For the binary package build, we can simply read out the .version file
because it contains the version number that was used for building the
kernel image.We can remove scripts/mkversion because scripts/package/Makefile need
not touch the .version file.Signed-off-by: Masahiro Yamada
-
Commit 5620a0d1aacd ("firmware: delete in-kernel firmware") deleted
in-kernel firmware support, including the firmware install command.So, the firmware package does not make sense any more. Remove it.
Signed-off-by: Masahiro Yamada
Reviewed-by: Riku Voipio
Acked-by: Greg Kroah-Hartman -
Commit 5620a0d1aacd ("firmware: delete in-kernel firmware") deleted
in-kernel firmware support, including "make firmware_install".Since then, "make rpm-pkg" / "make binrpm-pkg" fails to build with
the error:make[2]: *** No rule to make target `firmware_install'. Stop.
Commit df85b2d767aa ("firmware: Restore support for built-in firmware")
restored the build infrastructure for CONFIG_EXTRA_FIRMWARE, but this
is out of the scope of "make firmware_install". So, the right thing to
do is to kill the use of "make firmware_install".Fixes: 5620a0d1aacd ("firmware: delete in-kernel firmware")
Signed-off-by: Masahiro Yamada
Acked-by: Greg Kroah-Hartman
12 Sep, 2017
2 commits
-
The previous commit spotted that "Tarball successfully created ..."
is displayed even if the "tar" command returns error code because
it is followed by "| ${compress}".Let the build fail instead of printing the successful message since
if the "tar" command fails, the output may not be what users expect.Avoid the use of the pipe. While we are here, refactor the script
removing the use of sub-shell, ${compress}, ${file_ext}.Signed-off-by: Masahiro Yamada
-
$tmpdir/lib is created by "make modules_install". It does not exist
if CONFIG_MODULES is disabled, then tar reports the following messages:tar: lib: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errorsSigned-off-by: Masahiro Yamada
02 Sep, 2017
1 commit
-
Previously, .config was used in buildtar script regardless of the value of
KCONFIG_CONFIG.Signed-off-by: Nicolas Porcel
Signed-off-by: Masahiro Yamada
11 May, 2017
1 commit
-
…asahiroy/linux-kbuild
Pull misc Kbuild updates from Masahiro Yamada:
- clean up builddeb script
- use full path for KBUILD_IMAGE to fix rpm-pkg build
- fix objdiff tool to ignore debug info
* tag 'kbuild-misc-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
builddeb: fix typo
builddeb: Update a few outdated and hardcoded strings
deb-pkg: Remove the KBUILD_IMAGE workaround
unicore32: Use full path in KBUILD_IMAGE definition
sh: Use full path in KBUILD_IMAGE definition
arc: Use full path in KBUILD_IMAGE definition
arm: Use full path in KBUILD_IMAGE definition
arm64: Use full path in KBUILD_IMAGE definition
scripts: objdiff: Ignore debug info when comparing
25 Apr, 2017
2 commits
-
Signed-off-by: Andrew Donnellan
Signed-off-by: Riku Voipio
Signed-off-by: Masahiro Yamada -
The builddeb script has some hardcoded references to Linux version 2.6
which is ancient. Drop Provides as the virtual packages provided are not
useful anymore. Leave the Provides for linux-kernel-headers, as someone
might still be referring to it.While at it, updated copyright date and drop Standards-Version: since
the package isn't Debian Standards compliant anyways.Cc: Timo Sigurdsson
Signed-off-by: Riku Voipio
Signed-off-by: Masahiro Yamada
28 Mar, 2017
1 commit
-
URLs to ftp.kernel.org are still exist though the service is closed [0].
This commit fixes the URLs to use www.kernel.org instead.[0] https://www.kernel.org/shutting-down-ftp-services.html
Signed-off-by: SeongJae Park
Signed-off-by: Jiri Kosina
20 Mar, 2017
1 commit
-
The arch Makefile are fixed to set KBUILD_IMAGE to the full patch, so
the workaround is no longer needed.Signed-off-by: Michal Marek
Reviewed-by: Riku Voipio
Signed-off-by: Masahiro Yamada
12 Dec, 2016
1 commit
11 Dec, 2016
1 commit
-
Brace expansion might not work properly if _buildshell RPM macro
points to a shell other than bash. Particularly, with _bulidshell
defined to /bin/dash it leads to broken build and source symlinks.Signed-off-by: Anton Tikhomirov
Signed-off-by: Michal Marek
25 Nov, 2016
1 commit
-
Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
"aarch64". Recognizing just the latter should be enough but let's
accept both in case something regresses again or an user sets
UTS_MACHINE=arm64.Regressed in cfa88c7: arm64: Set UTS_MACHINE in the Makefile.
Signed-off-by: Adam Borowski
Acked-by: Riku Voipio
Signed-off-by: Michal Marek
16 Aug, 2016
1 commit
-
When attempting to build a Debian kernel package, the "scripts/gcc-plugins"
directory does not exist in the output tree unless CONFIG_GCC_PLUGINS=y.
To avoid errors when not defined, this wraps the failing "find" in a config
test.Reported-by: Frank Paulsen
Tested-by: Christian Kujau
Signed-off-by: Kees Cook
Signed-off-by: Michal Marek
03 Aug, 2016
1 commit
-
Pull misc kbuild updates from Michal Marek:
- coccicheck script improvements by Luis Rodriguez and Deepa Dinamani
- new coccinelle patches by Yann Droneaud and Vaishali Thakkar
- debian packaging fixes by Wilfried Klaebe, Henning Schild and Marcin
Mielniczuk* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
Fix the Debian packaging script on systems with no codename
builddeb: fix file permissions before packaging
scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue.cocci
coccicheck: refer to Documentation/coccinelle.txt and wiki
coccicheck: add support for requring a coccinelle version
scripts: add Linux .cocciconfig for coccinelle
coccicheck: replace --very-quiet with --quiet when debugging
coccicheck: add support for DEBUG_FILE
coccicheck: enable parmap support
coccicheck: make SPFLAGS more useful
coccicheck: move spatch binary check up
builddeb: really include objtool binary in headers package
coccinelle: catch krealloc() on devm_*() allocated memory
coccinelle: recognize more devm_* memory allocation functions
coccinelle: also catch kzfree() issues
coccicheck: Allow for overriding spatch flags
Coccinelle: noderef: Add new rules and correct the old rule
27 Jul, 2016
2 commits
-
When calling `make deb-pkg` on a system with no codename (for example
Arch Linux), lsb_release sometimes outputs `n/a` as the codename.This breaks dpkg-parsechangelog, which can't process the changelog
correctly.Signed-off-by: Marcin Mielniczuk
Signed-off-by: Michal Marek -
Builddep is not very explicit about file permissions. Actually the file
permissions in the package are largely influenced by the umask of the
user cloning the git and building the package. If that umask does not
set go+r the resulting linux-headers package will prevent non-root users
from building out-of-tree modules. And that is probably just one
unexpected effect.
Being a packaging/install tool builddep should make sure the file
permissions are set correctly and not just derived from a value that is
never checked.This patch sets ugo read permissions for all packaged files and derives
the executable bit for directories and executables from the file-owner.Signed-off-by: Henning Schild
Signed-off-by: Michal Marek
19 Jul, 2016
1 commit
-
On May 4th, Bjørn Mork provided patch 697bbc7b8320 ("builddeb: include
objtool binary in headers package"). However, that one only works if
$srctree=$objtree, because the objtool binaries are not written to the
srctree, but to the objtree.Signed-off-by: Wilfried Klaebe
Fixes: 697bbc7b8320 ("builddeb: include objtool binary in headers package")
Signed-off-by: Michal Marek
08 Jun, 2016
1 commit
-
This patch allows to build the whole kernel with GCC plugins. It was ported from
grsecurity/PaX. The infrastructure supports building out-of-tree modules and
building in a separate directory. Cross-compilation is supported too.
Currently the x86, arm, arm64 and uml architectures enable plugins.The directory of the gcc plugins is scripts/gcc-plugins. You can use a file or a directory
there. The plugins compile with these options:
* -fno-rtti: gcc is compiled with this option so the plugins must use it too
* -fno-exceptions: this is inherited from gcc too
* -fasynchronous-unwind-tables: this is inherited from gcc too
* -ggdb: it is useful for debugging a plugin (better backtrace on internal
errors)
* -Wno-narrowing: to suppress warnings from gcc headers (ipa-utils.h)
* -Wno-unused-variable: to suppress warnings from gcc headers (gcc_version
variable, plugin-version.h)The infrastructure introduces a new Makefile target called gcc-plugins. It
supports all gcc versions from 4.5 to 6.0. The scripts/gcc-plugin.sh script
chooses the proper host compiler (gcc-4.7 can be built by either gcc or g++).
This script also checks the availability of the included headers in
scripts/gcc-plugins/gcc-common.h.The gcc-common.h header contains frequently included headers for GCC plugins
and it has a compatibility layer for the supported gcc versions.The gcc-generate-*-pass.h headers automatically generate the registration
structures for GIMPLE, SIMPLE_IPA, IPA and RTL passes.Note that 'make clean' keeps the *.so files (only the distclean or mrproper
targets clean all) because they are needed for out-of-tree modules.Based on work created by the PaX Team.
Signed-off-by: Emese Revfy
Acked-by: Kees Cook
Signed-off-by: Michal Marek
16 May, 2016
1 commit
-
After commit 21a59991ce0c ("scripts/package/Makefile: rpmbuild is needed
for rpm targets"), it is no longer possible to specify RPMOPTS.
For example, we can no longer able to control _topdir using the following
make command.
make RPMOPTS="--define '_topdir /home/xyz/workspace/'" binrpm-pkgFixes: 21a59991ce0c ("scripts/package/Makefile: rpmbuild is needed for rpm targets")
Cc: # 4.3+
Signed-off-by: Srinivas Pandruvada
Signed-off-by: Michal Marek
10 May, 2016
2 commits
-
The kernel headers package (linux-headers) doesn't include
header files from other architectures required to build
out-of-tree modules.For e.g. on ARM64, opcodes.h includes the same file from ARM
which causes the following error:
./arch/arm64/include/asm/opcodes.h:1:43: fatal error:
../../arm/include/asm/opcodes.h: No such file or directory
compilation terminated.Signed-off-by: Azriel Samson
Signed-off-by: Michal Marek -
"objtool" is required for building external m dules if "Compile-time
stack metadata validation" is enabled. Otherwise all builds based
on the headers package fail with:make[1]: Entering directory '/usr/src/linux-headers-4.6.0-rc6'
make[2]: *** No rule to make target 'tools/objtool/objtool', needed by 'foo.o'. Stop.
Makefile:1598: recipe for target 'foo.ko' failed
make[1]: *** [foo.ko] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.6.0-rc6'Signed-off-by: Bjørn Mork
Signed-off-by: Michal Marek
20 Apr, 2016
1 commit
-
When uninstalling kernel RPM, we're unconditionally calling
"new-kernel-pkg --remove". This is useless on systems which are based on
'update-bootloader' script instead.Support update-bootloader removal method as well in case the script is
present; contrary to new-kernel-pkg, this needs to be done in %postun,
otherwise update-bootloader will refuse to remove entry for kernel for
which the binary still exists.Signed-off-by: Jiri Kosina
Signed-off-by: Michal Marek
05 Mar, 2016
1 commit
-
This patch add a rpm preuninstall scriptlet to cleanup the
boot loader configuration on kernel package uninstall.
The initrd for the to-be-removed kernel is deleted, too.Signed-off-by: Paolo Abeni
Signed-off-by: Michal Marek
26 Feb, 2016
1 commit
-
mkspec is copying built kernel to temporrary location
/boot/vmlinuz-$KERNELRELEASE-rpm
and runs installkernel on it. This however directly leads to grub2
menuentry for this suffixed binary being generated as well during the run
of installkernel script.Later in the process the temporary -rpm suffixed files are removed, and
therefore we end up with spurious (and non-functional) grub2 menu entries
for each installed kernel RPM.Fix that by using a different temporary name (prefixed by '.'), so that
the binary is not recognized as an actual kernel binary and no menuentry
is created for it.Signed-off-by: Jiri Kosina
Fixes: 3c9c7a14b627 ("rpm-pkg: add %post section to create initramfs and grub hooks")
Signed-off-by: Michal Marek
25 Nov, 2015
1 commit
-
building with $srctree != $objtree, perf-tar-* targets fail
to read the MANIFEST file and add the PERF-VERSION-FILE needed
by out-of-tree builds. The build errors and an incorrect tar is created:$ make O=build-x86 perf-targz-src-pkg
TAR
cat: ../tools/perf/MANIFEST: No such file or directory
tar: perf-4.1.0-rc8/PERF-VERSION-FILE: Cannot stat: No such file or
dir..
tar: Exiting with failure status due to previous errorsKbuild sets objtree to "." and srctree to ".." The command to output
MANIFEST becomes:$(cd ..; echo $(cat ../tools/perf/MANIFEST))
Without MANIFEST, the entire kernel source tree is added to the perf
source tarball. The *correct* fix is to keep the cd and remove srctree
from cat command line since MANIFEST has wildcards that fail to expand
working directory isn't srctree.Second, PERF-VERSION-FILE gets not added, because in-tree build path is
hardcoded to Makefile:util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null)
The PERF-VERSION-GEN needs to be run from tools/perf directory,
and the output directory needs to be changed from relative to
to absolute. This can be achieved using the $(CURDIR) variable.Also remove the error redirect to /dev/null which hid the error.
Signed-off-by: Riku Voipio
Signed-off-by: Michal Marek
11 Nov, 2015
1 commit
-
Pull misc kbuild updates from Michal Marek:
"This is the non-critical part of kbuild:- several coccinelle updates
- make deb-pkg creates an armhf package if CONFIG_VFP=y
- make tags understands some more powerpc macros"* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
coccinelle: Improve checking for missing NULL terminators
coccinelle: ifnullfree: handle various destroy functions
coccinelle: ifnullfree: various cleanups
cocinelle: iterators: semantic patch to delete unneeded of_node_put
deb-pkg: Add automatic support for armhf architecture
scripts/coccinelle: fix typos
coccinelle: misc: remove "complex return code" warnings
Coccinelle: fix incorrect -include option transformation
coccinelle: tests: improve odd_ptr_err.cocci
coccinelle: misc: move constants to the right
scripts/tags.sh: Teach tags about some powerpc macros
27 Oct, 2015
1 commit
-
The Debian armhf architecture uses the ARM EABI hard-float variant,
whereas armel uses the soft-float variant. Although the kernel
doesn't use FP itself, CONFIG_VFP must be enabled to support
hard-float userland and will probably be disabled when supporting a
soft-float userland. So set the architecture to armhf by default when
CONFIG_AEABI and CONFIG_VFP are both enabled.Signed-off-by: Ben Hutchings
Acked-by: Ian Campbell
Acked-by: Fathi Boudra
Reviewed-by: Riku Voipio
Signed-off-by: Michal Marek
17 Oct, 2015
1 commit
-
Commit 3716001bcb7f ("deb-pkg: add source package") added the ability to
create a debian changelog file. This exposed that previously the
builddeb script hasn't cleared debian/files between builds.As debian/files keeps accumulating entries, the changes file will end up
growing indefinelty. With outdated entries in debian/files, builddeb
script will exit with failure. This regression impacts those who use
"make deb-pkg" target to build kernel into a .deb package and never use
"make mrproper" or other means to clean kernel tree from generated
directories.To fix the regression, remove debian/files before starting build and in
the generated clean rule.Fixes: 3716001bcb7f ("deb-pkg: add source package")
Signed-off-by: Riku Voipio
Reported-by: Doug Smythies
Tested-by: Doug Smythies
Tested-by: Kalle Valo
Acked-by: Ben Hutchings
Cc: Michal Marek
Cc: maximilian attems
Cc: Chris J Arges
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Sep, 2015
2 commits
-
Make deb-pkg build both source and binary package like make rpm-pkg does.
For people who only need binary kernel package, there is now bindeb-pkg
target, same target also used to build the .deb files if built from the
source package using dpkg-buildpackage.Generated source package will build the same kernel .config than what
was available for make deb-pkg. The name of the source package can
be set with KDEB_SOURCENAME enviroment variable.The source package is useful for GPL compliance, or for feeding to a
automated debian package builder.Cc: Chris J Arges
Reviewed-by: maximilian attems
Reviewed-by: Ben Hutchings
Signed-off-by: Riku Voipio
Signed-off-by: Michal Marek -
Split source tarball creation from rpm-pkg target
so it can be used from deb-pkg target as well. As
added bonus, we can now pretty print TAR the name of
tarball created in quiet modeThis patch prepares the groundwork for deb-pkg source
package adding bit.Signed-off-by: Riku Voipio
Signed-off-by: Michal Marek
26 Aug, 2015
1 commit
-
This causes conflicts when using multiple kernels built
with this mechanism.Reviewed-by: Dennis Dalessandro
Signed-off-by: Mike Marciniszyn
Signed-off-by: Michal Marek
20 Aug, 2015
1 commit
-
I happened to build a kernel with "make deb-pkg" on a machine with no
network connectivity, but this failed with:[...]
INSTALL debian/headertmp/usr/include/asm/ (65 files)
hostname: Name or service not known
../scripts/package/Makefile:90: recipe for target 'deb-pkg' failed
make[2]: *** [deb-pkg] Error 1In scripts/package/builddeb it tries to construct an email address (that
can be queried in /proc/version later on) but with no network,
the "hostname -f" fails. The following patch falls back to just use the
shortname if we cannot determine our FQDN.Signed-off-by: Christian Kujau
Signed-off-by: Michal Marek
19 Aug, 2015
1 commit
-
Every package needs /usr/share/doc/$package_name and
DEBIAN directory, so create them as part of create_package
function.Signed-off-by: Riku Voipio
Signed-off-by: Michal Marek