Skip to content
Snippets Groups Projects
  1. Jun 04, 2019
  2. May 21, 2019
  3. Mar 17, 2019
    • Arseny Maslennikov's avatar
      kbuild: deb-pkg: avoid implicit effects · f6d9db63
      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: default avatarArseny Maslennikov <ar@cs.msu.ru>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      f6d9db63
  4. Mar 13, 2019
  5. Feb 28, 2019
  6. Feb 20, 2019
  7. Dec 01, 2018
  8. Nov 11, 2018
    • Rob Herring's avatar
      builddeb: Fix inclusion of dtbs in debian package · d5615e47
      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: default avatarNuno Gonçalves <nunojpg@gmail.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      d5615e47
    • Masahiro Yamada's avatar
      kbuild: deb-pkg: fix too low build version number · bbcde0a7
      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: default avatarDoug Smythies <dsmythies@telus.net>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: default avatarDoug Smythies <dsmythies@telus.net>
      bbcde0a7
  9. Nov 05, 2018
    • Masahiro Yamada's avatar
      kbuild: deb-pkg: fix bindeb-pkg breakage when O= is used · 02826a6b
      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: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      02826a6b
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: fix binrpm-pkg breakage when O= is used · 21b42eb4
      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: default avatarZhenzhong Duan <zhenzhong.duan@oracle.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      21b42eb4
  10. Jul 28, 2018
  11. Jul 18, 2018
  12. May 17, 2018
    • Riku Voipio's avatar
      kbuild: deb-pkg improve maintainer address generation · d5940c60
      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: default avatarMathieu Malaterre <malat@debian.org>
      Signed-off-by: default avatarRiku Voipio <riku.voipio@linaro.org>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      d5940c60
  13. Apr 13, 2018
  14. Apr 07, 2018
  15. Mar 27, 2018
  16. 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
  17. 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
  18. Nov 14, 2017
    • Sven Joachim's avatar
      builddeb: Pass the kernel:debarch substvar to dpkg-genchanges · bace6480
      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: default avatarSven Joachim <svenjoac@gmx.de>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      bace6480
    • 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
Loading