23 Sep, 2013

1 commit

  • Commit ea4054a23 (modpost: handle huge numbers of modules) added
    support for building a large number of modules.

    Unfortunately, the commit changed the semantics of the makefile: Instead of
    passing only existing object files to modpost, make now passes all expected
    object files. If make was started with option -i, this results in a modpost
    error if a single file failed to build.

    Example with the current btrfs build falure on m68k:

    fs/btrfs/btrfs.o: No such file or directory
    make[1]: [__modpost] Error 1 (ignored)

    This error is followed by lots of errors such as:

    m68k-linux-gcc: error: arch/m68k/emu/nfcon.mod.c: No such file or directory
    m68k-linux-gcc: fatal error: no input files
    compilation terminated.
    make[1]: [arch/m68k/emu/nfcon.mod.o] Error 1 (ignored)

    This doesn't matter much for normal builds, but it is annoying for builds
    started with "make -i" due to the large number of secondary errors.
    Those errors unnececessarily clog any error log and make it difficult
    to find the real errors in the build.

    Fix the problem by adding a new parameter '-n' to modpost. If this parameter
    is specified, modpost reports but ignores missing object files.

    With this patch, error output from above problem is (with make -i):

    m68k-linux-ld: cannot find fs/btrfs/ioctl.o: No such file or directory
    make[2]: [fs/btrfs/btrfs.o] Error 1 (ignored)
    ...
    fs/btrfs/btrfs.o: No such file or directory (ignored)

    Cc: Rusty Russell
    Cc: Michael Marek
    Signed-off-by: Guenter Roeck
    Signed-off-by: Rusty Russell

    Guenter Roeck
     

05 Apr, 2013

