- Sep 28, 2022
-
-
Masahiro Yamada authored
My future plan is to list subdirectories in ./Kbuild. When it occurs, $(vmlinux-alldirs) will not contain all subdirectories. Let's hard-code the directory list until I get around to implementing a more sophisticated way for generating a source tarball. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Tested-by:
Nick Desaulniers <ndesaulniers@google.com> Reviewed-by:
Nicolas Schier <nicolas@fjasle.eu>
-
- Jul 27, 2022
-
-
Masahiro Yamada authored
Presumably, _target_os is defined even if the --target flag does not specify it, but it is better to make it explicit. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Oct 12, 2021
-
-
Paweł Jasiak authored
Add tarzst-pkg and perf-tarzst-src-pkg targets to build zstd compressed tarballs. Signed-off-by:
Paweł Jasiak <pawel@jasiak.dev> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Apr 24, 2021
-
-
Masahiro Yamada authored
Change the source package name from 'linux-$(KERNELRELEASE)' to 'linux-upstream'. Initially, I tried to use 'linux' to be aligned with the Debian kernel package, but Ben suggested 'linux-upstream' so that it is clearly distinguished from distribution packages. [1] The filenames will be changed as follows: [Before] linux-5.12.0-rc3+_5.12.0-rc3+-1.dsc linux-5.12.0-rc3+_5.12.0-rc3+.orig.tar.gz linux-5.12.0-rc3+_5.12.0-rc3+-1.diff.gz [After] linux-upstream_5.12.0-rc3+-1.dsc linux-upstream_5.12.0-rc3+.orig.tar.gz linux-upstream_5.12.0-rc3+-1.diff.gz Commit 3716001b ("deb-pkg: add source package") introduced KDEB_SOURCENAME. If you are unhappy with the default name, you can override it via KDEB_SOURCENAME. [1]: https://lore.kernel.org/linux-kbuild/06ffa2a690d57f867b4bc1b42f0026917b1dd3cd.camel@decadent.org.uk/T/#m2c4afa0eca5ced5e57795b002f2dbcb05d7a4a44 Suggested-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Jun 11, 2020
-
-
Denis Efremov authored
Redefine GZIP, BZIP2, LZOP variables as KGZIP, KBZIP2, KLZOP resp. GZIP, BZIP2, LZOP env variables are reserved by the tools. The original attempt to redefine them internally doesn't work in makefiles/scripts intercall scenarios, e.g., "make GZIP=gzip bindeb-pkg" and results in broken builds. There can be other broken build commands because of this, so the universal solution is to use non-reserved env variables for the compression tools. Fixes: 8dfb61dc ("kbuild: add variables for compression tools") Signed-off-by:
Denis Efremov <efremov@linux.com> Tested-by:
Guenter Roeck <linux@roeck-us.net> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Jun 06, 2020
-
-
Denis Efremov authored
Allow user to use alternative implementations of compression tools, such as pigz, pbzip2, pxz. For example, multi-threaded tools to speed up the build: $ make GZIP=pigz BZIP2=pbzip2 Variables _GZIP, _BZIP2, _LZOP are used internally because original env vars are reserved by the tools. The use of GZIP in gzip tool is obsolete since 2015. However, alternative implementations (e.g., pigz) still rely on it. BZIP2, BZIP, LZOP vars are not obsolescent. The credit goes to @grsecurity. As a sidenote, for multi-threaded lzma, xz compression one can use: $ export XZ_OPT="--threads=0" Signed-off-by:
Denis Efremov <efremov@linux.com> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Nov 11, 2019
-
-
Matteo Croce authored
Add a 'dir-pkg' target which just creates the same directory structures as in tar-pkg, but doesn't package anything. Useful when the user wants to copy the kernel tree on a machine using ssh, rsync or whatever. Signed-off-by:
Matteo Croce <mcroce@redhat.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Geert Uytterhoeven authored
Some "make help" text lines extend beyond 80 characters. Wrap them before an opening parenthesis, or before 80 characters. Signed-off-by:
Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Aug 24, 2019
-
-
Masahiro Yamada authored
scripts/package/Makefile does not use $(obj) or $(src) at all. It actually generates files and directories in the top of $(objtree). I do not see much sense in descending into scripts/package/. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
These are not real targets. Adding them to PHONY is preferred. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
I am not a big fan of the $(objtree)/ hack for clean-files/clean-dirs. These are created in the top of $(objtree), so let's clean them up from the top Makefile. 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>
-
- 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>
-
- 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>
-
- 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
-
-
Masahiro Yamada authored
The spec file always passes %{?_smp_mflags}, but we have two problems here. [1] "make -jN rpm-pkg" emits the following warning message: make[2]: warning: -jN forced in submake: disabling jobserver mode. [2] We can not specify the number of jobs that run in parallel. Whether we give -jN or not from the top Makefile, the spec file always passes ${?_smp_mflags} to the build commands. ${?_smp_mflags} will be useful when we run rpmbuild by hand. When we invoke it from Makefile, -jN is propagated down to submake; it should not be overridden because we want to respect the number of jobs given by the user. Set _smp_mflags to empty string in this case. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
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 <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
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 <yamada.masahiro@socionext.com>
-
- Sep 20, 2017
-
-
Masahiro Yamada authored
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 <yamada.masahiro@socionext.com>
-
- May 16, 2016
-
-
Srinivas Pandruvada authored
After commit 21a59991 ("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-pkg Fixes: 21a59991 ("scripts/package/Makefile: rpmbuild is needed for rpm targets") Cc: <stable@vger.kernel.org> # 4.3+ Signed-off-by:
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by:
Michal Marek <mmarek@suse.com>
-
- Nov 24, 2015
-
-
Riku Voipio authored
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 errors Kbuild 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 <riku.voipio@linaro.org> Signed-off-by:
Michal Marek <mmarek@suse.com>
-
- Sep 04, 2015
-
-
Riku Voipio authored
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 <chris.j.arges@canonical.com> Reviewed-by:
maximilian attems <maks@stro.at> Reviewed-by:
Ben Hutchings <ben@decadent.org.uk> Signed-off-by:
Riku Voipio <riku.voipio@linaro.org> Signed-off-by:
Michal Marek <mmarek@suse.com>
-
Riku Voipio authored
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 mode This patch prepares the groundwork for deb-pkg source package adding bit. Signed-off-by:
Riku Voipio <riku.voipio@linaro.org> Signed-off-by:
Michal Marek <mmarek@suse.com>
-
- Jun 15, 2015
-
-
Jim Davis authored
Before rpm release 4.1, in 2002, either the rpm command or the rpmbuild command could be used in the rpm-pkg or binrpm-pkg targets, and the Makefile chose the rpm command if the rpmbuild command wasn't found. After release 4.1, however, the rpm command could no longer be used in place of the rpmbuild command. As the rpmbuild command is not installed by default, this can lead to failures with the rpm-pkg and binrpm-pkg targets: rpm --define "_builddir ." --target \ x86_64 -bb ./binkernel.spec rpm --target: unknown option scripts/package/Makefile:60: recipe for target 'binrpm-pkg' failed Change the Makefile to use rpmbuild unconditionally to avoid this. Signed-off-by:
Jim Davis <jim.epost@gmail.com> Signed-off-by:
Michal Marek <mmarek@suse.cz>
-
- Jun 09, 2014
-
-
Masahiro Yamada authored
Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com>
-
- Nov 07, 2013
-
-
David Ahern authored
When building perf out of tree: $ make perf-tar-src-pkg $ tar -xf perf-<ver>.tar -C /tmp $ cd /tmp/perf<ver> $ make -C tools/perf you get this warning message: make[1]: *** No rule to make target `kernelversion'. Stop. Fix it by saving the perf version in the tar file and using that for the out of tree builds. v2: removed short form request and fixed up version string from usual output. Signed-off-by:
David Ahern <dsahern@gmail.com> Suggested-by:
Ingo Molnar <mingo@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1383753335-25782-1-git-send-email-dsahern@gmail.com Signed-off-by:
Arnaldo Carvalho de Melo <acme@redhat.com>
-
- May 16, 2013
-
-
Luiz Capitulino authored
Commit 65013203 dropped the rpm spec as a prerequisite for the binrpm-pkg target but forgot to update $< usage, which causes the rule to break. This commit fixes that by replacing $< with the spec name. Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by:
Michal Marek <mmarek@suse.cz>
-
- Apr 18, 2013
-
-
Michal Marek authored
Signed-off-by:
Michal Marek <mmarek@suse.cz>
-
Michal Marek authored
The *pkg targets are always run, so it makes no sense to cache the generated specfile. This also fixes build errors when the specfile becomes out of date, without the Makefile noticing it: $ make rpm works $ echo yadadada >localversion-test $ make rpm fails, because kernel.spec assumes the old kernel release string Signed-off-by:
Michal Marek <mmarek@suse.cz>
-
Michal Marek authored
Now that we only package explicitly listed files to the tarball, there is no need to abuse the parent directory. Signed-off-by:
Michal Marek <mmarek@suse.cz>
-
Michal Marek authored
The source tree can contain lots of uninteresting data like tag or cscope files, packaging which slows down make rpm needlessly. It can also break the build, if the tree contains an unrelated file named *.spec. The downside of this change is that new subdirectories have to be added to the KBUILD_ALLDIRS variable in the top-level Makefile. The upside is that the behavior is more predictable. Signed-off-by:
Michal Marek <mmarek@suse.cz>
-
- Apr 08, 2013
-
-
Bin Wang authored
KBUILD_OUTPUT is always empty here, so it is useless to test it. But while use O=.., objtree and srctree will be different. I compare them instead. Signed-off-by:
Bin Wang <wbin00@gmail.com> Signed-off-by:
Michal Marek <mmarek@suse.cz>
-
- Oct 29, 2011
-
-
Paul Menzel authored
Signed-off-by:
Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by:
Jiri Kosina <jkosina@suse.cz>
-
- Jun 24, 2011
-
-
matt mooney authored
Specify --git-dir when building perf targets to allow out-of-tree builds using O=<build-dir>. The shell command in `git archive' had to be modified to allow proper file name expansion of the files listed in MANIFEST. Signed-off-by:
matt mooney <mfm@muteddisk.com> Signed-off-by:
Michal Marek <mmarek@suse.cz>
-