summary refs log tree commit diff
path: root/pkgs/os-specific/linux/dracut
diff options
context:
space:
mode:
authorLily Foster <lily@lily.flowers>2023-01-10 19:11:21 -0500
committerEmery Hemingway <ehmry@posteo.net>2023-01-16 10:53:16 -0600
commitf46ee73ba6851e458dedc78e3f0fe2c6eb099697 (patch)
treef9bf388566820cbf33d1368613d39b72f42e9727 /pkgs/os-specific/linux/dracut
parent7c1096ab995f8a75b794b1f4ac841ea6caa7a120 (diff)
downloadnixpkgs-f46ee73ba6851e458dedc78e3f0fe2c6eb099697.tar
nixpkgs-f46ee73ba6851e458dedc78e3f0fe2c6eb099697.tar.gz
nixpkgs-f46ee73ba6851e458dedc78e3f0fe2c6eb099697.tar.bz2
nixpkgs-f46ee73ba6851e458dedc78e3f0fe2c6eb099697.tar.lz
nixpkgs-f46ee73ba6851e458dedc78e3f0fe2c6eb099697.tar.xz
nixpkgs-f46ee73ba6851e458dedc78e3f0fe2c6eb099697.tar.zst
nixpkgs-f46ee73ba6851e458dedc78e3f0fe2c6eb099697.zip
dracut: init at 059
Diffstat (limited to 'pkgs/os-specific/linux/dracut')
-rw-r--r--pkgs/os-specific/linux/dracut/default.nix128
1 files changed, 128 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/dracut/default.nix b/pkgs/os-specific/linux/dracut/default.nix
new file mode 100644
index 00000000000..2b483e2c7c7
--- /dev/null
+++ b/pkgs/os-specific/linux/dracut/default.nix
@@ -0,0 +1,128 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, gitUpdater
+, makeBinaryWrapper
+, pkg-config
+, asciidoc
+, libxslt
+, docbook_xsl
+, bash
+, kmod
+, binutils
+, busybox
+, bzip2
+, coreutils
+, cpio
+, findutils
+, glibc
+, gnugrep
+, gnused
+, gnutar
+, gzip
+, kbd
+, lvm2
+, lz4
+, lzop
+, procps
+, rng-tools
+, squashfsTools
+, systemd
+, util-linux
+, xz
+, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dracut";
+  version = "059";
+
+  src = fetchFromGitHub {
+    owner = "dracutdevs";
+    repo = "dracut";
+    rev = version;
+    hash = "sha256-zSyC2SnSQkmS/mDpBXG2DtVVanRRI9COKQJqYZZCPJM=";
+  };
+
+  strictDeps = true;
+
+  buildInputs = [
+    bash
+    kmod
+  ];
+
+  nativeBuildInputs = [
+    makeBinaryWrapper
+    pkg-config
+    asciidoc
+    libxslt
+    docbook_xsl
+  ];
+
+  postPatch = ''
+    substituteInPlace dracut.sh \
+      --replace 'dracutbasedir="$dracutsysrootdir"/usr/lib/dracut' 'dracutbasedir="$dracutsysrootdir"'"$out/lib/dracut"
+    substituteInPlace lsinitrd.sh \
+      --replace 'dracutbasedir=/usr/lib/dracut' "dracutbasedir=$out/lib/dracut"
+
+    echo 'DRACUT_VERSION=${version}' >dracut-version.sh
+  '';
+
+  preConfigure = ''
+    patchShebangs ./configure
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/dracut --prefix PATH : ${lib.makeBinPath [
+      coreutils
+      util-linux
+    ]} --prefix DRACUT_PATH : ${lib.makeBinPath [
+      bash
+      binutils
+      coreutils
+      findutils
+      glibc
+      gnugrep
+      gnused
+      gnutar
+      kbd
+      lvm2
+      procps
+      rng-tools
+      squashfsTools
+      systemd
+      util-linux
+      busybox
+    ]}
+    wrapProgram $out/bin/dracut-catimages --set PATH ${lib.makeBinPath [
+      coreutils
+      cpio
+      findutils
+      gzip
+    ]}
+    wrapProgram $out/bin/lsinitrd --set PATH ${lib.makeBinPath [
+      binutils
+      bzip2
+      coreutils
+      cpio
+      gnused
+      gzip
+      lz4
+      lzop
+      squashfsTools
+      util-linux
+      xz
+      zstd
+    ]}
+  '';
+
+  passthru.updateScript = gitUpdater { };
+
+  meta = with lib; {
+    homepage = "https://dracut.wiki.kernel.org";
+    description = "An event driven initramfs infrastructure";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ lilyinstarlight ];
+    platforms = platforms.linux;
+  };
+}