1 commit

  • strace shows:
    72102 execve("/bin/sh", ["/bin/sh", "-c", "echo ' scripts/mod/modpost -m -a
    -o /cc/wfg/sound-compiletest/Module.symvers -s'; scripts/
    mod/modpost -m -a -o /cc/wfg/sound-compiletest/Module.symvers -s vmlinux
    arch/x86/crypto/ablk_helper.o arch/x86/crypto/aes-i586.o arch
    /x86/crypto/aesni-intel.o arch/x86/crypto/crc32-pclmul.o
    ...
    drivers/ata/sata_promise.o "...], [/* 119 vars */]
    71827 wait4(-1,
    72102 ) = -1 E2BIG (Argument list too long)

    So we re-run the shell command which produces the list and feed it into modpost -T -.

    Reported-by: Fengguang Wu
    Signed-off-by: Rusty Russell

    Rusty Russell
     

25 Jan, 2013

1 commit


19 Oct, 2012

1 commit

  • Linus deleted the old code and put signing on the install command,
    I fixed it to extract the keyid and signer-name within sign-file
    and cleaned up that script now it always signs in-place.

    Some enthusiast should convert sign-key to perl and pull
    x509keyid into it.

    Signed-off-by: Rusty Russell
    Signed-off-by: Linus Torvalds

    Rusty Russell
     

15 Oct, 2012

1 commit

  • Pull module signing support from Rusty Russell:
    "module signing is the highlight, but it's an all-over David Howells frenzy..."

    Hmm "Magrathea: Glacier signing key". Somebody has been reading too much HHGTTG.

    * 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (37 commits)
    X.509: Fix indefinite length element skip error handling
    X.509: Convert some printk calls to pr_devel
    asymmetric keys: fix printk format warning
    MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
    MODSIGN: Make mrproper should remove generated files.
    MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
    MODSIGN: Use the same digest for the autogen key sig as for the module sig
    MODSIGN: Sign modules during the build process
    MODSIGN: Provide a script for generating a key ID from an X.509 cert
    MODSIGN: Implement module signature checking
    MODSIGN: Provide module signing public keys to the kernel
    MODSIGN: Automatically generate module signing keys if missing
    MODSIGN: Provide Kconfig options
    MODSIGN: Provide gitignore and make clean rules for extra files
    MODSIGN: Add FIPS policy
    module: signature checking hook
    X.509: Add a crypto key parser for binary (DER) X.509 certificates
    MPILIB: Provide a function to read raw data into an MPI
    X.509: Add an ASN.1 decoder
    X.509: Add simple ASN.1 grammar compiler
    ...

    Linus Torvalds
     

10 Oct, 2012

1 commit

  • If CONFIG_MODULE_SIG is set, then this patch will cause all modules files to
    to have signatures added. The following steps will occur:

    (1) The module will be linked to foo.ko.unsigned instead of foo.ko

    (2) The module will be stripped using both "strip -x -g" and "eu-strip" to
    ensure minimal size for inclusion in an initramfs.

    (3) The signature will be generated on the stripped module.

    (4) The signature will be appended to the module, along with some information
    about the signature and a magic string that indicates the presence of the
    signature.

    Step (3) requires private and public keys to be available. By default these
    are expected to be found in files:

    signing_key.priv
    signing_key.x509

    in the base directory of the build. The first is the private key in PEM form
    and the second is the X.509 certificate in DER form as can be generated from
    openssl:

    openssl req \
    -new -x509 -outform PEM -out signing_key.x509 \
    -keyout signing_key.priv -nodes \
    -subj "/CN=H2G2/O=Magrathea/CN=Slartibartfast"

    If the secret key is not found then signing will be skipped and the unsigned
    module from (1) will just be copied to foo.ko.

    If signing occurs, lines like the following will be seen:

    LD [M] fs/foo/foo.ko.unsigned
    STRIP [M] fs/foo/foo.ko.stripped
    SIGN [M] fs/foo/foo.ko

    will appear in the build log. If the signature step will be skipped and the
    following will be seen:

    LD [M] fs/foo/foo.ko.unsigned
    STRIP [M] fs/foo/foo.ko.stripped
    NO SIGN [M] fs/foo/foo.ko

    NOTE! After the signature step, the signed module _must_not_ be passed through
    strip. The unstripped, unsigned module is still available at the name on the
    LD [M] line. This restriction may affect packaging tools (such as rpmbuild)
    and initramfs composition tools.

    Signed-off-by: David Howells
    Signed-off-by: Rusty Russell

    David Howells
     

31 Aug, 2012

1 commit

  • This error may happen when the user's id or path includes .ko string.
    For example, user's id is xxx.ko and building test.ko module,
    the test.mod file lists ko name and all object files.
    /home/xxx.ko/kernel_dev/device/drivers/test.ko
    /home/xxx.ko/kernel_dev/device/drivers/test_main.o
    /home/xxx.ko/kernel_dev/device/drivers/test_io.o ...
    Current Makefile.modpost and Makefile.modinst find and list up not
    only test.ko but also other object files.
    because all of object file's path includes .ko string.
    This is a patch to fix it.

    Signed-off-by: Gunho Lee
    Signed-off-by: Michal Marek

    이건호
     

07 Jun, 2011

1 commit


25 May, 2011

1 commit


31 Mar, 2011

1 commit


03 Aug, 2010

2 commits

  • Signed-off-by: Uwe Kleine-König
    Signed-off-by: Michal Marek

    Uwe Kleine-König
     
  • It is now possible to assign options to AS, CC and LD
    on the command line - which is only used when building modules.

    {A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile
    in the arch makefiles, thus users had no way to specify
    additional options to AS, CC, LD when building modules
    without overriding the original value.

    Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE
    that is used by arch specific files and free up
    {A,C,LD}FLAGS_MODULE so they can be assigned on
    the command line.

    All arch Makefiles that used the old variables has been updated.

    Note: Previously we had a MODFLAGS variable for both
    AS and CC. But in favour of consistency this was dropped.
    So in some cases arch Makefile has one assignmnet replaced by
    two assignmnets.

    Note2: MODFLAGS was not documented and is dropped
    without any notice. I do not expect much/any breakage
    from this.

    Signed-off-by: Sam Ravnborg
    Cc: Denys Vlasenko
    Cc: Haavard Skinnemoen
    Cc: Mike Frysinger
    Cc: Tony Luck
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: Chen Liqin
    Acked-by: Mike Frysinger [blackfin]
    Acked-by: Haavard Skinnemoen [avr32]
    Signed-off-by: Michal Marek

    Sam Ravnborg