Split sd-card configuration into new image
This commit is contained in:
parent
e992ecb107
commit
15f95ca074
2
build.sh
2
build.sh
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
nix-build "<nixpkgs/nixos>" \
|
nix-build "<nixpkgs/nixos>" \
|
||||||
-I nixpkgs=https://github.com/danielfullmer/nixpkgs/archive/e69838e006a7271006ab834b521187891bf93ff4.tar.gz \
|
-I nixpkgs=https://github.com/danielfullmer/nixpkgs/archive/e69838e006a7271006ab834b521187891bf93ff4.tar.gz \
|
||||||
-I nixos-config=./configuration.nix \
|
-I nixos-config=./sd-image.nix \
|
||||||
-A config.system.build.sdImage
|
-A config.system.build.sdImage
|
||||||
|
@ -1,18 +1,6 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
uboot = pkgs.callPackage ./uboot {};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [ <nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix> ];
|
|
||||||
|
|
||||||
nixpkgs.crossSystem = lib.recursiveUpdate lib.systems.examples.armv7l-hf-multiplatform {
|
|
||||||
platform = {
|
|
||||||
name = "pinecube";
|
|
||||||
kernelBaseConfig = "sunxi_defconfig";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
boot.loader.generic-extlinux-compatible.enable = true;
|
boot.loader.generic-extlinux-compatible.enable = true;
|
||||||
boot.consoleLogLevel = 7;
|
boot.consoleLogLevel = 7;
|
||||||
@ -20,15 +8,6 @@ in
|
|||||||
# cma is 64M by default which is waay too much and we can't even unpack initrd
|
# cma is 64M by default which is waay too much and we can't even unpack initrd
|
||||||
boot.kernelParams = [ "console=ttyS0,115200n8" "cma=32M" ];
|
boot.kernelParams = [ "console=ttyS0,115200n8" "cma=32M" ];
|
||||||
|
|
||||||
sdImage.populateFirmwareCommands = "";
|
|
||||||
sdImage.populateRootCommands = ''
|
|
||||||
mkdir -p ./files/boot
|
|
||||||
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
|
|
||||||
'';
|
|
||||||
sdImage.postBuildCommands = ''
|
|
||||||
dd if=${uboot}/u-boot-sunxi-with-spl.bin of=$img bs=1024 seek=8 conv=notrunc
|
|
||||||
'';
|
|
||||||
|
|
||||||
# See: https://lore.kernel.org/patchwork/project/lkml/list/?submitter=22013&order=name
|
# See: https://lore.kernel.org/patchwork/project/lkml/list/?submitter=22013&order=name
|
||||||
boot.kernelPackages = pkgs.linuxPackages_5_9;
|
boot.kernelPackages = pkgs.linuxPackages_5_9;
|
||||||
boot.kernelPatches = [
|
boot.kernelPatches = [
|
||||||
@ -75,7 +54,15 @@ in
|
|||||||
|
|
||||||
networking.wireless.enable = true;
|
networking.wireless.enable = true;
|
||||||
|
|
||||||
###
|
### Cross-compilation stuff ###
|
||||||
|
# Natively compiling on the pinecube is infeasible
|
||||||
|
|
||||||
|
nixpkgs.crossSystem = lib.recursiveUpdate lib.systems.examples.armv7l-hf-multiplatform {
|
||||||
|
platform = {
|
||||||
|
name = "pinecube";
|
||||||
|
kernelBaseConfig = "sunxi_defconfig";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
nixpkgs.overlays = [ (self: super: {
|
nixpkgs.overlays = [ (self: super: {
|
||||||
|
20
sd-image.nix
Normal file
20
sd-image.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
uboot = pkgs.callPackage ./uboot {};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
<nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix>
|
||||||
|
./configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
sdImage.populateFirmwareCommands = "";
|
||||||
|
sdImage.populateRootCommands = ''
|
||||||
|
mkdir -p ./files/boot
|
||||||
|
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
|
||||||
|
'';
|
||||||
|
sdImage.postBuildCommands = ''
|
||||||
|
dd if=${uboot}/u-boot-sunxi-with-spl.bin of=$img bs=1024 seek=8 conv=notrunc
|
||||||
|
'';
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user