mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-14 18:21:41 +03:00
Merge pull request #158 from samueldr-wip/feature/stage-1-firmware
Add firmware support to stage-1
This commit is contained in:
commit
f68c78cacb
@ -33,6 +33,11 @@
|
||||
|
||||
mobile.system.type = "depthcharge";
|
||||
|
||||
mobile.device.firmware = pkgs.callPackage ./firmware {};
|
||||
mobile.boot.stage-1.firmware = [
|
||||
config.mobile.device.firmware
|
||||
];
|
||||
|
||||
mobile.boot.stage-1.tasks = [
|
||||
# This hack unbinds and rebinds the currently problematic storage driver.
|
||||
# TODO: move into a generic "gru family" thing.
|
||||
|
19
devices/asus-dumo/firmware/default.nix
Normal file
19
devices/asus-dumo/firmware/default.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ lib
|
||||
, runCommandNoCC
|
||||
, firmwareLinuxNonfree
|
||||
}:
|
||||
|
||||
# The minimum set of firmware files required for the device.
|
||||
runCommandNoCC "asus-dumo-firmware" {
|
||||
src = firmwareLinuxNonfree;
|
||||
} ''
|
||||
for firmware in \
|
||||
ath10k/QCA6174/hw3.0 \
|
||||
qca/nvm_usb_00000302.bin \
|
||||
qca/rampatch_usb_00000302.bin \
|
||||
rockchip/dptx.bin \
|
||||
; do
|
||||
mkdir -p "$(dirname $out/lib/firmware/$firmware)"
|
||||
cp -vrf "$src/lib/firmware/$firmware" $out/lib/firmware/$firmware
|
||||
done
|
||||
''
|
32
modules/initrd-firmware.nix
Normal file
32
modules/initrd-firmware.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types;
|
||||
inherit (config.mobile.boot.stage-1) firmware;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
mobile.boot.stage-1.firmware = lib.mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
description = ''
|
||||
List of packages containing firmware files to be included in the
|
||||
stage-1 for the device.
|
||||
'';
|
||||
apply = list: pkgs.buildEnv {
|
||||
name = "firmware";
|
||||
paths = list;
|
||||
pathsToLink = [ "/lib/firmware" ];
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
mobile.boot.stage-1.contents = [
|
||||
{
|
||||
object = "${firmware}/lib/firmware";
|
||||
symlink = "/lib/firmware";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
@ -187,6 +187,7 @@ let
|
||||
nativeBuildInputs = with pkgs.buildPackages; [
|
||||
ncdu
|
||||
cpio
|
||||
tree
|
||||
];
|
||||
} ''
|
||||
mkdir initrd
|
||||
@ -194,6 +195,7 @@ let
|
||||
|
||||
mkdir -p $out
|
||||
ncdu -0x -o $out/initrd.ncdu ./initrd
|
||||
tree -a ./initrd > $out/tree
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
@ -18,6 +18,7 @@
|
||||
./initrd-boot-gui.nix
|
||||
./initrd-fbterm.nix
|
||||
./initrd-fail.nix
|
||||
./initrd-firmware.nix
|
||||
./initrd-kernel.nix
|
||||
./initrd-logs.nix
|
||||
./initrd-network.nix
|
||||
|
Loading…
Reference in New Issue
Block a user