Commit Graph

55 Commits

Author SHA1 Message Date
Linus Heckemann
14fbf575ec make-initrd: various improvements
- Generate a link to the initramfs file with an appropriate file
  extension, guessed based on the compressor by default
- Use correct metadata in u-boot images if generated, up to now this
  was hardcoded to gzip and would silently generate an erroneous image
  if another compressor was specified
- Document all the parameters
- Improve cross-building compatibility, by allowing passing either a
  string as before, or a function taking a package set and returning the
  path to a compressor in the "compressor" argument of the
  function.
- Support more compression algorithms
- Place compressor executable function and arguments in passthru, for
  reuse when appending initramfses

Co-Authored-By: Dominik Xaver Hörl <hoe.dom@gmx.de>
2020-12-17 11:37:04 +01:00
Linus Heckemann
3a3c9c9548 makeInitrd: include dotfiles at root 2020-12-17 11:10:37 +01:00
Linus Heckemann
85e0ae7827 makeInitrd: don't assume uImage => arm
mips for example might use uImages too
2020-12-17 11:10:37 +01:00
Linus Heckemann
a343ff7e14 makeInitrd: make uinitrd behaviour optional 2020-12-17 11:10:36 +01:00
Arthur Gautier
70bc1a3f49 makeModulesClosuse: read modules from corrent kernel version
Before this commit, the firmware information would be loaded from the
currently running kernel, not from the kernel to be loaded.

This commit ensures the correct kernel version and modules are read.
2020-08-27 10:48:18 -07:00
Arthur Gautier
ee8572d6b3 makeModulesClosure: fixup firmware extraction
After a recent upgrade of modinfo, its output is now incorrect for
builtin modules. This commit filters out the output until a fix is made
available upstream
2020-08-27 10:45:23 -07:00
CrystalGamma
b155b1dafb makeModulesClosure: handle builtin modules better
The previous code discarded entire dependency trees if the first entry in the dependency list compiled by `modprobe --show-depends` is a builtin and otherwise handled its output in a rather hackish way.
2020-07-16 20:44:07 +02:00
Markus S. Wamser
34b04a6364 modules-shrunk: preserve module priorities from build
depmod looks for files modules.order and modules.builtin which are
generated at kernel build time but were previously not passed to
the modules-shrunk derivation
2019-12-07 23:04:17 +01:00
Eelco Dolstra
328796d734
makeInitrd: Use stdenvNoCC 2019-10-11 17:12:09 +02:00
Arian van Putten
b086b342bb build-support/make-initrd: Don't derive derivation name from file name
not all valid file names are valid derivation names. This can cause
troubles when, for example, trying to place systemd template unit
files, which contain an '@' in their name,  in an initrd.

Fixes #53987
2019-05-29 16:07:05 +02:00
Linus Heckemann
3b16f345b5 make-initrd: allow specifying name
Also moves the argument defaults out of all-packages.nix and into
make-initrd itself.
2019-04-13 23:20:58 +02:00
John Ericson
0828e2d8c3 treewide: Remove usage of remaining redundant platform compatability stuff
Want to get this out of here for 18.09, so it can be deprecated
thereafter.
2018-08-30 17:20:32 -04:00
aszlig
de581b99ca
kernel: Fix running kernels *with* modules
Pull request #38470 added support for running/building kernels without
modules. This got merged in 38e04bbf29fe3b6af26b3505a42ce5871aeac17d but
unfortunately while this works perfectly on kernels without modules it
also makes sure that *every* kernel gets no modules.

So all of our VM tests fail since that merge with something like this:

machine# loading module loop...
machine# modprobe: FATAL: Module loop not found in directory /lib/modules/4.14.33
machine# loading module vfat...
machine# modprobe: FATAL: Module vfat not found in directory /lib/modules/4.14.33
machine# loading module nls_cp437...
machine# modprobe: FATAL: Module nls_cp437 not found in directory /lib/modules/4.14.33
machine# loading module nls_iso8859-1...
machine# modprobe: FATAL: Module nls_iso8859-1 not found in directory /lib/modules/4.14.33
machine# loading module fuse...
machine# modprobe: FATAL: Module fuse not found in directory /lib/modules/4.14.33
machine# loading module dm_mod...
machine# modprobe: FATAL: Module dm_mod not found in directory /lib/modules/4.14.33

I shortly tested this against the "misc" VM test and the test is working
again.

