- Jul 09, 2019
-
-
Masahiro Yamada authored
header-test-y does not work with headers in sub-directories. For example, you may want to write a Makefile, like this: include/linux/Kbuild: header-test-y += mtd/nand.h This entry will create a wrapper include/linux/mtd/nand.hdrtest.c with the following content: #include "mtd/nand.h" To make this work, we need to add $(srctree)/include/linux to the header search path. It would be tedious to add ccflags-y. Instead, we could change the *.hdrtest.c rule to wrap: #include "nand.h" This works for in-tree build since #include "..." searches in the relative path from the header with this directive. For O=... build, we need to add $(srctree)/include/linux/mtd to the header search path, which will be even more tedious. After all, I thought it would be handier to compile headers directly without creating wrappers. I added a new build rule to compile %.h into %.h.s The target is %.h.s instead of %.h.o because it is slightly faster. Also, as for GCC, an empty assembly is smaller than an empty object. I wrote the build rule: $(CC) $(c_flags) -S -o $@ -x c /dev/null -include $< instead of: $(CC) $(c_flags) -S -o $@ -x c $< Both work fine with GCC, but the latter is bad for Clang. This comes down to the difference in the -Wunused-function policy. GCC does not warn about unused 'static inline' functions at all. Clang does not warn about the ones in included headers, but does about the ones in the source. So, we should handle headers as headers, not as source files. In fact, this has been hidden since commit abb2ea7d ("compiler, clang: suppress warning for unused static inline functions"), but we should not rely on that. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by:
Jani Nikula <jani.nikula@intel.com> Tested-by:
Jani Nikula <jani.nikula@intel.com>
-
- Jun 15, 2019
-
-
Masahiro Yamada authored
It is absolutely fine to add extra sanity checks in package scripts, but it is not necessary to do so. This is already covered by the daily compile-testing (0day bot etc.) because headers_check is run as a part of the normal build process when CONFIG_HEADERS_CHECK=y. Replace it with the newly-added "make headers". Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jun 04, 2019
-
-
Trevor Bourget authored
The buildtar script might want to invoke a make, so tell the parent make to pass the jobserver token pipe to the subcommand by prefixing the command with a +. This addresses the issue seen here: /bin/sh ../scripts/package/buildtar tar-pkg make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. See https://www.gnu.org/software/make/manual/html_node/Job-Slots.html for more information. Signed-off-by:
Trevor Bourget <tgb.kernel@gmail.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- May 21, 2019
-
-
Thomas Gleixner authored
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by:
Thomas Gleixner <tglx@linutronix.de> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- Mar 17, 2019
-
-
Arseny Maslennikov authored
* The man page for dpkg-source(1) notes: > -b, --build directory [format-specific-parameters] > Build a source package (--build since dpkg 1.17.14). > <...> > > dpkg-source will build the source package with the first > format found in this ordered list: the format indicated > with the --format command line option, the format > indicated in debian/source/format, “1.0”. The fallback > to “1.0” is deprecated and will be removed at some point > in the future, you should always document the desired > source format in debian/source/format. See section > SOURCE PACKAGE FORMATS for an extensive description of > the various source package formats. Thus it would be more foolproof to explicitly use 1.0 (as we always did) than to rely on dpkg-source's defaults. * In a similar vein, debian/rules is not made executable by mkdebian, and dpkg-source warns about that but still silently fixes the file. Let's be explicit once again. Signed-off-by:
Arseny Maslennikov <ar@cs.msu.ru> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Mar 13, 2019
-
-
Masahiro Yamada authored
This will be a little more efficient since unset CONFIG options are stripped away from auto.conf, and we can hard-code the path to auto.conf since it is never overridden. include/config/kernel.release is generated before %pkg is run. So, it is guaranteed auto.conf is up-to-date. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
I think is_enabled() and if_enable_echo() in scripts/package/mkdebian are useful. builddeb also has many repetitive greps over the kernel config, so I borrowed the idea to clean it up. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
This might be a kind of bike-shed, but I personally prefer grep'able code. I often do 'git grep CONFIG_FOO' instead of 'git grep FOO' when I want to know where that CONFIG option is used. This makes code longer, but I hope this is acceptable level. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Riku Voipio authored
bison/flex is now needed always for building for kconfig. Some build dependencies depend on kernel configuration, enable them as needed: - libelf-dev when UNWINDER_ORC is set - libssl-dev for SYSTEM_TRUSTED_KEYRING Since the libssl-dev is needed for extract_cert binary, denote with :native to install the libssl-dev for the build machines architecture, rather than for the architecture of the kernel being built. Tested-by:
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by:
Riku Voipio <riku.voipio@linaro.org> Reviewed-by:
Ben Hutchings <ben@decadent.org.uk> Acked-by:
maximilian attems <maks@stro.at> [masahiro.yamada: change 'flex' to 'flex | flex:native' ] Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Feb 28, 2019
-
-
Kacper Kołodziej authored
DPKG_FLAGS variable lets user to add more flags to dpkg-buildpackage command in deb-pkg and bindeb-pkg. Signed-off-by:
Kacper Kołodziej <kacper@kolodziej.it> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Feb 20, 2019
-
-
Masahiro Yamada authored
'$(MAKE) KBUILD_SRC=' changes the working directory back and forth between objtree and srctree. It is better to recurse to the top-level Makefile directly. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Dec 01, 2018
-
-
Masahiro Yamada authored
These three cmd_* are invoked in the $(call cmd,*) form. Now that 'set -e' moved to the 'cmd' macro, they do not need to explicitly give 'set -e'. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Nov 11, 2018
-
-
Rob Herring authored
Commit 37c8a5fa ("kbuild: consolidate Devicetree dtb build rules") moved the location of 'dtbs_install' target which caused dtbs to not be installed when building debian package with 'bindeb-pkg' target. Update the builddeb script to use the same logic that determines if there's a 'dtbs_install' target which is presence of the arch dts directory. Also, use CONFIG_OF_EARLY_FLATTREE instead of CONFIG_OF as that's a better indication of whether we are building dtbs. This commit will also have the side effect of installing dtbs on any arch that has dts files. Previously, it was dependent on whether the arch defined 'dtbs_install'. Fixes: 37c8a5fa ("kbuild: consolidate Devicetree dtb build rules") Reported-by:
Nuno Gonçalves <nunojpg@gmail.com> Signed-off-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Since commit b41d920a ("kbuild: deb-pkg: split generating packaging and build"), the build version of the kernel contained in a deb package is too low by 1. Prior to the bad commit, the kernel was built first, then the number in .version file was read out, and written into the debian control file. Now, the debian control file is created before the kernel is actually compiled, which is causing the version number mismatch. Let the mkdebian script pass KBUILD_BUILD_VERSION=${revision} to require the build system to use the specified version number. Fixes: b41d920a ("kbuild: deb-pkg: split generating packaging and build") Reported-by:
Doug Smythies <dsmythies@telus.net> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by:
Doug Smythies <dsmythies@telus.net>
-
- Nov 05, 2018
-
-
Masahiro Yamada authored
Ard Biesheuvel reports bindeb-pkg with O= option is broken in the following way: ... LD [M] sound/soc/rockchip/snd-soc-rk3399-gru-sound.ko LD [M] sound/soc/rockchip/snd-soc-rockchip-pcm.ko LD [M] sound/soc/rockchip/snd-soc-rockchip-rt5645.ko LD [M] sound/soc/rockchip/snd-soc-rockchip-spdif.ko LD [M] sound/soc/sh/rcar/snd-soc-rcar.ko fakeroot -u debian/rules binary make KERNELRELEASE=4.19.0-12677-g19beffaf7a99-dirty ARCH=arm64 KBUILD_SRC= intdeb-pkg /bin/bash /home/ard/linux/scripts/package/builddeb Makefile:600: include/config/auto.conf: No such file or directory *** *** Configuration file ".config" not found! *** *** Please run some configurator (e.g. "make oldconfig" or *** "make menuconfig" or "make xconfig"). *** make[12]: *** [syncconfig] Error 1 make[11]: *** [syncconfig] Error 2 make[10]: *** [include/config/auto.conf] Error 2 make[9]: *** [__sub-make] Error 2 ... Prior to commit 80463f1b ("kbuild: add --include-dir flag only for out-of-tree build"), both srctree and objtree were added to --include-dir redundantly, and the wrong code '$MAKE image_name' was working by relying on that. Now, the potential issue that had previously been hidden just showed up. '$MAKE image_name' recurses to the generated $(objtree)/Makefile and ends up with running in srctree, which is incorrect. It should be invoked with '-f $srctree/Makefile' (or KBUILD_SRC=) to be executed in objtree. Fixes: 80463f1b ("kbuild: add --include-dir flag only for out-of-tree build") Reported-by:
Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by:
Ard Biesheuvel <ard.biesheuvel@linaro.org>
-
Masahiro Yamada authored
Zhenzhong Duan reported that running 'make O=/build/kernel binrpm-pkg' failed with the following errors: Running 'make O=/build/kernel binrpm-pkg' failed with below two errors. Makefile:600: include/config/auto.conf: No such file or directory + cp make -C /mnt/root/kernel O=/build/kernel image_name make -f /mnt/root/kernel/Makefile ... cp: invalid option -- 'C' Try 'cp --help' for more information. Prior to commit 80463f1b ("kbuild: add --include-dir flag only for out-of-tree build"), both srctree and objtree were added to --include-dir redundantly, and the wrong code 'make image_name' was working by relying on that. Now, the potential issue that had previously been hidden just showed up. 'make image_name' recurses to the generated $(objtree)/Makefile and ends up with running in srctree, which is incorrect. It should be invoked with '-f $srctree/Makefile' (or KBUILD_SRC=) to be executed in objtree. Fixes: 80463f1b ("kbuild: add --include-dir flag only for out-of-tree build") Reported-by:
Zhenzhong Duan <zhenzhong.duan@oracle.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jul 28, 2018
-
-
Ben Hutchings authored
Different generations of the SH architecture are not very compatible, so there are/were separate Debian ports for SH3 and SH4. Move the fallback out of the "case" statement, so that it will also be used in case we find some SH architecture version without a known mapping. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
Debian currently only defines "riscv64", but it seems safe to assume that any 32-bit port will now be called "riscv32", also matching $UTS_MACHINE. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
We currently label 64-bit kernel packages as sparc (32-bit), mostly because it was officially supported while sparc64 was not. Now neither is officially supported, so label these packages as sparc64. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
MIPS R6 is not fully backward-compatible, so Debian has separate architecture names for userland built for R6. Label kernel packages accordingly. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
We currently label 64-bit little-endian kernel packages as mipsel (32-bit little-endian), mostly it was officially supported while mips64el (64-bit little-endian) was not. Now both are officially supported, so label these packages as mips64el. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
We currently label 64-bit big-endian kernel packages as powerpc (32-bit), mostly because it was officially supported while ppc64 (64-bit big-endian) was not. Now neither is officially supported, so label these packages as ppc64. Debian also has a powerpcspe (32-bit with SPE) architecture. Label packages with a suitable configuration as powerpcspe. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
We now have many repetitive greps over the kernel config. Refactor them into functions. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
s390 now only supports 64-bit configurations. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
We currently use dpkg --print-architecture, which reports the architecture of the build machine. We can make a better guess than this by asking dpkg-architecture what the host architecture, i.e. the default architecture for building packages, is. This is sensitive to environment variables such as CC and DEB_HOST_ARCH, which should already be set in a cross-build environment. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Ben Hutchings authored
If KBUILD_DEBARCH is set then we will not use the result of architecture detection, and we may also warn unnecessarily. Move the check for KBUILD_DEBARCH further up to avoid this. Signed-off-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jul 18, 2018
-
-
Olof Johansson authored
Make 'make tar-pkg' work on arm64. Cc: Will Deacon <will.deacon@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by:
Olof Johansson <olof@lixom.net> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Olof Johansson authored
ARCH=vax isn't in mainline; it can be added back if/when it shows up. Signed-off-by:
Olof Johansson <olof@lixom.net> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- May 17, 2018
-
-
Riku Voipio authored
There is multiple issues with the genaration of maintainer string It uses DEBEMAIL and EMAIL enviroment variables, which may contain angle brackets, creating invalid maintainer strings. The documented KBUILD_BUILD_USER and KBUILD_BUILD_HOST variables are not used. Undocumented and uncommon NAME variable is used. Refactor the Maintainer string to: - use EMAIL or DEBEMAIL directly if they are in form "name <user@host>" - use KBUILD_BUILD_USER and KBUILD_BUILD_HOST if set before falling back to autodetection - no longer use NAME variable or the useless Anonymous string The logic is switched from multiline if/then/fi statements to compact shell variable substition commands. Reported-by:
Mathieu Malaterre <malat@debian.org> Signed-off-by:
Riku Voipio <riku.voipio@linaro.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Apr 13, 2018
-
-
Javier Martinez Canillas authored
The new-kernel-pkg script is only present when grubby is installed, but it may not always be the case. So if the script isn't present, attempt to use the kernel-install script as a fallback instead. Signed-off-by:
Javier Martinez Canillas <javierm@redhat.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Apr 07, 2018
-
-
Riku Voipio authored
Move debian/ directory generation out of builddeb to a new script, mkdebian. The package build commands are kept in builddeb, which is now an internal command called from debian/rules. With these changes in place, we can now use dpkg-buildpackage from deb-pkg and bindeb-pkg removing need for handrolled source/changes generation. This patch is based on the criticism of the current state of builddeb discussed on: https://patchwork.kernel.org/patch/9656403/ Signed-off-by:
Riku Voipio <riku.voipio@linaro.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Mar 27, 2018
-
-
Jason Gunthorpe authored
There is a change in how command line parsing is done in this version. Excludes and includes are now ordered with the file list. Since the spec file puts the file list before the exclude list it means newer tar ignores the excludes and packs all the build output into the kernel-devel RPM resulting in a huge package. Simple argument re-ordering fixes the problem. Signed-off-by:
Jason Gunthorpe <jgg@mellanox.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Jan Kiszka authored
Since d5d332d3, 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 <jan.kiszka@siemens.com> Reviewed-by:
Riku Voipio <riku.voipio@linaro.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Dec 12, 2017
-
-
Masahiro Yamada authored
We do not support out-of-tree building of rpm-pkg / deb-pkg. If O= is given, the build should be terminated, but the "false" command is not effective since it is not the last command in the cmd_src_tar. Then, rpm-pkg / deb-pkg tries to continue building, and fails for a different reason. Set -e option so that the "false" terminates the building immediately. I also put the error messages to stderr, and made it stand out more. For example, "make O=foo rpm-pkg" will fail as follows: /bin/bash ../scripts/package/mkspec >./kernel.spec TAR kernel-4.15.0_rc2+.tar.gz ERROR: Building source tarball is not possible outside the kernel source tree. Don't set KBUILD_OUTPUT, or use the binrpm-pkg or bindeb-pkg target instead. ../scripts/package/Makefile:53: recipe for target 'rpm-pkg' failed Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by:
Jim Davis <jim.epost@gmail.com>
-
Paolo Pisati authored
Following in footsteps of other targets like 'deb-pkg, 'rpm-pkg' and 'tar-pkg', this patch adds a 'snap-pkg' target for the creation of a Linux kernel snap package using the kbuild infrastructure. A snap, in its general form, is a self contained, sandboxed, universal package and it is intended to work across multiple distributions and/or devices. A snap package is distributed as a single compressed squashfs filesystem. A kernel snap is a snap package carrying the Linux kernel, kernel modules, accessory files (DTBs, System.map, etc) and a manifesto file. The purpose of a kernel snap is to carry the Linux kernel during the creation of a system image, eg. Ubuntu Core, and its subsequent upgrades. For more information on snap packages: https://snapcraft.io/docs/ Signed-off-by:
Paolo Pisati <paolo.pisati@canonical.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Nov 23, 2017
-
-
Masahiro Yamada authored
The "rpm" has been kept for backward compatibility since pre-git era. I am planning to remove it after the Linux 4.18 release. Annouce the end of the support, prompting to use "rpm-pkg" instead. If you use "rpm", it will work like "rpm-pkg", but warning messages will be displayed as follows: WARNING: "rpm" target will be removed after Linux 4.18 Please use "rpm-pkg" instead. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
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 <yamada.masahiro@socionext.com>
-
- Nov 14, 2017
-
-
Sven Joachim authored
At the end of "make bindeb-pkg" I noticed the following warning: dpkg-genchanges: warning: unknown substitution variable ${kernel:debarch} It turns out that since dpkg version 1.19.0 dpkg-genchanges honors substitution variables in the Description field, while earlier versions silently left them alone, see https://bugs.debian.org/856547 . The result is an incomplete description of the linux-headers package in the generated .changes file. Fix it by passing the kernel:debarch substitution variable to dpkg-genchanges. Signed-off-by:
Sven Joachim <svenjoac@gmx.de> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-