summaryrefslogtreecommitdiffstats
path: root/scripts/package/buildtar
AgeCommit message (Collapse)AuthorFilesLines
2021-10-12kbuild: Add make tarzst-pkg build optionPaweł Jasiak1-0/+4
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>
2021-03-29kbuild: buildtar: add riscv supportCarlos de Paula1-0/+8
Make 'make tar-pkg' and 'tarbz2-pkg' work on riscv. Signed-off-by: Carlos de Paula <me@carlosedp.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2020-07-07kbuild: buildtar: add dtbs supportDomenico Andreoli1-0/+12
Make 'make tar-pkg' install dtbs. Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-11kbuild: fix broken builds because of GZIP,BZIP2,LZOP variablesDenis Efremov1-2/+2
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: 8dfb61dcbace ("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>
2020-06-06kbuild: add variables for compression toolsDenis Efremov1-3/+3
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>
2019-11-11kbuild: Add make dir-pkg build optionMatteo Croce1-2/+6
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>
2019-03-14kbuild: pkg: grep include/config/auto.conf instead of $KCONFIG_CONFIGMasahiro Yamada1-1/+1
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>
2019-02-20kbuild: pkg: use -f $(srctree)/Makefile to recurse to top MakefileMasahiro Yamada1-1/+1
'$(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>
2018-07-19kbuild: buildtar: add arm64 supportOlof Johansson1-0/+8
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>
2018-07-19kbuild: buildtar: remove crufty vax piecesOlof Johansson1-4/+0
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>
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman1-0/+1
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 <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-13kbuild: buildtar: do not print successful message if tar returns errorMasahiro Yamada1-16/+13
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 <yamada.masahiro@socionext.com>
2017-09-13kbuild: buildtar: fix tar error when CONFIG_MODULES is disabledMasahiro Yamada1-2/+3
$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 errors Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-09-02kbuild: Use KCONFIG_CONFIG in buildtarNicolas Porcel1-2/+2
Previously, .config was used in buildtar script regardless of the value of KCONFIG_CONFIG. Signed-off-by: Nicolas Porcel <nicolasporcel06@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2014-08-20kbuild: Make scripts executableMichal Marek1-0/+0
The Makefiles call the respective interpreter explicitly, but this makes it easier to use the scripts manually. Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-06-18kbuild: Fix tar-pkg with relative $(objtree)Michal Marek1-2/+1
Commit 7e1c0477 (kbuild: Use relative path for $(objtree)) assumes that the build process does not change its working directory. make tar-pkg was a couterexample, fix this by changing directory only for the tar command and not for the whole script, which at one point references the now relative $(objtree). Reported-and-tested-by: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-06-10kbuild: trivial - remove trailing empty linesMasahiro Yamada1-1/+0
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-08-26kbuild: Add MIPS specific files to generated package.Stuart Longland1-0/+21
A lot of 64-bit systems supported by Linux/MIPS have boot firmware or bootloaders that only understand 32-bit ELF files, and as such, the vmlinux.32 target exists to support these systems. Therefore, it'd be nice if the tar-pkg target recognised this, and included the right version when packaging up a binary of the kernel. This updates buildtar to support MIPS targets. MIPS may use 'vmlinux' or 'vmlinux.32' depending on the target system. This uses 'vmlinux.32' in preference to 'vmlinux' where present (although I should check which is newer), including either file as /boot/vmlinux-${version}. Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/1673/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-04-08buildtar: Add ARCH to the archive nameBorislav Petkov1-1/+1
When dealing with multiple sub-arches (like 32- and 64-bit on x86, for example) generating a bunch of kernel tar archives with the same name but for different sub-arches could get confusing and error-prone. Also, the build process could overwrite otherwise unrelated builds and you probably don't want that. So, add the architecture to the archive name for more clarity and less shoot-yourself-in-the-foot practices. Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-10-12Merge branch 'kbuild' of ↵Linus Torvalds1-3/+3
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild Pull kbuild changes from Michal Marek: "The main part of kbuild for v3.7 contains: - Fix for scripts/Makefile.modpost to not choke on a '.ko' substring in the build directory path - Two warning fixes (modpost and main Makefile) - __compiletime_error works also with gcc 4.3 - make tar{gz,bz2,xz}-pkg uses default compression settings instead of saving as many bytes as possible (this should actually be in the misc branch, I don't know why I applied it here)." * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: compiler-gcc4.h: correct verion check for __compiletime_error modpost: Permit .GCC.command.line sections Kbuild: use normal compression settings for tar*-pkg scripts/Makefile.modpost: error in finding modules from .mod files. kbuild: Remove useless warning while appending KCFLAGS
2012-09-27Kbuild: use normal compression settings for tar*-pkgAndi Kleen1-3/+3
For large kernel configurations (like a distribution kernel) targz-pkg takes a quite long time to just do the compression. I clocked it at 15+mins for a SUSE kernel like config on a fast system. And tarxz and bzip2 are even slower. The main reason is that the script that is doing the taring sets the highest compression level (-9). When I change it to just use the defaults the gzip time for the same kernel goes down to ~3 mins. I haven't tested xz and bzip, but I expect those to be much faster too. I'm not willing to wait that long for a small compression gain. So just change the script to use the defaults. Signed-off-by: Andi Kleen <ak@linux.intel.com> Reviewed-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-09-27kbuild: Do not package /boot and /lib in make tar-pkgMichal Marek1-1/+1
There were reports of users destroying their Fedora installs by a kernel tarball that replaces the /lib -> /usr/lib symlink. Let's remove the toplevel directories from the tarball to prevent this from happening. Reported-by: Andi Kleen <andi@firstfloor.org> Suggested-by: Ben Hutchings <ben@decadent.org.uk> Cc: <stable@kernel.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-09kbuild: Add make tarxz-pkg build optionZdenek Kaspar1-0/+4
Signed-off-by: Zdenek Kaspar <zkaspar82@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-12scripts/package: tar-pkg: use tar --owner=rootMichal Marek1-1/+5
Use the --owner= and --group= options to make sure the entries in the built tar file are owned by root. Without this change, a careless sysadmin using the tar-pkg target can easily end up installing a kernel that is writable by the unprivileged user account used to build the kernel. Test that these options are understood before using them so that non-GNU versions of tar can still be used if the operator is appropriately cautious. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-04-02parisc: fix "make tar-pkg"Helge Deller1-0/+4
Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2008-01-28kbuild: support ARCH=x86 in buildtarDaniel De Graaf1-2/+2
Signed-off-by: Daniel De Graaf <danieldegraaf@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-05-21x86_64: Support x86_64 in make buildtarAndi Kleen1-2/+2
Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-01-01kbuild: tar-pkg with out-out-tree buildingJan-Benedict Glaw1-18/+13
Fix out-of-tree builds for the tar-pkg targets When I wrote the buildtar script, I didn't even think about out-of-tree builds because I didn't use these back then. This patch throughoutly uses ${objtree} instead of `pwd`. Also, the kernel version is no longer manually built. Instead, it will properly use $KERNELRELEASE . Installing modules is only done if CONFIG_MODULES is set. Signed-off-by: Jan-Benedict Glaw <jbglaw@lug-owl.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2005-07-12[PATCH] kbuild: create tarballsJan-Benedict Glaw1-0/+111
It adds tarball packaging, which I prefer for distribution. Also one of the two blanks after @echo is removed. One seems to be enough :) Signed-off-by: Jan-Benedict Glaw <jbglaw@lug-owl.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>