In the long term (and I currently don't have time for this) it would be
better to also have a VM test which tests a kernel without modules.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @roberth, @7c6f434c
2018-04-12 15:43:53 +02:00
Robert Hensing
30bff42231 linux module handling: support kernels without modules 2018-04-05 17:00:00 +02:00
Jan Malakhovski
7079e744d4 Merge branch 'master' into staging
Resolved the following conflicts (by carefully applying patches from the both
branches since the fork point):

   pkgs/development/libraries/epoxy/default.nix
   pkgs/development/libraries/gtk+/3.x.nix
   pkgs/development/python-modules/asgiref/default.nix
   pkgs/development/python-modules/daphne/default.nix
   pkgs/os-specific/linux/systemd/default.nix
2018-03-10 20:38:13 +00:00
Vladimír Čunát
a373fe8322
makeInitrd: explain why we don't use closureInfo
/cc #36268.
2018-03-05 13:04:55 +01:00
Eelco Dolstra
165b32d386
Revert "makeInitrd: Use closureInfo"
This reverts commit 776a5e6ebfacc6831527bc6c3c1a58ef2087c819.

Fixes #36268.
2018-03-05 12:49:59 +01:00
Shea Levy
6a32291523
makeModulesClosure: Fix cross-compilation 2018-02-28 15:01:32 -05:00
Eelco Dolstra
776a5e6ebf
makeInitrd: Use closureInfo 2018-02-23 16:41:31 +01:00
Nikolay Amiantov
56e0943b08 makeModulesClosure: support firmware
Link it in stage 1.
2018-02-16 00:11:07 +02:00
Tuomas Tynkkynen
0d9f2f0bb4 platforms.nix: Clean up more 'uboot' legacy
For a while now, the only thing the 'uboot' attribute does is to tell
whether to add ubootTools to kernel/initrd builds. That can be
determined with platform.kernelTarget == "uImage" just as well.
2017-11-05 17:06:59 +02:00
Tuomas Tynkkynen
b50693d16c kernel, initrd: Remove legacy ubootChooser 2017-11-05 15:11:12 +02:00
Eelco Dolstra
5939af52b3
pathsFromGraph: Remove obsolete printManifest feature 2017-10-25 15:38:11 +02:00
John Ericson
deb8fae4c0 make-initrd: Don't use stdenv.cross 2017-06-28 18:21:05 -04:00
Joachim Fasting
5a8147479e make-initrd: create reproducible initrds
To achieve reproducible results, `cpio` archive members are added in
sorted order and inodes renumbered.

The `cpio-clean.pl` script is made obsolete by setting mtimes via
`touch` & using `cpio --reproducible`.  Suggested by @dezgeg in
https://github.com/NixOS/nixpkgs/pull/21273#issuecomment-268116605.

Note that using `--reproducible` means that initial ramdisk creation now
requires at least `cpio` version 2.12 (released in 2015).
2016-12-20 14:00:04 +01:00
Tuomas Tynkkynen
5076c0a5d3 modules-closure: Use stdenvNoCC 2016-10-20 02:39:29 +03:00
Nikolay Amiantov
6d6f6b4748 makeModulesClosure: don't set pipefail as it's already set in $stdenv/setup 2016-08-14 22:38:33 +03:00
Eelco Dolstra
030838ba25 makeModulesClosure: Small cleanup 2016-02-01 18:19:23 +01:00
Nikolay Amiantov
9c431b77ff make-initrd: store all files with root as owner 2015-12-28 12:07:11 +03:00
William A. Kennington III
f2655e4fa0 makeInitrd: Support prepending other initrds 2015-03-25 14:14:46 -07:00
Alexander Kjeldaas
81172a77e6 Document paths-from-graph.pl somewhat. 2014-06-28 20:44:22 -05:00
Mathijs Kwik
b21853f255 Fix initrd breaking by recent repeatable-builds changes
See the comments at f67015cae4
for more information.

Please note: this makes initrd unrepeatable again, but most people will prefer that above an unbootable system.
2014-04-12 00:06:30 +02:00
Alexander Kjeldaas
f67015cae4 Make initrd and the kernel builds repeatable. 2014-04-05 08:41:06 +02:00
Eelco Dolstra
4c77c6e232 makeModulesClosure: Use kmod instead of module-init-tools 2013-08-07 22:46:11 +02:00
Shea Levy
acd4299e75 Merge branch 'master' into stdenv-updates
Conflicts:
	pkgs/applications/networking/browsers/chromium/default.nix
	pkgs/top-level/all-packages.nix

Merge conflicts seemed trivial, but a look from viric and aszlig would be nice.
2013-02-21 11:13:30 -05:00
Shea Levy
79c3f992b4 makeInitrd: Make the compressor configurable 2013-02-19 11:49:31 -05:00
Eelco Dolstra
ab3eeabfed Rename buildNativeInputs -> nativeBuildInputs
Likewise for propagatedBuildNativeInputs, etc.  "buildNativeInputs"
sounds like an imperative rather than a noun phrase.
2012-12-28 19:20:09 +01:00
Eelco Dolstra
8336d55993 * Be less verbose generating initrds.
svn path=/nixpkgs/trunk/; revision=34199
2012-05-21 20:47:57 +00:00
Eelco Dolstra
c556a6ea46 * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless
function, so obsolete it.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31644
2012-01-18 20:16:00 +00:00
Peter Simons
69488d688d synchronize with trunk
svn path=/nixpkgs/branches/stdenv-updates/; revision=30186
2011-11-02 10:28:32 +00:00
Shea Levy
0f80aa96a6 s|/nix/store|$NIX_STORE|
svn path=/nixpkgs/trunk/; revision=30094
2011-10-28 23:44:49 +00:00
Peter Simons
1abdc56a12 Synchronized stdenv-updates branch with trunk.
There were conflicting patches of pkgs/os-specific/linux/module-init-tools.
Apparently, the expression was updated independently in both branches. I've
resolved the conflict by preferring the patches from stdenv-updates, because
those patches appeared to be more sophisticated, i.e. they build the manual,
etc.

svn path=/nixpkgs/branches/stdenv-updates/; revision=29680
2011-10-06 09:37:22 +00:00
Shea Levy
21b2dd7ab4 D'oh
svn path=/nixpkgs/trunk/; revision=29562
2011-10-02 12:53:51 +00:00
Shea Levy
36910c10e5 modprobe --show-depends now spits out 'builtin' if a requested module is, well, built-in
svn path=/nixpkgs/trunk/; revision=29560
2011-10-02 11:50:19 +00:00
Shea Levy
4d70ba6cc9 Merge from trunk up through r28790
svn path=/nixpkgs/branches/stdenv-updates/; revision=28792
2011-08-24 19:16:43 +00:00
David Guibert
05a530fd10 module-init-tools: 3.4 -> 3.16
svn path=/nixpkgs/branches/stdenv-updates/; revision=28621
2011-08-16 18:20:59 +00:00
Eelco Dolstra
a74d449daf * nixSqlite expects another integer (denoting the size of the NAR) in
`nix-store --load-db'.

svn path=/nixpkgs/trunk/; revision=25988
2011-02-16 11:49:08 +00:00
Lluís Batlle i Rossell
3b747e92e5 Fixing the correct handling of uboot in the initrd and the kernel derivations.
(nixos on sheevaplug)


svn path=/nixpkgs/trunk/; revision=20275
2010-02-27 18:51:06 +00:00
Lluís Batlle i Rossell
11aa65c28a Simplified much more the expressions for cross building and multiplatform.
I introduce the new nixpkgs parameter "platform", defaulting to "pc",
which was before defined as an attribute of nixpkgs.

I made the crossSystem nixpkgs attribute set parameter contain its own 'platform'.

This allows cross-building a kernel for a given crossSystem.platform in a non-PC
platform.

The actual native platform can be taken from stdenv.platform, and this way we also
avoid the constant passing of 'platform' to packages for platform-dependant builds
(kernel, initrd, ...).

I will update nixos accordingly to these changes, for non-PC platforms to work.

I think we are gaining on flexibility and clearness. I could cross build succesfully
an ultrasparc kernel and a mipsel kernel on PC. But since this change, I should be able
to do this also in non-PC.

Before this change, there was no possibility of distinguishing the "target platform" or
the "native build platform" when cross building, being the single "platform" attribute
always interpreted as target platform.

The platform is a quite relevant attribute set, as it determines the linuxHeaders used
(in the case, by now the only one supported, of linux targets).

The platform attributes are quite linux centric still. Let's hope for more generality to come.

svn path=/nixpkgs/trunk/; revision=20273
2010-02-27 17:35:47 +00:00
Lluís Batlle i Rossell
be2ff23280 Making the 'makeInitrd' expression use "platform"
svn path=/nixpkgs/branches/stdenv-updates/; revision=18292
2009-11-08 18:47:55 +00:00