1. 12 12月, 2017 1 次提交
    • P
      scripts/package: snap-pkg target · 5704d455
      Paolo Pisati 提交于
      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: NPaolo Pisati <paolo.pisati@canonical.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      5704d455
  2. 23 11月, 2017 2 次提交
    • M
      kbuild: rpm: prompt to use "rpm-pkg" if "rpm" target is used · ebaad7d3
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      ebaad7d3
    • M
      kbuild: pkg: use --transform option to prefix paths in tar · 2dbc644a
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      2dbc644a
  3. 14 11月, 2017 3 次提交
    • M
      kbuild: rpm-pkg: do not force -jN in submake · 8a16a070
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      8a16a070
    • M
      kbuild: rpm-pkg: keep spec file until make mrproper · af60e207
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      af60e207
    • M
      kbuild: rpm-pkg: fix jobserver unavailable warning · 606625be
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      606625be
  4. 20 9月, 2017 1 次提交
    • M
      kbuild: rpm-pkg: fix version number handling · 25b080bd
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      25b080bd
  5. 16 5月, 2016 1 次提交
  6. 25 11月, 2015 1 次提交
    • R
      package Makefile: fix perf-tar targets when outdir is set · 4b63f603
      Riku Voipio 提交于
      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: NRiku Voipio <riku.voipio@linaro.org>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      4b63f603
  7. 04 9月, 2015 2 次提交
  8. 15 6月, 2015 1 次提交
    • J
      scripts/package/Makefile: rpmbuild is needed for rpm targets · 21a59991
      Jim Davis 提交于
      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: NJim Davis <jim.epost@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      21a59991
  9. 10 6月, 2014 1 次提交
  10. 07 11月, 2013 1 次提交
  11. 16 5月, 2013 1 次提交
  12. 18 4月, 2013 4 次提交
  13. 08 4月, 2013 1 次提交
  14. 30 10月, 2011 1 次提交
  15. 24 6月, 2011 1 次提交
  16. 24 5月, 2011 1 次提交
  17. 05 5月, 2011 1 次提交
  18. 09 3月, 2011 1 次提交
  19. 21 7月, 2010 1 次提交
  20. 18 6月, 2010 1 次提交
    • M
      kbuild: Clean up and speed up the localversion logic · 09155120
      Michal Marek 提交于
      Now that we run scripts/setlocalversion during every build, it makes
      sense to move all the localversion logic there. This cleans up the
      toplevel Makefile and also makes sure that the script is called only
      once in 'make prepare' (previously, it would be called every time due to
      a variable expansion in an ifneq statement). No user-visible change is
      intended, unless one runs the setlocalversion script directly.
      Reported-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Nico Schottelius <nico-linuxsetlocalversion@schottelius.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      09155120
  21. 05 6月, 2010 1 次提交
    • A
      perf tools: Make target to generate self contained source tarball · 8e5564e6
      Arnaldo Carvalho de Melo 提交于
      Useful for when people want to try some version of the perf tools and don't
      wants to download the kernel tarball.
      
      Here is a session using this new target:
      
        [root@emilia linux-2.6-tip]# make help | grep -i perf
          perf-tar-src-pkg    - Build perf-2.6.35-rc1.tar source tarball
          perf-targz-src-pkg  - Build perf-2.6.35-rc1.tar.gz source tarball
          perf-tarbz2-src-pkg - Build perf-2.6.35-rc1.tar.bz2 source tarball
        [root@emilia linux-2.6-tip]# make perf-tarbz2-src-pkg
          TAR
        [root@emilia linux-2.6-tip]# ls -la perf-2.6.35-rc1.tar.bz2
        -rw-r--r-- 1 root root 295731 May 31 11:18 perf-2.6.35-rc1.tar.bz2
        [root@emilia linux-2.6-tip]# tar xf perf-2.6.35-rc1.tar.bz2
        [root@emilia linux-2.6-tip]# cd perf-2.6.35-rc1
        [root@emilia perf-2.6.35-rc1]# ls
        arch  HEAD  include  lib  tools
        [root@emilia perf-2.6.35-rc1]# cd tools/perf
        [root@emilia perf]# make -j9 2>&1 | tail
            CC arch/x86/util/dwarf-regs.o
            CC util/probe-finder.o
            CC util/newt.o
            CC util/scripting-engines/trace-event-perl.o
            CC scripts/perl/Perf-Trace-Util/Context.o
            CC perf.o
            CC builtin-help.o
            AR libperf.a
            LINK perf
        rm .perf.dev.null
        [root@emilia perf]# ./perf record -a sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.262 MB perf.data (~11457 samples) ]
        [root@emilia perf]# ./perf report | head -12
        # Events: 6K cycles
        #
        # Overhead          Command       Shared Object  Symbol
        # ........  ...............  ..................  ......
        #
             4.73%             perf  [kernel.kallsyms]   [k] format_decode
             4.49%             perf  libc-2.12.so        [.] _IO_file_underflow_internal
             4.38%             init  [kernel.kallsyms]   [k] mwait_idle
             3.29%             perf  [kernel.kallsyms]   [k] vsnprintf
             2.38%             init  [kernel.kallsyms]   [k] sched_clock_local
             2.35%             init  [kernel.kallsyms]   [k] apic_timer_interrupt
             1.86%     sirq-timer/5  [kernel.kallsyms]   [k] find_busiest_group
        [root@emilia perf]#
      Acked-by: NMichal Marek <mmarek@suse.cz>
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20100528185357.GA28009@ghostprotocols.net>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8e5564e6
  22. 12 12月, 2009 2 次提交
    • J
      scripts/package: deb-pkg: use fakeroot if available · db1d1865
      Jonathan Nieder 提交于
      Running "make deb-pkg" requires setting KBUILD_PKG_ROOTCMD or
      becoming root oneself or it errors out.  Unless already running
      as root or KBUILD_PKG_ROOTCMD is already set, use fakeroot as a
      good default.
      
      With this patch applied, you can run "make oldconfig deb-pkg" as
      an ordinary user to build a binary package for an updated kernel
      tree and it should just work.
      
      fakeroot is too zealous by default in treating files as owned by
      root.  Its wrapped stat() sets st_uid and st_gid to 0 for all
      files, which causes Git to go on a wild goose chase if
      CONFIG_LOCALVERSION_AUTO is set, checking if any file's content
      has changed along with its stat information.  Avoid this by
      telling fakeroot to use the actual owner and group for
      preexisting files, by passing it the -u option.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      db1d1865
    • J
      scripts/package: add KBUILD_PKG_ROOTCMD variable · 05ba4488
      Jonathan Nieder 提交于
      Let the deb-pkg target acquire (fake) root privileges before
      running commands that need them.  Without such privileges,
      deb-pkg errors out because chown fails.
      
      The new KBUILD_PKG_ROOTCMD variable, if defined, is used as a
      command to run other commands with possibly fake elevated
      privileges.  Since this is not needed for the tar-pkg and rpm-pkg
      targets, it is only used by deb-pkg.  If it is not defined, the
      behavior is as before, and the user will have to rerun make as
      root.
      
      In other words, as a shortcut, instead of running 'make oldconfig &&
      make && fakeroot -u make deb-pkg', one can use the single command
      'make oldconfig deb-pkg KBUILD_PKG_ROOTCMD="fakeroot -u"'.
      Suggested-by: NRyan Anderson <ryan@michonline.com>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      05ba4488
  23. 12 10月, 2009 1 次提交
  24. 07 3月, 2009 1 次提交
    • J
      kbuild: fix 'make rpm' when CONFIG_LOCALVERSION_AUTO=y and using SCM tree · b925dbfe
      Josh Hunt 提交于
      Running 'make rpm' fails when CONFIG_LOCALVERSION_AUTO=y and using a kernel source
      tree under SCM.  This is due to KERNELRELEASE being different when the initial make
      is run and when make is run from rpmbuild.
      
      mkspec creates kernel.spec using KERNELRELEASE:
      
      <mkspec>
      echo "%files"
      echo '%defattr (-, root, root)'
      echo "%dir /lib/modules"
      echo "/lib/modules/$KERNELRELEASE"
      echo "/lib/firmware"
      echo "/boot/*"
      echo ""
      </mkspec>
      
      When CONFIG_LOCALVERSION_AUTO=y scripts/setlocalversion is called and grabs any
      additional version info from SCM.  Next, the srctree is tarred up and SCM
      information is excluded.
      
      rpmbuild reruns make and in the process generates a new include/config/kernel.release
      and thus a new KERNELRELEASE.  However this time the SCM information is gone so
      KERNELRELEASE no longer has the additional version information.  When "make modules_install"
      runs, it uses the new KERNELRELEASE value to determine where to install the modules.
      This conflicts with where the spec file assumes they are going because of the
      mis-matching KERNELRELEASE versions.
      
      <snippet>
      + INSTALL_MOD_PATH=/var/tmp/kernel-2.6.29rc4tip01479g5d85422-root
      + make -j16 modules_install
        INSTALL crypto/aead.ko
        INSTALL crypto/cbc.ko
        INSTALL crypto/chainiv.ko
        INSTALL crypto/crc32c.ko
        INSTALL crypto/crypto_algapi.ko
        INSTALL crypto/crypto_blkcipher.ko
        INSTALL crypto/crypto_hash.ko
        INSTALL crypto/cryptomgr.ko
        INSTALL crypto/ecb.ko
        INSTALL crypto/eseqiv.ko
        INSTALL crypto/krng.ko
        INSTALL crypto/md5.ko
        INSTALL crypto/pcbc.ko
        INSTALL crypto/rng.ko
        INSTALL drivers/block/cciss.ko
        INSTALL drivers/hid/hid-dummy.ko
        INSTALL drivers/scsi/iscsi_tcp.ko
        INSTALL drivers/scsi/libiscsi.ko
        INSTALL drivers/scsi/libiscsi_tcp.ko
        INSTALL drivers/scsi/scsi_transport_iscsi.ko
        INSTALL drivers/scsi/scsi_wait_scan.ko
        INSTALL fs/lockd/lockd.ko
        INSTALL fs/nfs/nfs.ko
        INSTALL fs/nfsd/nfsd.ko
        INSTALL lib/libcrc32c.ko
        INSTALL net/sunrpc/sunrpc.ko
        DEPMOD  2.6.29-rc4-tip
      + cp arch/x86/boot/bzImage
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/vmlinuz-2.6.29-rc4-tip-01479-g5d85422
      + cp System.map
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/System.map-2.6.29-rc4-tip-01479-g5d85422
      + cp .config
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/config-2.6.29-rc4-tip-01479-g5d85422
      + cp vmlinux vmlinux.orig
      + bzip2 -9 vmlinux
      + mv vmlinux.bz2
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/boot/vmlinux-2.6.29-rc4-tip-01479-g5d85422.bz2
      + mv vmlinux.orig vmlinux
      + /usr/lib/rpm/brp-compress
      Processing files: kernel-2.6.29rc4tip01479g5d85422-2
      error: File not found:
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/lib/modules/2.6.29-rc4-tip-01479-g5d85422
      
      RPM build errors:
          File not found:
      /var/tmp/kernel-2.6.29rc4tip01479g5d85422-root/lib/modules/2.6.29-rc4-tip-01479-g5d85422
      make[1]: *** [rpm] Error 1
      make: *** [rpm] Error 2
      </snippet>
      
      I have tested this patch on git -tip, Linus' git tree, and the kernel.org tar files, both
      with and without CONFIG_LOCALVERSION_AUTO=y.
      Signed-off-by: NJosh Hunt <josh@scalex86.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      ----
      b925dbfe
  25. 06 12月, 2008 1 次提交
  26. 04 12月, 2008 1 次提交
  27. 29 1月, 2008 1 次提交
  28. 09 3月, 2006 1 次提交
  29. 06 3月, 2006 1 次提交
  30. 02 1月, 2006 1 次提交
  31. 22 7月, 2005 1 次提交
  32. 15 7月, 2005 1 次提交