1
0
forked from dan/liminix

follow openwrt more closely

This commit is contained in:
Arnout Engelen 2024-12-30 18:10:16 +01:00
parent 833d05dc58
commit 84c07f30c9
No known key found for this signature in database
GPG Key ID: 061107B0F74A6DAA
2 changed files with 32 additions and 20 deletions

View File

@ -43,12 +43,23 @@
};
module = {pkgs, config, lib, lim, ... }:
let firmware = pkgs.stdenv.mkDerivation {
let
mediatek-firmware = pkgs.stdenv.mkDerivation {
name = "wlan-firmware";
phases = ["installPhase"];
installPhase = ''
mkdir $out
cp ${pkgs.linux-firmware}/lib/firmware/mediatek/{mt7915,mt7615,mt7986_eeprom_mt7976,mt7981}* $out
cp ${pkgs.openwrt.linux-firmware}/lib/firmware/mediatek/{mt7915,mt7615,mt7986_eeprom_mt7976,mt7981}* $out
'';
};
airoha-firmware = pkgs.stdenv.mkDerivation {
name = "airoha-firmware";
phases = ["installPhase"];
installPhase = ''
mkdir $out
cp ${pkgs.openwrt.linux-firmware}/lib/firmware/airoha/* $out
'';
};
in {
@ -126,6 +137,8 @@
BUILTIN_RETURN_ADDRESS_STRIPS_PAC="y";
CC_HAVE_SHADOW_CALL_STACK="y";
CC_HAVE_STACKPROTECTOR_SYSREG="y";
#CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5";
CC_NO_ARRAY_BOUNDS="y";
CLKSRC_MMIO="y";
CLONE_BACKWARDS="y";
CMDLINE_OVERRIDE="y";
@ -223,6 +236,7 @@
FWNODE_MDIO="y";
FW_LOADER_PAGED_BUF="y";
#FW_LOADER_SYSFS="y";
#GCC11_NO_ARRAY_BOUNDS="y";
#GCC_ASM_GOTO_OUTPUT_WORKAROUND="y";
GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS="y";
GENERIC_ALLOCATOR="y";
@ -272,7 +286,7 @@
I2C_MT65XX="y";
ICPLUS_PHY="y";
ILLEGAL_POINTER_VALUE="0xdead000000000000";
#INITRAMFS_SOURCE="\"\"";
#INITRAMFS_SOURCE="""";
IRQCHIP="y";
IRQ_DOMAIN="y";
IRQ_DOMAIN_HIERARCHY="y";
@ -283,7 +297,6 @@
JUMP_LABEL="y";
LEDS_PWM="y";
LEDS_SMARTRG_LED="y";
LEDS_TRIGGER_PATTERN="y";
LIBFDT="y";
LOCK_DEBUGGING_SUPPORT="y";
LOCK_SPIN_ON_OWNER="y";
@ -326,7 +339,6 @@
MTD_UBI_FASTMAP="y";
MTD_UBI_NVMEM="y";
MTD_UBI_WL_THRESHOLD="4096";
MTD_VIRT_CONCAT="y";
MTK_CPUX_TIMER="y";
MTK_HSDMA="y";
MTK_INFRACFG="y";
@ -459,7 +471,6 @@
RTC_CLASS="y";
RTC_DRV_MT7622="y";
RTC_I2C_AND_SPI="y";
#RTL8261N_PHY="y";
RWSEM_SPIN_ON_OWNER="y";
SCHED_MC="y";
SCSI="y";
@ -569,7 +580,8 @@
dir {
lib = dir {
firmware = dir {
mediatek = symlink firmware;
mediatek = symlink mediatek-firmware;
airoha = symlink airoha-firmware;
};
};
};
@ -653,20 +665,12 @@
eth0 = link.build { ifname = "eth0"; };
eth1 = link.build { ifname = "eth1"; };
phy0-ap0 = link.build {
ifname = "phy0-ap0";
wlan0 = link.build {
ifname = "wlan0";
dependencies = [ mac80211 ];
};
phy0-ap1 = link.build {
ifname = "phy0-ap1";
dependencies = [ mac80211 ];
};
phy1-ap0 = link.build {
ifname = "phy1-ap0";
dependencies = [ mac80211 ];
};
phy1-ap1 = link.build {
ifname = "phy1-ap1";
wlan1 = link.build {
ifname = "wlan1";
dependencies = [ mac80211 ];
};
};

View File

@ -1,4 +1,4 @@
{ fetchFromGitHub, pkgsBuildBuild }:
{ fetchFromGitHub, pkgsBuildBuild, linux-firmware, fetchzip }:
let
src = fetchFromGitHub {
name = "openwrt-source";
@ -43,6 +43,14 @@ in {
};
kernelVersion = "6.6.57";
# From package/firmware/linux-firmware/Makefile
linux-firmware = linux-firmware.overrideAttrs(a: {
src = fetchzip {
url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-20241017.tar.gz";
hash = "sha256-q4StJdoLCHQThFTzhxETDYlQP/ywmb3vwCr13xtrQzc=";
};
});
applyPatches.ath79 = doPatch "ath79";
applyPatches.ramips = doPatch "ramips";
applyPatches.mediatek = doPatch "mediatek"; # aarch64