Skip to content
Snippets Groups Projects
  1. Sep 28, 2022
  2. Jul 27, 2022
  3. Oct 12, 2021
  4. Apr 24, 2021
  5. Jun 11, 2020
  6. Jun 06, 2020
    • Denis Efremov's avatar
      kbuild: add variables for compression tools · 8dfb61dc
      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: default avatarDenis Efremov <efremov@linux.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      8dfb61dc
  7. Nov 11, 2019
  8. Aug 24, 2019
  9. Jun 04, 2019
  10. May 21, 2019
  11. Feb 28, 2019
  12. Feb 20, 2019
  13. Dec 01, 2018
  14. Apr 07, 2018
  15. Dec 12, 2017
    • Masahiro Yamada's avatar
      kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail · 262dad68
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: default avatarJim Davis <jim.epost@gmail.com>
      262dad68
    • Paolo Pisati's avatar
      scripts/package: snap-pkg target · 5704d455
      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: default avatarPaolo Pisati <paolo.pisati@canonical.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      5704d455
  16. Nov 23, 2017
    • Masahiro Yamada's avatar
      kbuild: rpm: prompt to use "rpm-pkg" if "rpm" target is used · ebaad7d3
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      ebaad7d3
    • Masahiro Yamada's avatar
      kbuild: pkg: use --transform option to prefix paths in tar · 2dbc644a
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      2dbc644a
  17. Nov 14, 2017
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: do not force -jN in submake · 8a16a070
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      8a16a070
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: keep spec file until make mrproper · af60e207
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      af60e207
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: fix jobserver unavailable warning · 606625be
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      606625be
  18. Sep 20, 2017
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: fix version number handling · 25b080bd
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      25b080bd
  19. May 16, 2016
  20. Nov 24, 2015
    • Riku Voipio's avatar
      package Makefile: fix perf-tar targets when outdir is set · 4b63f603
      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: default avatarRiku Voipio <riku.voipio@linaro.org>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
      4b63f603
  21. Sep 04, 2015
  22. Jun 15, 2015
    • Jim Davis's avatar
      scripts/package/Makefile: rpmbuild is needed for rpm targets · 21a59991
      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: default avatarJim Davis <jim.epost@gmail.com>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
      21a59991
  23. Jun 09, 2014
  24. Nov 07, 2013
  25. May 16, 2013
  26. Apr 18, 2013
  27. Apr 08, 2013
  28. Oct 29, 2011
  29. Jun 24, 2011
Loading