src/userspace: merge back into initramfs
Previously ownerboot had separate `userspace` (the initramfs contents without kernel modules) and `initramfs` (the complete initramfs) expressions. This was done in order to allow the use of CONFIG_INITRAMFS_SOURCE, which links an initramfs image into the kernel itself. I did this because I was having a hard time getting coreboot to load a separate initrd on rk3399. I have since solved that problem, and am now using coreboot to load an initramfs on all platforms. There is no longer any need for this unusual separation.master
parent
f26abaaeba
commit
98c5638e64
@ -1,59 +0,0 @@
|
||||
# This constructs a minimal initramfs userspace containing `signify`,
|
||||
# `lvm`, `dmsetup`, `cryptsetup`, and `kexec`.
|
||||
{ lib
|
||||
, nixpkgsOnBuildForHost
|
||||
, kernel
|
||||
, bootScript ? ../boot.sh # symlinked to /init if non-null
|
||||
|
||||
, withBusybox ? true
|
||||
, withSignify ? true
|
||||
# Inclusion of these is temporarily disabled. I had a bunch of
|
||||
# ugly space-saving hacks that were removed during the pre-release
|
||||
# cleanup, and it turns out that without those hacks there isn't enough
|
||||
# space for the large userspace tools. Once I clean up and
|
||||
# reinstate those hacks I will reenable this.
|
||||
, withLvm ? false
|
||||
, withCryptsetup ? false
|
||||
, withKexec ? false
|
||||
, withNvramTool ? false # nixpkgsOnBuildForHost.stdenv.hostPlatform.isx86
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (nixpkgsOnBuildForHost.pkgsStatic) stdenv busybox signify lvm2 cryptsetup kexec-tools findutils cpio;
|
||||
nvramtool = nixpkgsOnBuildForHost.pkgsStatic.nvramtool.overrideAttrs(a: {
|
||||
NIX_CFLAGS_COMPILE = "-D__GLIBC__";
|
||||
});
|
||||
in stdenv.mkDerivation {
|
||||
name = "ownerboot-initramfs-userspace";
|
||||
dontUnpack = true;
|
||||
dontFixup = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/usr
|
||||
ln -s bin $out/sbin
|
||||
ln -s ../bin $out/usr/bin
|
||||
ln -s ../sbin $out/usr/sbin
|
||||
'' + lib.optionalString withBusybox ''
|
||||
cp -r ${busybox}/bin $out/bin
|
||||
chmod -R u+w $out/bin
|
||||
'' + lib.optionalString (bootScript != null) ''
|
||||
cp ${bootScript} $out/boot.sh
|
||||
chmod +x $out/boot.sh
|
||||
ln -s boot.sh $out/init
|
||||
chmod +x $out/sbin/init
|
||||
'' + lib.optionalString withSignify ''
|
||||
cp ${signify}/bin/signify $out/bin/
|
||||
'' + lib.optionalString withLvm ''
|
||||
cp ${lib.getBin lvm2}/bin/lvm $out/bin/
|
||||
cp ${lib.getBin lvm2}/bin/dmsetup $out/bin/
|
||||
'' + lib.optionalString withCryptsetup ''
|
||||
cp ${cryptsetup}/bin/cryptsetup $out/bin/
|
||||
'' + lib.optionalString withKexec ''
|
||||
cp ${kexec-tools}/bin/kexec $out/bin/
|
||||
'' + lib.optionalString withNvramTool ''
|
||||
cp ${nvramtool}/bin/nvramtool $out/bin/
|
||||
'' + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue