Compare commits
10 Commits
c72e1a55be
...
bae6a905ac
Author | SHA1 | Date |
---|---|---|
Raito Bezarius | bae6a905ac | 7 months ago |
Raito Bezarius | 94e542b2a8 | 7 months ago |
Raito Bezarius | 59c5ffbda6 | 7 months ago |
Raito Bezarius | 37793ce3f6 | 7 months ago |
Raito Bezarius | abc04f36c1 | 7 months ago |
Raito Bezarius | 634f5081b6 | 7 months ago |
Raito Bezarius | 1310a397d1 | 7 months ago |
Raito Bezarius | d32e206d7f | 7 months ago |
Adam Joseph | 65f821adf8 | 8 months ago |
Adam Joseph | 9dd5bdf298 | 8 months ago |
@ -0,0 +1,51 @@
|
||||
{ fetchurl }: [
|
||||
{
|
||||
name = "gmp-6.2.1.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "1wml97fdmpcynsbw9yl77rj29qibfp652d0w3222zlfx5j8jjj7x";
|
||||
url = "mirror://gnu/gmp/gmp-6.2.1.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "mpfr-4.1.0.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c";
|
||||
url = "mirror://gnu/mpfr/mpfr-4.1.0.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "mpc-1.2.1.tar.gz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0n846hqfqvmsmim7qdlms0qr86f1hck19p12nq3g3z2x74n3sl0p";
|
||||
url = "mirror://gnu/mpc/mpc-1.2.1.tar.gz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "gcc-11.2.0.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "12zs6vd2rapp42x154m479hg3h3lsafn3xhg06hp5hsldd9xr3nh";
|
||||
url = "mirror://gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "binutils-2.37.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0b53hhgfnafw27y0c3nbmlfidny2cc5km29pnfffd8r0y0j9f3c2";
|
||||
url = "mirror://gnu/binutils/binutils-2.37.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "acpica-unix2-20211217.tar.gz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0521hmaw2zhi0mpgnaf2i83dykfgql4bx98cg7xqy8wmj649z194";
|
||||
url = "https://acpica.org/sites/acpica/files/acpica-unix2-20211217.tar.gz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "nasm-2.15.05.tar.bz2";
|
||||
archive = fetchurl {
|
||||
sha256 = "1l1gxs5ncdbgz91lsl4y7w5aapask3w02q9inayb2m5bwlwq6jrw";
|
||||
url = "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2";
|
||||
};
|
||||
}
|
||||
]
|
@ -0,0 +1,212 @@
|
||||
From db4da17916cbeed002e4fa8422ed2cdd82b3b26f Mon Sep 17 00:00:00 2001
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 2 Dec 2021 23:39:00 -0800
|
||||
Subject: [PATCH] use_fallback(): platform-independent part
|
||||
|
||||
This commit implements the platform-independent part of a two-image
|
||||
fallback system.
|
||||
|
||||
The images are stored as separate FMAP regions, with each region
|
||||
containing a complete CBFS structure. The names of the two FMAP
|
||||
regions, NORMAL and FALLBACK, are hardcoded in
|
||||
src/include/bootblock_common.h.
|
||||
|
||||
There is only one copy of the bootblock. Where it is kept is a
|
||||
platform-specific matter.
|
||||
|
||||
The bootblock will call use_fallback(); if this function returns 0
|
||||
then the NORMAL FMAP region is used for CBFS lookups. If it returns
|
||||
1 then the FALLBACK FMAP region is used for CBFS lookups. The default
|
||||
__weak implementation always returns 1.
|
||||
|
||||
Any CBFS accesses from romcc stages will always use the FALLBACK copy,
|
||||
since the romcc version of the CBFS-walking routine does not
|
||||
understand FMAP partitions. This means that the `cmos.layout` from
|
||||
the FALLBACK region is used for the majority of the boot process.
|
||||
---
|
||||
Makefile.inc | 5 +++--
|
||||
src/drivers/pc80/rtc/mc146818rtc.c | 9 +++++++--
|
||||
src/include/bootblock_common.h | 4 ++++
|
||||
src/lib/bootblock.c | 1 +
|
||||
src/lib/cbfs.c | 9 +++++++--
|
||||
src/lib/prog_loaders.c | 6 +++++-
|
||||
util/cbfstool/cbfs_sections.h | 2 +-
|
||||
util/scripts/dts-to-fmd.sh | 6 +++---
|
||||
8 files changed, 31 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/Makefile.inc b/Makefile.inc
|
||||
index 44c58be5b78..fde7511ee82 100644
|
||||
--- a/Makefile.inc
|
||||
+++ b/Makefile.inc
|
||||
@@ -727,7 +727,7 @@ extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-)
|
||||
#
|
||||
# This is the default implementation. When using a boot strategy employing
|
||||
# multiple CBFSes in fmap regions, override it.
|
||||
-regions-for-file ?= COREBOOT
|
||||
+regions-for-file ?= FALLBACK
|
||||
|
||||
ifeq ($(CONFIG_CBFS_AUTOGEN_ATTRIBUTES),y)
|
||||
cbfs-autogen-attributes=-g
|
||||
@@ -999,7 +999,7 @@ else # ifeq ($(CONFIG_ARCH_X86),y)
|
||||
-b -4
|
||||
rm -f $@.tmp.2
|
||||
endif # ifeq ($(CONFIG_ARCH_X86),y)
|
||||
- $(CBFSTOOL) $@.tmp add-master-header $(TS_OPTIONS)
|
||||
+ $(CBFSTOOL) $@.tmp add-master-header -rFALLBACK $(TS_OPTIONS)
|
||||
$(prebuild-files) true
|
||||
mv $@.tmp $@
|
||||
else # ifneq ($(CONFIG_UPDATE_IMAGE),y)
|
||||
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c
|
||||
index 3b22a46298b..ef1ef7a275b 100644
|
||||
--- a/src/drivers/pc80/rtc/mc146818rtc.c
|
||||
+++ b/src/drivers/pc80/rtc/mc146818rtc.c
|
||||
@@ -250,9 +250,14 @@ static enum cb_err locate_cmos_layout(struct region_device *rdev)
|
||||
* we have multiple CMOS layout files and to locate them we'd need to
|
||||
* include VBOOT into SMM...
|
||||
*
|
||||
- * Support only one CMOS layout in the 'COREBOOT' region for now.
|
||||
+ * Support only one CMOS layout in the 'NORMAL' region for now.
|
||||
*/
|
||||
- if (cbfs_locate_file_in_region(&fh, "COREBOOT", "cmos_layout.bin",
|
||||
+ if (cbfs_locate_file_in_region(&fh,
|
||||
+ // always use FALLBACK because we can't yet access the
|
||||
+ // nvram in order to figure out which mode (normal/fallback)
|
||||
+ // we are in.
|
||||
+ "FALLBACK",
|
||||
+ "cmos_layout.bin",
|
||||
&cbfs_type)) {
|
||||
printk(BIOS_ERR, "RTC: cmos_layout.bin could not be found. "
|
||||
"Options are disabled\n");
|
||||
diff --git a/src/include/bootblock_common.h b/src/include/bootblock_common.h
|
||||
index 7af0cebe633..21a5efee901 100644
|
||||
--- a/src/include/bootblock_common.h
|
||||
+++ b/src/include/bootblock_common.h
|
||||
@@ -21,6 +21,9 @@
|
||||
#include <timestamp.h>
|
||||
#include <types.h>
|
||||
|
||||
+#define FMAP_REGION_FALLBACK "FALLBACK"
|
||||
+#define FMAP_REGION_NORMAL "FALLBACK"
|
||||
+
|
||||
/*
|
||||
* These are defined as weak no-ops that can be overridden by mainboard/SoC.
|
||||
* The 'early' variants are called prior to console initialization. Also, the
|
||||
@@ -31,6 +34,7 @@ void bootblock_mainboard_early_init(void);
|
||||
void bootblock_mainboard_init(void);
|
||||
void bootblock_soc_early_init(void);
|
||||
void bootblock_soc_init(void);
|
||||
+int use_fallback(void);
|
||||
|
||||
/*
|
||||
* C code entry point for the boot block.
|
||||
diff --git a/src/lib/bootblock.c b/src/lib/bootblock.c
|
||||
index f2ada522eb5..890c19f3160 100644
|
||||
--- a/src/lib/bootblock.c
|
||||
+++ b/src/lib/bootblock.c
|
||||
@@ -28,6 +28,7 @@ __weak void bootblock_mainboard_early_init(void) { /* no-op */ }
|
||||
__weak void bootblock_soc_early_init(void) { /* do nothing */ }
|
||||
__weak void bootblock_soc_init(void) { /* do nothing */ }
|
||||
__weak void bootblock_mainboard_init(void) { /* do nothing */ }
|
||||
+__weak int use_fallback(void) { /* always */ return 1; }
|
||||
|
||||
asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp,
|
||||
struct timestamp_entry *timestamps, size_t num_timestamps)
|
||||
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
|
||||
index a5c9f852386..076ff1a8a97 100644
|
||||
--- a/src/lib/cbfs.c
|
||||
+++ b/src/lib/cbfs.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <timestamp.h>
|
||||
#include <fmap.h>
|
||||
#include "fmap_config.h"
|
||||
+#include "bootblock_common.h"
|
||||
|
||||
#define ERROR(x...) printk(BIOS_ERR, "CBFS: " x)
|
||||
#define LOG(x...) printk(BIOS_INFO, "CBFS: " x)
|
||||
@@ -273,7 +274,7 @@ out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/* This only supports the "COREBOOT" fmap region. */
|
||||
+/* This now supports both the "NORMAL" and "FALLBACK" fmap regions. */
|
||||
static int cbfs_master_header_props(struct cbfs_props *props)
|
||||
{
|
||||
struct cbfs_header header;
|
||||
@@ -286,7 +287,11 @@ static int cbfs_master_header_props(struct cbfs_props *props)
|
||||
if (bdev == NULL)
|
||||
return -1;
|
||||
|
||||
- size_t fmap_top = ___FMAP__COREBOOT_BASE + ___FMAP__COREBOOT_SIZE;
|
||||
+ size_t fmap_top =
|
||||
+ use_fallback()
|
||||
+ ? (___FMAP__FALLBACK_BASE + ___FMAP__FALLBACK_SIZE)
|
||||
+ : (___FMAP__FALLBACK_BASE + ___FMAP__FALLBACK_SIZE)
|
||||
+ ;
|
||||
|
||||
/* Find location of header using signed 32-bit offset from
|
||||
* end of CBFS region. */
|
||||
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
|
||||
index a9c9addbc60..10b5746e384 100644
|
||||
--- a/src/lib/prog_loaders.c
|
||||
+++ b/src/lib/prog_loaders.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <symbols.h>
|
||||
#include <timestamp.h>
|
||||
#include <fit_payload.h>
|
||||
+#include <bootblock_common.h>
|
||||
|
||||
/* Only can represent up to 1 byte less than size_t. */
|
||||
const struct mem_region_device addrspace_32bit =
|
||||
@@ -41,7 +42,10 @@ int prog_locate(struct prog *prog)
|
||||
|
||||
cbfs_prepare_program_locate();
|
||||
|
||||
- if (cbfs_boot_locate(&file, prog_name(prog), NULL))
|
||||
+ if (cbfs_locate_file_in_region(&file,
|
||||
+ use_fallback() ? FMAP_REGION_FALLBACK : FMAP_REGION_NORMAL,
|
||||
+ prog_name(prog),
|
||||
+ NULL))
|
||||
return -1;
|
||||
|
||||
cbfsf_file_type(&file, &prog->cbfs_type);
|
||||
diff --git a/util/cbfstool/cbfs_sections.h b/util/cbfstool/cbfs_sections.h
|
||||
index 3526f8d94c3..fe2011cbb34 100644
|
||||
--- a/util/cbfstool/cbfs_sections.h
|
||||
+++ b/util/cbfstool/cbfs_sections.h
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#define SECTION_NAME_FMAP "FMAP"
|
||||
-#define SECTION_NAME_PRIMARY_CBFS "COREBOOT"
|
||||
+#define SECTION_NAME_PRIMARY_CBFS "FALLBACK"
|
||||
|
||||
#define SECTION_ANNOTATION_CBFS "CBFS"
|
||||
|
||||
diff --git a/util/scripts/dts-to-fmd.sh b/util/scripts/dts-to-fmd.sh
|
||||
index b468b35bcd7..6a022933022 100755
|
||||
--- a/util/scripts/dts-to-fmd.sh
|
||||
+++ b/util/scripts/dts-to-fmd.sh
|
||||
@@ -91,9 +91,9 @@ for region in $FMAP_REGIONS; do
|
||||
|
||||
# special handling: rename BOOT_STUB to COREBOOT, mark them as CBFS
|
||||
if [ "${REGION_NAME}" = "BOOT_STUB" ]; then
|
||||
- REGION_NAME="COREBOOT"
|
||||
+ REGION_NAME="NORMAL"
|
||||
fi
|
||||
- if [ "${REGION_NAME}" = "COREBOOT" ]; then
|
||||
+ if [ "${REGION_NAME}" = "NORMAL" ]; then
|
||||
IS_CBFS="(CBFS)"
|
||||
fi
|
||||
|
||||
@@ -105,7 +105,7 @@ for region in $FMAP_REGIONS; do
|
||||
# special handling: COREBOOT region at 0, inject a 128K bootblock
|
||||
# The size may need changes to accommodate the chipsets,
|
||||
# but should work for now.
|
||||
- if [ "${REGION_NAME}" = "COREBOOT" -a \
|
||||
+ if [ "${REGION_NAME}" = "NORMAL" -a \
|
||||
$(( ${REGION_START} )) -eq 0 ]; then
|
||||
printf "\n${PREFIX}BOOTBLOCK@0 128K"
|
||||
LOCAL_REGION_START=$(( ${LOCAL_REGION_START} + 128*1024 ))
|
||||
--
|
||||
2.39.1
|
||||
|
@ -0,0 +1,22 @@
|
||||
diff --git c/Makefile.inc i/Makefile.inc
|
||||
index b25ac6b426..73df96d31c 100644
|
||||
--- c/Makefile.inc
|
||||
+++ i/Makefile.inc
|
||||
@@ -439,14 +439,14 @@ ADAFLAGS_common += -ffunction-sections -fdata-sections
|
||||
# .Y Disable information messages for why package spec needs body:
|
||||
# Those messages are annoying. But don't forget to enable those,
|
||||
# if you need the information.
|
||||
-ADAFLAGS_common += -gnatwa.eeD.HHTU.U.W.Y
|
||||
+ADAFLAGS_common += -gnatwa.eeD.HHTU.U.W.Y -gnatwR
|
||||
# Disable style checks for now
|
||||
ADAFLAGS_common += -gnatyN
|
||||
|
||||
-LDFLAGS_common := --gc-sections -nostdlib -nostartfiles -static --emit-relocs
|
||||
+LDFLAGS_common := --gc-sections -nostdlib --nmagic -static --emit-relocs
|
||||
|
||||
ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
|
||||
-CFLAGS_common += -Werror
|
||||
+CFLAGS_common += -Werror -Wno-address-of-packed-member
|
||||
endif
|
||||
ifneq ($(GDB_DEBUG),)
|
||||
CFLAGS_common += -Og
|
@ -0,0 +1,7 @@
|
||||
let
|
||||
commit = "f4e681b896aae165506b7963eb6ac6d6c032145f";
|
||||
sha256 = "0mwqzinvacb8xd5wdv13l2b481n8xzm9dvh07ghs5pgifspi7skw";
|
||||
in builtins.fetchTarball {
|
||||
url = "https://github.com/samueldr/celun/archive/${commit}.tar.gz";
|
||||
inherit sha256;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
#
|
||||
# Note: on x86 platforms the SPI flash is mapped into or copied into
|
||||
# the topmost X bytes of memory, and the very topmost word of memory
|
||||
# is the "reset vector" which points to the BIOS entry point. Because
|
||||
# of this we must protect the TOPMOST half of memory; if an attacker
|
||||
# controls the reset vector and any other chunk of the flash, the game
|
||||
# is over.
|
||||
#
|
||||
FLASH@0 0x1000000 {
|
||||
BIOS@0 0x1000000 {
|
||||
# read-write zone
|
||||
NORMAL(CBFS) @ 0x400 0x7FFC00
|
||||
|
||||
# read-only zone (eventually)
|
||||
FMAP @ 0x800000 0x400
|
||||
FALLBACK(CBFS) @ 0x800400 0x7FFC00
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
{ lib
|
||||
, common_amd64
|
||||
}:
|
||||
{
|
||||
overlays = common_amd64.overlays ++ [(final: prev:
|
||||
let
|
||||
flash-chip-bytes-per-image = final.flash-chip-size-in-bytes / final.images-per-flash-chip;
|
||||
default-flash-chip-size-in-bytes = 12 * 1024 * 1024;
|
||||
default-bios-offset-in-bytes = 8 * 1024 * 1024;
|
||||
fmap-size-in-bytes = 1024;
|
||||
cbfs-size-in-bytes = flash-chip-bytes-per-image - fmap-size-in-bytes;
|
||||
initramfs_lzma = initramfs: final.nixpkgsOnBuildForBuild.runCommand "initramfs.lzma" { } ''
|
||||
lzma < ${initramfs} > $out;
|
||||
'';
|
||||
in {
|
||||
|
||||
platform_name = "x230";
|
||||
|
||||
kernel =
|
||||
final.lib.makeOverridable (prev.kernel.override {
|
||||
# config = ./linux.config;
|
||||
# buildTargets = [ "bzImage" ];
|
||||
}).overrideAttrs (a: {
|
||||
postInstall = (a.postInstall or "") + ''
|
||||
cp arch/x86/boot/compressed/vmlinux $out/vmlinuz
|
||||
'';
|
||||
});
|
||||
initramfs = initramfs_lzma prev.initramfs;
|
||||
device = ./device.nix;
|
||||
console-device = "ttyS1";
|
||||
payload = "${final.kernel}/bzImage";
|
||||
fmap = final.nixpkgsOnBuildForBuild.writeText "custom.fmap" (''
|
||||
#
|
||||
# Note: on x86 platforms the SPI flash is mapped into or copied into
|
||||
# the topmost X bytes of memory, and the very topmost word of memory
|
||||
# is the "reset vector" which points to the BIOS entry point. Because
|
||||
# of this we must protect the TOPMOST half of memory; if an attacker
|
||||
# controls the reset vector and any other chunk of the flash, the game
|
||||
# is over.
|
||||
# The X230 has a quite special situation.
|
||||
# It contains *2* flash chips, one of 8MB and one of 4MB.
|
||||
# The 8MB contains mostly opaque stuff, e.g. embedded controller, Intel Management Engine and a chunk of the BIOS.
|
||||
# It is not supposed to be modified, except by me_cleaner for example.
|
||||
# The 4MB on the contrary contains most of the BIOS.
|
||||
# It is enough to flash the 4MB one to achieve the desired effect for now.
|
||||
# TODO: eat the extra 1MB on the other chip.
|
||||
FLASH@0 0x${lib.toHexString default-flash-chip-size-in-bytes} {
|
||||
BIOS@0x${lib.toHexString default-bios-offset-in-bytes} 0x${lib.toHexString final.flash-chip-size-in-bytes} {
|
||||
${lib.optionalString (final.images-per-flash-chip > 1) ''
|
||||
# read-write zone
|
||||
NORMAL(CBFS) @ 0x${lib.toHexString fmap-size-in-bytes} 0x${lib.toHexString cbfs-size-in-bytes}
|
||||
''}
|
||||
# read-only zone (eventually)
|
||||
FMAP @ 0x${lib.toHexString flash-chip-bytes-per-image} 0x${lib.toHexString fmap-size-in-bytes}
|
||||
FALLBACK(CBFS) @ 0x${lib.toHexString (flash-chip-bytes-per-image + fmap-size-in-bytes)} 0x${lib.toHexString cbfs-size-in-bytes}
|
||||
}
|
||||
}
|
||||
'');
|
||||
|
||||
|
||||
coreboot = (prev.coreboot.override {
|
||||
iasl = final.iasl_20180531;
|
||||
coreboot-toolchain = with final.coreboot-toolchain; [ x64 i386 ];
|
||||
config = with lib.kernel; {
|
||||
# CBFS_PREFIX = lib.mkForce (freeform "prefix");
|
||||
|
||||
# COLLECT_TIMESTAMPS = yes;
|
||||
# VBOOT = yes;
|
||||
# MEASURED_BOOT = yes;
|
||||
# VBOOT_SLOTS_RW_AB = yes;
|
||||
|
||||
VENDOR_LENOVO = lib.mkForce yes;
|
||||
BOARD_LENOVO_X230 = lib.mkForce yes;
|
||||
|
||||
CONSOLE_CBMEM = lib.mkForce no;
|
||||
|
||||
# ON_DEVICE_ROM_LOAD = lib.mkForce no;
|
||||
POST_DEVICE = lib.mkForce no;
|
||||
POST_IO = lib.mkForce no;
|
||||
|
||||
DEFAULT_CONSOLE_LOGLEVEL = lib.mkForce (freeform "7");
|
||||
ONBOARD_VGA_IS_PRIMARY = lib.mkForce yes;
|
||||
|
||||
USE_NATIVE_RAMINIT = lib.mkForce yes;
|
||||
MAINBOARD_USE_LIBGFXINIT = lib.mkForce yes;
|
||||
|
||||
# MAINBOARD_SMBIOS_MANUFACTURER = lib.mkForce (freeform "LENOVO");
|
||||
# MAINBOARD_SMBIOS_PRODUCT_NAME = lib.mkForce (freeform "ThinkPad X230");
|
||||
};
|
||||
uart-for-console =
|
||||
if final.console-device == "ttyS0" then 0 # IDC ribbon-cable header on the motherboarod
|
||||
else if final.console-device == "ttyS1" then 1 # DB9 connector on rear I/O panel; omitted from some board variants
|
||||
else if final.console-device == null then null
|
||||
else throw "x230 currently supports only `null` and `ttyS{0,1}` for `console-device`";
|
||||
}).overrideAttrs (a: {
|
||||
postInstall = (a.postInstall or "") + ''
|
||||
cp src/mainboard/lenovo/x230/cmos.layout $out/
|
||||
'';
|
||||
});
|
||||
})];
|
||||
}
|
||||
|
@ -0,0 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./minify.nix
|
||||
./kernel-config.nix
|
||||
];
|
||||
|
||||
hardware.cpu = "generic-x86_64";
|
||||
# wip.kernel.defconfig = "allnoconfig";
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
wip.kernel = {
|
||||
structuredConfig = lib.mkMerge [
|
||||
(with lib.kernel; {
|
||||
# SPI_INTEL = yes; /* deps: */ SPI = yes;
|
||||
# PINCTRL_INTEL = yes; /* deps: */ PINCTRL = yes;
|
||||
})
|
||||
(with lib.kernel; {
|
||||
/* deps: */
|
||||
# REGMAP = yes;
|
||||
# I2C_DESIGNWARE_PLATFORM = yes; /* deps: */ I2C = yes;
|
||||
})
|
||||
(with lib.kernel; {
|
||||
# FB_EFI = yes;
|
||||
# BACKLIGHT_CLASS_DEVICE = yes;
|
||||
# FRAMEBUFFER_CONSOLE_ROTATION = yes;
|
||||
# FRAMEBUFFER_CONSOLE_DETECT_PRIMARY = yes;
|
||||
})
|
||||
# TODO: Somehow make configurable
|
||||
# (with lib.kernel; {
|
||||
# LTRF216A = yes; /* deps: */ IIO = yes; I2C = yes;
|
||||
# })
|
||||
# TODO: allow introspecting current config to `mkIf SND != no`
|
||||
# (with lib.kernel; {
|
||||
# SND_SOC_CS35L41 = yes;
|
||||
# SND_SOC_CS35L41_SPI = yes;
|
||||
|
||||
# SND_SOC_AMD_ACP5x = yes;
|
||||
# SND_SOC_AMD_VANGOGH_MACH = yes;
|
||||
# SND_SOC_WM_ADSP = yes;
|
||||
# # CONFIG_SND_SOC_CS35L41_I2C is not set
|
||||
# SND_SOC_NAU8821 = yes;
|
||||
# # Doesn't build on latest tag, not used in neptune hardware (?)
|
||||
# SND_SOC_CS35L36 = no;
|
||||
# })
|
||||
|
||||
(with lib.kernel; {
|
||||
# SD card reader
|
||||
MMC = lib.mkForce no;
|
||||
KERNEL_XZ = lib.mkForce yes;
|
||||
|
||||
# Internal storage
|
||||
# BLK_DEV_NVME = yes; /* deps: */ PCI = yes;
|
||||
|
||||
# USB interface
|
||||
# USB = yes;
|
||||
# USB_DWC3 = yes;
|
||||
# #USB_DWC3_GADGET = yes;
|
||||
# USB_DWC3_HOST = yes;
|
||||
# # USB_DWC3_DUAL_ROLE = yes;
|
||||
# # NOP_USB_XCEIV = yes;
|
||||
# USB_PHY = yes;
|
||||
#
|
||||
# # Keyboard input
|
||||
# USB_HIDDEV = yes;
|
||||
# HID_PID = yes;
|
||||
# USB_XHCI_HCD = yes;
|
||||
#
|
||||
# TYPEC = yes;
|
||||
# TYPEC_TCPM = yes;
|
||||
#
|
||||
# #TYPEC_FUSB302 = yes;
|
||||
# #I2C = yes;
|
||||
#
|
||||
# PCIEPORTBUS = yes;
|
||||
# HOTPLUG_PCI_PCIE = yes;
|
||||
# PCI_MSI = yes;
|
||||
# HOTPLUG_PCI = yes;
|
||||
# HOTPLUG_PCI_ACPI = yes;
|
||||
# ACPI_PCI_SLOT = yes;
|
||||
#
|
||||
# # Unlikely:
|
||||
# PCIE_DW = yes;
|
||||
# PCIE_DW_HOST = yes;
|
||||
# PCIE_DW_PLAT = yes;
|
||||
# PCIE_DW_PLAT_HOST = yes;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,179 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
wip.kernel = {
|
||||
structuredConfig = lib.mkMerge [
|
||||
# Slim down config somewhat
|
||||
# TODO: move into more general options
|
||||
(with lib.kernel; {
|
||||
NET = no;
|
||||
ETHERNET = no;
|
||||
NETFILTER = no;
|
||||
BPFILTER = no;
|
||||
USB_NET_DRIVERS = no;
|
||||
WIRELESS = no;
|
||||
WIREGUARD = no;
|
||||
BT = no;
|
||||
WLAN = no;
|
||||
NETDEVICES = no;
|
||||
MMC = no;
|
||||
INET = no; # No TCP/IP networking
|
||||
ETHTOOL_NETLINK = no;
|
||||
SERIO = no;
|
||||
LEGACY_PTYS = no;
|
||||
HW_RANDOM = no;
|
||||
SND = no;
|
||||
IKHEADERS = no;
|
||||
|
||||
CRYPTO_DEFLATE = no;
|
||||
CRYPTO_842 = no;
|
||||
CRYPTO_LZ4 = no;
|
||||
CRYPTO_LZ4HC = no;
|
||||
CRYPTO_ZSTD = no;
|
||||
|
||||
# It's an AMD!
|
||||
PROCESSOR_SELECT = yes; /* deps: */ EXPERT = yes;
|
||||
CPU_SUP_AMD = no;
|
||||
CPU_SUP_CENTAUR = no;
|
||||
CPU_SUP_HYGON = no;
|
||||
CPU_SUP_INTEL = yes;
|
||||
CPU_SUP_ZHAOXIN = no;
|
||||
})
|
||||
|
||||
(with lib.kernel; {
|
||||
# Relying on efifb is better for this specific use case
|
||||
DRM = no;
|
||||
})
|
||||
|
||||
(with lib.kernel; {
|
||||
DEBUG_FS = no;
|
||||
BLK_DEBUG_FS = no;
|
||||
|
||||
AFFS_FS = no;
|
||||
AUTOFS4_FS = no;
|
||||
AUTOFS_FS = no;
|
||||
BEFS_FS = no;
|
||||
BTRFS_FS = no;
|
||||
ECRYPT_FS = no;
|
||||
EFIVAR_FS = no;
|
||||
EROFS_FS = no;
|
||||
EXFAT_FS = no;
|
||||
EXT2_FS = no;
|
||||
EXT4_FS = no;
|
||||
F2FS_FS = no;
|
||||
FAT_FS = no;
|
||||
FSCACHE = no;
|
||||
FUSE_FS = no;
|
||||
GFS2_FS = no;
|
||||
HFS_FS = no;
|
||||
HFSPLUS_FS = no;
|
||||
ISO9660_FS = no;
|
||||
JFFS2_FS = no;
|
||||
JFS_FS = no;
|
||||
MINIX_FS = no;
|
||||
MSDOS_FS = no;
|
||||
NILFS2_FS = no;
|
||||
OMFS_FS = no;
|
||||
ORANGEFS_FS = no;
|
||||
OVERLAY_FS = no;
|
||||
REISERFS_FS = no;
|
||||
ROMFS_FS = no;
|
||||
UBIFS_FS = no;
|
||||
UDF_FS = no;
|
||||
UFS_FS = no;
|
||||
VBOXSF_FS = no;
|
||||
VFAT_FS = no;
|
||||
VIRTIO_FS = no;
|
||||
XFS_FS = no;
|
||||
ZONEFS_FS = no;
|
||||
ZONE_FS = no;
|
||||
CONFIGFS_FS = no;
|
||||
|
||||
BINFMT_SCRIPT = no;
|
||||
BINFMT_ELF = no;
|
||||
KERNFS = no;
|
||||
SYSFS = no;
|
||||
PROCFS = no;
|
||||
PROC_KCORE = no;
|
||||
PROC_SYSCTL = no;
|
||||
PROC_PAGE_MONITOR = no;
|
||||
PROC_CHILDREN = no;
|
||||
# PERF_EVENTS = no;
|
||||
TRACING = no;
|
||||
IO_URING = no;
|
||||
UPROBE_EVENTS = no;
|
||||
})
|
||||
|
||||
(with lib.kernel; {
|
||||
SYSVIPC = no;
|
||||
POSIX_MQUEUE = no;
|
||||
NO_HZ = no;
|
||||
HIGH_RES_TIMERS = no;
|
||||
PREEMPT_VOLUNTARY = no;
|
||||
CC_OPTIMIZE_FOR_SIZE = yes;
|
||||
JUMP_LABEL = no;
|
||||
NET = no;
|
||||
PACKET = no;
|
||||
PACKET_DIAG = no;
|
||||
UNIX = no;
|
||||
UNIX_DIAG = no;
|
||||
#INPUT_EVDEV = yes;
|
||||
#INPUT_TOUCHSCREEN = yes;
|
||||
#LOGO = yes;
|
||||
NEW_LEDS = no;
|
||||
LEDS_CLASS = no;
|
||||
RTC_CLASS = no;
|
||||
CONSOLE_LOGLEVEL_DEFAULT = freeform "3";
|
||||
FRAME_WARN = freeform "1024";
|
||||
MAGIC_SYSRQ = no;
|
||||
# DEBUG_FS = yes;
|
||||
STACKTRACE = no;
|
||||
|
||||
STACKPROTECTOR = no;
|
||||
GCC_PLUGINS = no;
|
||||
WIRELESS = no;
|
||||
INPUT_MOUSEDEV = no;
|
||||
RTC_INTF_PROC = no;
|
||||
})
|
||||
|
||||
# Disabling generally unneeded things
|
||||
(with lib.kernel; {
|
||||
MEDIA_SUBDRV_AUTOSELECT = no;
|
||||
NETWORK_FILESYSTEMS = no;
|
||||
RAID6_PQ_BENCHMARK = no;
|
||||
RUNTIME_TESTING_MENU = no;
|
||||
STRICT_DEVMEM = no;
|
||||
REMOTEPROC = no;
|
||||
RPMSG = no;
|
||||
VHOST_MENU = no;
|
||||
VIRTIO = no;
|
||||
I2C_VIRTIO = no;
|
||||
VIRTIO_CONSOLE = no;
|
||||
VIRTIO_MENU = no;
|
||||
})
|
||||
|
||||
(with lib.kernel; {
|
||||
#MODULES_TREE_LOOKUP = no;
|
||||
#PERF_EVENTS = no;
|
||||
})
|
||||
|
||||
(with lib.kernel; {
|
||||
HID_A4TECH = no;
|
||||
HID_APPLE = no;
|
||||
HID_BELKIN = no;
|
||||
HID_CHERRY = no;
|
||||
HID_CHICONY = no;
|
||||
HID_CYPRESS = no;
|
||||
HID_EZKEY = no;
|
||||
HID_ITE = no;
|
||||
HID_KENSINGTON = no;
|
||||
HID_LOGITECH = no;
|
||||
HID_REDRAGON = no;
|
||||
HID_MICROSOFT = no;
|
||||
HID_MONTEREY = no;
|
||||
INPUT_MOUSE = no;
|
||||
KEYBOARD_ATKBD = no;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{ lib, ... }: {
|
||||
wip.stage-1.compression = lib.mkDefault "xz";
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{ celun, device }@args:
|
||||
|
||||
import (celun + "/lib/eval-with-configuration.nix") ((builtins.removeAttrs args [ "celun" ]) // {
|
||||
inherit device;
|
||||
verbose = true;
|
||||
configuration = {
|
||||
imports = [
|
||||
./configuration.nix
|
||||
(
|
||||
{ lib, ... }:
|
||||
{
|
||||
# celun.system.automaticCross = lib.mkDefault true;
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
})
|
Loading…
Reference in New Issue